respec 28.2.8 → 29.0.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,7 +1,7 @@
1
- window.respecVersion="28.2.8",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map(e=>{if(!(e in window.require.modules))throw new Error("Unsupported dependency name: "+e);return window.require.modules[e]});Promise.all(n).then(e=>t(...e))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},s=n.lang;var i=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:s,run:function(e){e.l10n=r[s]||r.en}});let o,a;const c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(c.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(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",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});l.set(e,t)}(e),t=e,(o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(g(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&c.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!y.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let o=i.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),s&&i.done]))[0]};return v.set(t,i),i}f=(e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)}))(f);var $=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=g(o);return r&&o.addEventListener("upgradeneeded",e=>{r(g(o.result),e.oldVersion,e.newVersion,g(o.transaction))}),n&&o.addEventListener("blocked",()=>n()),a.then(e=>{i&&e.addEventListener("close",()=>i()),s&&e.addEventListener("versionchange",()=>s())}).catch(()=>{}),a},unwrap:b,wrap:g});function x(e,t,n,r,s,{level:i="error",autofix:o,ruleName:a}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const s=n.map(e=>e.trivia+e.value).join(""),i=e[t];return"eof"===i.type?s:r?s+i.trivia:s.slice(i.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),f=l(p),h=d+f.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===s?"since":"inside",g=`${s} error at line ${u}${e.name?" in "+e.name:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map(e=>function(e,t){let n=e;return t&&(n+=" "+t),n}(e.type,e.name)).join(" -> ")}(n)}\``:""}:\n${h}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:i,ruleName:a,autofix:o,input:f,tokens:p}}function _(e,t,n,r){return x(e,t,n,r,"Syntax")}function S(e,t,n,r,s={}){return s.ruleName=n,x(t.source,e.index,t,r,"Validation",s)}class C{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function R(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const s=R(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,s),s)return{reference:e,dictionary:s.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=R(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function E(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some(e=>e.required);if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?E(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class A extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class L extends C{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new L({source:e.source,tokens:{value:n}})}}get value(){return V(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class T extends L{static parse(e){const t=e.consumeKind("eof");if(t)return new T({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function P(e,t){return K(e,{parser:L.parser(e,t),listName:t+" list"})}const I=["identifier","decimal","integer","string"],D=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map(e=>[e,"Legacy"+e]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function N(e){for(const t of I){const n=P(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class j extends C{static parse(e){const t={assign:e.consume("=")},n=ie(new j({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...I)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?N(e):Q(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):n.hasRhs&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map(n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e)),e.token(this.tokens.close)])}}class O extends C{static parse(e){const t=e.consumeKind("identifier");if(t)return new O({source:e.source,tokens:{name:t},params:j.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:this.params.tokens.secondaryName?V(t.secondaryName.value):null}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.";yield S(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(D.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${D.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield S(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=D.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class z extends A{static parse(e){const t={};if(t.open=e.consume("["),!t.open)return new z({});const n=new z({source:e.source,tokens:t});return n.push(...K(e,{parser:O.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Unexpected closing token of extended attribute"),n.length||e.error("Found an empty extended attribute"),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n}*validate(e){for(const t of this)yield*t.validate(e)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map(t=>t.write(e)),e.token(this.tokens.close)]):""}}function M(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function q(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=ie(new U({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error("No opening bracket after "+n.value),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=ee(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=X(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(s);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...ce)||e.error("Record key must be one of: "+ce.join(", ")),s=new U({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const i=X(e,t)||e.error("Error parsing generic type record");r.subtype.push(s,i);break}}return r.idlType||e.error("Error parsing generic type "+n.value),r.tokens.close=e.consume(">")||e.error("Missing closing bracket after "+n.value),r.this}(e,t)||J(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...ce,...ae);if(!t)return;n=new U({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error("Unsupported generic type "+t.value)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,M(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class U extends C{static parse(e,t){return q(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=ie(new U({source:e.source,tokens:n}));for(r.type=t||null;;){const t=X(e)||e.error("No type after open parenthesis or 'or' in union type");"any"===t.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===t.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(t);const n=e.consume("or");if(!n)break;t.tokens.separator=n}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),M(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new z({})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return V([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter(e=>e).map(e=>e.value).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.";yield S(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=R(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield S(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map(t=>t.write(e)),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}}class W extends C{static parse(e){const t=e.consume("=");if(!t)return null;const n=Y(e)||e.consumeKind("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new W({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return Z(this.expression[0]).type}get value(){return Z(this.expression[0]).value}get negative(){return Z(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map(t=>e.token(t))])}}class F extends C{static parse(e){const t=e.position,n={},r=ie(new F({source:e.source,tokens:n}));return r.extAttrs=z.parse(e),n.optional=e.consume("optional"),r.idlType=X(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...le),n.name?(r.default=n.optional?W.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return V(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=R(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield S(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield S(this.tokens.name,this,"dict-arg-default",e,{autofix:B(this)})}}else if(this.parent&&!E(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e);return!t.slice(n+1).some(e=>!e.optional)}(this)){const e="Dictionary argument must be optional if it has no required fields";yield S(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=se(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",B(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function B(e){return()=>{e.default=W.parse(new fe(" = {}"))}}class H extends C{static parse(e,{special:t,regular:n}={}){const r={special:t},s=ie(new H({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(s.arguments=[],s):(t||n||(r.special=e.consume("getter","setter","deleter")),s.idlType=ee(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=Q(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),s.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?V(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield S(this.tokens.open,this,"incomplete-op",e)}this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class G extends C{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,i={special:t},o=ie(new G({source:e.source,tokens:i}));if(t||n||(i.special=e.consume("inherit")),"inherit"===o.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),i.readonly=e.consume("readonly"),r&&!i.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),i.base=e.consume("attribute"),i.base)return o.idlType=X(e,"attribute-type")||e.error("Attribute lacks a type"),i.name=e.consumeKind("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),i.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),o.this;e.unconsume(s)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return V(this.tokens.name.value)}*validate(e){switch(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),this.idlType.generic){case"sequence":case"record":{const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield S(this.tokens.name,this,"attr-invalid-type",e);break}default:{const{reference:t}=R(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield S(e,this,"attr-invalid-type",n)}}}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function V(e){return e.startsWith("_")?e.slice(1):e}function K(e,{parser:t,allowDangler:n,listName:r="list"}){const s=t(e);if(!s)return[];s.tokens.separator=e.consume(",");const i=[s];for(;s.tokens.separator;){const s=t(e);if(!s){n||e.error("Trailing comma in "+r);break}if(s.tokens.separator=e.consume(","),i.push(s),!s.tokens.separator)break}return i}function Y(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function Z({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function J(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const s=e.consume("long");return new U({source:t,tokens:{prefix:n,base:r,postfix:s}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new U({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new U({source:t,tokens:{base:r}}):void 0}function Q(e){return K(e,{parser:F.parse,listName:"arguments list"})}function X(e,t){const n=z.parse(e),r=U.parse(e,t);return r&&(ie(r).extAttrs=n),r}function ee(e,t){const n=U.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new U({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function te(e){const t=e.consume("stringifier");if(!t)return;return G.parse(e,{special:t})||H.parse(e,{special:t})||e.error("Unterminated stringifier")}function ne(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function re(e){return()=>{if(e.extAttrs.length){const t=new fe("Exposed=Window,"),n=O.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=" "+r.tokens.name.trivia),e.extAttrs.unshift(n)}else{ie(e).extAttrs=z.parse(new fe("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia="\n"+ne(t)}}}function se(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return se(e.idlType);return Object.values(e.tokens).sort((e,t)=>e.index-t.index)[0]}function ie(e,t){return t||(t=e),e?new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)?ie(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}}):e}const oe={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},ae=["ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float32Array","Float64Array","any","object","symbol"],ce=["ByteString","DOMString","USVString"],le=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],ue=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(le,ce,ae),de=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],pe=["_constructor","toString","_toString"];class fe{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,i=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=o("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=o("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;s+=(e.match(/\n/g)||[]).length,r+=e,i-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=o("decimal"),-1===c&&(c=o("integer")),-1===c){c=o("identifier");const e=t.length-1,n=t[e];if(-1!==c){if(pe.includes(n.value)){const r=V(n.value)+" is a reserved identifier and must not be used.";throw new he(_(t,e,null,r))}ue.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=o("string"));for(const o of de)if(e.startsWith(o,n)){t.push({type:"inline",value:o,trivia:r,line:s,index:i}),r="",n+=o.length,c=n;break}if(-1===c&&(c=o("other")),-1===c)throw new Error("Token stream not progressing");n=c,i+=1}return t.push({type:"eof",value:"",trivia:r,line:s,index:i}),t;function o(o,{noFlushTrivia:a}={}){const c=oe[o];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:o,value:l[0],trivia:r,line:s,index:i}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new he(_(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class he extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:s,input:i,tokens:o}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=s,this.input=i,this.tokens=o}}class me extends L{static parse(e){const t=e.consumeKind("string");if(t)return new me({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class ge extends C{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=ie(new ge({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=K(e,{parser:me.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return V(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class be extends C{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new be({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return V(this.tokens.target.value)}get includes(){return V(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class ye extends C{static parse(e){const t={},n=ie(new ye({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=X(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return V(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class we extends C{static parse(e,t){const n={base:t},r=ie(new we({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=ee(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=Q(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return V(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map(t=>t.write(e)),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class ve extends C{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:s,type:i}=t;for(s.name=e.consumeKind("identifier")||e.error("Missing name in "+i),e.current=t,t=ie(t),n&&Object.assign(s,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),s.open=e.consume("{")||e.error("Bodyless "+i),t.members=[];;){if(s.close=e.consume("}"),s.close)return s.termination=e.consume(";")||e.error("Missing semicolon after "+i),t.this;const n=z.parse(e);let o;for(const[t,...n]of r)if(o=ie(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=n,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return V(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?V(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class ke extends C{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=J(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new U({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=Y(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new ke({source:e.source,tokens:t});return ie(r).idlType=n,r}get type(){return"const"}get name(){return V(this.tokens.name.value)}get value(){return Z(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class $e extends C{static parse(e){const t=e.position,n={},r=ie(new $e({source:e.source,tokens:n}));if(n.readonly=e.consume("readonly"),n.readonly||(n.async=e.consume("async")),n.base=n.readonly?e.consume("maplike","setlike"):n.async?e.consume("iterable"):e.consume("iterable","maplike","setlike"),!n.base)return void e.unconsume(t);const{type:s}=r,i="maplike"===s,o=i||"iterable"===s,a=r.async&&"iterable"===s;n.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=X(e)||e.error(`Missing a type argument in ${s} declaration`);return r.idlType=[c],r.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?r.idlType.push(X(e)):i&&e.error(`Missing second type argument in ${s} declaration`)),n.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(n.argsOpen=e.consume("("),r.arguments.push(...Q(e)),n.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),n.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),r.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class xe extends C{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=Q(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new xe({source:e.source,tokens:n});return ie(s).arguments=r,s}get type(){return"constructor"}*validate(e){this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function _e(e){const t=e.consume("static");if(!t)return;return G.parse(e,{special:t})||H.parse(e,{special:t})||e.error("No body in static member")}class Se extends ve{static parse(e,t,{partial:n=null}={}){const r={partial:n,base:t};return ve.parse(e,new Se({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[ke.parse],[xe.parse],[_e],[te],[$e.parse],[G.parse],[H.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield S(this.tokens.name,this,"require-exposed",e,{autofix:re(this)})}const t=this.extAttrs.filter(e=>"Constructor"===e.name);for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield S(e.tokens.name,this,"constructor-member",t,{autofix:Ce(this,e)})}if(this.extAttrs.some(e=>"Global"===e.name)){const e=this.extAttrs.filter(e=>"LegacyFactoryFunction"===e.name);for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield S(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter(e=>"constructor"===e.type);for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield S(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=new Set(o(t).map(e=>e.name)),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=o(e);yield*i(r,n,e,t);for(const e of r)n.add(e.name)}function*i(e,t,n,r){for(const s of e){const{name:e}=s;if(e&&t.has(e)){const t=`The operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield S(s.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter(({type:e})=>"operation"===e)}}(e,this))}}function Ce(e,t){return e=ie(e),()=>{const n=ne(e.extAttrs.tokens.open.trivia),r=e.members.length?ne(se(e.members[0]).trivia):function(e){const t=ne(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=xe.parse(new fe(`\n${r}constructor();`));s.extAttrs=new z({}),ie(s).arguments=t.arguments;const i=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,e=>"constructor"===e.type);e.members.splice(i+1,0,s);const{close:o}=e.tokens;o.trivia.includes("\n")||(o.trivia+="\n"+n);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class Re extends ve{static parse(e,t,{partial:n}={}){const r={partial:n,base:t};if(r.mixin=e.consume("mixin"),r.mixin)return ve.parse(e,new Re({source:e.source,tokens:r}),{allowedMembers:[[ke.parse],[te],[G.parse,{noInherit:!0}],[H.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Ee extends C{static parse(e){const t={},n=ie(new Ee({source:e.source,tokens:t}));return n.extAttrs=z.parse(e),t.required=e.consume("required"),n.idlType=X(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=W.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return V(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class Ae extends ve{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("dictionary"),n.base)return ve.parse(e,new Ae({source:e.source,tokens:n}),{inheritable:!t,allowedMembers:[[Ee.parse]]})}get type(){return"dictionary"}}class Le extends ve{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("namespace"),n.base)return ve.parse(e,new Le({source:e.source,tokens:n}),{allowedMembers:[[G.parse,{noInherit:!0,readonly:!0}],[ke.parse],[H.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield S(this.tokens.name,this,"require-exposed",e,{autofix:re(this)})}yield*super.validate(e)}}class Te extends ve{static parse(e,t,{partial:n=null}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return ve.parse(e,new Te({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[ke.parse],[H.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Pe(e,t){const n=e.source;function r(t){e.error(t)}function s(...t){return e.consume(...t)}function i(t){const n=s("interface");if(!n)return;return Re.parse(e,n,t)||Se.parse(e,n,t)||r("Interface has no proper body")}function o(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const t=s("callback");if(t)return e.probe("interface")?Te.parse(e,t):we.parse(e,t)}()||i()||function(){const t=s("partial");if(t)return Ae.parse(e,{partial:t})||i({partial:t})||Le.parse(e,{partial:t})||r("Partial doesn't apply to anything")}()||Ae.parse(e)||ge.parse(e)||ye.parse(e)||be.parse(e)||Le.parse(e)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=z.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}ie(n).extAttrs=t,s.push(n)}const i=T.parse(e);return t.concrete&&s.push(i),s}();return e.position<n.length&&r("Unrecognised tokens"),a}function Ie(e){return e}const De={wrap:e=>e.join(""),trivia:Ie,name:Ie,reference:Ie,type:Ie,generic:Ie,nameless:Ie,inheritance:Ie,definition:Ie,extendedAttribute:Ie,extendedAttributeReference:Ie};class Ne{constructor(e){this.ts=Object.assign({},De,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=Ie,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function je(e,t){const n=new Map,r=e.filter(e=>"includes"===e.type);for(const e of r){const r=t.get(e.includes);if(!r)continue;const s=n.get(e.target);s?s.push(r):n.set(e.target,[r])}return n}function*Oe(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const s of e)if(s.partial){const e=r.get(s.name);e?e.push(s):r.set(s.name,[s])}else s.name&&(t.has(s.name)?n.add(s):t.set(s.name,s));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:je(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield S(n.tokens.name,n,"no-duplicate",r)}}(t)}var ze=Object.freeze({__proto__:null,parse:function(e,t={}){const n=new fe(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Pe(n,t)},write:function(e,{templates:t=De}={}){t=Object.assign({},De,t);const n=new Ne(t);return t.wrap(e.map(e=>e.write(n)))},validate:function(e){return[...Oe((t=e,t.flat?t.flat():[].concat(...t)))];var t},WebIDLParseError:he});const Me=/^[!#$%&'*+-.^`|~\w]+$/,qe=/[\u000A\u000D\u0009\u0020]/u,Ue=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function We(e,t,n){(t&&""!==t&&!e.has(t)&&Ue.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function Fe(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Be={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const He=/[&<>"']/,Ge=/[&<>"']/g,Ve=/[<>"']|&(?!#?\w+;)/,Ke=/[<>"']|&(?!#?\w+;)/g,Ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ze=e=>Ye[e];function Je(e,t){if(t){if(He.test(e))return e.replace(Ge,Ze)}else if(Ve.test(e))return e.replace(Ke,Ze);return e}const Qe=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Xe(e){return e.replace(Qe,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const et=/(^|[^\[])\^/g;function tt(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(et,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const nt=/[^\w:]/g,rt=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function st(e,t,n){if(e){let e;try{e=decodeURIComponent(Xe(n)).replace(nt,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!rt.test(n)&&(n=function(e,t){it[" "+e]||(ot.test(e)?it[" "+e]=e+"/":it[" "+e]=pt(e,"/",!0));const n=-1===(e=it[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(at,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(ct,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const it={},ot=/^[^:]+:\/*[^/]*$/,at=/^([^:]+:)[\s\S]*$/,ct=/^([^:]+:\/*[^/]*)[\s\S]*$/;const lt={exec:function(){}};function ut(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function dt(e,t){const n=e.replace(/\|/g,(e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n[n.length-1].trim()||n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function pt(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.substr(0,r-s)}function ft(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ht(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function mt(e,t,n,r){const s=t.href,i=t.title?Je(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:Je(o)}}class gt{constructor(e){this.options=e||Be}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:pt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=pt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,s,i,o,a,c,l,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?"\\d{1,9}\\"+h.slice(-1):"\\"+h,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),l=t[2].split("\n",1)[0],u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=l.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=l.slice(i),i+=t[1].length),a=!1,!l&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(d=e.split("\n",1)[0],l=d,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(l));){if(l.search(/[^ ]/)>=i||!l.trim())p+="\n"+l.slice(i);else{if(a)break;p+="\n"+l}a||l.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1)}}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(s="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:s,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(o=0;o<y;o++){this.lexer.state.top=!1,g.items[o].tokens=this.lexer.blockTokens(g.items[o].text,[]);const e=g.items[o].tokens.filter(e=>"space"===e.type),t=e.every(e=>{const t=e.raw.split("");let n=0;for(const e of t)if("\n"===e&&(n+=1),n>1)return!0;return!1});!g.loose&&e.length&&t&&(g.loose=!0,g.items[o].loose=!0)}return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):Je(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:dt(t[1]).map(e=>({text:e})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,s,i,o=e.align.length;for(n=0;n<o;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(o=e.rows.length,n=0;n<o;n++)e.rows[n]=dt(e.rows[n],e.header.length).map(e=>({text:e}));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=[],this.lexer.inlineTokens(e.header[r].text,e.header[r].tokens);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],s=0;s<i.length;s++)i[s].tokens=[],this.lexer.inlineTokens(i[s].text,i[s].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Je(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Je(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=pt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,s=0;for(;s<n;s++)if("\\"===e[s])s++;else if(e[s]===t[0])r++;else if(e[s]===t[1]&&(r--,r<0))return s;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),mt(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return mt(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const s=r[1]||r[2]||"";if(!s||s&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let s,i,o=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=s.length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;if(i=Math.min(i,i+o+a),Math.min(n,i)%2){const t=e.slice(1,n+r.index+i);return{type:"em",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+i-1);return{type:"strong",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Je(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=Je(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=Je(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=Je(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=Je(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Je(n[0]):n[0]:Je(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const bt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:lt,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};bt.def=tt(bt.def).replace("label",bt._label).replace("title",bt._title).getRegex(),bt.bullet=/(?:[*+-]|\d{1,9}[.)])/,bt.listItemStart=tt(/^( *)(bull) */).replace("bull",bt.bullet).getRegex(),bt.list=tt(bt.list).replace(/bull/g,bt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+bt.def.source+")").getRegex(),bt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,bt.html=tt(bt.html,"i").replace("comment",bt._comment).replace("tag",bt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bt.paragraph=tt(bt._paragraph).replace("hr",bt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt._tag).getRegex(),bt.blockquote=tt(bt.blockquote).replace("paragraph",bt.paragraph).getRegex(),bt.normal=ut({},bt),bt.gfm=ut({},bt.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),bt.gfm.table=tt(bt.gfm.table).replace("hr",bt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt._tag).getRegex(),bt.gfm.paragraph=tt(bt._paragraph).replace("hr",bt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",bt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt._tag).getRegex(),bt.pedantic=ut({},bt.normal,{html:tt("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",bt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:lt,paragraph:tt(bt.normal._paragraph).replace("hr",bt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",bt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const yt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:lt,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:lt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function wt(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function vt(e){let t,n,r="";const s=e.length;for(t=0;t<s;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}yt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",yt.punctuation=tt(yt.punctuation).replace(/punctuation/g,yt._punctuation).getRegex(),yt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,yt.escapedEmSt=/\\\*|\\_/g,yt._comment=tt(bt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),yt.emStrong.lDelim=tt(yt.emStrong.lDelim).replace(/punct/g,yt._punctuation).getRegex(),yt.emStrong.rDelimAst=tt(yt.emStrong.rDelimAst,"g").replace(/punct/g,yt._punctuation).getRegex(),yt.emStrong.rDelimUnd=tt(yt.emStrong.rDelimUnd,"g").replace(/punct/g,yt._punctuation).getRegex(),yt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,yt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,yt._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])?)+(?![-_])/,yt.autolink=tt(yt.autolink).replace("scheme",yt._scheme).replace("email",yt._email).getRegex(),yt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,yt.tag=tt(yt.tag).replace("comment",yt._comment).replace("attribute",yt._attribute).getRegex(),yt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,yt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,yt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,yt.link=tt(yt.link).replace("label",yt._label).replace("href",yt._href).replace("title",yt._title).getRegex(),yt.reflink=tt(yt.reflink).replace("label",yt._label).replace("ref",bt._label).getRegex(),yt.nolink=tt(yt.nolink).replace("ref",bt._label).getRegex(),yt.reflinkSearch=tt(yt.reflinkSearch,"g").replace("reflink",yt.reflink).replace("nolink",yt.nolink).getRegex(),yt.normal=ut({},yt),yt.pedantic=ut({},yt.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:tt(/^!?\[(label)\]\((.*?)\)/).replace("label",yt._label).getRegex(),reflink:tt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yt._label).getRegex()}),yt.gfm=ut({},yt.normal,{escape:tt(yt.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),yt.gfm.url=tt(yt.gfm.url,"i").replace("email",yt.gfm._extended_email).getRegex(),yt.breaks=ut({},yt.gfm,{br:tt(yt.br).replace("{2,}","*").getRegex(),text:tt(yt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class kt{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Be,this.options.tokenizer=this.options.tokenizer||new gt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:bt.normal,inline:yt.normal};this.options.pedantic?(t.block=bt.pedantic,t.inline=yt.pedantic):this.options.gfm&&(t.block=bt.gfm,this.options.breaks?t.inline=yt.breaks:t.inline=yt.gfm),this.tokenizer.rules=t}static get rules(){return{block:bt,inline:yt}}static lex(e,t){return new kt(t).lex(e)}static lexInline(e,t){return new kt(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,s,i;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,s,i,o,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+ht("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+ht("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,vt))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,vt))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s,wt))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class $t{constructor(e){this.options=e||Be}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+Je(r,!0)+'">'+(n?e:Je(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Je(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=st(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+Je(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=st(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class xt{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class _t{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class St{constructor(e){this.options=e||Be,this.options.renderer=this.options.renderer||new $t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new xt,this.slugger=new _t}static parse(e,t){return new St(t).parse(e)}static parseInline(e,t){return new St(t).parseInline(e)}parse(e,t=!0){let n,r,s,i,o,a,c,l,u,d,p,f,h,m,g,b,y,w,v,k="";const $=e.length;for(n=0;n<$;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))k+=v||"";else switch(d.type){case"space":continue;case"hr":k+=this.renderer.hr();continue;case"heading":k+=this.renderer.heading(this.parseInline(d.tokens),d.depth,Xe(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":k+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(l="",c="",i=d.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(l+=this.renderer.tablerow(c),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],c="",o=a.length,s=0;s<o;s++)c+=this.renderer.tablecell(this.parseInline(a[s].tokens),{header:!1,align:d.align[s]});u+=this.renderer.tablerow(c)}k+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(d.tokens),k+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,y=g.task,m="",g.task&&(w=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);k+=this.renderer.list(u,p,f);continue;case"html":k+=this.renderer.html(d.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<$&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);k+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return k}parseInline(e,t){t=t||this.renderer;let n,r,s,i="";const o=e.length;for(n=0;n<o;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(s=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==s||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=s||"";else switch(r.type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}function Ct(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),ft(t=ut({},Ct.defaults,t||{})),n){const r=t.highlight;let s;try{s=kt.lex(e,t)}catch(e){return n(e)}const i=function(e){let i;if(!e)try{t.walkTokens&&Ct.walkTokens(s,t.walkTokens),i=St.parse(s,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,i)};if(!r||r.length<3)return i();if(delete t.highlight,!s.length)return i();let o=0;return Ct.walkTokens(s,(function(e){"code"===e.type&&(o++,setTimeout(()=>{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),o--,0===o&&i()}))},0))})),void(0===o&&i())}try{const n=kt.lex(e,t);return t.walkTokens&&Ct.walkTokens(n,t.walkTokens),St.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+Je(e.message+"",!0)+"</pre>";throw e}}Ct.options=Ct.setOptions=function(e){var t;return ut(Ct.defaults,e),t=Ct.defaults,Be=t,Ct},Ct.getDefaults=Fe,Ct.defaults=Be,Ct.use=function(...e){const t=ut({},...e),n=Ct.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=Ct.defaults.renderer||new $t;for(const t in e.renderer){const r=n[t];n[t]=(...s)=>{let i=e.renderer[t].apply(n,s);return!1===i&&(i=r.apply(n,s)),i}}t.renderer=n}if(e.tokenizer){const n=Ct.defaults.tokenizer||new gt;for(const t in e.tokenizer){const r=n[t];n[t]=(...s)=>{let i=e.tokenizer[t].apply(n,s);return!1===i&&(i=r.apply(n,s)),i}}t.tokenizer=n}if(e.walkTokens){const n=Ct.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),Ct.setOptions(t)})},Ct.walkTokens=function(e,t){for(const n of e)switch(t.call(Ct,n),n.type){case"table":for(const e of n.header)Ct.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)Ct.walkTokens(n.tokens,t);break;case"list":Ct.walkTokens(n.items,t);break;default:Ct.defaults.extensions&&Ct.defaults.extensions.childTokens&&Ct.defaults.extensions.childTokens[n.type]?Ct.defaults.extensions.childTokens[n.type].forEach((function(e){Ct.walkTokens(n[e],t)})):n.tokens&&Ct.walkTokens(n.tokens,t)}},Ct.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");ft(t=ut({},Ct.defaults,t||{}));try{const n=kt.lexInline(e,t);return t.walkTokens&&Ct.walkTokens(n,t.walkTokens),St.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+Je(e.message+"",!0)+"</pre>";throw e}},Ct.Parser=St,Ct.parser=St.parse,Ct.Renderer=$t,Ct.TextRenderer=xt,Ct.Lexer=kt,Ct.lexer=kt.lex,Ct.Tokenizer=gt,Ct.Slugger=_t,Ct.parse=Ct,St.parse,kt.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Rt,Et={exports:{}};Rt=Et,function(e,t){Rt.exports=t()}(0,(function(){var e=[],t=[],n={},r={},s={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function o(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function c(e,t){return e.replace(t[0],(function(n,r){var s=a(t[1],arguments);return o(""===n?e[r-1]:n,s)}))}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var s=r.length;s--;){var i=r[s];if(i[0].test(t))return c(t,i)}return t}function u(e,t,n){return function(r){var s=r.toLowerCase();return t.hasOwnProperty(s)?o(r,s):e.hasOwnProperty(s)?o(r,e[s]):l(s,r,n)}}function d(e,t,n,r){return function(r){var s=r.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&l(s,s,n)===s}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(s,r,e),p.isPlural=d(s,r,e),p.singular=u(r,s,t),p.isSingular=d(r,s,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),s[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var At=Et.exports,Lt=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,s=i.prototype;return s.delete=function(e){return this.has(e)&&delete e[this._]},s.get=function(e){return this.has(e)?e[this._]:void 0},s.has=function(e){return r.call(e,this._)},s.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=s.prototype;function s(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=s}(Math.random(),Object.defineProperty)}function s(e,t,n,r,s,i){for(var o=("selectedIndex"in t),a=o;r<s;){var c,l=e(n[r],1);t.insertBefore(l,i),o&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function i(e,t){return e==t}function o(e){return e}function a(e,t,n,r,s,i,o){var a=i-s;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=s;c<n&&l<i&&o(e[c],r[l]);)c++,l++;if(l===i)return t;t=c+1}return-1}function c(e,t,n,r,s){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:s}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,s=t;r<s;){var i=(r+s)/2>>>0;n<e[i]?s=i:r=1+i}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||o,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return s(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var k=m-g,$=b-y,x=-1;if(k<$){if(-1<(x=a(n,y,b,t,g,m,u)))return s(d,e,n,y,x,d(t[g],0)),s(d,e,n,x+k,b,c(d,t,m,h,f)),n}else if($<k&&-1<(x=a(t,g,m,n,y,b,u)))return l(d,t,g,x),l(d,t,x+$,m),n;return k<2||$<2?(s(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):k==$&&function(e,t,n,r,s,i){for(;r<s&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?s(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,i,o,a,c,u,d,f,h,m){!function(e,t,n,r,i,o,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:i++,f++;break;case 1:d.push(r[i]),s(t,n,r,i++,i,f<c?t(o[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(o[a])?a++:l(t,o,a++,a)}}(function(e,t,n,r,s,i,o){var a,c,l,u,d,p,f=n+i,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<i&&c<n&&o(r[s+l],e[t+c]);)l++,c++;if(l===i&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&o(r[s+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,o,a,c,d,h)||function(e,t,n,r,s,i,o,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=o;for(var h=s.slice(i,o),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+i))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--o;d[c]>o;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,k=w.oldi;v<n;)y[--l]=1,--n;for(;k<o;)y[--l]=-1,--o;y[--l]=0,--n,--o,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;i<=o;)y[--l]=-1,--o;return y}(n,r,i,o,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,$,t,g,m,k,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(s){var i=r(s);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,s){e.call(r,n[s],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(s,i){return n[r(s)?e:t.push(s)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function k(e,t){var n="_"+e+"$";return{get:function(){return this[n]||$(this,n,t.call(this,e))},set:function(e){$(this,n,e)}}}var $=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,_,S,C,R,E,A={},L={},T=[],P=L.hasOwnProperty,I=0,D={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in L||(I=T.push(e)),L[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<I;n++){var r=T[n];if(P.call(e,r))return L[r](e[r],t)}}},N=Array.isArray||(_=(x={}.toString).call([]),function(e){return x.call(e)===_}),j=(S=e,C="fragment",E="content"in z(R="template")?function(e){var t=z(R);return t.innerHTML=e,t.content}:function(e){var t,n=z(C),r=z(R);return O(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(C),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",O(t,n.firstChild.childNodes),t}:E)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===C?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,U,W,F,B,H,G,V,K=(q="appendChild",U="cloneNode",W="createTextNode",B=(F="importNode")in(M=e),(H=M.createDocumentFragment())[q](M[W]("g")),H[q](M[W]("")),(B?M[F](H,!0):H[U](!0)).childNodes.length<2?function e(t,n){for(var r=t[U](),s=t.childNodes||[],i=s.length,o=0;n&&o<i;o++)r[q](e(s[o],n));return r}:B?M[F]:function(e,t){return e[U](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Z="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Z+'"></p>',G.content.childNodes[0].getAttribute(V)==Z)||(Z="_dt: "+Z.slice(1,-1)+";",J=!0)}catch(u){}var Q="\x3c!--"+Z+"--\x3e",X=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,se="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",oe=new RegExp(se+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(se+re+ie+"*)(["+te+"]*/>)","g"),ce=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+Q+"\\2","gi");function le(e,t,n,r){return"<"+t+n.replace(ce,ue)+r}function ue(e,t,n){return t+(n||'"')+Z+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,s){for(var i=t.childNodes,o=i.length,a=0;a<o;){var c=i[a];switch(c.nodeType){case 1:var l=s.concat(a);!function(t,n,r,s){for(var i,o=t.attributes,a=[],c=[],l=pe(o,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Z;if(f||1<(i=p.value.split(Q)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=o[m]||o[m.toLowerCase()];if(f)n.push(he(g,s,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(he(g,s,m,i))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var k=e.createElement(v);for(u=o.length,d=0;d<u;)k.setAttributeNode(o[d++].cloneNode(!0));k.textContent=t.textContent,t.parentNode.replaceChild(k,t)}}(c,n,r,l),fe(c,n,r,l);break;case 8:var u=c.textContent;if(u===Z)r.shift(),n.push(X.test(t.nodeName)?me(t,s):{type:"any",node:c,path:s.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(c),a--,o--}break;case 3:X.test(t.nodeName)&&Y.call(c.textContent)===Q&&(r.shift(),n.push(me(t,s)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(Q).replace(ae,de).replace(oe,le)})(t),r=e.transform;r&&(n=r(n));var s=j(n,e.type);ve(s);var i=[];return fe(s,i,t.slice(0),[]),{content:s,updates:function(n){for(var r=[],s=i.length,o=0,a=0;o<s;){var c=i[o++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return s+=a,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var i=1,o=1;i<e;){var a=r[i-o];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(o+=d-2;u<d;)l+=arguments[i++]+c[u++];a.fn(l)}else a.fn(arguments[i++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Y.call(r.textContent).length&&e.removeChild(r)}}var ke,$e,xe=(ke=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,$e=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Se(n,!0)}(e,t):Se(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Se(e,t){var n,r;return function(s){var i,o,a,c;switch(typeof s){case"object":if(s){if("object"===n){if(!t&&r!==s)for(o in r)o in s||(e[o]="")}else t?e.value="":e.cssText="";for(o in i=t?{}:e,s)a="number"!=typeof(c=s[o])||ke.test(o)?c:c+"px",!t&&/^--/.test(o)?i.setProperty(o,a):i[o]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace($e,_e),":",e[t],";");return n.join("")}(r=i):r=s;break}default:r!=s&&(n="string",r=s,t?e.value=s||"":e.cssText=s||"")}}}var Ce,Re,Ee=(Ce=[].slice,(Re=Ae.prototype).ELEMENT_NODE=1,Re.nodeType=111,Re.remove=function(e){var t,n=this.childNodes,r=this.firstChild,s=this.lastChild;return this._=null,e&&2===n.length?s.parentNode.removeChild(s):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(s),t.deleteContents()),r},Re.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,s=0,i=r.length;s<i;s++)t.appendChild(r[s]);return t},Ae);function Ae(e){var t=this.childNodes=Ce.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Le(e){return{html:e}}function Te(e,t){switch(e.nodeType){case Ue:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return 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(Le).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Ie(e){return null!=e&&"then"in e}var De,Ne,je,Oe,ze,Me="ownerSVGElement",qe=v.prototype.nodeType,Ue=Ee.prototype.nodeType,We=(Ne=(De={Event:b,WeakSet:u}).Event,je=De.WeakSet,Oe=!0,ze=null,function(e){return Oe&&(Oe=!Oe,ze=new je,function(e){var t=new je,n=new je;try{new MutationObserver(o).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,s=[],i=function(e){s.push(e),clearTimeout(r),r=setTimeout((function(){o(s.splice(r=0,s.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function o(e){for(var r,s=e.length,i=0;i<s;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var s,i=new Ne(t),o=e.length,a=0;a<o;1===(s=e[a++]).nodeType&&function e(t,n,r,s,i){ze.has(t)&&!s.has(t)&&(i.delete(t),s.add(t),t.dispatchEvent(n));for(var o=t.children||[],a=o.length,c=0;c<a;e(o[c++],n,r,s,i));}(s,i,t,n,r));}}(e.ownerDocument)),ze.add(e),e}),Fe=/^(?:form|list)$/i,Be=[].slice;function He(t){return this.type=t,function(t){var n=we,r=ve;return function(s){var i,o,a;return n!==s&&(i=t,o=n=s,a=be.get(o)||be.set(o,ye(i,o)),r=a.updates(K.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,s=Me in e;if("style"===t)return xe(e,n,s);if("."===t.slice(0,1))return l=e,u=t.slice(1),s?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return o=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(a,""):o.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?We(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!s&&t in e&&!Fe.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var s=D.attributes[t](e,n);r!==s&&(null==(r=s)?e.removeAttribute(t):e.setAttribute(t,s))};var o,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Te,before:e},s=Me in e?"svg":"html",i=!1;return function o(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":o(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=h(e.parentNode,t,[],r);break}default:if(i=!1,N(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":o({html:a});break;case"object":if(N(a[0])&&(a=a.concat.apply([],a)),Ie(a[0])){Promise.all(a).then(o);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Be.call(a.childNodes):[a],r):Ie(a)?a.then(o):"placeholder"in a?Pe(a,o):"text"in a?o(String(a.text)):"any"in a?o(a.any):"html"in a?t=h(e.parentNode,t,Be.call(j([].concat(a.html).join(""),s).childNodes),r):o("length"in a?Be.call(a):D.invoke(a,o))}var c}},text:function(e){var t;return function n(r){var s;t!==r&&("object"==(s=typeof(t=r))&&r?Ie(r)?r.then(n):"placeholder"in r?Pe(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Be.call(r).join(""):D.invoke(r,n)):"function"==s?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,s,i,o,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(s={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return s[t]||(s[t]=e)},Ve=c?i:(o=new n,function(e){return o.get(e)||(n=i(t=e),o.set(t,n),n);var t,n})):Ge=!0,Ke(t)};function Ke(e){return Ge?e:Ve(e)}function Ye(e){for(var t=arguments.length,n=[Ke(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ze=new n,Je=function(e){var t,n,r;return function(){var s=Ye.apply(null,arguments);return r!==s[0]?(r=s[0],n=new He(e),t=Xe(n.apply(n,s))):n.apply(n,s),t}},Qe=function(e,t){var n=t.indexOf(":"),r=Ze.get(e),s=t;return-1<n&&(s=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ze.set(e,r={}),r[s]||(r[s]=Je(t))},Xe=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ee(t):e},et=new n;function tt(){var e=et.get(this),t=Ye.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(Me in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,st,it,ot=D.define,at=He.prototype;function ct(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?ct.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?ct.bind(e):Qe(e,"html"):("raw"in e?Je("html"):ct.wire).apply(null,arguments)}return ct.Component=v,ct.bind=function(e){return tt.bind(e)},ct.define=ot,ct.diff=h,(ct.hyper=ct).observe=We,ct.tagger=at,ct.wire=function(e,t){return null==e?Je(t||"html"):Qe(e,t||"html")},ct._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,st=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,s){var i,o,a,c=t.get(e)||it(e,t);switch(typeof s){case"object":case"function":var l=c.w||(c.w=new n);return l.get(s)||(i=l,o=s,a=new e(r),i.set(o,a),a);default:var u=c.p||(c.p=st(null));return u[s]||(u[s]=new e(r))}}(this,rt.get(e)||(r=e,s=new w,rt.set(r,s),s),e,null==t?"default":t);var r,s}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html: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 s in r)n[s]=r[s];return!1!==t&&this.render(),this}}}),ct}(document);
2
- /*! (c) Andrea Giammarchi (ISC) */const Tt=$,Pt=ze,It=Lt,Dt=Ct,Nt=At,jt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",s=null,i=new Map,o="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(o){case"type":if("/"===c){o="subtype";continue}t+=c;break;case"subtype":if(";"===c){o="param-start";continue}n+=c;break;case"param-start":if(qe.test(c)||";"===c)continue;r+=c,o="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){o="param-value",s=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){o="collect-quoted-string";continue}if(";"===c){s=s.trimEnd(),o="param-start",We(i,r,s),r="";continue}s="string"==typeof s?s+c:c;break;case"collect-quoted-string":if('"'===c){We(i,r,s),o="ignore-input-until-next-param",r="",s=null;continue}if("\\"===c)continue;s="string"==typeof s?s+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;o="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${o} `)}}r&&We(i,r,s);if(""===t.trim()||!Me.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!Me.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?Me.test(n)?r+="="+n:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Ot=/-/g;const zt=new Intl.DateTimeFormat(["en-ca-iso8601"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Mt=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function qt(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Ut(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach(e=>{e.remove()})}function Wt(e,t="long"){const n=new Intl.ListFormat(s,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map(({type:n,value:s})=>"element"===n&&t?t(s,r++,e):s)}}const Ft=Wt("conjunction"),Bt=Wt("disjunction");function Ht(e,t){return Ft(e,t).join("")}function Gt(e,t){return Bt(e,t).join("")}function Vt(e){return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function Kt(e){return e.trim().replace(/\s+/g," ")}function Yt(e){const t=e.toLowerCase();return{"zh-hans":"zh","zh-cn":"zh"}[t]||t}function Zt(e,t=s){return t=Yt(t),new Proxy(e,{get(e,n){const r=e[t]&&e[t][n]||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function Jt(e,t=""){return zt.format(e).replace(Ot,t)}function Qt(e=new Date,t=document.documentElement.lang||"en"){e instanceof Date||(e=new Date(e));const n=[t,"en"];return`${e.toLocaleString(n,{day:"2-digit",timeZone:"UTC"})} ${e.toLocaleString(n,{month:"long",timeZone:"UTC"})} ${e.toLocaleString(n,{year:"numeric",timeZone:"UTC"})}`}function Xt(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){wn(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}async function en(e,t=864e5){const n=new Request(e),r=new URL(n.url);let s,i;if("caches"in window)try{if(s=await caches.open(r.origin),i=await s.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const o=await fetch(n);if(!o.ok&&i)return console.warn("Returning a stale cached response for "+r),i;if(s&&o.ok){const e=o.clone(),r=new Headers(o.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await s.put(n,a).catch(console.error)}return o}function tn(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map(e=>It`${e}, `);return It`${r}${n[n.length-1]}`}function nn(e,t){return[].concat(Ft(e,t)).map(e=>"string"==typeof e?It`${e}`:e)}function rn(e,t=""){return sn(e,t,function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(Kt(e.textContent)))}function sn(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let s=r?n:n.toLowerCase();if(s=s.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),s?!/\.$/.test(s)&&/^[a-z]/i.test(t||s)||(s="x"+s):s="generatedID",t&&(s=`${t}-${s}`),e.ownerDocument.getElementById(s)){let t=0,n=`${s}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${s}-${t}`;s=n}return e.id=s,s}function on(e){const t=new Set,n="ltNodefault"in e.dataset?"":Kt(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>Kt(e)).forEach(e=>t.add(e)):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach(e=>t.add(Kt(e)))}return[...t]}function an(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 cn(e,t){const n=t.closest(Mt);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 ln(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function un(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function dn(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 pn extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some(t=>t.toLowerCase()===e.toLowerCase())}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find(t=>t.toLowerCase()===e.toLowerCase())}}function fn(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{an(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),hn(t),t}function hn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...mn(t)])e.remove()}function*mn(e){for(;e.nextNode();)yield e.currentNode}class gn 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 bn extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach(t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||sn(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:s,elements:i,title:o,details:a}=this;return{message:e,name:t,plugin:r,hint:s,elements:i,title:o,details:a,stack:n}}}function yn(e,t,n={}){const r={...n,isWarning:!1};Rn("error",new bn(e,t,r))}function wn(e,t,n={}){const r={...n,isWarning:!0};Rn("warn",new bn(e,t,r))}function vn(e){return e?`\`${e}\``:""}function kn(e,{quotes:t}={quotes:!1}){return Gt(e,t?e=>vn(xn(e)):vn)}function $n(e,{quotes:t}={quotes:!1}){return Ht(e,t?e=>vn(xn(e)):vn)}function xn(e){return String(e)?`"${e}"`:""}function _n(e,...t){return e.map((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[s,i]=r.slice(1,-1).split("|");if(i){return`${e}[${s}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${s}\`](https://respec.org/docs/#${s})`}).join("")}const Sn="core/pubsubhub",Cn=new Map;function Rn(e,...t){if(!Cn.has(e))throw new Error(`No subscribers for topic "${e}".`);if(Array.from(Cn.get(e)).forEach(e=>{try{e(...t)}catch(t){yn(`Error when calling function ${e.name}.`,Sn,{hint:"See developer console."}),console.error(t)}}),window.parent===window.self)return;const n=t.map(e=>String(JSON.stringify(e.stack||e)));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function En(e,t,n={once:!1}){return n.once?En(e,(function n(...r){!function({topic:e,cb:t}){const n=Cn.get(e);if(!n||!n.has(t))return console.warn("Already unsubscribed:",e,t),!1;n.delete(t)}({topic:e,cb:n}),t(...r)})):(Cn.has(e)?Cn.get(e).add(t):Cn.set(e,new Set([t])),{topic:e,cb:t})}t(Sn,{sub:En});const An=["githubToken","githubUser"];const Ln=new Map([["text/html","html"],["application/xml","xml"]]);function Tn(e,t=document){const n=Ln.get(e);if(!n){const t=[...Ln.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Pn(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Pn(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;hn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar"),Ut(r);const s=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&s.appendChild(i);let o=e.querySelector("meta[charset], meta[content*='charset=']");o||(o=It`<meta charset="utf-8" />`);s.appendChild(o);const a="ReSpec "+(window.respecVersion||"Developer Channel"),c=It`
1
+ window.respecVersion="29.0.0",function(){"use strict";const e=!!window.require;if(!e){const e=function(e,t){const n=e.map(e=>{if(!(e in window.require.modules))throw new Error("Unsupported dependency name: "+e);return window.require.modules[e]});Promise.all(n).then(e=>t(...e))};e.modules={},window.require=e}function t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},s=n.lang;var i=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:s,run:function(e){e.l10n=r[s]||r.en}});let o,a;const c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(c.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return u.set(r,t.sort?t.sort():[t]),g(r)}}function m(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",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});l.set(e,t)}(e),t=e,(o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(g(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&c.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=m(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!y.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let o=i.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),s&&i.done]))[0]};return v.set(t,i),i}f=(e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)}))(f);var $=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),g(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=g(o);return r&&o.addEventListener("upgradeneeded",e=>{r(g(o.result),e.oldVersion,e.newVersion,g(o.transaction))}),n&&o.addEventListener("blocked",()=>n()),a.then(e=>{i&&e.addEventListener("close",()=>i()),s&&e.addEventListener("versionchange",()=>s())}).catch(()=>{}),a},unwrap:b,wrap:g});function x(e,t,n,r,s,{level:i="error",autofix:o,ruleName:a}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const s=n.map(e=>e.trivia+e.value).join(""),i=e[t];return"eof"===i.type?s:r?s+i.trivia:s.slice(i.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),f=l(p),h=d+f.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===s?"since":"inside",g=`${s} error at line ${u}${e.name?" in "+e.name:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map(e=>function(e,t){let n=e;return t&&(n+=" "+t),n}(e.type,e.name)).join(" -> ")}(n)}\``:""}:\n${h}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:i,ruleName:a,autofix:o,input:f,tokens:p}}function _(e,t,n,r){return x(e,t,n,r,"Syntax")}function S(e,t,n,r,s={}){return s.ruleName=n,x(t.source,e.index,t,r,"Validation",s)}class C{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function R(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const s=R(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,s),s)return{reference:e,dictionary:s.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=R(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function E(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some(e=>e.required);if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?E(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class A extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class L extends C{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new L({source:e.source,tokens:{value:n}})}}get value(){return V(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class T extends L{static parse(e){const t=e.consumeKind("eof");if(t)return new T({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function P(e,t){return K(e,{parser:L.parser(e,t),listName:t+" list"})}const I=["identifier","decimal","integer","string"],D=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map(e=>[e,"Legacy"+e]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function N(e){for(const t of I){const n=P(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class j extends C{static parse(e){const t={assign:e.consume("=")},n=ie(new j({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...I)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?N(e):Q(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):n.hasRhs&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map(n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e)),e.token(this.tokens.close)])}}class O extends C{static parse(e){const t=e.consumeKind("identifier");if(t)return new O({source:e.source,tokens:{name:t},params:j.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:this.params.tokens.secondaryName?V(t.secondaryName.value):null}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.";yield S(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(D.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${D.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield S(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=D.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class z extends A{static parse(e){const t={};if(t.open=e.consume("["),!t.open)return new z({});const n=new z({source:e.source,tokens:t});return n.push(...K(e,{parser:O.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Unexpected closing token of extended attribute"),n.length||e.error("Found an empty extended attribute"),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n}*validate(e){for(const t of this)yield*t.validate(e)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map(t=>t.write(e)),e.token(this.tokens.close)]):""}}function M(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function q(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=ie(new W({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error("No opening bracket after "+n.value),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=ee(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=X(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(s);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...ce)||e.error("Record key must be one of: "+ce.join(", ")),s=new W({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const i=X(e,t)||e.error("Error parsing generic type record");r.subtype.push(s,i);break}}return r.idlType||e.error("Error parsing generic type "+n.value),r.tokens.close=e.consume(">")||e.error("Missing closing bracket after "+n.value),r.this}(e,t)||J(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...ce,...ae);if(!t)return;n=new W({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error("Unsupported generic type "+t.value)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,M(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class W extends C{static parse(e,t){return q(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=ie(new W({source:e.source,tokens:n}));for(r.type=t||null;;){const t=X(e)||e.error("No type after open parenthesis or 'or' in union type");"any"===t.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===t.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(t);const n=e.consume("or");if(!n)break;t.tokens.separator=n}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),M(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new z({})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return V([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter(e=>e).map(e=>e.value).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.";yield S(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=R(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield S(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map(t=>t.write(e)),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}}class U extends C{static parse(e){const t=e.consume("=");if(!t)return null;const n=Y(e)||e.consumeKind("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new U({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return Z(this.expression[0]).type}get value(){return Z(this.expression[0]).value}get negative(){return Z(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map(t=>e.token(t))])}}class F extends C{static parse(e){const t=e.position,n={},r=ie(new F({source:e.source,tokens:n}));return r.extAttrs=z.parse(e),n.optional=e.consume("optional"),r.idlType=X(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...le),n.name?(r.default=n.optional?U.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return V(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=R(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield S(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield S(this.tokens.name,this,"dict-arg-default",e,{autofix:B(this)})}}else if(this.parent&&!E(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e);return!t.slice(n+1).some(e=>!e.optional)}(this)){const e="Dictionary argument must be optional if it has no required fields";yield S(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=se(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",B(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function B(e){return()=>{e.default=U.parse(new fe(" = {}"))}}class H extends C{static parse(e,{special:t,regular:n}={}){const r={special:t},s=ie(new H({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(s.arguments=[],s):(t||n||(r.special=e.consume("getter","setter","deleter")),s.idlType=ee(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=Q(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),s.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?V(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield S(this.tokens.open,this,"incomplete-op",e)}this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class G extends C{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,i={special:t},o=ie(new G({source:e.source,tokens:i}));if(t||n||(i.special=e.consume("inherit")),"inherit"===o.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),i.readonly=e.consume("readonly"),r&&!i.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),i.base=e.consume("attribute"),i.base)return o.idlType=X(e,"attribute-type")||e.error("Attribute lacks a type"),i.name=e.consumeKind("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),i.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),o.this;e.unconsume(s)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return V(this.tokens.name.value)}*validate(e){switch(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),this.idlType.generic){case"sequence":case"record":{const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield S(this.tokens.name,this,"attr-invalid-type",e);break}default:{const{reference:t}=R(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield S(e,this,"attr-invalid-type",n)}}}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function V(e){return e.startsWith("_")?e.slice(1):e}function K(e,{parser:t,allowDangler:n,listName:r="list"}){const s=t(e);if(!s)return[];s.tokens.separator=e.consume(",");const i=[s];for(;s.tokens.separator;){const s=t(e);if(!s){n||e.error("Trailing comma in "+r);break}if(s.tokens.separator=e.consume(","),i.push(s),!s.tokens.separator)break}return i}function Y(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function Z({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function J(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const s=e.consume("long");return new W({source:t,tokens:{prefix:n,base:r,postfix:s}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new W({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new W({source:t,tokens:{base:r}}):void 0}function Q(e){return K(e,{parser:F.parse,listName:"arguments list"})}function X(e,t){const n=z.parse(e),r=W.parse(e,t);return r&&(ie(r).extAttrs=n),r}function ee(e,t){const n=W.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new W({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function te(e){const t=e.consume("stringifier");if(!t)return;return G.parse(e,{special:t})||H.parse(e,{special:t})||e.error("Unterminated stringifier")}function ne(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function re(e){return()=>{if(e.extAttrs.length){const t=new fe("Exposed=Window,"),n=O.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=" "+r.tokens.name.trivia),e.extAttrs.unshift(n)}else{ie(e).extAttrs=z.parse(new fe("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia="\n"+ne(t)}}}function se(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return se(e.idlType);return Object.values(e.tokens).sort((e,t)=>e.index-t.index)[0]}function ie(e,t){return t||(t=e),e?new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)?ie(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}}):e}const oe={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},ae=["ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float32Array","Float64Array","any","object","symbol"],ce=["ByteString","DOMString","USVString"],le=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],ue=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(le,ce,ae),de=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],pe=["_constructor","toString","_toString"];class fe{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,i=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=o("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=o("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;s+=(e.match(/\n/g)||[]).length,r+=e,i-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=o("decimal"),-1===c&&(c=o("integer")),-1===c){c=o("identifier");const e=t.length-1,n=t[e];if(-1!==c){if(pe.includes(n.value)){const r=V(n.value)+" is a reserved identifier and must not be used.";throw new he(_(t,e,null,r))}ue.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=o("string"));for(const o of de)if(e.startsWith(o,n)){t.push({type:"inline",value:o,trivia:r,line:s,index:i}),r="",n+=o.length,c=n;break}if(-1===c&&(c=o("other")),-1===c)throw new Error("Token stream not progressing");n=c,i+=1}return t.push({type:"eof",value:"",trivia:r,line:s,index:i}),t;function o(o,{noFlushTrivia:a}={}){const c=oe[o];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:o,value:l[0],trivia:r,line:s,index:i}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new he(_(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class he extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:s,input:i,tokens:o}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=s,this.input=i,this.tokens=o}}class me extends L{static parse(e){const t=e.consumeKind("string");if(t)return new me({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class ge extends C{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=ie(new ge({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=K(e,{parser:me.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return V(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class be extends C{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new be({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return V(this.tokens.target.value)}get includes(){return V(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class ye extends C{static parse(e){const t={},n=ie(new ye({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=X(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return V(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class we extends C{static parse(e,t){const n={base:t},r=ie(new we({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=ee(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=Q(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return V(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map(t=>t.write(e)),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class ve extends C{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:s,type:i}=t;for(s.name=e.consumeKind("identifier")||e.error("Missing name in "+i),e.current=t,t=ie(t),n&&Object.assign(s,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),s.open=e.consume("{")||e.error("Bodyless "+i),t.members=[];;){if(s.close=e.consume("}"),s.close)return s.termination=e.consume(";")||e.error("Missing semicolon after "+i),t.this;const n=z.parse(e);let o;for(const[t,...n]of r)if(o=ie(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=n,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return V(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?V(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class ke extends C{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=J(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new W({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=Y(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new ke({source:e.source,tokens:t});return ie(r).idlType=n,r}get type(){return"const"}get name(){return V(this.tokens.name.value)}get value(){return Z(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class $e extends C{static parse(e){const t=e.position,n={},r=ie(new $e({source:e.source,tokens:n}));if(n.readonly=e.consume("readonly"),n.readonly||(n.async=e.consume("async")),n.base=n.readonly?e.consume("maplike","setlike"):n.async?e.consume("iterable"):e.consume("iterable","maplike","setlike"),!n.base)return void e.unconsume(t);const{type:s}=r,i="maplike"===s,o=i||"iterable"===s,a=r.async&&"iterable"===s;n.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=X(e)||e.error(`Missing a type argument in ${s} declaration`);return r.idlType=[c],r.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?r.idlType.push(X(e)):i&&e.error(`Missing second type argument in ${s} declaration`)),n.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(n.argsOpen=e.consume("("),r.arguments.push(...Q(e)),n.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),n.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),r.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class xe extends C{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=Q(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new xe({source:e.source,tokens:n});return ie(s).arguments=r,s}get type(){return"constructor"}*validate(e){this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function _e(e){const t=e.consume("static");if(!t)return;return G.parse(e,{special:t})||H.parse(e,{special:t})||e.error("No body in static member")}class Se extends ve{static parse(e,t,{partial:n=null}={}){const r={partial:n,base:t};return ve.parse(e,new Se({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[ke.parse],[xe.parse],[_e],[te],[$e.parse],[G.parse],[H.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield S(this.tokens.name,this,"require-exposed",e,{autofix:re(this)})}const t=this.extAttrs.filter(e=>"Constructor"===e.name);for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield S(e.tokens.name,this,"constructor-member",t,{autofix:Ce(this,e)})}if(this.extAttrs.some(e=>"Global"===e.name)){const e=this.extAttrs.filter(e=>"LegacyFactoryFunction"===e.name);for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield S(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter(e=>"constructor"===e.type);for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield S(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=new Set(o(t).map(e=>e.name)),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=o(e);yield*i(r,n,e,t);for(const e of r)n.add(e.name)}function*i(e,t,n,r){for(const s of e){const{name:e}=s;if(e&&t.has(e)){const t=`The operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield S(s.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter(({type:e})=>"operation"===e)}}(e,this))}}function Ce(e,t){return e=ie(e),()=>{const n=ne(e.extAttrs.tokens.open.trivia),r=e.members.length?ne(se(e.members[0]).trivia):function(e){const t=ne(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=xe.parse(new fe(`\n${r}constructor();`));s.extAttrs=new z({}),ie(s).arguments=t.arguments;const i=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,e=>"constructor"===e.type);e.members.splice(i+1,0,s);const{close:o}=e.tokens;o.trivia.includes("\n")||(o.trivia+="\n"+n);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class Re extends ve{static parse(e,t,{partial:n}={}){const r={partial:n,base:t};if(r.mixin=e.consume("mixin"),r.mixin)return ve.parse(e,new Re({source:e.source,tokens:r}),{allowedMembers:[[ke.parse],[te],[G.parse,{noInherit:!0}],[H.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Ee extends C{static parse(e){const t={},n=ie(new Ee({source:e.source,tokens:t}));return n.extAttrs=z.parse(e),t.required=e.consume("required"),n.idlType=X(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=U.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return V(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class Ae extends ve{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("dictionary"),n.base)return ve.parse(e,new Ae({source:e.source,tokens:n}),{inheritable:!t,allowedMembers:[[Ee.parse]]})}get type(){return"dictionary"}}class Le extends ve{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("namespace"),n.base)return ve.parse(e,new Le({source:e.source,tokens:n}),{allowedMembers:[[G.parse,{noInherit:!0,readonly:!0}],[ke.parse],[H.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield S(this.tokens.name,this,"require-exposed",e,{autofix:re(this)})}yield*super.validate(e)}}class Te extends ve{static parse(e,t,{partial:n=null}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return ve.parse(e,new Te({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[ke.parse],[H.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Pe(e,t){const n=e.source;function r(t){e.error(t)}function s(...t){return e.consume(...t)}function i(t){const n=s("interface");if(!n)return;return Re.parse(e,n,t)||Se.parse(e,n,t)||r("Interface has no proper body")}function o(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const t=s("callback");if(t)return e.probe("interface")?Te.parse(e,t):we.parse(e,t)}()||i()||function(){const t=s("partial");if(t)return Ae.parse(e,{partial:t})||i({partial:t})||Le.parse(e,{partial:t})||r("Partial doesn't apply to anything")}()||Ae.parse(e)||ge.parse(e)||ye.parse(e)||be.parse(e)||Le.parse(e)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=z.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}ie(n).extAttrs=t,s.push(n)}const i=T.parse(e);return t.concrete&&s.push(i),s}();return e.position<n.length&&r("Unrecognised tokens"),a}function Ie(e){return e}const De={wrap:e=>e.join(""),trivia:Ie,name:Ie,reference:Ie,type:Ie,generic:Ie,nameless:Ie,inheritance:Ie,definition:Ie,extendedAttribute:Ie,extendedAttributeReference:Ie};class Ne{constructor(e){this.ts=Object.assign({},De,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=Ie,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function je(e,t){const n=new Map,r=e.filter(e=>"includes"===e.type);for(const e of r){const r=t.get(e.includes);if(!r)continue;const s=n.get(e.target);s?s.push(r):n.set(e.target,[r])}return n}function*Oe(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const s of e)if(s.partial){const e=r.get(s.name);e?e.push(s):r.set(s.name,[s])}else s.name&&(t.has(s.name)?n.add(s):t.set(s.name,s));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:je(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield S(n.tokens.name,n,"no-duplicate",r)}}(t)}var ze=Object.freeze({__proto__:null,parse:function(e,t={}){const n=new fe(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Pe(n,t)},write:function(e,{templates:t=De}={}){t=Object.assign({},De,t);const n=new Ne(t);return t.wrap(e.map(e=>e.write(n)))},validate:function(e){return[...Oe((t=e,t.flat?t.flat():[].concat(...t)))];var t},WebIDLParseError:he});const Me=/^[!#$%&'*+-.^`|~\w]+$/,qe=/[\u000A\u000D\u0009\u0020]/u,We=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function Ue(e,t,n){(t&&""!==t&&!e.has(t)&&We.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function Fe(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Be={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const He=/[&<>"']/,Ge=/[&<>"']/g,Ve=/[<>"']|&(?!#?\w+;)/,Ke=/[<>"']|&(?!#?\w+;)/g,Ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ze=e=>Ye[e];function Je(e,t){if(t){if(He.test(e))return e.replace(Ge,Ze)}else if(Ve.test(e))return e.replace(Ke,Ze);return e}const Qe=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Xe(e){return e.replace(Qe,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const et=/(^|[^\[])\^/g;function tt(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(et,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const nt=/[^\w:]/g,rt=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function st(e,t,n){if(e){let e;try{e=decodeURIComponent(Xe(n)).replace(nt,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!rt.test(n)&&(n=function(e,t){it[" "+e]||(ot.test(e)?it[" "+e]=e+"/":it[" "+e]=pt(e,"/",!0));const n=-1===(e=it[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(at,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(ct,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const it={},ot=/^[^:]+:\/*[^/]*$/,at=/^([^:]+:)[\s\S]*$/,ct=/^([^:]+:\/*[^/]*)[\s\S]*$/;const lt={exec:function(){}};function ut(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function dt(e,t){const n=e.replace(/\|/g,(e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n[n.length-1].trim()||n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function pt(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.substr(0,r-s)}function ft(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ht(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function mt(e,t,n,r){const s=t.href,i=t.title?Je(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:Je(o)}}class gt{constructor(e){this.options=e||Be}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:pt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=pt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,s,i,o,a,c,l,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?"\\d{1,9}\\"+h.slice(-1):"\\"+h,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),l=t[2].split("\n",1)[0],u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=l.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=l.slice(i),i+=t[1].length),a=!1,!l&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(d=e.split("\n",1)[0],l=d,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(l));){if(l.search(/[^ ]/)>=i||!l.trim())p+="\n"+l.slice(i);else{if(a)break;p+="\n"+l}a||l.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1)}}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(s="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:s,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(o=0;o<y;o++){this.lexer.state.top=!1,g.items[o].tokens=this.lexer.blockTokens(g.items[o].text,[]);const e=g.items[o].tokens.filter(e=>"space"===e.type),t=e.every(e=>{const t=e.raw.split("");let n=0;for(const e of t)if("\n"===e&&(n+=1),n>1)return!0;return!1});!g.loose&&e.length&&t&&(g.loose=!0,g.items[o].loose=!0)}return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):Je(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:dt(t[1]).map(e=>({text:e})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,s,i,o=e.align.length;for(n=0;n<o;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(o=e.rows.length,n=0;n<o;n++)e.rows[n]=dt(e.rows[n],e.header.length).map(e=>({text:e}));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=[],this.lexer.inlineTokens(e.header[r].text,e.header[r].tokens);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],s=0;s<i.length;s++)i[s].tokens=[],this.lexer.inlineTokens(i[s].text,i[s].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Je(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Je(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=pt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,s=0;for(;s<n;s++)if("\\"===e[s])s++;else if(e[s]===t[0])r++;else if(e[s]===t[1]&&(r--,r<0))return s;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),mt(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return mt(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const s=r[1]||r[2]||"";if(!s||s&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let s,i,o=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=s.length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;if(i=Math.min(i,i+o+a),Math.min(n,i)%2){const t=e.slice(1,n+r.index+i);return{type:"em",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+i-1);return{type:"strong",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Je(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=Je(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=Je(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=Je(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=Je(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Je(n[0]):n[0]:Je(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const bt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:lt,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};bt.def=tt(bt.def).replace("label",bt._label).replace("title",bt._title).getRegex(),bt.bullet=/(?:[*+-]|\d{1,9}[.)])/,bt.listItemStart=tt(/^( *)(bull) */).replace("bull",bt.bullet).getRegex(),bt.list=tt(bt.list).replace(/bull/g,bt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+bt.def.source+")").getRegex(),bt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,bt.html=tt(bt.html,"i").replace("comment",bt._comment).replace("tag",bt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bt.paragraph=tt(bt._paragraph).replace("hr",bt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt._tag).getRegex(),bt.blockquote=tt(bt.blockquote).replace("paragraph",bt.paragraph).getRegex(),bt.normal=ut({},bt),bt.gfm=ut({},bt.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),bt.gfm.table=tt(bt.gfm.table).replace("hr",bt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt._tag).getRegex(),bt.gfm.paragraph=tt(bt._paragraph).replace("hr",bt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",bt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt._tag).getRegex(),bt.pedantic=ut({},bt.normal,{html:tt("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",bt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:lt,paragraph:tt(bt.normal._paragraph).replace("hr",bt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",bt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const yt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:lt,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:lt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function wt(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function vt(e){let t,n,r="";const s=e.length;for(t=0;t<s;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}yt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",yt.punctuation=tt(yt.punctuation).replace(/punctuation/g,yt._punctuation).getRegex(),yt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,yt.escapedEmSt=/\\\*|\\_/g,yt._comment=tt(bt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),yt.emStrong.lDelim=tt(yt.emStrong.lDelim).replace(/punct/g,yt._punctuation).getRegex(),yt.emStrong.rDelimAst=tt(yt.emStrong.rDelimAst,"g").replace(/punct/g,yt._punctuation).getRegex(),yt.emStrong.rDelimUnd=tt(yt.emStrong.rDelimUnd,"g").replace(/punct/g,yt._punctuation).getRegex(),yt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,yt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,yt._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])?)+(?![-_])/,yt.autolink=tt(yt.autolink).replace("scheme",yt._scheme).replace("email",yt._email).getRegex(),yt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,yt.tag=tt(yt.tag).replace("comment",yt._comment).replace("attribute",yt._attribute).getRegex(),yt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,yt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,yt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,yt.link=tt(yt.link).replace("label",yt._label).replace("href",yt._href).replace("title",yt._title).getRegex(),yt.reflink=tt(yt.reflink).replace("label",yt._label).replace("ref",bt._label).getRegex(),yt.nolink=tt(yt.nolink).replace("ref",bt._label).getRegex(),yt.reflinkSearch=tt(yt.reflinkSearch,"g").replace("reflink",yt.reflink).replace("nolink",yt.nolink).getRegex(),yt.normal=ut({},yt),yt.pedantic=ut({},yt.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:tt(/^!?\[(label)\]\((.*?)\)/).replace("label",yt._label).getRegex(),reflink:tt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yt._label).getRegex()}),yt.gfm=ut({},yt.normal,{escape:tt(yt.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),yt.gfm.url=tt(yt.gfm.url,"i").replace("email",yt.gfm._extended_email).getRegex(),yt.breaks=ut({},yt.gfm,{br:tt(yt.br).replace("{2,}","*").getRegex(),text:tt(yt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class kt{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Be,this.options.tokenizer=this.options.tokenizer||new gt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:bt.normal,inline:yt.normal};this.options.pedantic?(t.block=bt.pedantic,t.inline=yt.pedantic):this.options.gfm&&(t.block=bt.gfm,this.options.breaks?t.inline=yt.breaks:t.inline=yt.gfm),this.tokenizer.rules=t}static get rules(){return{block:bt,inline:yt}}static lex(e,t){return new kt(t).lex(e)}static lexInline(e,t){return new kt(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,s,i;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,s,i,o,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+ht("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+ht("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,vt))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,vt))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s,wt))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class $t{constructor(e){this.options=e||Be}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+Je(r,!0)+'">'+(n?e:Je(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Je(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=st(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+Je(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=st(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class xt{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class _t{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class St{constructor(e){this.options=e||Be,this.options.renderer=this.options.renderer||new $t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new xt,this.slugger=new _t}static parse(e,t){return new St(t).parse(e)}static parseInline(e,t){return new St(t).parseInline(e)}parse(e,t=!0){let n,r,s,i,o,a,c,l,u,d,p,f,h,m,g,b,y,w,v,k="";const $=e.length;for(n=0;n<$;n++)if(d=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(v=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))k+=v||"";else switch(d.type){case"space":continue;case"hr":k+=this.renderer.hr();continue;case"heading":k+=this.renderer.heading(this.parseInline(d.tokens),d.depth,Xe(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":k+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(l="",c="",i=d.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(l+=this.renderer.tablerow(c),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],c="",o=a.length,s=0;s<o;s++)c+=this.renderer.tablecell(this.parseInline(a[s].tokens),{header:!1,align:d.align[s]});u+=this.renderer.tablerow(c)}k+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(d.tokens),k+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,y=g.task,m="",g.task&&(w=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,y,b);k+=this.renderer.list(u,p,f);continue;case"html":k+=this.renderer.html(d.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<$&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);k+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return k}parseInline(e,t){t=t||this.renderer;let n,r,s,i="";const o=e.length;for(n=0;n<o;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(s=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==s||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=s||"";else switch(r.type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}function Ct(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),ft(t=ut({},Ct.defaults,t||{})),n){const r=t.highlight;let s;try{s=kt.lex(e,t)}catch(e){return n(e)}const i=function(e){let i;if(!e)try{t.walkTokens&&Ct.walkTokens(s,t.walkTokens),i=St.parse(s,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,i)};if(!r||r.length<3)return i();if(delete t.highlight,!s.length)return i();let o=0;return Ct.walkTokens(s,(function(e){"code"===e.type&&(o++,setTimeout(()=>{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),o--,0===o&&i()}))},0))})),void(0===o&&i())}try{const n=kt.lex(e,t);return t.walkTokens&&Ct.walkTokens(n,t.walkTokens),St.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+Je(e.message+"",!0)+"</pre>";throw e}}Ct.options=Ct.setOptions=function(e){var t;return ut(Ct.defaults,e),t=Ct.defaults,Be=t,Ct},Ct.getDefaults=Fe,Ct.defaults=Be,Ct.use=function(...e){const t=ut({},...e),n=Ct.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach(e=>{if(e.extensions&&(r=!0,e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){const n=Ct.defaults.renderer||new $t;for(const t in e.renderer){const r=n[t];n[t]=(...s)=>{let i=e.renderer[t].apply(n,s);return!1===i&&(i=r.apply(n,s)),i}}t.renderer=n}if(e.tokenizer){const n=Ct.defaults.tokenizer||new gt;for(const t in e.tokenizer){const r=n[t];n[t]=(...s)=>{let i=e.tokenizer[t].apply(n,s);return!1===i&&(i=r.apply(n,s)),i}}t.tokenizer=n}if(e.walkTokens){const n=Ct.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),Ct.setOptions(t)})},Ct.walkTokens=function(e,t){for(const n of e)switch(t.call(Ct,n),n.type){case"table":for(const e of n.header)Ct.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)Ct.walkTokens(n.tokens,t);break;case"list":Ct.walkTokens(n.items,t);break;default:Ct.defaults.extensions&&Ct.defaults.extensions.childTokens&&Ct.defaults.extensions.childTokens[n.type]?Ct.defaults.extensions.childTokens[n.type].forEach((function(e){Ct.walkTokens(n[e],t)})):n.tokens&&Ct.walkTokens(n.tokens,t)}},Ct.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");ft(t=ut({},Ct.defaults,t||{}));try{const n=kt.lexInline(e,t);return t.walkTokens&&Ct.walkTokens(n,t.walkTokens),St.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+Je(e.message+"",!0)+"</pre>";throw e}},Ct.Parser=St,Ct.parser=St.parse,Ct.Renderer=$t,Ct.TextRenderer=xt,Ct.Lexer=kt,Ct.lexer=kt.lex,Ct.Tokenizer=gt,Ct.Slugger=_t,Ct.parse=Ct,St.parse,kt.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Rt,Et={exports:{}};Rt=Et,function(e,t){Rt.exports=t()}(0,(function(){var e=[],t=[],n={},r={},s={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function o(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function c(e,t){return e.replace(t[0],(function(n,r){var s=a(t[1],arguments);return o(""===n?e[r-1]:n,s)}))}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var s=r.length;s--;){var i=r[s];if(i[0].test(t))return c(t,i)}return t}function u(e,t,n){return function(r){var s=r.toLowerCase();return t.hasOwnProperty(s)?o(r,s):e.hasOwnProperty(s)?o(r,e[s]):l(s,r,n)}}function d(e,t,n,r){return function(r){var s=r.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&l(s,s,n)===s}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=u(s,r,e),p.isPlural=d(s,r,e),p.singular=u(r,s,t),p.isSingular=d(r,s,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),s[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}));var At=Et.exports,Lt=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,s=i.prototype;return s.delete=function(e){return this.has(e)&&delete e[this._]},s.get=function(e){return this.has(e)?e[this._]:void 0},s.has=function(e){return r.call(e,this._)},s.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=s.prototype;function s(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=s}(Math.random(),Object.defineProperty)}function s(e,t,n,r,s,i){for(var o=("selectedIndex"in t),a=o;r<s;){var c,l=e(n[r],1);t.insertBefore(l,i),o&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function i(e,t){return e==t}function o(e){return e}function a(e,t,n,r,s,i,o){var a=i-s;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=s;c<n&&l<i&&o(e[c],r[l]);)c++,l++;if(l===i)return t;t=c+1}return-1}function c(e,t,n,r,s){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:s}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,s=t;r<s;){var i=(r+s)/2>>>0;n<e[i]?s=i:r=1+i}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||o,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return s(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var k=m-g,$=b-y,x=-1;if(k<$){if(-1<(x=a(n,y,b,t,g,m,u)))return s(d,e,n,y,x,d(t[g],0)),s(d,e,n,x+k,b,c(d,t,m,h,f)),n}else if($<k&&-1<(x=a(t,g,m,n,y,b,u)))return l(d,t,g,x),l(d,t,x+$,m),n;return k<2||$<2?(s(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):k==$&&function(e,t,n,r,s,i){for(;r<s&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?s(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,i,o,a,c,u,d,f,h,m){!function(e,t,n,r,i,o,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:i++,f++;break;case 1:d.push(r[i]),s(t,n,r,i++,i,f<c?t(o[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(o[a])?a++:l(t,o,a++,a)}}(function(e,t,n,r,s,i,o){var a,c,l,u,d,p,f=n+i,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<i&&c<n&&o(r[s+l],e[t+c]);)l++,c++;if(l===i&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&o(r[s+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,o,a,c,d,h)||function(e,t,n,r,s,i,o,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=o;for(var h=s.slice(i,o),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+i))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--o;d[c]>o;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,k=w.oldi;v<n;)y[--l]=1,--n;for(;k<o;)y[--l]=-1,--o;y[--l]=0,--n,--o,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;i<=o;)y[--l]=-1,--o;return y}(n,r,i,o,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,$,t,g,m,k,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(s){var i=r(s);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,s){e.call(r,n[s],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(s,i){return n[r(s)?e:t.push(s)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function k(e,t){var n="_"+e+"$";return{get:function(){return this[n]||$(this,n,t.call(this,e))},set:function(e){$(this,n,e)}}}var $=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,_,S,C,R,E,A={},L={},T=[],P=L.hasOwnProperty,I=0,D={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in L||(I=T.push(e)),L[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<I;n++){var r=T[n];if(P.call(e,r))return L[r](e[r],t)}}},N=Array.isArray||(_=(x={}.toString).call([]),function(e){return x.call(e)===_}),j=(S=e,C="fragment",E="content"in z(R="template")?function(e){var t=z(R);return t.innerHTML=e,t.content}:function(e){var t,n=z(C),r=z(R);return O(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(C),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",O(t,n.firstChild.childNodes),t}:E)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===C?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,W,U,F,B,H,G,V,K=(q="appendChild",W="cloneNode",U="createTextNode",B=(F="importNode")in(M=e),(H=M.createDocumentFragment())[q](M[U]("g")),H[q](M[U]("")),(B?M[F](H,!0):H[W](!0)).childNodes.length<2?function e(t,n){for(var r=t[W](),s=t.childNodes||[],i=s.length,o=0;n&&o<i;o++)r[q](e(s[o],n));return r}:B?M[F]:function(e,t){return e[W](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Z="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Z+'"></p>',G.content.childNodes[0].getAttribute(V)==Z)||(Z="_dt: "+Z.slice(1,-1)+";",J=!0)}catch(u){}var Q="\x3c!--"+Z+"--\x3e",X=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,se="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",oe=new RegExp(se+re+ie+"+)(["+te+"]*/?>)","g"),ae=new RegExp(se+re+ie+"*)(["+te+"]*/>)","g"),ce=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+Q+"\\2","gi");function le(e,t,n,r){return"<"+t+n.replace(ce,ue)+r}function ue(e,t,n){return t+(n||'"')+Z+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function fe(t,n,r,s){for(var i=t.childNodes,o=i.length,a=0;a<o;){var c=i[a];switch(c.nodeType){case 1:var l=s.concat(a);!function(t,n,r,s){for(var i,o=t.attributes,a=[],c=[],l=pe(o,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Z;if(f||1<(i=p.value.split(Q)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=o[m]||o[m.toLowerCase()];if(f)n.push(he(g,s,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(he(g,s,m,i))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var k=e.createElement(v);for(u=o.length,d=0;d<u;)k.setAttributeNode(o[d++].cloneNode(!0));k.textContent=t.textContent,t.parentNode.replaceChild(k,t)}}(c,n,r,l),fe(c,n,r,l);break;case 8:var u=c.textContent;if(u===Z)r.shift(),n.push(X.test(t.nodeName)?me(t,s):{type:"any",node:c,path:s.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(c),a--,o--}break;case 3:X.test(t.nodeName)&&Y.call(c.textContent)===Q&&(r.shift(),n.push(me(t,s)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(Q).replace(ae,de).replace(oe,le)})(t),r=e.transform;r&&(n=r(n));var s=j(n,e.type);ve(s);var i=[];return fe(s,i,t.slice(0),[]),{content:s,updates:function(n){for(var r=[],s=i.length,o=0,a=0;o<s;){var c=i[o++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return s+=a,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var i=1,o=1;i<e;){var a=r[i-o];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(o+=d-2;u<d;)l+=arguments[i++]+c[u++];a.fn(l)}else a.fn(arguments[i++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Y.call(r.textContent).length&&e.removeChild(r)}}var ke,$e,xe=(ke=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,$e=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Se(n,!0)}(e,t):Se(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Se(e,t){var n,r;return function(s){var i,o,a,c;switch(typeof s){case"object":if(s){if("object"===n){if(!t&&r!==s)for(o in r)o in s||(e[o]="")}else t?e.value="":e.cssText="";for(o in i=t?{}:e,s)a="number"!=typeof(c=s[o])||ke.test(o)?c:c+"px",!t&&/^--/.test(o)?i.setProperty(o,a):i[o]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace($e,_e),":",e[t],";");return n.join("")}(r=i):r=s;break}default:r!=s&&(n="string",r=s,t?e.value=s||"":e.cssText=s||"")}}}var Ce,Re,Ee=(Ce=[].slice,(Re=Ae.prototype).ELEMENT_NODE=1,Re.nodeType=111,Re.remove=function(e){var t,n=this.childNodes,r=this.firstChild,s=this.lastChild;return this._=null,e&&2===n.length?s.parentNode.removeChild(s):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(s),t.deleteContents()),r},Re.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,s=0,i=r.length;s<i;s++)t.appendChild(r[s]);return t},Ae);function Ae(e){var t=this.childNodes=Ce.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Le(e){return{html:e}}function Te(e,t){switch(e.nodeType){case We: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(Le).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Ie(e){return null!=e&&"then"in e}var De,Ne,je,Oe,ze,Me="ownerSVGElement",qe=v.prototype.nodeType,We=Ee.prototype.nodeType,Ue=(Ne=(De={Event:b,WeakSet:u}).Event,je=De.WeakSet,Oe=!0,ze=null,function(e){return Oe&&(Oe=!Oe,ze=new je,function(e){var t=new je,n=new je;try{new MutationObserver(o).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,s=[],i=function(e){s.push(e),clearTimeout(r),r=setTimeout((function(){o(s.splice(r=0,s.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function o(e){for(var r,s=e.length,i=0;i<s;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var s,i=new Ne(t),o=e.length,a=0;a<o;1===(s=e[a++]).nodeType&&function e(t,n,r,s,i){ze.has(t)&&!s.has(t)&&(i.delete(t),s.add(t),t.dispatchEvent(n));for(var o=t.children||[],a=o.length,c=0;c<a;e(o[c++],n,r,s,i));}(s,i,t,n,r));}}(e.ownerDocument)),ze.add(e),e}),Fe=/^(?:form|list)$/i,Be=[].slice;function He(t){return this.type=t,function(t){var n=we,r=ve;return function(s){var i,o,a;return n!==s&&(i=t,o=n=s,a=be.get(o)||be.set(o,ye(i,o)),r=a.updates(K.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,s=Me in e;if("style"===t)return xe(e,n,s);if("."===t.slice(0,1))return l=e,u=t.slice(1),s?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return o=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(a,""):o.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?Ue(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!s&&t in e&&!Fe.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var s=D.attributes[t](e,n);r!==s&&(null==(r=s)?e.removeAttribute(t):e.setAttribute(t,s))};var o,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Te,before:e},s=Me in e?"svg":"html",i=!1;return function o(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":o(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=h(e.parentNode,t,[],r);break}default:if(i=!1,N(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":o({html:a});break;case"object":if(N(a[0])&&(a=a.concat.apply([],a)),Ie(a[0])){Promise.all(a).then(o);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Be.call(a.childNodes):[a],r):Ie(a)?a.then(o):"placeholder"in a?Pe(a,o):"text"in a?o(String(a.text)):"any"in a?o(a.any):"html"in a?t=h(e.parentNode,t,Be.call(j([].concat(a.html).join(""),s).childNodes),r):o("length"in a?Be.call(a):D.invoke(a,o))}var c}},text:function(e){var t;return function n(r){var s;t!==r&&("object"==(s=typeof(t=r))&&r?Ie(r)?r.then(n):"placeholder"in r?Pe(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Be.call(r).join(""):D.invoke(r,n)):"function"==s?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,s,i,o,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(s={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return s[t]||(s[t]=e)},Ve=c?i:(o=new n,function(e){return o.get(e)||(n=i(t=e),o.set(t,n),n);var t,n})):Ge=!0,Ke(t)};function Ke(e){return Ge?e:Ve(e)}function Ye(e){for(var t=arguments.length,n=[Ke(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ze=new n,Je=function(e){var t,n,r;return function(){var s=Ye.apply(null,arguments);return r!==s[0]?(r=s[0],n=new He(e),t=Xe(n.apply(n,s))):n.apply(n,s),t}},Qe=function(e,t){var n=t.indexOf(":"),r=Ze.get(e),s=t;return-1<n&&(s=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ze.set(e,r={}),r[s]||(r[s]=Je(t))},Xe=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ee(t):e},et=new n;function tt(){var e=et.get(this),t=Ye.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(Me in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,st,it,ot=D.define,at=He.prototype;function ct(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?ct.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?ct.bind(e):Qe(e,"html"):("raw"in e?Je("html"):ct.wire).apply(null,arguments)}return ct.Component=v,ct.bind=function(e){return tt.bind(e)},ct.define=ot,ct.diff=h,(ct.hyper=ct).observe=Ue,ct.tagger=at,ct.wire=function(e,t){return null==e?Je(t||"html"):Qe(e,t||"html")},ct._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,st=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,s){var i,o,a,c=t.get(e)||it(e,t);switch(typeof s){case"object":case"function":var l=c.w||(c.w=new n);return l.get(s)||(i=l,o=s,a=new e(r),i.set(o,a),a);default:var u=c.p||(c.p=st(null));return u[s]||(u[s]=new e(r))}}(this,rt.get(e)||(r=e,s=new w,rt.set(r,s),s),e,null==t?"default":t);var r,s}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html: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 s in r)n[s]=r[s];return!1!==t&&this.render(),this}}}),ct}(document);
2
+ /*! (c) Andrea Giammarchi (ISC) */const Tt=$,Pt=ze,It=Lt,Dt=Ct,Nt=At,jt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",s=null,i=new Map,o="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(o){case"type":if("/"===c){o="subtype";continue}t+=c;break;case"subtype":if(";"===c){o="param-start";continue}n+=c;break;case"param-start":if(qe.test(c)||";"===c)continue;r+=c,o="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){o="param-value",s=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){o="collect-quoted-string";continue}if(";"===c){s=s.trimEnd(),o="param-start",Ue(i,r,s),r="";continue}s="string"==typeof s?s+c:c;break;case"collect-quoted-string":if('"'===c){Ue(i,r,s),o="ignore-input-until-next-param",r="",s=null;continue}if("\\"===c)continue;s="string"==typeof s?s+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;o="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${o} `)}}r&&Ue(i,r,s);if(""===t.trim()||!Me.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!Me.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?Me.test(n)?r+="="+n:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Ot=/-/g;const zt=new Intl.DateTimeFormat(["en-ca-iso8601"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Mt=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function qt(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Wt(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach(e=>{e.remove()})}function Ut(e,t="long"){const n=new Intl.ListFormat(s,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map(({type:n,value:s})=>"element"===n&&t?t(s,r++,e):s)}}const Ft=Ut("conjunction"),Bt=Ut("disjunction");function Ht(e,t){return Ft(e,t).join("")}function Gt(e,t){return Bt(e,t).join("")}function Vt(e){return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function Kt(e){return e.trim().replace(/\s+/g," ")}function Yt(e){const t=e.toLowerCase();return{"zh-hans":"zh","zh-cn":"zh"}[t]||t}function Zt(e,t=s){return t=Yt(t),new Proxy(e,{get(e,n){const r=e[t]&&e[t][n]||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function Jt(e,t=""){return zt.format(e).replace(Ot,t)}function Qt(e=new Date,t=document.documentElement.lang||"en"){e instanceof Date||(e=new Date(e));const n=[t,"en"];return`${e.toLocaleString(n,{day:"2-digit",timeZone:"UTC"})} ${e.toLocaleString(n,{month:"long",timeZone:"UTC"})} ${e.toLocaleString(n,{year:"numeric",timeZone:"UTC"})}`}function Xt(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){wn(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}async function en(e,t=864e5){const n=new Request(e),r=new URL(n.url);let s,i;if("caches"in window)try{if(s=await caches.open(r.origin),i=await s.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const o=await fetch(n);if(!o.ok&&i)return console.warn("Returning a stale cached response for "+r),i;if(s&&o.ok){const e=o.clone(),r=new Headers(o.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await s.put(n,a).catch(console.error)}return o}function tn(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map(e=>It`${e}, `);return It`${r}${n[n.length-1]}`}function nn(e,t){return[].concat(Ft(e,t)).map(e=>"string"==typeof e?It`${e}`:e)}function rn(e,t=""){return sn(e,t,function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(Kt(e.textContent)))}function sn(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let s=r?n:n.toLowerCase();if(s=s.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),s?!/\.$/.test(s)&&/^[a-z]/i.test(t||s)||(s="x"+s):s="generatedID",t&&(s=`${t}-${s}`),e.ownerDocument.getElementById(s)){let t=0,n=`${s}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${s}-${t}`;s=n}return e.id=s,s}function on(e){const t=new Set,n="ltNodefault"in e.dataset?"":Kt(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>Kt(e)).forEach(e=>t.add(e)):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach(e=>t.add(Kt(e)))}return[...t]}function an(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 cn(e,t){const n=t.closest(Mt);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 ln(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function un(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function dn(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 pn extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some(t=>t.toLowerCase()===e.toLowerCase())}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find(t=>t.toLowerCase()===e.toLowerCase())}}function fn(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{an(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),hn(t),t}function hn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...mn(t)])e.remove()}function*mn(e){for(;e.nextNode();)yield e.currentNode}class gn 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 bn extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach(t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||sn(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:s,elements:i,title:o,details:a}=this;return{message:e,name:t,plugin:r,hint:s,elements:i,title:o,details:a,stack:n}}}function yn(e,t,n={}){const r={...n,isWarning:!1};Rn("error",new bn(e,t,r))}function wn(e,t,n={}){const r={...n,isWarning:!0};Rn("warn",new bn(e,t,r))}function vn(e){return e?`\`${e}\``:""}function kn(e,{quotes:t}={quotes:!1}){return Gt(e,t?e=>vn(xn(e)):vn)}function $n(e,{quotes:t}={quotes:!1}){return Ht(e,t?e=>vn(xn(e)):vn)}function xn(e){return String(e)?`"${e}"`:""}function _n(e,...t){return e.map((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[s,i]=r.slice(1,-1).split("|");if(i){return`${e}[${s}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${s}\`](https://respec.org/docs/#${s})`}).join("")}const Sn="core/pubsubhub",Cn=new Map;function Rn(e,...t){if(!Cn.has(e))throw new Error(`No subscribers for topic "${e}".`);if(Array.from(Cn.get(e)).forEach(e=>{try{e(...t)}catch(t){yn(`Error when calling function ${e.name}.`,Sn,{hint:"See developer console."}),console.error(t)}}),window.parent===window.self)return;const n=t.map(e=>String(JSON.stringify(e.stack||e)));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function En(e,t,n={once:!1}){return n.once?En(e,(function n(...r){!function({topic:e,cb:t}){const n=Cn.get(e);if(!n||!n.has(t))return console.warn("Already unsubscribed:",e,t),!1;n.delete(t)}({topic:e,cb:n}),t(...r)})):(Cn.has(e)?Cn.get(e).add(t):Cn.set(e,new Set([t])),{topic:e,cb:t})}t(Sn,{sub:En});const An=["githubToken","githubUser"];const Ln=new Map([["text/html","html"],["application/xml","xml"]]);function Tn(e,t=document){const n=Ln.get(e);if(!n){const t=[...Ln.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Pn(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Pn(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;hn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar"),Wt(r);const s=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&s.appendChild(i);let o=e.querySelector("meta[charset], meta[content*='charset=']");o||(o=It`<meta charset="utf-8" />`);s.appendChild(o);const a="ReSpec "+(window.respecVersion||"Developer Channel"),c=It`
3
3
  <meta name="generator" content="${a}" />
4
- `;s.appendChild(c),t.prepend(s),Rn("beforesave",r)}(n);let r="";switch(e){case"xml":r=(new XMLSerializer).serializeToString(n);break;default:!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}t("core/exporter",{rsDocToDataURL:Tn});class In{constructor(){this._respecDonePromise=new Promise(e=>{En("end-all",e,{once:!0})}),this.errors=[],this.warnings=[],En("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),En("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Pn("html",document)}}const Dn="core/post-process";const Nn="core/pre-process";const jn="core/base-runner";async function On(e){!function(){const e=new In;Object.defineProperty(document,"respec",{value:e})}(),Rn("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),En("amend-user-config",n),En("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of An)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)})}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter(([e,t])=>!!e&&!!t).map(([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let s;try{s=JSON.parse(r)}catch{s=r}return[n,s]}),r=Object.fromEntries(n);Object.assign(e,r),Rn("amend-user-config",r)}(respecConfig),performance.mark(jn+"-start"),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter(e=>{const t="function"==typeof e;return t||yn("Every item in `preProcess` must be a JS function.",Nn),t}).map(async t=>{try{return await t(e,document)}catch(e){yn(`Function ${t.name} threw an error during \`preProcess\`.`,Nn,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}}(respecConfig);const t=e.filter(e=>{return(t=e)&&(t.run||t.Plugin);var t});t.forEach(e=>!e.name&&console.warn("Plugin lacks name:",e)),respecConfig.state={},await async function(e,t){for(const n of e.filter(e=>e.prepare))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise(async(r,s)=>{const i=setTimeout(()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),s(new Error(t))},15e3);performance.mark(e+"-start");try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){s(e)}finally{clearTimeout(i),performance.mark(e+"-end"),performance.measure(e,e+"-start",e+"-end")}})}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},Rn("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||yn("Every item in `postProcess` must be a JS function.",Dn),t}).map(async t=>{try{return await t(e,document)}catch(e){yn(`Function ${t.name} threw an error during \`postProcess\`.`,Dn,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),Rn("end-all"),Ut(document),performance.mark(jn+"-end"),performance.measure(jn,jn+"-start",jn+"-end")}var zn=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
+ `;s.appendChild(c),t.prepend(s),Rn("beforesave",r)}(n);let r="";switch(e){case"xml":r=(new XMLSerializer).serializeToString(n);break;default:!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}t("core/exporter",{rsDocToDataURL:Tn});class In{constructor(){this._respecDonePromise=new Promise(e=>{En("end-all",e,{once:!0})}),this.errors=[],this.warnings=[],En("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),En("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Pn("html",document)}}const Dn="core/post-process";const Nn="core/pre-process";const jn="core/base-runner";async function On(e){!function(){const e=new In;Object.defineProperty(document,"respec",{value:e})}(),Rn("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),En("amend-user-config",n),En("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of An)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)})}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter(([e,t])=>!!e&&!!t).map(([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let s;try{s=JSON.parse(r)}catch{s=r}return[n,s]}),r=Object.fromEntries(n);Object.assign(e,r),Rn("amend-user-config",r)}(respecConfig),performance.mark(jn+"-start"),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter(e=>{const t="function"==typeof e;return t||yn("Every item in `preProcess` must be a JS function.",Nn),t}).map(async t=>{try{return await t(e,document)}catch(e){yn(`Function ${t.name} threw an error during \`preProcess\`.`,Nn,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}}(respecConfig);const t=e.filter(e=>{return(t=e)&&(t.run||t.Plugin);var t});t.forEach(e=>!e.name&&console.warn("Plugin lacks name:",e)),respecConfig.state={},await async function(e,t){for(const n of e.filter(e=>e.prepare))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise(async(r,s)=>{const i=setTimeout(()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),s(new Error(t))},15e3);performance.mark(e+"-start");try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){s(e)}finally{clearTimeout(i),performance.mark(e+"-end"),performance.measure(e,e+"-start",e+"-end")}})}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},Rn("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||yn("Every item in `postProcess` must be a JS function.",Dn),t}).map(async t=>{try{return await t(e,document)}catch(e){yn(`Function ${t.name} threw an error during \`postProcess\`.`,Dn,{hint:"See developer console."}),console.error(e)}});await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),Rn("end-all"),Wt(document),performance.mark(jn+"-end"),performance.measure(jn,jn+"-start",jn+"-end")}var zn=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}
5
5
  #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000}
6
6
  #respec-pill,.respec-info-button{background:#fff;height:2.5em;color:#787878;border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5)}
7
7
  .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em}
@@ -55,37 +55,37 @@ window.respecVersion="28.2.8",function(){"use strict";const e=!!window.require;i
55
55
  .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center}
56
56
  .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px}
57
57
  p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
58
- .respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;function Mn(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter(e=>e.trim()).map(e=>e.search(/[^\s]/)),r=Math.min(...n);return t.map(e=>e.slice(r)).join("\n")}var qn=Object.freeze({__proto__:null,name:"core/reindent",reindent:Mn,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Mn(e.innerHTML)}});const Un=/&gt;/gm,Wn=/&amp;/gm;class Fn extends Dt.Renderer{code(e,t,n){const{language:r,...s}=Fn.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const i=super.code(e,r,n),{example:o,illegalExample:a}=s;if(!o&&!a)return i;const c=o||a,l=`${r} ${o?"example":"illegal-example"}`;return i.replace("<pre>",`<pre title="${c}" class="${l}">`)}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let s;if(r)try{s=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...s}}heading(e,t,n,r){const s=/(.+)\s+{#([\w-]+)}$/;if(s.test(e)){const[,n,r]=e.match(s);return`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}function Bn(e){const t=Mn(e).replace(Un,">").replace(Wn,"&");return Dt(t,{sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new Fn})}function Hn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Bn(e.innerHTML)}class Gn{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e,t){const n=this.findHeader(e),r=n?this.findPosition(n):1,s=this.findParent(r);n&&e.removeChild(n),e.appendChild(t(e)),n&&e.prepend(n),s.appendChild(e),this.current=s}addElement(e){this.current.appendChild(e)}}function Vn(e,t){return function e(n){const r=new Gn(t);for(;n.firstChild;){const t=n.firstChild;if(t.nodeType===Node.ELEMENT_NODE)switch(t.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":r.addHeader(t);break;case"section":r.addSection(t,e);break;default:r.addElement(t)}else n.removeChild(t)}return r.root}(e)}function Kn(e){const t=Vn(e,e.ownerDocument);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}const Yn=(Zn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Zn);return t.forEach(Hn),Array.from(t)});var Zn;var Jn=Object.freeze({__proto__:null,name:"core/markdown",markdownToHtml:Bn,restructure:Kn,run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n){for(const e of Yn(document.body))Kn(e);return}const r=document.getElementById("respec-ui");r.remove();const s=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),s=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),s.trim()){const t=dn(e);e.append("\n\n"+t)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Hn(s),function(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}(s.querySelectorAll(".nolinks a[href]"));const i=Vn(s,document);s.append(r,i),document.body.replaceWith(s)}});function Qn(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute("aria-"+t,n)})}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=zn,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const Xn=It`<div id="respec-ui" class="removeOnSave" hidden></div>`,er=It`<ul
58
+ .respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;function Mn(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter(e=>e.trim()).map(e=>e.search(/[^\s]/)),r=Math.min(...n);return t.map(e=>e.slice(r)).join("\n")}var qn=Object.freeze({__proto__:null,name:"core/reindent",reindent:Mn,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Mn(e.innerHTML)}});const Wn=/&gt;/gm,Un=/&amp;/gm;class Fn extends Dt.Renderer{code(e,t,n){const{language:r,...s}=Fn.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const i=super.code(e,r,n),{example:o,illegalExample:a}=s;if(!o&&!a)return i;const c=o||a,l=`${r} ${o?"example":"illegal-example"}`;return i.replace("<pre>",`<pre title="${c}" class="${l}">`)}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let s;if(r)try{s=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...s}}heading(e,t,n,r){const s=/(.+)\s+{#([\w-]+)}$/;if(s.test(e)){const[,n,r]=e.match(s);return`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}function Bn(e){const t=Mn(e).replace(Wn,">").replace(Un,"&");return Dt(t,{sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new Fn})}function Hn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Bn(e.innerHTML)}const Gn=(Vn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Vn);return t.forEach(Hn),Array.from(t)});var Vn;var Kn=Object.freeze({__proto__:null,name:"core/markdown",markdownToHtml:Bn,run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void Gn(document.body);const r=document.getElementById("respec-ui");r.remove();const s=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),s=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),s.trim()){const t=dn(e);e.append("\n\n"+t)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Hn(s),function(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}(s.querySelectorAll(".nolinks a[href]")),s.append(r),document.body.replaceWith(s)}});function Yn(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute("aria-"+t,n)})}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=zn,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const Zn=It`<div id="respec-ui" class="removeOnSave" hidden></div>`,Jn=It`<ul
59
59
  id="respec-menu"
60
60
  role="menu"
61
61
  aria-labelledby="respec-pill"
62
62
  hidden
63
- ></ul>`,tr=It`<button
63
+ ></ul>`,Qn=It`<button
64
64
  class="close-button"
65
- onclick=${()=>pr.closeModal()}
65
+ onclick=${()=>lr.closeModal()}
66
66
  title="Close"
67
67
  >
68
68
 
69
- </button>`;let nr,rr;window.addEventListener("load",()=>lr(er));const sr=[],ir=[],or={};En("start-all",()=>document.body.prepend(Xn),{once:!0}),En("end-all",()=>document.body.prepend(Xn),{once:!0});const ar=It`<button id="respec-pill" disabled>ReSpec</button>`;function cr(){er.classList.toggle("respec-hidden"),er.classList.toggle("respec-visible"),er.hidden=!er.hidden}function lr(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))})}Xn.appendChild(ar),ar.addEventListener("click",e=>{e.stopPropagation(),ar.setAttribute("aria-expanded",String(er.hidden)),cr(),er.querySelector("li:first-child button").focus()}),document.documentElement.addEventListener("click",()=>{er.hidden||cr()}),Xn.appendChild(er),er.addEventListener("keydown",e=>{"Escape"!==e.key||er.hidden||(ar.setAttribute("aria-expanded",String(er.hidden)),cr(),ar.focus())});const ur=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function dr(e,t,n,r){t.push(e),or.hasOwnProperty(n)||(or[n]=function(e,t,n){const r=It`<button
69
+ </button>`;let Xn,er;window.addEventListener("load",()=>or(Jn));const tr=[],nr=[],rr={};En("start-all",()=>document.body.prepend(Zn),{once:!0}),En("end-all",()=>document.body.prepend(Zn),{once:!0});const sr=It`<button id="respec-pill" disabled>ReSpec</button>`;function ir(){Jn.classList.toggle("respec-hidden"),Jn.classList.toggle("respec-visible"),Jn.hidden=!Jn.hidden}function or(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))})}Zn.appendChild(sr),sr.addEventListener("click",e=>{e.stopPropagation(),sr.setAttribute("aria-expanded",String(Jn.hidden)),ir(),Jn.querySelector("li:first-child button").focus()}),document.documentElement.addEventListener("click",()=>{Jn.hidden||ir()}),Zn.appendChild(Jn),Jn.addEventListener("keydown",e=>{"Escape"!==e.key||Jn.hidden||(sr.setAttribute("aria-expanded",String(Jn.hidden)),ir(),sr.focus())});const ar=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function cr(e,t,n,r){t.push(e),rr.hasOwnProperty(n)||(rr[n]=function(e,t,n){const r=It`<button
70
70
  id="${"respec-pill-"+e}"
71
71
  class="respec-info-button"
72
- ></button>`;r.addEventListener("click",()=>{r.setAttribute("aria-expanded","true");const s=It`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(fr(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),s.appendChild(n)}pr.freshModal(n,s,r)});const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Qn(r,s),r}(n,t,r),Xn.appendChild(or[n]));const s=or[n];s.textContent=t.length;const i=1===t.length?Nt.singular(r):r;Qn(s,new Map([["label",`${t.length} ${i}`]]))}Qn(ar,ur);const pr={show(){try{Xn.hidden=!1}catch(e){console.error(e)}},hide(){Xn.hidden=!0},enable(){ar.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s="respec-button-"+e.toLowerCase().replace(/\s+/,"-"),i=It`<button id="${s}" class="respec-option">
72
+ ></button>`;r.addEventListener("click",()=>{r.setAttribute("aria-expanded","true");const s=It`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(ur(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),s.appendChild(n)}lr.freshModal(n,s,r)});const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Yn(r,s),r}(n,t,r),Zn.appendChild(rr[n]));const s=rr[n];s.textContent=t.length;const i=1===t.length?Nt.singular(r):r;Yn(s,new Map([["label",`${t.length} ${i}`]]))}Yn(sr,ar);const lr={show(){try{Zn.hidden=!1}catch(e){console.error(e)}},hide(){Zn.hidden=!0},enable(){sr.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s="respec-button-"+e.toLowerCase().replace(/\s+/,"-"),i=It`<button id="${s}" class="respec-option">
73
73
  <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}…
74
- </button>`,o=It`<li role="menuitem">${i}</li>`;return o.addEventListener("click",t),er.appendChild(o),i},error(e){dr(e,sr,"error","ReSpec Errors")},warning(e){dr(e,ir,"warning","ReSpec Warnings")},closeModal(e){rr&&(rr.classList.remove("respec-show-overlay"),rr.classList.add("respec-hide-overlay"),rr.addEventListener("transitionend",()=>{rr.remove(),rr=null})),e&&e.setAttribute("aria-expanded","false"),nr&&(nr.remove(),nr=null,ar.focus())},freshModal(e,t,n){nr&&nr.remove(),rr&&rr.remove(),rr=It`<div id="respec-overlay" class="removeOnSave"></div>`;const r=n.id+"-modal",s=r+"-heading";nr=It`<div
74
+ </button>`,o=It`<li role="menuitem">${i}</li>`;return o.addEventListener("click",t),Jn.appendChild(o),i},error(e){cr(e,tr,"error","ReSpec Errors")},warning(e){cr(e,nr,"warning","ReSpec Warnings")},closeModal(e){er&&(er.classList.remove("respec-show-overlay"),er.classList.add("respec-hide-overlay"),er.addEventListener("transitionend",()=>{er.remove(),er=null})),e&&e.setAttribute("aria-expanded","false"),Xn&&(Xn.remove(),Xn=null,sr.focus())},freshModal(e,t,n){Xn&&Xn.remove(),er&&er.remove(),er=It`<div id="respec-overlay" class="removeOnSave"></div>`;const r=n.id+"-modal",s=r+"-heading";Xn=It`<div
75
75
  id="${r}"
76
76
  class="respec-modal removeOnSave"
77
77
  role="dialog"
78
78
  aria-labelledby="${s}"
79
79
  >
80
- ${tr}
80
+ ${Qn}
81
81
  <h3 id="${s}">${e}</h3>
82
82
  <div class="inside">${t}</div>
83
- </div>`;const i=new Map([["labelledby",s]]);Qn(nr,i),document.body.append(rr,nr),rr.addEventListener("click",()=>this.closeModal(n)),rr.classList.toggle("respec-show-overlay"),nr.hidden=!1,lr(nr)}};function fr(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`<p class="respec-hint">**How to fix:** ${e.hint.trim()}</p>`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred **${e.elements.length}** times at:</p>\n ${e.elements.map(hr)}\n `:"",s=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return Bn(`**${e.message}**<br>${n}${r}${s}${t}`)}function hr(e){return`\n * [\`<${e.localName}>\`](#${e.id}) element`}async function mr(e){try{pr.show(),await async function(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(),await On(e)}finally{pr.enable()}}document.addEventListener("keydown",e=>{"Escape"===e.key&&pr.closeModal()}),window.respecUI=pr,En("error",e=>pr.error(e)),En("warn",e=>pr.warning(e)),window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const gr=[Promise.resolve().then((function(){return br})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return kr})),Promise.resolve().then((function(){return ds})),Promise.resolve().then((function(){return hs})),Promise.resolve().then((function(){return ys})),Promise.resolve().then((function(){return vs})),Promise.resolve().then((function(){return Cs})),Promise.resolve().then((function(){return As})),Promise.resolve().then((function(){return Jn})),Promise.resolve().then((function(){return qn})),Promise.resolve().then((function(){return Ps})),Promise.resolve().then((function(){return Ns})),Promise.resolve().then((function(){return os})),Promise.resolve().then((function(){return zs})),Promise.resolve().then((function(){return Ms})),Promise.resolve().then((function(){return Ws})),Promise.resolve().then((function(){return Ji})),Promise.resolve().then((function(){return eo})),Promise.resolve().then((function(){return po})),Promise.resolve().then((function(){return fo})),Promise.resolve().then((function(){return bo})),Promise.resolve().then((function(){return $o})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return Qo})),Promise.resolve().then((function(){return yi})),Promise.resolve().then((function(){return ba})),Promise.resolve().then((function(){return Ta})),Promise.resolve().then((function(){return ca})),Promise.resolve().then((function(){return Pa})),Promise.resolve().then((function(){return Ai})),Promise.resolve().then((function(){return Ha})),Promise.resolve().then((function(){return Va})),Promise.resolve().then((function(){return Ka})),Promise.resolve().then((function(){return nc})),Promise.resolve().then((function(){return sc})),Promise.resolve().then((function(){return oc})),Promise.resolve().then((function(){return dc})),Promise.resolve().then((function(){return wc})),Promise.resolve().then((function(){return xc})),Promise.resolve().then((function(){return Rc})),Promise.resolve().then((function(){return Pc})),Promise.resolve().then((function(){return zc})),Promise.resolve().then((function(){return Mc})),Promise.resolve().then((function(){return Hc})),Promise.resolve().then((function(){return Qc})),Promise.resolve().then((function(){return Mo})),Promise.resolve().then((function(){return il})),Promise.resolve().then((function(){return ul})),Promise.resolve().then((function(){return gl})),Promise.resolve().then((function(){return wl})),Promise.resolve().then((function(){return kl})),Promise.resolve().then((function(){return xl})),Promise.resolve().then((function(){return Ll})),Promise.resolve().then((function(){return Nl})),Promise.resolve().then((function(){return jl})),Promise.resolve().then((function(){return zl})),Promise.resolve().then((function(){return Wl})),Promise.resolve().then((function(){return Vl})),Promise.resolve().then((function(){return Jl})),Promise.resolve().then((function(){return nu})),Promise.resolve().then((function(){return au})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return gu})),Promise.resolve().then((function(){return $u})),Promise.resolve().then((function(){return Cu})),Promise.resolve().then((function(){return Lu})),Promise.resolve().then((function(){return Du}))];Promise.all(gr).then(e=>mr(e)).catch(e=>console.error(e));var br=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.then(()=>{let e=decodeURIComponent(location.hash).substr(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}location.hash="#"+e})}});const yr="w3c/group",wr=["wg","wgURI","wgId","wgPatentURI","wgPatentPolicy"];async function vr(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,"https://respec.org/w3c/groups/"),s=await en(r.href);if(s.ok){const e=await s.json(),{id:t,name:n,patentURI:r,patentPolicy:i,type:o,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:i,groupType:o}}const i=await s.text(),o=`Failed to fetch group details (HTTP: ${s.status}). ${i}`,a=404===s.status?_n`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`:void 0;yn(o,yr,{hint:a})}var kr=Object.freeze({__proto__:null,name:yr,run:async function(e){const t=wr.filter(t=>e[t]);if(!e.group){if(t.length){const e=_n`Please use the ${"[group]"} configuration option instead.`;wn(`Configuration options ${$n(wr)} are deprecated.`,yr,{hint:e})}return}if(t.length){const e=_n`Remove them from the document's ${"[respecConfig]"} to silence this warning.`;wn(_n`Configuration options ${$n(t)} are superseded by ${"[group]"} and will be overridden by ReSpec.`,yr,{hint:e})}const{group:n}=e,r=Array.isArray(n)?await async function(e){const t=await Promise.all(e.map(vr)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter(e=>e))for(const t of Object.keys(n))n[t].push(e[t]);return n}(n):await vr(n);Object.assign(e,r)}});function $r(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return wn(t,"core/templates/show-link"),void console.warn(t,e)}return It`
83
+ </div>`;const i=new Map([["labelledby",s]]);Yn(Xn,i),document.body.append(er,Xn),er.addEventListener("click",()=>this.closeModal(n)),er.classList.toggle("respec-show-overlay"),Xn.hidden=!1,or(Xn)}};function ur(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`<p class="respec-hint">**How to fix:** ${e.hint.trim()}</p>`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred **${e.elements.length}** times at:</p>\n ${e.elements.map(dr)}\n `:"",s=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return Bn(`**${e.message}**<br>${n}${r}${s}${t}`)}function dr(e){return`\n * [\`<${e.localName}>\`](#${e.id}) element`}async function pr(e){try{lr.show(),await async function(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(),await On(e)}finally{lr.enable()}}document.addEventListener("keydown",e=>{"Escape"===e.key&&lr.closeModal()}),window.respecUI=lr,En("error",e=>lr.error(e)),En("warn",e=>lr.warning(e)),window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const fr=[Promise.resolve().then((function(){return hr})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return br})),Promise.resolve().then((function(){return cs})),Promise.resolve().then((function(){return ds})),Promise.resolve().then((function(){return hs})),Promise.resolve().then((function(){return gs})),Promise.resolve().then((function(){return $s})),Promise.resolve().then((function(){return As})),Promise.resolve().then((function(){return Kn})),Promise.resolve().then((function(){return qn})),Promise.resolve().then((function(){return Ps})),Promise.resolve().then((function(){return Ns})),Promise.resolve().then((function(){return rs})),Promise.resolve().then((function(){return zs})),Promise.resolve().then((function(){return Ms})),Promise.resolve().then((function(){return Us})),Promise.resolve().then((function(){return Ji})),Promise.resolve().then((function(){return eo})),Promise.resolve().then((function(){return po})),Promise.resolve().then((function(){return fo})),Promise.resolve().then((function(){return bo})),Promise.resolve().then((function(){return $o})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return Qo})),Promise.resolve().then((function(){return yi})),Promise.resolve().then((function(){return ba})),Promise.resolve().then((function(){return Ta})),Promise.resolve().then((function(){return ca})),Promise.resolve().then((function(){return Ai})),Promise.resolve().then((function(){return Ba})),Promise.resolve().then((function(){return Ga})),Promise.resolve().then((function(){return Cs})),Promise.resolve().then((function(){return Va})),Promise.resolve().then((function(){return Ka})),Promise.resolve().then((function(){return nc})),Promise.resolve().then((function(){return sc})),Promise.resolve().then((function(){return oc})),Promise.resolve().then((function(){return dc})),Promise.resolve().then((function(){return wc})),Promise.resolve().then((function(){return xc})),Promise.resolve().then((function(){return Rc})),Promise.resolve().then((function(){return Pc})),Promise.resolve().then((function(){return zc})),Promise.resolve().then((function(){return Mc})),Promise.resolve().then((function(){return Hc})),Promise.resolve().then((function(){return Qc})),Promise.resolve().then((function(){return Mo})),Promise.resolve().then((function(){return il})),Promise.resolve().then((function(){return ul})),Promise.resolve().then((function(){return gl})),Promise.resolve().then((function(){return wl})),Promise.resolve().then((function(){return kl})),Promise.resolve().then((function(){return xl})),Promise.resolve().then((function(){return Ll})),Promise.resolve().then((function(){return Nl})),Promise.resolve().then((function(){return jl})),Promise.resolve().then((function(){return zl})),Promise.resolve().then((function(){return Ul})),Promise.resolve().then((function(){return Vl})),Promise.resolve().then((function(){return Jl})),Promise.resolve().then((function(){return nu})),Promise.resolve().then((function(){return au})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return gu})),Promise.resolve().then((function(){return $u})),Promise.resolve().then((function(){return Cu})),Promise.resolve().then((function(){return Lu})),Promise.resolve().then((function(){return Du}))];Promise.all(fr).then(e=>pr(e)).catch(e=>console.error(e));var hr=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.then(()=>{let e=decodeURIComponent(location.hash).substr(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}location.hash="#"+e})}});const mr="w3c/group";async function gr(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,"https://respec.org/w3c/groups/"),s=await en(r.href);if(s.ok){const e=await s.json(),{id:t,name:n,patentURI:r,patentPolicy:i,type:o,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:i,groupType:o}}const i=await s.text(),o=`Failed to fetch group details (HTTP: ${s.status}). ${i}`,a=404===s.status?_n`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`:void 0;yn(o,mr,{hint:a})}var br=Object.freeze({__proto__:null,name:mr,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(gr)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter(e=>e))for(const t of Object.keys(n))n[t].push(e[t]);return n}(t):await gr(t);Object.assign(e,n)}});function yr(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return wn(t,"core/templates/show-link"),void console.warn(t,e)}return It`
84
84
  <dt class="${e.class?e.class:null}">${e.key}</dt>
85
- ${e.data?e.data.map(xr):xr(e)}
86
- `}function xr(e){return It`<dd class="${e.class?e.class:null}">
85
+ ${e.data?e.data.map(wr):wr(e)}
86
+ `}function wr(e){return It`<dd class="${e.class?e.class:null}">
87
87
  ${e.href?It`<a href="${e.href}">${e.value||e.href}</a>`:e.value}
88
- </dd>`}const _r="core/templates/show-logo";function Sr(e,t){const n=It`<a href="${e.url||null}" class="logo"
88
+ </dd>`}const vr="core/templates/show-logo";function kr(e,t){const n=It`<a href="${e.url||null}" class="logo"
89
89
  ><img
90
90
  alt="${e.alt||null}"
91
91
  crossorigin
@@ -94,7 +94,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
94
94
  src="${e.src||null}"
95
95
  width="${e.width||null}"
96
96
  />
97
- </a>`;if(!e.alt){const r=_n`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;yn(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,_r,{hint:r,elements:[n]})}if(!e.src){const e=_n`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;yn(`Logo at index ${t} is missing "\`src\`" property.`,_r,{hint:e,elements:[n]})}return n}const Cr="core/templates/show-people",Rr={en:{until:e=>It` Until ${e} `},es:{until:e=>It` Hasta ${e} `},ko:{until:e=>It` ${e} 이전 `},ja:{until:e=>It` ${e} 以前 `},de:{until:e=>It` bis ${e} `},zh:{until:e=>It` 直到 ${e} `}},Er=s in Rr?s:"en";function Ar(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(s=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,i=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${s}\`](${n}#${s})" configuration option.`;if(!e.name)return yn(i+' Missing required property `"name"`.',Cr,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${i} ORCID "${e.orcid}" at index ${t} is invalid.`,s=`The origin should be "https://orcid.org", not "${r.origin}".`;return yn(n,Cr,{hint:s}),!1}const s=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(s))return yn(`${i} ORCID "${s}" has wrong format.`,Cr,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=(12-e.split("").slice(0,-1).filter(e=>/\d/.test(e)).map(Number).reduce((e,t)=>2*(e+t),0)%11)%11,r=10===n?"X":String(n);return t===r}(n))return yn(`${i} ORCID "${n}" failed checksum check.`,Cr,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(o=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(o)?new Date(o):"Invalid Date").toString())?(yn(i+' The property "`retiredDate`" is not a valid date.',Cr,{hint:"The expected format is YYYY-MM-DD. "+r}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every((e,r)=>{switch(!0){case"object"!=typeof e:return yn(`${n}. Member "extra" at index ${r} is not an object.`,Cr,{hint:t}),!1;case!e.hasOwnProperty("name"):return yn(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Cr,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return yn(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Cr,{hint:t}),!1}return!0}):(yn(n+'. A person\'s "extras" member must be an array.',Cr,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&wn(i+' Has both "url" and "mailto" property.',Cr,{hint:'Please choose either "url" or "mailto" ("url" is preferred). '+r}),e.companyURL&&!e.company&&wn(i+' Has a "`companyURL`" property but no "`company`" property.',Cr,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var o});var s;return n.filter(r).map(Lr)}function Lr(e){const t=Rr[Er],n=[e.name],r=[e.company],s=e.w3cid||null,i=[];if(e.mailto&&(e.url="mailto:"+e.mailto),e.url){const t="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";i.push(It`<a class="${t}" href="${e.url}">${n}</a>`)}else i.push(It`<span class="p-name fn">${n}</span>`);if(e.orcid&&i.push(It`<a class="p-name orcid" href="${e.orcid}">${It`<svg
97
+ </a>`;if(!e.alt){const r=_n`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;yn(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,vr,{hint:r,elements:[n]})}if(!e.src){const e=_n`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;yn(`Logo at index ${t} is missing "\`src\`" property.`,vr,{hint:e,elements:[n]})}return n}const $r="core/templates/show-people",xr={en:{until:e=>It` Until ${e} `},es:{until:e=>It` Hasta ${e} `},ko:{until:e=>It` ${e} 이전 `},ja:{until:e=>It` ${e} 以前 `},de:{until:e=>It` bis ${e} `},zh:{until:e=>It` 直到 ${e} `}},_r=s in xr?s:"en";function Sr(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(s=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,i=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${s}\`](${n}#${s})" configuration option.`;if(!e.name)return yn(i+' Missing required property `"name"`.',$r,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${i} ORCID "${e.orcid}" at index ${t} is invalid.`,s=`The origin should be "https://orcid.org", not "${r.origin}".`;return yn(n,$r,{hint:s}),!1}const s=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(s))return yn(`${i} ORCID "${s}" has wrong format.`,$r,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=(12-e.split("").slice(0,-1).filter(e=>/\d/.test(e)).map(Number).reduce((e,t)=>2*(e+t),0)%11)%11,r=10===n?"X":String(n);return t===r}(n))return yn(`${i} ORCID "${n}" failed checksum check.`,$r,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(o=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(o)?new Date(o):"Invalid Date").toString())?(yn(i+' The property "`retiredDate`" is not a valid date.',$r,{hint:"The expected format is YYYY-MM-DD. "+r}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every((e,r)=>{switch(!0){case"object"!=typeof e:return yn(`${n}. Member "extra" at index ${r} is not an object.`,$r,{hint:t}),!1;case!e.hasOwnProperty("name"):return yn(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,$r,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return yn(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,$r,{hint:t}),!1}return!0}):(yn(n+'. A person\'s "extras" member must be an array.',$r,{hint:t}),!1)}(e.extras,r,i))&&(e.url&&e.mailto&&wn(i+' Has both "url" and "mailto" property.',$r,{hint:'Please choose either "url" or "mailto" ("url" is preferred). '+r}),e.companyURL&&!e.company&&wn(i+' Has a "`companyURL`" property but no "`company`" property.',$r,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var o});var s;return n.filter(r).map(Cr)}function Cr(e){const t=xr[_r],n=[e.name],r=[e.company],s=e.w3cid||null,i=[];if(e.mailto&&(e.url="mailto:"+e.mailto),e.url){const t="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";i.push(It`<a class="${t}" href="${e.url}">${n}</a>`)}else i.push(It`<span class="p-name fn">${n}</span>`);if(e.orcid&&i.push(It`<a class="p-name orcid" href="${e.orcid}">${It`<svg
98
98
  width="16"
99
99
  height="16"
100
100
  xmlns="http://www.w3.org/2000/svg"
@@ -120,29 +120,29 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
120
120
  data-editor-id="${s}"
121
121
  >
122
122
  ${i}
123
- </dd>`}const Tr=Zt({en:{archives:"archives",author:"Author:",authors:"Authors:",commit_history:"Commit history",edited_in_place:"edited in place",editor:"Editor:",editors:"Editors:",feedback:"Feedback:",former_editor:"Former editor:",former_editors:"Former editors:",history:"History:",implementation_report:"Implementation report:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",latest_recommendation:"Latest Recommendation:",message_topic:"… message topic …",more_details_about_this_doc:"More details about this document",multiple_alternates:e=>`This document is also available in ${e?"these non-normative formats":"this non-normative format"}:`,prev_editor_draft:"Previous editor's draft:",prev_recommendation:"Previous Recommendation:",prev_version:"Previous version:",publication_history:"Publication history",test_suite:"Test suite:",this_version:"This version:",with_subject_line:"with subject line",your_topic_here:"YOUR TOPIC HERE"},ko:{author:"저자:",authors:"저자:",editor:"편집자:",editors:"편집자:",former_editor:"이전 편집자:",former_editors:"이전 편집자:",latest_editors_draft:"최신 편집 초안:",latest_published_version:"최신 버전:",this_version:"현재 버전:"},zh:{author:"作者:",authors:"作者:",commit_history:"Git提交历史",editor:"编辑:",editors:"编辑:",feedback:"反馈:",former_editor:"原编辑:",former_editors:"原编辑:",history:"历史:",implementation_report:"实现报告:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",latest_recommendation:"最新发布的正式推荐标准:",message_topic:"… 邮件主题 …",prev_editor_draft:"上一版编辑草稿:",prev_recommendation:"上一版正式推荐标准:",prev_version:"上一版:",test_suite:"测试套件:",this_version:"本版本:"},ja:{archives:"アーカイブ",author:"著者:",authors:"著者:",commit_history:"更新履歴",edited_in_place:"改版なく更新",editor:"編者:",editors:"編者:",feedback:"フィードバック:",former_editor:"以前の版の編者:",former_editors:"以前の版の編者:",history:"履歴:",implementation_report:"実装レポート:",latest_editors_draft:"最新の編集用草案:",latest_published_version:"最新バージョン:",latest_recommendation:"最新の勧告版:",message_topic:"… メール件名 …",more_details_about_this_doc:"この文書についてのより詳細",prev_editor_draft:"前回の編集用草案:",prev_recommendation:"前回の勧告版:",prev_version:"前回のバージョン:",publication_history:"公表履歴",test_suite:"テストスイート:",this_version:"このバージョン:",with_subject_line:"次の件名で"},nl:{author:"Auteur:",authors:"Auteurs:",editor:"Redacteur:",editors:"Redacteurs:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",this_version:"Deze versie:"},es:{archives:"archivos",author:"Autor:",authors:"Autores:",commit_history:"Historial de cambios",edited_in_place:"editado en lugar",editor:"Editor:",editors:"Editores:",feedback:"Comentarios:",former_editor:"Antiguo editor:",former_editors:"Antiguos editores:",history:"Historia:",implementation_report:"Informe de implementación:",latest_editors_draft:"Última versión del editor:",latest_published_version:"Última versión publicada:",latest_recommendation:"Recomendación más reciente:",message_topic:"… detalles de mensaje …",more_details_about_this_doc:"Más detalles sobre este documento:",publication_history:"Historial de publicación",prev_editor_draft:"Última versión del editor:",prev_recommendation:"Última Recomendación:",prev_version:"Última versión:",test_suite:"Suite de pruebas:",this_version:"Esta versión:",with_subject_line:"con línea de asunto",your_topic_here:"TU SUJETO AQUÍ"},de:{archives:"Archiv",author:"Autor/in:",authors:"Autor/innen:",commit_history:"Commit-Historie",edited_in_place:"zuletzt geändert am",editor:"Redaktion:",editors:"Redaktion:",feedback:"Feedback:",former_editor:"Frühere Mitwirkende:",former_editors:"Frühere Mitwirkende:",history:"Verlauf:",implementation_report:"Umsetzungsbericht:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",latest_recommendation:"Aktuellste Empfehlung:",more_details_about_this_doc:"Mehr Informationen über dieses Dokument",prev_editor_draft:"Vorheriger Entwurf:",prev_recommendation:"Vorherige Empfehlung:",prev_version:"Vorherige Version:",publication_history:"Veröffentlichungsverlauf",test_suite:"Testumgebung:",this_version:"Diese Fassung:"}});var Pr=(e,t)=>(En("beforesave",e=>{e.querySelector(".head details").open=!0}),It`<div class="head">
124
- ${e.logos.map(Sr)} ${document.querySelector("h1#title")}
123
+ </dd>`}const Rr=Zt({en:{archives:"archives",author:"Author:",authors:"Authors:",commit_history:"Commit history",edited_in_place:"edited in place",editor:"Editor:",editors:"Editors:",feedback:"Feedback:",former_editor:"Former editor:",former_editors:"Former editors:",history:"History:",implementation_report:"Implementation report:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",latest_recommendation:"Latest Recommendation:",message_topic:"… message topic …",more_details_about_this_doc:"More details about this document",multiple_alternates:e=>`This document is also available in ${e?"these non-normative formats":"this non-normative format"}:`,prev_editor_draft:"Previous editor's draft:",prev_recommendation:"Previous Recommendation:",prev_version:"Previous version:",publication_history:"Publication history",test_suite:"Test suite:",this_version:"This version:",with_subject_line:"with subject line",your_topic_here:"YOUR TOPIC HERE"},ko:{author:"저자:",authors:"저자:",editor:"편집자:",editors:"편집자:",former_editor:"이전 편집자:",former_editors:"이전 편집자:",latest_editors_draft:"최신 편집 초안:",latest_published_version:"최신 버전:",this_version:"현재 버전:"},zh:{author:"作者:",authors:"作者:",commit_history:"Git提交历史",editor:"编辑:",editors:"编辑:",feedback:"反馈:",former_editor:"原编辑:",former_editors:"原编辑:",history:"历史:",implementation_report:"实现报告:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",latest_recommendation:"最新发布的正式推荐标准:",message_topic:"… 邮件主题 …",prev_editor_draft:"上一版编辑草稿:",prev_recommendation:"上一版正式推荐标准:",prev_version:"上一版:",test_suite:"测试套件:",this_version:"本版本:"},ja:{archives:"アーカイブ",author:"著者:",authors:"著者:",commit_history:"更新履歴",edited_in_place:"改版なく更新",editor:"編者:",editors:"編者:",feedback:"フィードバック:",former_editor:"以前の版の編者:",former_editors:"以前の版の編者:",history:"履歴:",implementation_report:"実装レポート:",latest_editors_draft:"最新の編集用草案:",latest_published_version:"最新バージョン:",latest_recommendation:"最新の勧告版:",message_topic:"… メール件名 …",more_details_about_this_doc:"この文書についてのより詳細",prev_editor_draft:"前回の編集用草案:",prev_recommendation:"前回の勧告版:",prev_version:"前回のバージョン:",publication_history:"公表履歴",test_suite:"テストスイート:",this_version:"このバージョン:",with_subject_line:"次の件名で"},nl:{author:"Auteur:",authors:"Auteurs:",editor:"Redacteur:",editors:"Redacteurs:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",this_version:"Deze versie:"},es:{archives:"archivos",author:"Autor:",authors:"Autores:",commit_history:"Historial de cambios",edited_in_place:"editado en lugar",editor:"Editor:",editors:"Editores:",feedback:"Comentarios:",former_editor:"Antiguo editor:",former_editors:"Antiguos editores:",history:"Historia:",implementation_report:"Informe de implementación:",latest_editors_draft:"Última versión del editor:",latest_published_version:"Última versión publicada:",latest_recommendation:"Recomendación más reciente:",message_topic:"… detalles de mensaje …",more_details_about_this_doc:"Más detalles sobre este documento:",publication_history:"Historial de publicación",prev_editor_draft:"Última versión del editor:",prev_recommendation:"Última Recomendación:",prev_version:"Última versión:",test_suite:"Suite de pruebas:",this_version:"Esta versión:",with_subject_line:"con línea de asunto",your_topic_here:"TU SUJETO AQUÍ"},de:{archives:"Archiv",author:"Autor/in:",authors:"Autor/innen:",commit_history:"Commit-Historie",edited_in_place:"zuletzt geändert am",editor:"Redaktion:",editors:"Redaktion:",feedback:"Feedback:",former_editor:"Frühere Mitwirkende:",former_editors:"Frühere Mitwirkende:",history:"Verlauf:",implementation_report:"Umsetzungsbericht:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",latest_recommendation:"Aktuellste Empfehlung:",more_details_about_this_doc:"Mehr Informationen über dieses Dokument",multiple_alternates:e=>`Dieses Dokument ist ebenfalls in ${e?"diesen nicht-normativen Formaten verfügbar":"in diesem nicht-normativen Format verfügbar"}:`,prev_editor_draft:"Vorheriger Entwurf:",prev_recommendation:"Vorherige Empfehlung:",prev_version:"Vorherige Version:",publication_history:"Veröffentlichungsverlauf",test_suite:"Testumgebung:",this_version:"Diese Fassung:"}});var Er=(e,t)=>(En("beforesave",e=>{e.querySelector(".head details").open=!0}),It`<div class="head">
124
+ ${e.logos.map(kr)} ${document.querySelector("h1#title")}
125
125
  ${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)}
126
126
  <p id="w3c-state">${function(e){const t=e.isCR||e.isCRY?e.longStatus:e.textStatus,n=e.prependW3C?It`<a href="https://www.w3.org/standards/types#${e.specStatus}"
127
127
  >W3C ${t}</a
128
128
  >`:It`${t}`;return It`${n}${" "}
129
129
  <time class="dt-published" datetime="${e.dashDate}"
130
130
  >${e.publishHumanDate}</time
131
- >${e.modificationDate?It`, ${Tr.edited_in_place}${" "}
131
+ >${e.modificationDate?It`, ${Rr.edited_in_place}${" "}
132
132
  ${function(e){const t=Qt(new Date(e));return It`<time class="dt-modified" datetime="${e}"
133
133
  >${t}</time
134
134
  >`}(e.modificationDate)}`:""}`}(e)}</p>
135
135
  <details open="${localStorage.getItem("tr-metadata")||"true"}">
136
- <summary>${Tr.more_details_about_this_doc}</summary>
136
+ <summary>${Rr.more_details_about_this_doc}</summary>
137
137
  <dl>
138
138
  ${e.isTagFinding&&!e.isTagEditorFinding||!e.isNoTrack?It`
139
- <dt>${Tr.this_version}</dt>
139
+ <dt>${Rr.this_version}</dt>
140
140
  <dd>
141
141
  <a class="u-url" href="${e.thisVersion}"
142
142
  >${e.thisVersion}</a
143
143
  >
144
144
  </dd>
145
- <dt>${Tr.latest_published_version}</dt>
145
+ <dt>${Rr.latest_published_version}</dt>
146
146
  <dd>
147
147
  ${e.latestVersion?It`<a href="${e.latestVersion}"
148
148
  >${e.latestVersion}</a
@@ -150,23 +150,23 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
150
150
  </dd>
151
151
  `:""}
152
152
  ${e.edDraftURI?It`
153
- <dt>${Tr.latest_editors_draft}</dt>
153
+ <dt>${Rr.latest_editors_draft}</dt>
154
154
  <dd><a href="${e.edDraftURI}">${e.edDraftURI}</a></dd>
155
155
  `:""}
156
156
  ${function(e){if(!e.historyURI&&!e.github)return;const t=[];if(e.historyURI){const n=It`<dd>
157
157
  <a href="${e.historyURI}">${e.historyURI}</a>
158
158
  </dd>`;t.push(n)}if(e.github){const n=It`
159
159
  <dd>
160
- <a href="${e.github.commitHistoryURL}">${Tr.commit_history}</a>
160
+ <a href="${e.github.commitHistoryURL}">${Rr.commit_history}</a>
161
161
  </dd>
162
- `;t.push(n)}return It`<dt>${Tr.history}</dt>
162
+ `;t.push(n)}return It`<dt>${Rr.history}</dt>
163
163
  ${t}`}(e)}
164
164
  ${e.testSuiteURI?It`
165
- <dt>${Tr.test_suite}</dt>
165
+ <dt>${Rr.test_suite}</dt>
166
166
  <dd><a href="${e.testSuiteURI}">${e.testSuiteURI}</a></dd>
167
167
  `:""}
168
168
  ${e.implementationReportURI?It`
169
- <dt>${Tr.implementation_report}</dt>
169
+ <dt>${Rr.implementation_report}</dt>
170
170
  <dd>
171
171
  <a href="${e.implementationReportURI}"
172
172
  >${e.implementationReportURI}</a
@@ -174,48 +174,48 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
174
174
  </dd>
175
175
  `:""}
176
176
  ${e.isED&&e.prevED?It`
177
- <dt>${Tr.prev_editor_draft}</dt>
177
+ <dt>${Rr.prev_editor_draft}</dt>
178
178
  <dd><a href="${e.prevED}">${e.prevED}</a></dd>
179
179
  `:""}
180
180
  ${e.showPreviousVersion?It`
181
- <dt>${Tr.prev_version}</dt>
181
+ <dt>${Rr.prev_version}</dt>
182
182
  <dd><a href="${e.prevVersion}">${e.prevVersion}</a></dd>
183
183
  `:""}
184
184
  ${e.prevRecURI?e.isRec?It`
185
- <dt>${Tr.prev_recommendation}</dt>
185
+ <dt>${Rr.prev_recommendation}</dt>
186
186
  <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd>
187
187
  `:It`
188
- <dt>${Tr.latest_recommendation}</dt>
188
+ <dt>${Rr.latest_recommendation}</dt>
189
189
  <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd>
190
190
  `:""}
191
- <dt>${e.multipleEditors?Tr.editors:Tr.editor}</dt>
192
- ${Ar(e,"editors")}
191
+ <dt>${e.multipleEditors?Rr.editors:Rr.editor}</dt>
192
+ ${Sr(e,"editors")}
193
193
  ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?It`
194
194
  <dt>
195
- ${e.multipleFormerEditors?Tr.former_editors:Tr.former_editor}
195
+ ${e.multipleFormerEditors?Rr.former_editors:Rr.former_editor}
196
196
  </dt>
197
- ${Ar(e,"formerEditors")}
197
+ ${Sr(e,"formerEditors")}
198
198
  `:""}
199
199
  ${e.authors?It`
200
- <dt>${e.multipleAuthors?Tr.authors:Tr.author}</dt>
201
- ${Ar(e,"authors")}
200
+ <dt>${e.multipleAuthors?Rr.authors:Rr.author}</dt>
201
+ ${Sr(e,"authors")}
202
202
  `:""}
203
203
  ${function(e){if(!e.github&&!e.wgPublicList)return;const t=[];if(e.github){const{repoURL:n,issuesURL:r,newIssuesURL:s,pullsURL:i,fullName:o}=e.github;t.push(It`<dd>
204
204
  <a href="${n}">GitHub ${o}</a>
205
205
  (<a href="${i}">pull requests</a>,
206
206
  <a href="${s}">new issue</a>,
207
207
  <a href="${r}">open issues</a>)
208
- </dd>`)}if(e.wgPublicList){const n=new URL(`mailto:${e.wgPublicList}@w3.org`),r=e.subjectPrefix??`[${e.shortName}] ${Tr.your_topic_here}`,s=It`<a
208
+ </dd>`)}if(e.wgPublicList){const n=new URL(`mailto:${e.wgPublicList}@w3.org`),r=e.subjectPrefix??`[${e.shortName}] ${Rr.your_topic_here}`,s=It`<a
209
209
  href="${n.href}?subject=${encodeURIComponent(r)}"
210
210
  >${n.pathname}</a
211
- >`,i=e.subjectPrefix||It`[${e.shortName}] <em>${Tr.message_topic}</em>`,o=It`${Tr.with_subject_line}${" "}
211
+ >`,i=e.subjectPrefix||It`[${e.shortName}] <em>${Rr.message_topic}</em>`,o=It`${Rr.with_subject_line}${" "}
212
212
  <kbd>${i}</kbd>`,a=new URL(e.wgPublicList,"https://lists.w3.org/Archives/Public/"),c=It`(<a href="${a}" rel="discussion"
213
- >${Tr.archives}</a
214
- >)`;t.push(It`<dd>${s} ${o} ${c}</dd>`)}return It`<dt>${Tr.feedback}</dt>
213
+ >${Rr.archives}</a
214
+ >)`;t.push(It`<dd>${s} ${o} ${c}</dd>`)}return It`<dt>${Rr.feedback}</dt>
215
215
  ${t}`}(e)}
216
216
  ${e.errata?It`<dt>Errata:</dt>
217
217
  <dd><a href="${e.errata}">Errata exists</a>.</dd>`:""}
218
- ${e.otherLinks?e.otherLinks.map($r):""}
218
+ ${e.otherLinks?e.otherLinks.map(yr):""}
219
219
  </dl>
220
220
  </details>
221
221
  ${e.isRec?It`<p>
@@ -227,7 +227,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
227
227
  >.
228
228
  </p>`:""}
229
229
  ${e.alternateFormats?It`<p>
230
- ${Tr.multiple_alternates(t.multipleAlternates)}
230
+ ${Rr.multiple_alternates(t.multipleAlternates)}
231
231
  ${t.alternatesHTML}
232
232
  </p>`:""}
233
233
  ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.isUnofficial&&e.licenseInfo)return It`<p class="copyright">
@@ -266,8 +266,8 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
266
266
  <a rel="license" href="${t}" title="${r}">${n}</a> rules apply.`}(e.licenseInfo)}
267
267
  </p>`}(e)}(e)}
268
268
  <hr title="Separator for header" />
269
- </div>`);var Ir=(e,t)=>{const n=document.querySelector(".copyright");n&&n.remove();const r=document.querySelector("h1#title"),s=r.cloneNode(!0);return It`<div class="head">
270
- ${e.logos.map(Sr)} ${r}
269
+ </div>`);var Ar=(e,t)=>{const n=document.querySelector(".copyright");n&&n.remove();const r=document.querySelector("h1#title"),s=r.cloneNode(!0);return It`<div class="head">
270
+ ${e.logos.map(kr)} ${r}
271
271
  ${e.subtitle?It`<h2 id="subtitle">${e.subtitle}</h2>`:""}
272
272
  <h2>
273
273
  ${e.longStatus}
@@ -277,7 +277,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
277
277
  </h2>
278
278
  <dl>
279
279
  ${e.thisVersion?It`
280
- <dt>${Tr.this_version}</dt>
280
+ <dt>${Rr.this_version}</dt>
281
281
  <dd>
282
282
  <a class="u-url" href="${e.thisVersion}"
283
283
  >${e.thisVersion}</a
@@ -285,13 +285,13 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
285
285
  </dd>
286
286
  `:""}
287
287
  ${e.latestVersion?It`
288
- <dt>${Tr.latest_published_version}</dt>
288
+ <dt>${Rr.latest_published_version}</dt>
289
289
  <dd>
290
290
  <a href="${e.latestVersion}">${e.latestVersion}</a>
291
291
  </dd>
292
292
  `:""}
293
293
  ${e.edDraftURI?It`
294
- <dt>${Tr.latest_editors_draft}</dt>
294
+ <dt>${Rr.latest_editors_draft}</dt>
295
295
  <dd><a href="${e.edDraftURI}">${e.edDraftURI}</a></dd>
296
296
  `:""}
297
297
  ${e.testSuiteURI?It`
@@ -316,19 +316,19 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
316
316
  <dd><a href="${e.prevED}">${e.prevED}</a></dd>
317
317
  `:""}
318
318
  `}
319
- <dt>${e.multipleEditors?Tr.editors:Tr.editor}</dt>
320
- ${Ar(e,"editors")}
319
+ <dt>${e.multipleEditors?Rr.editors:Rr.editor}</dt>
320
+ ${Sr(e,"editors")}
321
321
  ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?It`
322
322
  <dt>
323
- ${e.multipleFormerEditors?Tr.former_editors:Tr.former_editor}
323
+ ${e.multipleFormerEditors?Rr.former_editors:Rr.former_editor}
324
324
  </dt>
325
- ${Ar(e,"formerEditors")}
325
+ ${Sr(e,"formerEditors")}
326
326
  `:""}
327
327
  ${e.authors?It`
328
- <dt>${e.multipleAuthors?Tr.authors:Tr.author}</dt>
329
- ${Ar(e,"authors")}
328
+ <dt>${e.multipleAuthors?Rr.authors:Rr.author}</dt>
329
+ ${Sr(e,"authors")}
330
330
  `:""}
331
- ${e.otherLinks?e.otherLinks.map($r):""}
331
+ ${e.otherLinks?e.otherLinks.map(yr):""}
332
332
  </dl>
333
333
  ${e.alternateFormats?It`<p>
334
334
  ${t.multipleAlternates?"This document is also available in these non-normative formats:":"This document is also available in this non-normative format:"}
@@ -365,9 +365,9 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
365
365
  `}
366
366
  </p>`}
367
367
  <hr title="Separator for header" />
368
- </div>`};const Dr=Zt({en:{sotd:"Status of This Document"},ko:{sotd:"현재 문서의 상태"},zh:{sotd:"关于本文档"},ja:{sotd:"この文書の位置付け"},nl:{sotd:"Status van dit document"},es:{sotd:"Estado de este Document"},de:{sotd:"Status dieses Dokuments"}}),Nr="https://www.w3.org/2021/Process-20211102/";function jr(e){return/^[aeiou]/i.test(e)?"an "+e:"a "+e}var Or=(e,t)=>It`
369
- <h2>${Dr.sotd}</h2>
370
- ${e.isPreview?zr(e):""}
368
+ </div>`};const Lr=Zt({en:{sotd:"Status of This Document"},ko:{sotd:"현재 문서의 상태"},zh:{sotd:"关于本文档"},ja:{sotd:"この文書の位置付け"},nl:{sotd:"Status van dit document"},es:{sotd:"Estado de este Document"},de:{sotd:"Status dieses Dokuments"}}),Tr="https://www.w3.org/2021/Process-20211102/";function Pr(e){return/^[aeiou]/i.test(e)?"an "+e:"a "+e}var Ir=(e,t)=>It`
369
+ <h2>${Lr.sotd}</h2>
370
+ ${e.isPreview?Dr(e):""}
371
371
  ${e.isUnofficial?function(e){const{additionalContent:t}=e;return It`
372
372
  <p>
373
373
  This document is a draft of a potential specification. It has no official
@@ -411,17 +411,17 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
411
411
  `}(e,t):It`
412
412
  ${e.sotdAfterWGinfo?"":t.additionalContent}
413
413
  ${e.overrideStatus?"":It` ${function(e){if(!e.wg)return;let t=null;e.isRec&&e.revisionTypes&&e.revisionTypes.length&&(e.revisionTypes.includes("addition")?t=e.revisionTypes.includes("correction")?It`It includes
414
- <a href="${Nr}#proposed-amendments">proposed amendments</a>,
414
+ <a href="${Tr}#proposed-amendments">proposed amendments</a>,
415
415
  introducing substantive changes and new features since the previous
416
416
  Recommendation.`:It`It includes
417
- <a href="${Nr}#proposed-addition">proposed additions</a>,
417
+ <a href="${Tr}#proposed-addition">proposed additions</a>,
418
418
  introducing new features since the previous Recommendation.`:e.revisionTypes.includes("correction")&&(t=It`It includes
419
- <a href="${Nr}#proposed-correction">proposed corrections</a>.`));const n=Vr[e.specStatus]?It` using the
420
- <a href="${Nr}#recs-and-notes"
421
- >${Vr[e.specStatus]} track</a
419
+ <a href="${Tr}#proposed-correction">proposed corrections</a>.`));const n=Br[e.specStatus]?It` using the
420
+ <a href="${Tr}#recs-and-notes"
421
+ >${Br[e.specStatus]} track</a
422
422
  >`:"";return It`<p>
423
423
  This document was published by ${e.wgHTML} as
424
- ${jr(e.longStatus)}${n}. ${t}
424
+ ${Pr(e.longStatus)}${n}. ${t}
425
425
  </p>`}(e)} `}
426
426
  ${e.sotdAfterWGinfo?t.additionalContent:""}
427
427
  ${e.isRec?function({updateableRec:e,revisionTypes:t=[],humanRevisedRecEnd:n}){let r="";t.includes("addition")&&(r="additions");t.includes("correction")&&!r&&(r="corrections");return It`
@@ -440,7 +440,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
440
440
  >
441
441
  for implementations.
442
442
  ${e?It`Future updates to this Recommendation may incorporate
443
- <a href="${Nr}#allow-new-features">new features</a>.`:""}
443
+ <a href="${Tr}#allow-new-features">new features</a>.`:""}
444
444
  </p>
445
445
  ${t.includes("addition")?It`<p class="addition">
446
446
  Proposed additions are marked in the document.
@@ -457,13 +457,13 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
457
457
  >WBS questionnaires</a
458
458
  >.
459
459
  </p>`:""}
460
- `}(e):function(e){let t=null,n=null,r=It`Publication as ${jr(e.textStatus)} does not
460
+ `}(e):function(e){let t=null,n=null,r=It`Publication as ${Pr(e.textStatus)} does not
461
461
  imply endorsement by W3C and its Members.`,s=It`<p>
462
462
  This is a draft document and may be updated, replaced or obsoleted by other
463
463
  documents at any time. It is inappropriate to cite this document as other
464
464
  than work in progress.
465
465
  ${e.updateableRec?It`Future updates to this specification may incorporate
466
- <a href="${Nr}#allow-new-features">new features</a>.`:""}
466
+ <a href="${Tr}#allow-new-features">new features</a>.`:""}
467
467
  </p>`;const i=It`<p>
468
468
  This document is maintained and updated at any time. Some parts of this
469
469
  document are work in progress.
@@ -481,7 +481,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
481
481
  intends to include in a subsequent Candidate Recommendation Snapshot.`,"LS"===e.pubMode&&(s=i);break;case"CRYD":t=It`A Candidate Registry Draft integrates changes
482
482
  from the previous Candidate Registry Snapshot that the Working Group
483
483
  intends to include in a subsequent Candidate Registry Snapshot.`,"LS"===e.pubMode&&(s=i);break;case"CRY":t=It`A Candidate Registry Snapshot has received
484
- <a href="${Nr}#dfn-wide-review">wide review</a>.`,n=It`<p>
484
+ <a href="${Tr}#dfn-wide-review">wide review</a>.`,n=It`<p>
485
485
  The W3C Membership and other interested parties are invited to review
486
486
  the document and send comments through ${e.humanPREnd}. Advisory
487
487
  Committee Representatives should consult their
@@ -490,7 +490,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
490
490
  >. Note that substantive technical comments were expected during the
491
491
  Candidate Recommendation review period that ended ${e.humanCREnd}.
492
492
  </p>`;break;case"CR":t=It`A Candidate Recommendation Snapshot has received
493
- <a href="${Nr}#dfn-wide-review">wide review</a>, is intended to
493
+ <a href="${Tr}#dfn-wide-review">wide review</a>, is intended to
494
494
  gather
495
495
  <a href="${e.implementationReportURI}">implementation experience</a>,
496
496
  and has commitments from Working Group members to
@@ -498,7 +498,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
498
498
  >royalty-free licensing</a
499
499
  >
500
500
  for implementations.`,s=It`${e.updateableRec?It`Future updates to this specification may incorporate
501
- <a href="${Nr}#allow-new-features">new features</a>.`:""}`,n="LS"===e.pubMode?It`<p>
501
+ <a href="${Tr}#allow-new-features">new features</a>.`:""}`,n="LS"===e.pubMode?It`<p>
502
502
  Comments are welcome at any time but most especially before
503
503
  ${e.humanCREnd}.
504
504
  </p>`:It`<p>
@@ -552,7 +552,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
552
552
  </p>`}(e)}
553
553
  <p>
554
554
  This document is governed by the
555
- <a id="w3c_process_revision" href="${Nr}"
555
+ <a id="w3c_process_revision" href="${Tr}"
556
556
  >2 November 2021 W3C Process Document</a
557
557
  >.
558
558
  </p>
@@ -560,7 +560,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
560
560
  `}
561
561
  `}
562
562
  ${t.additionalSections}
563
- `;function zr(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return It`<details class="annoying-warning" open="">
563
+ `;function Dr(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return It`<details class="annoying-warning" open="">
564
564
  <summary>
565
565
  This is a
566
566
  preview${t&&n?It`
@@ -576,9 +576,9 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
576
576
  <a href="${r}">${r}</a> for the Editor's draft.
577
577
  `:""}
578
578
  </p>
579
- </details>`}var Mr=(e,t)=>It`
580
- <h2>${Dr.sotd}</h2>
581
- ${e.isPreview?zr(e):""}
579
+ </details>`}var Nr=(e,t)=>It`
580
+ <h2>${Lr.sotd}</h2>
581
+ ${e.isPreview?Dr(e):""}
582
582
  <p>
583
583
  This specification was published by the
584
584
  <a href="${e.wgURI}">${e.wg}</a>. It is not a W3C Standard nor is it
@@ -630,17 +630,17 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
630
630
  </p>`}(e,t):""}
631
631
  ${e.sotdAfterWGinfo?t.additionalContent:""}
632
632
  ${t.additionalSections}
633
- `;const qr="w3c/headers",Ur=new Intl.DateTimeFormat(["en-AU"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});function Wr(e){return new URL(e,"https://www.w3.org/").href}const Fr={LS:"WD",LD:"WD",FPWD:"WD"},Br={"Member-SUBM":"/Submission",finding:"/2001/tag/doc","draft-finding":"/2001/tag/doc"},Hr={DNOTE:"Group Draft Note",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",PER:"Proposed Edited Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Draft Registry",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},Gr={...Hr,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},Vr={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},Kr=["DNOTE","NOTE","STMT"],Yr=["FPWD","WD","CR","CRD","PR","PER","REC","DISC"],Zr=["DRY","CRY","CRYD","RY"],Jr=["CG-DRAFT","CG-FINAL"],Qr=["BG-DRAFT","BG-FINAL"],Xr=[...Jr,...Qr],es=["base",...Jr,...Qr,"editor-draft-finding","draft-finding","finding","MO","unofficial"],ts=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["w3c-software",{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231"}],["w3c-software-doc",{name:"W3C Software and Document Notice and License",short:"permissive document license",url:"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/Consortium/Legal/copyright-documents"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}],[void 0,{name:"unlicensed",url:null,short:"UNLICENSED"}]]),ns=["PP2017","PP2020"],rs=Object.freeze({id:"",alt:"",href:"",src:"",height:"48",width:"72"});function ss(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=zt.format(r);return new Date(e)}return yn(_n`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,qr),new Date(zt.format(new Date))}function is(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.firstChild.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){wn(_n`ReSpec does not support automated SotD generation for TAG findings.`,qr,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var os=Object.freeze({__proto__:null,name:qr,publicationSpaces:Br,status2track:Vr,W3CNotes:Kr,recTrackStatus:Yr,registryTrackStatus:Zr,cgStatus:Jr,bgStatus:Qr,cgbgStatus:Xr,noTrackStatus:es,licenses:ts,run:async function(e){if(!e.specStatus){const e=_n`Please select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;yn(_n`Missing required configuration: ${"[specStatus]"}.`,qr,{hint:e})}if(e.isUnofficial="unofficial"===e.specStatus,e.isUnofficial&&!Array.isArray(e.logos)&&(e.logos=[]),"IG-NOTE"===e.specStatus||"WG-NOTE"===e.specStatus){const t=_n`Please update your ${"[specStatus]"} to use "NOTE".`;wn(e.specStatus+" are no longer supported. ",qr,{hint:t}),e.specStatus="NOTE"}if(e.licenseInfo=function(e){let t=void 0;if("string"==typeof e.license){const n=e.license.toLowerCase();if(ts.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=_n`Please set
634
- ${"[license]"} to one of: ${kn([...ts.keys()].filter(e=>e),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;yn(t,qr,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=_n`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;yn(_n`License "\`${e.license}\`" is not allowed for W3C Specifications.`,qr,{hint:t})}return ts.get(t)}(e),e.isCGBG=Xr.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isBasic="base"===e.specStatus,e.isRegular=!e.isCGBG&&!e.isBasic,e.isRegular&&!e.shortName){yn("Missing required configuration: `shortName`",qr)}if(e.testSuiteURI){const t=new URL(e.testSuiteURI,location.href),{host:n,pathname:r}=t;if("github.com"===n&&r.startsWith("/w3c/web-platform-tests/")){const t="Web Platform Tests have moved to a new Github Organization at https://github.com/web-platform-tests. ",n=_n`Please update your ${"[testSuiteURI]"} to point to the new tests repository (e.g., ${"https://wpt.live/"+e.shortName}).`;wn(t,qr,{hint:n})}}if(e.subtitle||(e.subtitle=""),e.publishDate=ss(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=Ur.format(e.publishDate),e.isNoTrack=es.includes(e.specStatus),e.isRecTrack=!e.noRecTrack&&Yr.includes(e.specStatus),e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMemberSubmission){const t={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211"};e.logos.push({...rs,...t})}if(e.isTagFinding="finding"===e.specStatus||"draft-finding"===e.specStatus||"editor-draft-finding"===e.specStatus,e.isTagEditorFinding="editor-draft-finding"===e.specStatus,e.isRecTrack&&!e.github&&!e.wgPublicList){const e=_n`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;yn("W3C Process requires a either a link to a public repository or mailing list.",qr,{hint:e})}if(!e.edDraftURI&&(e.edDraftURI="","ED"===e.specStatus)){wn("Editor's Drafts should set edDraftURI.",qr)}const t=Fr[e.specStatus]||e.specStatus,n=Br[e.specStatus]||"/TR";if(e.isRegular){const{shortName:r,publishDate:s}=e,i=e.publishDate.getUTCFullYear(),o=`${t}-${r}-${Jt(s)}`;e.thisVersion=Wr(`${n}/${i}/${o}/`)}"ED"===e.specStatus&&(e.thisVersion=e.edDraftURI);const r=`${n}/${e.shortName}`;if(null!==e.latestVersion&&(e.latestVersion=e.latestVersion?Wr(""+e.latestVersion):Wr(`${n}/${e.shortName}/`)),e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){yn("`previousPublishDate` is set, but not `previousMaturity`.",qr)}e.previousPublishDate=ss(e,"previousPublishDate");const t=Fr[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=zt.format(e.publishDate);e.thisVersion=Wr(`${r}-${t}`);const n=zt.format(e.previousPublishDate);e.prevVersion=Wr(`${r}-${n}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const r=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,i=Jt(e.previousPublishDate);e.prevVersion=Wr(`${n}/${r}/${t}-${s}-${i}/`)}}else e.prevVersion||(e.prevVersion="");if(e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=Wr(`${n}/${e.prevRecShortname}`)),e.formerEditors||(e.formerEditors=[]),e.editors)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){yn("At least one editor is required.",qr)}if(e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.alternateFormats?.forEach(e=>{if(!e.uri||!e.label){yn("All alternate formats must have a uri and a label.",qr)}}),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.longStatus=Gr[e.specStatus],e.textStatus=Hr[e.specStatus],e.showPreviousVersion=!1,e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate),e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRec&&!e.errata){const e=_n`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;yn("Recommendations must have an errata link.",qr,{hint:e})}e.prependW3C=!e.isBasic&&!e.isUnofficial,e.isED="ED"===e.specStatus,e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRY="CRY"===e.specStatus||"CRYD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isPR="PR"===e.specStatus,e.isPER="PER"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Kr.includes(e.specStatus),e.isRegistry=Zr.includes(e.specStatus),e.dashDate=zt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=zt.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every(e=>ns.includes(e))){const e=_n`Invalid ${"[wgPatentPolicy]"} value(s): ${$n([...t].filter(e=>!ns.includes(e)))}.`,n=`Please use one of: ${kn(ns)}.`;yn(e,qr,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=_n`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;yn(e,qr,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI)return;const t=new URL(e.historyURI??e.shortName,"https://www.w3.org/standards/history/");if([...Yr,...Kr,...Zr].includes(e.specStatus))return void(e.historyURI=t.href);try{const n=await fetch(t,{method:"HEAD"});n.ok&&(e.historyURI=n.url)}catch{}}(e);const s={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&nn(e.alternateFormats.map(({label:e})=>e),(t,n)=>{const r=e.alternateFormats[n];return It`<a
633
+ `;const jr="w3c/headers",Or="en"===s||s.startsWith("en-")?"en-AU":s,zr=new Intl.DateTimeFormat(Or,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Or?"2-digit":"numeric"});function Mr(e){return new URL(e,"https://www.w3.org/").href}const qr={LS:"WD",LD:"WD",FPWD:"WD"},Wr={"Member-SUBM":"/Submission",finding:"/2001/tag/doc","draft-finding":"/2001/tag/doc"},Ur={DNOTE:"Group Draft Note",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",PER:"Proposed Edited Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Draft Registry",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},Fr={...Ur,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},Br={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},Hr=["DNOTE","NOTE","STMT"],Gr=["FPWD","WD","CR","CRD","PR","PER","REC","DISC","RSCND"],Vr=["DRY","CRY","CRYD","RY"],Kr=["CG-DRAFT","CG-FINAL"],Yr=["BG-DRAFT","BG-FINAL"],Zr=[...Kr,...Yr],Jr=["base",...Kr,...Yr,"editor-draft-finding","draft-finding","finding","MO","unofficial"],Qr=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["w3c-software",{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/Consortium/Legal/2002/copyright-software-20021231"}],["w3c-software-doc",{name:"W3C Software and Document Notice and License",short:"permissive document license",url:"https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/Consortium/Legal/copyright-documents"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}],[void 0,{name:"unlicensed",url:null,short:"UNLICENSED"}]]),Xr=["PP2017","PP2020"],es=Object.freeze({id:"",alt:"",href:"",src:"",height:"48",width:"72"});function ts(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=zt.format(r);return new Date(e)}return yn(_n`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,jr),new Date(zt.format(new Date))}function ns(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.firstChild.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){wn(_n`ReSpec does not support automated SotD generation for TAG findings.`,jr,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var rs=Object.freeze({__proto__:null,name:jr,publicationSpaces:Wr,status2track:Br,W3CNotes:Hr,recTrackStatus:Gr,registryTrackStatus:Vr,cgStatus:Kr,bgStatus:Yr,cgbgStatus:Zr,noTrackStatus:Jr,licenses:Qr,run:async function(e){if(!e.specStatus){const e=_n`Please select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;yn(_n`Missing required configuration: ${"[specStatus]"}.`,jr,{hint:e})}if(e.isUnofficial="unofficial"===e.specStatus,e.isUnofficial&&!Array.isArray(e.logos)&&(e.logos=[]),"IG-NOTE"===e.specStatus||"WG-NOTE"===e.specStatus){const t=_n`Please update your ${"[specStatus]"} to use "NOTE".`;wn(e.specStatus+" are no longer supported. ",jr,{hint:t}),e.specStatus="NOTE"}if(e.licenseInfo=function(e){let t=void 0;if("string"==typeof e.license){const n=e.license.toLowerCase();if(Qr.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=_n`Please set
634
+ ${"[license]"} to one of: ${kn([...Qr.keys()].filter(e=>e),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;yn(t,jr,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=_n`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;yn(_n`License "\`${e.license}\`" is not allowed for W3C Specifications.`,jr,{hint:t})}return Qr.get(t)}(e),e.isCGBG=Zr.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isBasic="base"===e.specStatus,e.isRegular=!e.isCGBG&&!e.isBasic,e.isRegular&&!e.shortName){yn("Missing required configuration: `shortName`",jr)}if(e.testSuiteURI){const t=new URL(e.testSuiteURI,location.href),{host:n,pathname:r}=t;if("github.com"===n&&r.startsWith("/w3c/web-platform-tests/")){const t="Web Platform Tests have moved to a new Github Organization at https://github.com/web-platform-tests. ",n=_n`Please update your ${"[testSuiteURI]"} to point to the new tests repository (e.g., ${"https://wpt.live/"+e.shortName}).`;wn(t,jr,{hint:n})}}if(e.subtitle||(e.subtitle=""),e.publishDate=ts(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=zr.format(e.publishDate),e.isNoTrack=Jr.includes(e.specStatus),e.isRecTrack=!e.noRecTrack&&Gr.includes(e.specStatus),e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMemberSubmission){const t={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211"};e.logos.push({...es,...t})}if(e.isTagFinding="finding"===e.specStatus||"draft-finding"===e.specStatus||"editor-draft-finding"===e.specStatus,e.isTagEditorFinding="editor-draft-finding"===e.specStatus,e.isRecTrack&&!e.github&&!e.wgPublicList){const e=_n`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;yn("W3C Process requires a either a link to a public repository or mailing list.",jr,{hint:e})}if(!e.edDraftURI&&(e.edDraftURI="","ED"===e.specStatus)){wn("Editor's Drafts should set edDraftURI.",jr)}const t=qr[e.specStatus]||e.specStatus,n=Wr[e.specStatus]||"/TR";if(e.isRegular){const{shortName:r,publishDate:s}=e,i=e.publishDate.getUTCFullYear(),o=`${t}-${r}-${Jt(s)}`;e.thisVersion=Mr(`${n}/${i}/${o}/`)}"ED"===e.specStatus&&(e.thisVersion=e.edDraftURI);const r=`${n}/${e.shortName}`;if(null!==e.latestVersion&&(e.latestVersion=e.latestVersion?Mr(""+e.latestVersion):Mr(`${n}/${e.shortName}/`)),e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){yn("`previousPublishDate` is set, but not `previousMaturity`.",jr)}e.previousPublishDate=ts(e,"previousPublishDate");const t=qr[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=zt.format(e.publishDate);e.thisVersion=Mr(`${r}-${t}`);const n=zt.format(e.previousPublishDate);e.prevVersion=Mr(`${r}-${n}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const r=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,i=Jt(e.previousPublishDate);e.prevVersion=Mr(`${n}/${r}/${t}-${s}-${i}/`)}}else e.prevVersion||(e.prevVersion="");if(e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=Mr(`${n}/${e.prevRecShortname}`)),e.formerEditors||(e.formerEditors=[]),e.editors)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){yn("At least one editor is required.",jr)}if(e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.alternateFormats?.forEach(e=>{if(!e.uri||!e.label){yn("All alternate formats must have a uri and a label.",jr)}}),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.longStatus=Fr[e.specStatus],e.textStatus=Ur[e.specStatus],e.showPreviousVersion=!1,e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate),e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRec&&!e.errata){const e=_n`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;yn("Recommendations must have an errata link.",jr,{hint:e})}e.prependW3C=!e.isBasic&&!e.isUnofficial,e.isED="ED"===e.specStatus,e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRY="CRY"===e.specStatus||"CRYD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isPR="PR"===e.specStatus,e.isPER="PER"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Hr.includes(e.specStatus),e.isRegistry=Vr.includes(e.specStatus),e.dashDate=zt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=zt.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every(e=>Xr.includes(e))){const e=_n`Invalid ${"[wgPatentPolicy]"} value(s): ${$n([...t].filter(e=>!Xr.includes(e)))}.`,n=`Please use one of: ${kn(Xr)}.`;yn(e,jr,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=_n`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;yn(e,jr,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI)return;const t=new URL(e.historyURI??e.shortName,"https://www.w3.org/standards/history/");if([...Gr,...Hr,...Vr].includes(e.specStatus))return void(e.historyURI=t.href);try{const n=await fetch(t,{method:"HEAD"});n.ok&&(e.historyURI=n.url)}catch{}}(e);const s={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&nn(e.alternateFormats.map(({label:e})=>e),(t,n)=>{const r=e.alternateFormats[n];return It`<a
635
635
  rel="alternate"
636
636
  href="${r.uri}"
637
637
  hreflang="${r?.lang??null}"
638
638
  type="${r?.type??null}"
639
639
  >${r.label}</a
640
- >`})}},i=(e.isCGBG?Ir:Pr)(e,s);document.body.prepend(i),document.body.classList.add("h-entry");const o=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!o.id){yn("A Status of This Document must include at least on custom paragraph.",qr,{elements:[o],hint:"Add a `<p>` in the 'sotd' section that reflects the status of this specification."})}o.id=o.id||"sotd",o.classList.add("introductory");const a=[e.wg,e.wgURI,e.wgPatentURI];if(a.some(e=>Array.isArray(e))&&!a.every(e=>Array.isArray(e))){const e=_n`Use the ${"[group]"} option with an array instead.`;yn(_n`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,qr,{hint:e})}if(e.isCGBG&&!e.wg){yn(_n`${"[wg]"} configuration option is required for this kind of document.`,qr)}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgHTML=nn(e.wg,(t,n)=>It`the <a href="${e.wgURI[n]}">${t}</a>`),e.wgPatentHTML=nn(e.wg,(t,n)=>It`a
640
+ >`})}},i=(e.isCGBG?Ar:Er)(e,s);document.body.prepend(i),document.body.classList.add("h-entry");const o=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!o.id){yn("A Status of This Document must include at least on custom paragraph.",jr,{elements:[o],hint:"Add a `<p>` in the 'sotd' section that reflects the status of this specification."})}o.id=o.id||"sotd",o.classList.add("introductory");const a=[e.wg,e.wgURI,e.wgPatentURI];if(a.some(e=>Array.isArray(e))&&!a.every(e=>Array.isArray(e))){const e=_n`Use the ${"[group]"} option with an array instead.`;yn(_n`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,jr,{hint:e})}if(e.isCGBG&&!e.wg){yn(_n`${"[wg]"} configuration option is required for this kind of document.`,jr)}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgHTML=nn(e.wg,(t,n)=>It`the <a href="${e.wgURI[n]}">${t}</a>`),e.wgPatentHTML=nn(e.wg,(t,n)=>It`a
641
641
  <a href="${e.wgPatentURI[n]}" rel="disclosure"
642
642
  >public list of any patent disclosures (${t})</a
643
- >`)):(e.multipleWGs=!1,e.wg&&(e.wgHTML=It`the <a href="${e.wgURI}">${e.wg}</a>`)),"PR"===e.specStatus&&!e.crEnd){yn(_n`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,qr)}if("CR"===e.specStatus&&!e.crEnd){yn(_n`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,qr)}if(e.crEnd=ss(e,"crEnd"),e.humanCREnd=Ur.format(e.crEnd),"PR"===e.specStatus&&!e.prEnd){yn(_n`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,qr)}if(e.prEnd=ss(e,"prEnd"),e.humanPREnd=Ur.format(e.prEnd),"PER"===e.specStatus&&!e.perEnd){yn(_n`${"[specStatus]"} is "PR", but no ${"[prEnd]"} is specified`,qr)}if(e.perEnd=ss(e,"perEnd"),e.humanPEREnd=Ur.format(e.perEnd),e.hasOwnProperty("updateableRec")){const t=_n`Add an ${"[`updateable-rec`|#updateable-rec-class]"} CSS class to the Status of This Document section instead.`;wn("Configuration option `updateableRec` is deprecated.",qr,{hint:t}),e.updateableRec&&o.classList.add("updateable-rec")}e.updateableRec=o.classList.contains("updateable-rec");const c=["addition","correction"];if("REC"===e.specStatus&&e.revisionTypes?.length>0){if(e.revisionTypes.some(e=>!c.includes(e))){const t=_n`${"[specStatus]"} is "REC" with unknown ${"[revisionTypes]"}: '${kn(e.revisionTypes.filter(e=>!c.includes(e)))}'.`,n=_n`The valid values for ${"[revisionTypes]"} are: ${kn(c)}.`;yn(t,qr,{hint:n})}if(e.revisionTypes.includes("addition")&&!e.updateableRec){yn(_n`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as a allowing new features.`,qr)}}if("REC"===e.specStatus&&e.updateableRec&&e.revisionTypes&&e.revisionTypes.length>0&&!e.revisedRecEnd){yn(_n`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,qr)}if(e.revisedRecEnd=ss(e,"revisedRecEnd"),e.humanRevisedRecEnd=Ur.format(e.revisedRecEnd),e.noRecTrack&&Yr.includes(e.specStatus)){const t=_n`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=kn(Yr,{quotes:!0});yn(t,qr,{hint:`Status **can't** be any of: ${n}.`})}if(o.classList.contains("override")||It.bind(o)`${function(e,t){const n={...is(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?"?subject="+encodeURIComponent(e.subjectPrefix):"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}};return(e.isCGBG?Mr:Or)(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=_n`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;yn(_n`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,qr,{hint:e})}if(!e.implementationReportURI&&e.isPR){wn(_n`PR documents should include an ${"[implementationReportURI]"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`,qr)}Rn("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const as={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},cs="w3c/defaults",ls={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},us={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0};var ds=Object.freeze({__proto__:null,name:cs,run:function(e){const t=!1!==e.lint&&{...as.lint,...us.lint,...e.lint};Object.assign(e,{...as,...us,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const t=e.specStatus??"";[...Yr,...Zr,...Kr].includes(t)&&e.logos?.unshift(ls);"ED"===t&&0===e.logos?.length&&e.logos.push(ls)}(e),e.groupType&&e.specStatus&&function(e){const{specStatus:t,groupType:n}=e;switch(n){case"cg":if(![...Xr,"unofficial"].includes(t)){const n=_n`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=kn(Jr,{quotes:!0});yn(n,cs,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Qr,"unofficial"].includes(t)){const n=_n`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=kn(Qr,{quotes:!0});yn(n,cs,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(Xr.includes(t)){const e=_n`Please see ${"[specStatus]"} for appropriate values for this type of group.`;yn(_n`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,cs,{hint:e})}}}(e)}});var ps=String.raw`@keyframes pop{
643
+ >`)):(e.multipleWGs=!1,e.wg&&(e.wgHTML=It`the <a href="${e.wgURI}">${e.wg}</a>`)),"PR"===e.specStatus&&!e.crEnd){yn(_n`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,jr)}if("CR"===e.specStatus&&!e.crEnd){yn(_n`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,jr)}if(e.crEnd=ts(e,"crEnd"),e.humanCREnd=zr.format(e.crEnd),"PR"===e.specStatus&&!e.prEnd){yn(_n`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,jr)}if(e.prEnd=ts(e,"prEnd"),e.humanPREnd=zr.format(e.prEnd),"PER"===e.specStatus&&!e.perEnd){yn(_n`${"[specStatus]"} is "PR", but no ${"[prEnd]"} is specified`,jr)}if(e.perEnd=ts(e,"perEnd"),e.humanPEREnd=zr.format(e.perEnd),e.hasOwnProperty("updateableRec")){const t=_n`Add an ${"[`updateable-rec`|#updateable-rec-class]"} CSS class to the Status of This Document section instead.`;wn("Configuration option `updateableRec` is deprecated.",jr,{hint:t}),e.updateableRec&&o.classList.add("updateable-rec")}e.updateableRec=o.classList.contains("updateable-rec");const c=["addition","correction"];if("REC"===e.specStatus&&e.revisionTypes?.length>0){if(e.revisionTypes.some(e=>!c.includes(e))){const t=_n`${"[specStatus]"} is "REC" with unknown ${"[revisionTypes]"}: '${kn(e.revisionTypes.filter(e=>!c.includes(e)))}'.`,n=_n`The valid values for ${"[revisionTypes]"} are: ${kn(c)}.`;yn(t,jr,{hint:n})}if(e.revisionTypes.includes("addition")&&!e.updateableRec){yn(_n`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as a allowing new features.`,jr)}}if("REC"===e.specStatus&&e.updateableRec&&e.revisionTypes&&e.revisionTypes.length>0&&!e.revisedRecEnd){yn(_n`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,jr)}if(e.revisedRecEnd=ts(e,"revisedRecEnd"),e.humanRevisedRecEnd=zr.format(e.revisedRecEnd),e.noRecTrack&&Gr.includes(e.specStatus)){const t=_n`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=kn(Gr,{quotes:!0});yn(t,jr,{hint:`Status **can't** be any of: ${n}.`})}if(o.classList.contains("override")||It.bind(o)`${function(e,t){const n={...ns(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?"?subject="+encodeURIComponent(e.subjectPrefix):"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}};return(e.isCGBG?Nr:Ir)(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=_n`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;yn(_n`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,jr,{hint:e})}if(!e.implementationReportURI&&e.isPR){wn(_n`PR documents should include an ${"[implementationReportURI]"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`,jr)}Rn("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const ss={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},is="w3c/defaults",os={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},as={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0};var cs=Object.freeze({__proto__:null,name:is,run:function(e){const t=!1!==e.lint&&{...ss.lint,...as.lint,...e.lint};if(Object.assign(e,{...ss,...as,...e,lint:t}),!e.specStatus){const t=_n`The ${"[specStatus]"} configuration option is required. Defaulting to 'base' status."`,n=_n`Add a ${"[specStatus]"}. If unsure, use "unofficial".`;e.specStatus="base",wn(t,is,{hint:n})}"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t}=e;e.wg?.length&&[...Gr,...Vr,...Hr].includes(t)&&e.logos?.unshift(os);"ED"===t&&0===e.logos?.length&&e.logos.push(os)}(e),function(e){const{specStatus:t,groupType:n}=e;switch(n){case"cg":if(![...Zr,"unofficial"].includes(t)){const n=_n`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=kn(Kr,{quotes:!0});yn(n,is,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Yr,"unofficial"].includes(t)){const n=_n`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=kn(Yr,{quotes:!0});yn(n,is,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(Zr.includes(t)){const e=_n`Please see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;yn(_n`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,is,{hint:e})}break;default:if(!e.wgId&&!["ED","unofficial","base","UD"].includes(e.specStatus)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=_n`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",wn(t,is,{hint:n})}}}(e)}});var ls=String.raw`@keyframes pop{
644
644
  0%{transform:scale(1,1)}
645
645
  25%{transform:scale(1.25,1.25);opacity:.75}
646
646
  100%{transform:scale(1,1)}
@@ -694,14 +694,14 @@ dd{margin-left:0}
694
694
  }
695
695
  @media print{
696
696
  .removeOnSave{display:none}
697
- }`;const fs=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=ps,document.head.appendChild(e),e}();var hs=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&fs.remove()}});const ms="w3c/style";function gs(){const e=It`<script src="https://www.w3.org/scripts/TR/2021/fixup.js">`;location.hash&&e.addEventListener("load",()=>{window.location.href=location.hash},{once:!0}),document.body.appendChild(e)}const bs=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2021/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/base.css",as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",as:"image"}],t=document.createDocumentFragment();for(const n of e.map(qt))t.appendChild(n);return t}();bs.appendChild(It`<link
697
+ }`;const us=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=ls,document.head.appendChild(e),e}();var ds=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&us.remove()}});function ps(){const e=It`<script src="https://www.w3.org/scripts/TR/2021/fixup.js">`;location.hash&&e.addEventListener("load",()=>{window.location.href=location.hash},{once:!0}),document.body.appendChild(e)}const fs=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2021/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/base.css",as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",as:"image"}],t=document.createDocumentFragment();for(const n of e.map(qt))t.appendChild(n);return t}();fs.appendChild(It`<link
698
698
  rel="stylesheet"
699
699
  href="https://www.w3.org/StyleSheets/TR/2021/base.css"
700
700
  class="removeOnSave"
701
- />`),document.head.querySelector("meta[name=viewport]")||bs.prepend(It`<meta
701
+ />`),document.head.querySelector("meta[name=viewport]")||fs.prepend(It`<meta
702
702
  name="viewport"
703
703
  content="width=device-width, initial-scale=1, shrink-to-fit=no"
704
- />`),document.head.prepend(bs);var ys=Object.freeze({__proto__:null,name:ms,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",wn(t,ms)}let t="W3C-";switch(e.specStatus.toUpperCase()){case"WD":case"FPWD":t="W3C-WD";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":t=e.specStatus.toLowerCase();break;case"UNOFFICIAL":t+="UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":t="base.css";break;default:t+=e.specStatus}e.noToc||En("end-all",gs,{once:!0});const n=new URL("/StyleSheets/TR/2021/"+t,"https://www.w3.org/");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.href),En("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);e.querySelector("head").append(t)}))}});const ws={en:{status_at_publication:It`This section describes the status of this
704
+ />`),document.head.prepend(fs);var hs=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){const t=e.specStatus?.toUpperCase()??"";let n="";const r=[...Gr,...Vr,...Hr,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;default:n=r?"W3C-"+e.specStatus:"base.css"}e.noToc||En("end-all",ps,{once:!0});const s=new URL("/StyleSheets/TR/2021/"+n,"https://www.w3.org/");var i;!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,s.href),En("beforesave",(i=s,e=>{const t=e.querySelector(`head link[href="${i}"]`);e.querySelector("head").append(t)}))}});const ms={en:{status_at_publication:It`This section describes the status of this
705
705
  document at the time of its publication. A list of current W3C
706
706
  publications and the latest revision of this technical report can be found
707
707
  in the <a href="https://www.w3.org/TR/">W3C technical reports index</a> at
@@ -722,9 +722,9 @@ dd{margin-left:0}
722
722
  Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen
723
723
  Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann
724
724
  im <a href="https://www.w3.org/TR/">W3C technical reports index</a> unter
725
- https://www.w3.org/TR/ abgerufen werden.`}};Object.keys(ws).forEach(e=>{r[e]||(r[e]={}),Object.assign(r[e],ws[e])});var vs=Object.freeze({__proto__:null,name:"w3c/l10n"});const ks="core/github";let $s,xs;const _s=new Promise((e,t)=>{$s=e,xs=e=>{yn(e,ks),t(new Error(e))}}),Ss=Zt({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var Cs=Object.freeze({__proto__:null,name:ks,github:_s,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void $s(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=_n`Config option ${"[github]"} is missing property \`repoURL\`.`;return void xs(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=_n`${"[github]"} configuration option is not a valid URL? (${n}).`;return void xs(e)}if("https://github.com"!==t.origin){const e=_n`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void xs(e)}const[r,s]=t.pathname.split("/").filter(e=>e);if(!r||!s){const e=_n`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void xs(e)}const i=e.github.branch||"gh-pages",o=new URL("./issues/",t).href,a=new URL("./commits/"+(e.github.branch??""),t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:o,atRiskBase:o,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:s};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{wn("The `githubAPI` configuration option is private and should not be added manually.",ks)}if(!e.excludeGithubLinks){const n={key:Ss.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:Ss.file_a_bug,href:c.issueBase},{value:Ss.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`,issuesURL:o,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",o).href,commitHistoryURL:a.href};$s(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});const Rs="core/data-include";function Es(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=Xt(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let s=t;"markdown"===r&&(s=Bn(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&Kn(e),n&&e.replaceWith(...e.childNodes)}(r,s,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach(t=>e.removeAttribute(t))}(r)}var As=Object.freeze({__proto__:null,name:Rs,run:async function(){const e=document.querySelectorAll("[data-include]"),t=Array.from(e).map(async e=>{const t=e.dataset.include;if(!t)return;const n="include-"+String(Math.random()).substr(2);e.dataset.includeId=n;try{const e=await fetch(t);Es(await e.text(),n,t)}catch(n){const r=`\`data-include\` failed: \`${t}\` (${n.message}).`;console.error(r,e,n),yn(r,Rs,{elements:[e]})}});await Promise.all(t)}});const Ls="core/title",Ts=Zt({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var Ps=Object.freeze({__proto__:null,name:Ls,run:function(e){const t=document.querySelector("h1#title")||It`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){yn('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',Ls,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||""+Ts.default_title);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=Kt(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=It`
725
+ https://www.w3.org/TR/ abgerufen werden.`}};Object.keys(ms).forEach(e=>{r[e]||(r[e]={}),Object.assign(r[e],ms[e])});var gs=Object.freeze({__proto__:null,name:"w3c/l10n"});const bs="core/github";let ys,ws;const vs=new Promise((e,t)=>{ys=e,ws=e=>{yn(e,bs),t(new Error(e))}}),ks=Zt({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"참여"},zh:{file_a_bug:"反馈错误",participate:"参与:"},ja:{commit_history:"変更履歴",file_a_bug:"問題報告",participate:"参加方法:"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var $s=Object.freeze({__proto__:null,name:bs,github:vs,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void ys(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=_n`Config option ${"[github]"} is missing property \`repoURL\`.`;return void ws(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=_n`${"[github]"} configuration option is not a valid URL? (${n}).`;return void ws(e)}if("https://github.com"!==t.origin){const e=_n`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void ws(e)}const[r,s]=t.pathname.split("/").filter(e=>e);if(!r||!s){const e=_n`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void ws(e)}const i=e.github.branch||"gh-pages",o=new URL("./issues/",t).href,a=new URL("./commits/"+(e.github.branch??""),t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:o,atRiskBase:o,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:s};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{wn("The `githubAPI` configuration option is private and should not be added manually.",bs)}if(!e.excludeGithubLinks){const n={key:ks.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:ks.file_a_bug,href:c.issueBase},{value:ks.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`,issuesURL:o,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",o).href,commitHistoryURL:a.href};ys(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class xs{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(_s(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function _s(e){const t=new xs(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function Ss(e){const t=_s(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var Cs=Object.freeze({__proto__:null,name:"core/sections",restructure:Ss,run:function(){Ss(document.body)}});const Rs="core/data-include";function Es(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=Xt(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let s=t;"markdown"===r&&(s=Bn(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&Ss(e),n&&e.replaceWith(...e.childNodes)}(r,s,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach(t=>e.removeAttribute(t))}(r)}var As=Object.freeze({__proto__:null,name:Rs,run:async function(){const e=document.querySelectorAll("[data-include]"),t=Array.from(e).map(async e=>{const t=e.dataset.include;if(!t)return;const n="include-"+String(Math.random()).substr(2);e.dataset.includeId=n;try{const e=await fetch(t);Es(await e.text(),n,t)}catch(n){const r=`\`data-include\` failed: \`${t}\` (${n.message}).`;console.error(r,e,n),yn(r,Rs,{elements:[e]})}});await Promise.all(t)}});const Ls="core/title",Ts=Zt({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var Ps=Object.freeze({__proto__:null,name:Ls,run:function(e){const t=document.querySelector("h1#title")||It`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){yn('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',Ls,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||""+Ts.default_title);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=Kt(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=It`
726
726
  Preview of PR <a href="${n}">#${e.prNumber}</a>:
727
- `;t.prepend(...s),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const Is="w3c/level",Ds=Zt({en:{level:"Level"}});var Ns=Object.freeze({__proto__:null,name:Is,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){yn(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,Is,{title:"Invalid level config.",elements:[t]})}else t.append(` ${Ds.level} ${n}`),document.title=`${document.title} ${Ds.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const js="w3c/abstract",Os=Zt({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var zs=Object.freeze({__proto__:null,name:js,run:async function(){const e=function(){const e=document.querySelector("#abstract");if(e)switch(e.localName){case"section":return e;case"div":return an(e,"section");default:return yn("The abstract should be a `<section>` element.",js,{elements:[e]}),e}const t=Os.abstract.toLowerCase();for(const e of document.querySelectorAll("h2, h3, h4, h5, h6")){if(Kt(e.textContent).toLowerCase()===t)return e.closest("section")}return null}();if(e)e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(It`<h2>${Os.abstract}</h2>`);else{yn('Document must have one `<section id="abstract">`.',js)}}});var Ms=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=Xt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}});const qs="core/dfn-abbr";function Us(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter(e=>e.trim()).concat(t).join("|")}var Ws=Object.freeze({__proto__:null,name:qs,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;switch(e){case"dfn":Us(t);break;default:yn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,qs,{elements:[t],title:"Error: unsupported."})}}}});const Fs=/^[a-z]+(\s+[a-z]+)+\??$/,Bs=/\B"([^"]*)"\B/,Hs=/(\w+)\((.*)\)$/,Gs=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Vs=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ks=/^(?:\w+)\??$/,Ys=/^(\w+)\["([\w- ]*)"\]$/,Zs=/\.?(\w+\(.*\)$)/,Js=/\/(.+)/,Qs=/\[\[.+\]\]/;function Xs(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return It`<a
727
+ `;t.prepend(...s),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const Is="w3c/level",Ds=Zt({en:{level:"Level"}});var Ns=Object.freeze({__proto__:null,name:Is,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){yn(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,Is,{title:"Invalid level config.",elements:[t]})}else t.append(` ${Ds.level} ${n}`),document.title=`${document.title} ${Ds.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const js="w3c/abstract",Os=Zt({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var zs=Object.freeze({__proto__:null,name:js,run:async function(){const e=function(){const e=document.querySelector("#abstract");if(e)switch(e.localName){case"section":return e;case"div":return an(e,"section");default:return yn("The abstract should be a `<section>` element.",js,{elements:[e]}),e}const t=Os.abstract.toLowerCase();for(const e of document.querySelectorAll("h2, h3, h4, h5, h6")){if(Kt(e.textContent).toLowerCase()===t)return e.closest("section")}return null}();if(e)e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(It`<h2>${Os.abstract}</h2>`);else{yn('Document must have one `<section id="abstract">`.',js)}}});var Ms=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=Xt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}});const qs="core/dfn-abbr";function Ws(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter(e=>e.trim()).concat(t).join("|")}var Us=Object.freeze({__proto__:null,name:qs,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;switch(e){case"dfn":Ws(t);break;default:yn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,qs,{elements:[t],title:"Error: unsupported."})}}}});const Fs=/^[a-z]+(\s+[a-z]+)+\??$/,Bs=/\B"([^"]*)"\B/,Hs=/(\w+)\((.*)\)$/,Gs=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Vs=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ks=/^(?:\w+)\??$/,Ys=/^(\w+)\["([\w- ]*)"\]$/,Zs=/\.?(\w+\(.*\)$)/,Js=/\/(.+)/,Qs=/\[\[.+\]\]/;function Xs(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return It`<a
728
728
  data-xref-type="_IDL_"
729
729
  data-link-type="idl"
730
730
  data-lt="${t}"
@@ -777,17 +777,17 @@ dd{margin-left:0}
777
777
  `:It`
778
778
  <dt id="${n}">[${e}]</dt>
779
779
  <dd><em class="respec-offending-element">Reference not found.</em></dd>
780
- `}function Ei(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:t+". ",e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${$i(e.publisher)} `),e.date&&(t+=e.date+". "),e.status&&(t+=(ki.get(e.status)||e.status)+". "),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Ai=Object.freeze({__proto__:null,name:wi,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")||It`<section id="references"></section>`;if(document.querySelector("section#references > h2")||r.prepend(It`<h2>${vi.references}</h2>`),r.classList.add("appendix"),n.length){const e=_i(n,vi.norm_references);r.appendChild(e)}if(t.length){const e=_i(t,vi.info_references);r.appendChild(e)}document.body.appendChild(r)},renderInlineCitation:Ci});const Li="core/inlines",Ti={},Pi=e=>new RegExp(e.map(e=>e.source).join("|")),Ii=Zt({en:{rfc2119Keywords:()=>Pi([/\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:()=>Pi([/\bMUSS\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bOPTIONAL\b/])}}),Di=/(?:`[^`]+`)(?!`)/,Ni=/(?:{{[^}]+\?*}})/,ji=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Oi=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,zi=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Mi=/(?:\[=[^=]+=\])/,qi=/(?:\[\^[^^]+\^\])/;function Ui(e){const t=e.slice(2,-2).trim(),[n,r,s]=t.split("/",3).map(e=>e&&e.trim()).filter(e=>!!e),[i,o,a]=t.startsWith("/")?["element-attr",null,n]:s?["attr-value",`${n}/${r}`,s]:r?["element-attr",n,r]:["element",null,n];return It`<code
780
+ `}function Ei(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:t+". ",e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${$i(e.publisher)} `),e.date&&(t+=e.date+". "),e.status&&(t+=(ki.get(e.status)||e.status)+". "),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Ai=Object.freeze({__proto__:null,name:wi,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")||It`<section id="references"></section>`;if(document.querySelector("section#references > h2")||r.prepend(It`<h2>${vi.references}</h2>`),r.classList.add("appendix"),n.length){const e=_i(n,vi.norm_references);r.appendChild(e)}if(t.length){const e=_i(t,vi.info_references);r.appendChild(e)}document.body.appendChild(r)},renderInlineCitation:Ci});const Li="core/inlines",Ti={},Pi=e=>new RegExp(e.map(e=>e.source).join("|")),Ii=Zt({en:{rfc2119Keywords:()=>Pi([/\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:()=>Pi([/\bMUSS\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bOPTIONAL\b/])}}),Di=/(?:`[^`]+`)(?!`)/,Ni=/(?:{{[^}]+\?*}})/,ji=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Oi=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,zi=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Mi=/(?:\[=[^=]+=\])/,qi=/(?:\[\^[^^]+\^\])/;function Wi(e){const t=e.slice(2,-2).trim(),[n,r,s]=t.split("/",3).map(e=>e&&e.trim()).filter(e=>!!e),[i,o,a]=t.startsWith("/")?["element-attr",null,n]:s?["attr-value",`${n}/${r}`,s]:r?["element-attr",n,r]:["element",null,n];return It`<code
781
781
  ><a data-xref-type="${i}" data-xref-for="${o}"
782
782
  >${a}</a
783
783
  ></code
784
- >`}function Wi(e){const t=Kt(e),n=It`<em class="rfc2119">${t}</em>`;return Ti[t]=!0,n}function Fi(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?It`<a href="${t}"></a>`:It`<a data-cite="${t}"></a>`}function Bi(e,t){const n=Kt(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=ai(n);return!!t.parentElement.closest("dfn")?Yi(`\`${r.textContent}\``):r}function Hi(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,i]=r.split("|").map(Kt),{type:o,illegal:a}=cn(s,t.parentElement),c=Ci(s,i),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;wn("Normative references in informative sections are not allowed. ",Li,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==o||a?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function Gi(e,t,n){return"ABBR"===t.parentElement.tagName?e:It`<abbr title="${n.get(e)}">${e}</abbr>`}function Vi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return It`<var data-type="${r}">${n}</var>`}function Ki(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(Kt).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const s=n.substring(0,r),i=n.substring(r+1,n.length);return[t(s),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[s,i]=r.includes("|")?r.split("|",2).map(e=>e.trim()):[null,r],o=Zi(i),a=n?Kt(n):null;return It`<a
784
+ >`}function Ui(e){const t=Kt(e),n=It`<em class="rfc2119">${t}</em>`;return Ti[t]=!0,n}function Fi(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?It`<a href="${t}"></a>`:It`<a data-cite="${t}"></a>`}function Bi(e,t){const n=Kt(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=ai(n);return!!t.parentElement.closest("dfn")?Yi(`\`${r.textContent}\``):r}function Hi(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,i]=r.split("|").map(Kt),{type:o,illegal:a}=cn(s,t.parentElement),c=Ci(s,i),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;wn("Normative references in informative sections are not allowed. ",Li,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==o||a?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function Gi(e,t,n){return"ABBR"===t.parentElement.tagName?e:It`<abbr title="${n.get(e)}">${e}</abbr>`}function Vi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return It`<var data-type="${r}">${n}</var>`}function Ki(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(Kt).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const s=n.substring(0,r),i=n.substring(r+1,n.length);return[t(s),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[s,i]=r.includes("|")?r.split("|",2).map(e=>e.trim()):[null,r],o=Zi(i),a=n?Kt(n):null;return It`<a
785
785
  data-link-type="dfn"
786
786
  data-link-for="${a}"
787
787
  data-xref-for="${a}"
788
788
  data-lt="${s}"
789
789
  >${o}</a
790
- >`}function Yi(e){const t=e.slice(1,-1);return It`<code>${t}</code>`}function Zi(e){return Di.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?Yi(e):Zi(e)):document.createTextNode(e)}var Ji=Object.freeze({__proto__:null,name:Li,rfc2119Usage:Ti,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new pn,e.informativeReferences=new pn,e.respecRFC2119||(e.respecRFC2119=Ti);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=Kt(e),s=Kt(r);t.set(n,s)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,s=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),s=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT),i=[];let o;for(;o=s.nextNode();)i.push(o);return i}(document.body,["#respec-ui",".head","pre"],{wsNodes:!1}),i=Ii.rfc2119Keywords(),o=new RegExp(`(${Pi([i,Ni,ji,Oi,zi,Mi,Di,qi,...r?[r]:[]]).source})`);for(const n of s){const r=n.data.split(o);if(1===r.length)continue;const s=document.createDocumentFragment();let a=!0;for(const o of r)if(a=!a,a)switch(!0){case o.startsWith("{{"):s.append(Bi(o,n));break;case o.startsWith("[[["):s.append(Fi(o));break;case o.startsWith("[["):s.append(...Hi(o,n,e));break;case o.startsWith("|"):s.append(Vi(o));break;case o.startsWith("[="):s.append(Ki(o));break;case o.startsWith("`"):s.append(Yi(o));break;case o.startsWith("[^"):s.append(Ui(o));break;case t.has(o):s.append(Gi(o,n,t));break;case i.test(o):s.append(Wi(o))}else s.append(o);n.replaceWith(s)}}});const Qi="w3c/conformance",Xi=Zt({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)=>It`<p>
790
+ >`}function Yi(e){const t=e.slice(1,-1);return It`<code>${t}</code>`}function Zi(e){return Di.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?Yi(e):Zi(e)):document.createTextNode(e)}var Ji=Object.freeze({__proto__:null,name:Li,rfc2119Usage:Ti,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new pn,e.informativeReferences=new pn,e.respecRFC2119||(e.respecRFC2119=Ti);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=Kt(e),s=Kt(r);t.set(n,s)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,s=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),s=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,e=>n.wsNodes||e.data.trim()?r&&e.parentElement.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT),i=[];let o;for(;o=s.nextNode();)i.push(o);return i}(document.body,["#respec-ui",".head","pre"],{wsNodes:!1}),i=Ii.rfc2119Keywords(),o=new RegExp(`(${Pi([i,Ni,ji,Oi,zi,Mi,Di,qi,...r?[r]:[]]).source})`);for(const n of s){const r=n.data.split(o);if(1===r.length)continue;const s=document.createDocumentFragment();let a=!0;for(const o of r)if(a=!a,a)switch(!0){case o.startsWith("{{"):s.append(Bi(o,n));break;case o.startsWith("[[["):s.append(Fi(o));break;case o.startsWith("[["):s.append(...Hi(o,n,e));break;case o.startsWith("|"):s.append(Vi(o));break;case o.startsWith("[="):s.append(Ki(o));break;case o.startsWith("`"):s.append(Yi(o));break;case o.startsWith("[^"):s.append(Wi(o));break;case t.has(o):s.append(Gi(o,n,t));break;case i.test(o):s.append(Ui(o))}else s.append(o);n.replaceWith(s)}}});const Qi="w3c/conformance",Xi=Zt({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)=>It`<p>
791
791
  The key word${t?"s":""} ${e} in this document
792
792
  ${t?"are":"is"} to be interpreted as described in
793
793
  <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a>
@@ -869,7 +869,7 @@ a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none}
869
869
  .respec-button-copy-paste:is(:disabled,:disabled:hover,.disabled,.disabled:hover){color:rgba(102,102,102,.5);cursor:default;background-color:rgba(229,229,229,.5);background-image:none;border-color:rgba(197,197,197,.5);box-shadow:none}
870
870
  @media print{
871
871
  .respec-button-copy-paste{visibility:hidden}
872
- }`;const Uo="core/webidl",Wo=Uo,Fo={},Bo={},Ho={wrap:e=>e.flat().filter(e=>""!==e).map(e=>"string"==typeof e?new Text(e):e),trivia:e=>e.trim()?It`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?It`<a data-xref-type="interface" data-cite="WEBIDL">${e}</a>`:It`<a data-xref-type="dfn" data-cite="WEBIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type&&"Exposed"!==n.name)return e;let r,s="_IDL_",i=null;switch(t){case"Window":s="interface",i="HTML";break;case"object":s="interface",i="WebIDL";break;default:t.includes("Worker")&&"extended-attribute"===n.type&&(r=t+"GlobalScope",s="interface",i=["Worker","DedicatedWorker","SharedWorker"].includes(t)?"HTML":null)}return It`<a data-xref-type="${s}" data-cite="${i}" data-lt="${r}"
872
+ }`;const Wo="core/webidl",Uo=Wo,Fo={},Bo={},Ho={wrap:e=>e.flat().filter(e=>""!==e).map(e=>"string"==typeof e?new Text(e):e),trivia:e=>e.trim()?It`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?It`<a data-xref-type="interface" data-cite="WEBIDL">${e}</a>`:It`<a data-xref-type="dfn" data-cite="WEBIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type&&"Exposed"!==n.name)return e;let r,s="_IDL_",i=null;switch(t){case"Window":s="interface",i="HTML";break;case"object":s="interface",i="WebIDL";break;default:t.includes("Worker")&&"extended-attribute"===n.type&&(r=t+"GlobalScope",s="interface",i=["Worker","DedicatedWorker","SharedWorker"].includes(t)?"HTML":null)}return It`<a data-xref-type="${s}" data-cite="${i}" data-lt="${r}"
873
873
  >${e}</a
874
874
  >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return It`<span class="idlParamName">${e}</span>`;const r=Go(e,t,n);if("enum-value"!==t.type){const e=n?"idlName":"idlID";r.classList.add(e)}return r},nameless(e,{data:t,parent:n}){switch(t.type){case"operation":case"constructor":return Go(e,t,n);default:return e}},type:e=>It`<span class="idlType">${e}</span>`,inheritance:e=>It`<span class="idlSuperclass">${e}</span>`,definition(e,{data:t,parent:n}){const r=function(e){switch(e.type){case"callback interface":return"idlInterface";case"operation":return"idlMethod";case"field":return"idlMember";case"enum-value":return"idlEnumItem";case"callback function":return"idlCallback"}return`idl${e.type[0].toUpperCase()}${e.type.slice(1)}`}(t);switch(t.type){case"includes":case"enum-value":return It`<span class="${r}">${e}</span>`}const s=n?n.name:"",{name:i,idlId:o}=Ko(t,s);return It`<span
875
875
  class="${r}"
@@ -893,11 +893,11 @@ a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none}
893
893
  data-title="${t.name}"
894
894
  data-xref-type="${o}"
895
895
  >${e}</a
896
- >`;if(s&&"typedef"!==t.type&&!(t.partial&&!i)){const e=_n`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;wn(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?s+"()":s}\` ${t.type}.`,Wo,{elements:[a],hint:e})}return a}const Vo=new WeakMap;function Ko(e,t=""){if(Vo.has(e))return Vo.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);let r=function(e,t){if(!t)return"idl-def-"+e.toLowerCase();return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}((e.special&&""===e.name?"anonymous-":"")+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":r+=function(e){if(!e.partial)return"";Bo[e.name]||(Bo[e.name]=0);return Bo[e.name]+=1,"-partial-"+Bo[e.name]}(e);break;case"constructor":case"operation":{const s=function(e,t){const n=`${t}.${e}`,r=n+"()";let s;Fo[r]||(Fo[r]=0);Fo[n]?s="!overload-"+Fo[n]:Fo[n]=0;return Fo[r]+=1,Fo[n]+=1,s||""}(n,t);s?(n+=s,r+=s):e.arguments.length&&(r+=e.arguments.map(e=>"-"+e.name.toLowerCase()).join(""));break}}return{name:n,idlId:r}}(e,t);return Vo.set(e,n),n}const Yo=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Zo(e,t){let n;try{n=Pt.parse(e.textContent,{sourceName:String(t)})}catch(t){return yn(`Failed to parse WebIDL: ${t.bareMessage}.`,Wo,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=Pt.write(n,{templates:Ho});It.bind(e)`${r}`,ln(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach(e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!Yo.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&so(e,[t])});const s=e.closest("[data-cite], body"),{dataset:i}=s;if(i.cite||(i.cite="WEBIDL"),!/\bwebidl\b/i.test(i.cite)){const e=i.cite.trim().split(/\s+/);i.cite=["WEBIDL",...e].join(" ")}return Jo(e),n}function Jo(e){rn(e,"webidl");const t=It`<span class="idlHeader"
896
+ >`;if(s&&"typedef"!==t.type&&!(t.partial&&!i)){const e=_n`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;wn(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?s+"()":s}\` ${t.type}.`,Uo,{elements:[a],hint:e})}return a}const Vo=new WeakMap;function Ko(e,t=""){if(Vo.has(e))return Vo.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);let r=function(e,t){if(!t)return"idl-def-"+e.toLowerCase();return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}((e.special&&""===e.name?"anonymous-":"")+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":r+=function(e){if(!e.partial)return"";Bo[e.name]||(Bo[e.name]=0);return Bo[e.name]+=1,"-partial-"+Bo[e.name]}(e);break;case"constructor":case"operation":{const s=function(e,t){const n=`${t}.${e}`,r=n+"()";let s;Fo[r]||(Fo[r]=0);Fo[n]?s="!overload-"+Fo[n]:Fo[n]=0;return Fo[r]+=1,Fo[n]+=1,s||""}(n,t);s?(n+=s,r+=s):e.arguments.length&&(r+=e.arguments.map(e=>"-"+e.name.toLowerCase()).join(""));break}}return{name:n,idlId:r}}(e,t);return Vo.set(e,n),n}const Yo=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Zo(e,t){let n;try{n=Pt.parse(e.textContent,{sourceName:String(t)})}catch(t){return yn(`Failed to parse WebIDL: ${t.bareMessage}.`,Uo,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=Pt.write(n,{templates:Ho});It.bind(e)`${r}`,ln(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach(e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!Yo.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&so(e,[t])});const s=e.closest("[data-cite], body"),{dataset:i}=s;if(i.cite||(i.cite="WEBIDL"),!/\bwebidl\b/i.test(i.cite)){const e=i.cite.trim().split(/\s+/);i.cite=["WEBIDL",...e].join(" ")}return Jo(e),n}function Jo(e){rn(e,"webidl");const t=It`<span class="idlHeader"
897
897
  ><a class="self-link" href="${"#"+e.id}">WebIDL</a></span
898
- >`;e.prepend(t),zo(t)}var Qo=Object.freeze({__proto__:null,name:Uo,addIDLHeader:Jo,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=qo,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Zo),r=Pt.validate(n);for(const t of r){let r=`<pre>${Vt(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${Vt(Pt.write(n[t.sourceName]))}</pre>`}yn("WebIDL validation error: "+t.bareMessage,Wo,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const Xo="core/data-cite",ea="__SPEC__";async function ta(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===ea)i=document.location.href;else{const e=await bi(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 na(e,t,n){const{href:r,title:s}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=s),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?ln(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){yn("Exporting an linked external definition is not allowed.",Xo,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function ra(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const sa=ra("#"),ia=ra("/");function oa(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:s,isNormative:i}=r?oa(r):{key:ea,isNormative:!1};return t.cite=i?s:"?"+s,t.citeFrag=n.replace("#",""),oa(e)}const o=r?"#"+r:sa(n),a=s||ia(n).split("#")[0],{type:c}=cn(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 aa(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 ca=Object.freeze({__proto__:null,name:Xo,THIS_SPEC:ea,toCiteDetails:oa,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(oa).map(async e=>({entry:e,result:await bi(e.key)})),n=(await Promise.all(t)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),r=await gi(n);r&&Object.assign(di,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=oa(t),r=await ta(n);if(r)na(t,r,n);else{wn(`Couldn't find a match for "${e}"`,Xo,{elements:[t]})}}En("beforesave",aa)}});const la="core/link-to-dfn",ua=[],da=Zt({en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}});function pa(e){const t=new Map,n=[];for(const r of ro.get(e)){const{dfnFor:s="",dfnType:i="dfn"}=r.dataset;if(t.has(s)&&t.get(s).has(i)){const e=t.get(s).get(i),o="dfn"===e.localName,a="dfn"===r.localName,c=i===(e.dataset.dfnType||"dfn"),l=s===(e.dataset.dfnFor||"");if(o&&a&&c&&l){n.push(r);continue}}const o="idl"in r.dataset||"dfn"!==i?"idl":"dfn";t.has(s)||t.set(s,new Map),t.get(s).set(o,r),sn(r,"dfn",e)}return{result:t,duplicates:n}}function fa(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return on(e).reduce((e,r)=>{const s=r.split(".");return 2===s.length&&e.push({for:s[0],title:s[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e},[])}(e).find(e=>t.has(e.title)&&t.get(e.title).has(e.for));if(!n)return;const r=t.get(n.title).get(n.for),{linkType:s}=e.dataset;if(s){const e="dfn"===s?"dfn":"idl";return r.get(e)||r.get("dfn")}{const e=n.for?"idl":"dfn";return r.get(e)||r.get("idl")}}function ha(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)&&s!==i)r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href="#"+t.id,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),s=ma(e)&&ma(t,n);r&&!s||ln(e,document.createElement("code"))}(e,t),!r}function ma(e,t=""){switch(e.localName){case"a":if(!e.querySelector("code"))return!0;break;default:{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 ga(e){e.forEach(e=>{wn(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,la,{title:"Linking error: not matching `<dfn>`",elements:[e]})})}var ba=Object.freeze({__proto__:null,name:la,possibleExternalLinks:ua,run:async function(e){const t=function(){const e=new gn;for(const t of ro.keys()){const{result:n,duplicates:r}=pa(t);e.set(t,n),r.length>0&&yn(da.duplicateMsg(t),la,{title:da.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){const r=fa(e,t);if(r){ha(e,r,t)||ua.push(e)}else""===e.dataset.cite?n.push(e):ua.push(e)}ga(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:s}=oa(t);r!==ea&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||ga(ua)}});const ya="xrefs",wa=3e5;async function va(){return await Tt.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t));e.createObjectStore(ya,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function ka(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-t<wa)return!1;const r=new URL("meta/version",_a).href,s=await fetch(r);if(!s.ok)return!1;const i=await s.text();return localStorage.setItem(e,n.toString()),parseInt(i,10)>t}())return await async function(){try{await va().then(e=>e.clear(ya))}catch(e){console.error(e)}}(),t;const n=new Set(e.map(e=>e.id));try{const e=await va();let r=await e.transaction(ya).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 $a="core/xref",xa={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},_a="https://respec.org/xref/";if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=qt({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Sa(e){const t="xrefType"in e.dataset;let n=Ca(e);t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=n.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter(e=>e);if(r.length&&t.push(r),n===e)break;n=n.parentElement.closest("[data-cite]")}if(n!==e){const n=e.closest("section"),r=[...n?n.querySelectorAll("a.bibref"):[]].map(e=>e.textContent.toLowerCase());r.length&&t.push(r)}return function(e){const t=[];for(const n of e){const e=t[t.length-1]||[],r=[...new Set(n)].filter(t=>!e.includes(t));t.push(r.sort())}return t}(t)}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),i=function(e,t){if(e.dataset.xrefFor)return Kt(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return Kt(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function Ca(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=Kt(n),"the-empty-string"===n?"":n}function Ra(e,t,n,r){const{term:s,specs:i=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=i.flat().includes(c)?c:a,f=new URL(o,"https://partial"),{pathname:h}=f,m={cite:p,citePath:h,citeFrag:f.hash.slice(1),type:u};d&&(m.linkFor=d[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,s){if(!function(e){const t=e.closest(".normative"),n=e.closest(Mt);return!n||e===t||t&&n&&n.contains(t)}(e))return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t):t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}wn(`Normative reference to "${r}" found but term is defined "informatively" in "${t}".`,$a,{title:"Normative reference to non-normative term.",elements:[e]})}(e,p,l,s,r)}function Ea(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Aa)}function Aa(e){return[...new Uint8Array(e)].map(e=>e.toString(16).padStart(2,"0")).join("")}function La(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 Ta=Object.freeze({__proto__:null,name:$a,API_URL:_a,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:_a,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in xa?Object.assign(n,{specs:xa[e.toLowerCase()]}):r(e);break;case"array":Object.assign(n,{specs:e});break;case"object":if(Object.assign(n,e),e.profile){const t=e.profile.toLowerCase();if(t in xa){const r=(e.specs??[]).concat(xa[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:yn(`Invalid value for \`xref\` configuration option. Received: "${e}".`,$a)}return n;function r(e){yn(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${Gt(Object.keys(xa),e=>`"${e}"`)}.`,$a)}}(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=ua.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=Sa(e);t.id=await Ea(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 ka(r),i=r.filter(e=>!s.get(e.id)),o=await async function(e,t){if(!e.length)return new Map;const n={keys:e},r={method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}},s=await fetch(t,r),i=await s.json();return new Map(i.result)}(i,t);o.size&&await async function(e,t){try{const n=(await va()).transaction(ya,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(ya).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...s,...o])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let i=0,o=e.length;i<o;i++){if(e[i].closest("[data-no-xref]"))continue;const o=e[i],a=t[i],{id:c}=a,l=n.get(c);if(1===l.length)Ra(o,a,l[0],r);else{const e=s[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c).elems.push(o)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(_a);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)=>_n`
898
+ >`;e.prepend(t),zo(t)}var Qo=Object.freeze({__proto__:null,name:Wo,addIDLHeader:Jo,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=qo,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Zo),r=Pt.validate(n);for(const t of r){let r=`<pre>${Vt(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${Vt(Pt.write(n[t.sourceName]))}</pre>`}yn("WebIDL validation error: "+t.bareMessage,Uo,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const Xo="core/data-cite",ea="__SPEC__";async function ta(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===ea)i=document.location.href;else{const e=await bi(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 na(e,t,n){const{href:r,title:s}=t,i=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=s),t.href=r,i){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,e.textContent?ln(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){yn("Exporting an linked external definition is not allowed.",Xo,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function ra(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const sa=ra("#"),ia=ra("/");function oa(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:s,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:s,isNormative:i}=r?oa(r):{key:ea,isNormative:!1};return t.cite=i?s:"?"+s,t.citeFrag=n.replace("#",""),oa(e)}const o=r?"#"+r:sa(n),a=s||ia(n).split("#")[0],{type:c}=cn(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 aa(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 ca=Object.freeze({__proto__:null,name:Xo,THIS_SPEC:ea,toCiteDetails:oa,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(oa).map(async e=>({entry:e,result:await bi(e.key)})),n=(await Promise.all(t)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),r=await gi(n);r&&Object.assign(di,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=oa(t),r=await ta(n);if(r)na(t,r,n);else{wn(`Couldn't find a match for "${e}"`,Xo,{elements:[t]})}}En("beforesave",aa)}});const la="core/link-to-dfn",ua=[],da=Zt({en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"}});function pa(e){const t=new Map,n=[];for(const r of ro.get(e)){const{dfnFor:s="",dfnType:i="dfn"}=r.dataset;if(t.has(s)&&t.get(s).has(i)){const e=t.get(s).get(i),o="dfn"===e.localName,a="dfn"===r.localName,c=i===(e.dataset.dfnType||"dfn"),l=s===(e.dataset.dfnFor||"");if(o&&a&&c&&l){n.push(r);continue}}const o="idl"in r.dataset||"dfn"!==i?"idl":"dfn";t.has(s)||t.set(s,new Map),t.get(s).set(o,r),sn(r,"dfn",e)}return{result:t,duplicates:n}}function fa(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return on(e).reduce((e,r)=>{const s=r.split(".");return 2===s.length&&e.push({for:s[0],title:s[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e},[])}(e).find(e=>t.has(e.title)&&t.get(e.title).has(e.for));if(!n)return;const r=t.get(n.title).get(n.for),{linkType:s}=e.dataset;if(s){const e="dfn"===s?"dfn":"idl";return r.get(e)||r.get("dfn")}{const e=n.for?"idl":"dfn";return r.get(e)||r.get("idl")}}function ha(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)&&s!==i)r=!0;else if(t.classList.contains("externalDFN")){const n=t.dataset.lt?t.dataset.lt.split("|"):[];e.dataset.lt=n[0]||t.textContent,r=!0}else"partial"!==e.dataset.idl?(e.href="#"+t.id,e.classList.add("internalDFN")):r=!0;return e.hasAttribute("data-link-type")||(e.dataset.linkType="idl"in t.dataset?"idl":"dfn"),function(e){if(e.closest("code,pre"))return!0;if(1!==e.childNodes.length)return!1;const[t]=e.childNodes;return"code"===t.localName}(t)&&function(e,t){const n=e.textContent.trim(),r=t.dataset.hasOwnProperty("idl"),s=ma(e)&&ma(t,n);r&&!s||ln(e,document.createElement("code"))}(e,t),!r}function ma(e,t=""){switch(e.localName){case"a":if(!e.querySelector("code"))return!0;break;default:{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 ga(e){e.forEach(e=>{wn(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,la,{title:"Linking error: not matching `<dfn>`",elements:[e]})})}var ba=Object.freeze({__proto__:null,name:la,possibleExternalLinks:ua,run:async function(e){const t=function(){const e=new gn;for(const t of ro.keys()){const{result:n,duplicates:r}=pa(t);e.set(t,n),r.length>0&&yn(da.duplicateMsg(t),la,{title:da.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)");for(const e of r){const r=fa(e,t);if(r){ha(e,r,t)||ua.push(e)}else""===e.dataset.cite?n.push(e):ua.push(e)}ga(n),function(e){const{shortName:t=""}=e,n=new RegExp(String.raw`^([?!])?${t}\b([^-])`,"i"),r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){t.dataset.cite=t.dataset.cite.replace(n,"$1__SPEC__$2");const{key:r,isNormative:s}=oa(t);r!==ea&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||ga(ua)}});const ya="xrefs",wa=3e5;async function va(){return await Tt.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t));e.createObjectStore(ya,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function ka(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-t<wa)return!1;const r=new URL("meta/version",_a).href,s=await fetch(r);if(!s.ok)return!1;const i=await s.text();return localStorage.setItem(e,n.toString()),parseInt(i,10)>t}())return await async function(){try{await va().then(e=>e.clear(ya))}catch(e){console.error(e)}}(),t;const n=new Set(e.map(e=>e.id));try{const e=await va();let r=await e.transaction(ya).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 $a="core/xref",xa={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},_a="https://respec.org/xref/";if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=qt({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Sa(e){const t="xrefType"in e.dataset;let n=Ca(e);t||(n=n.toLowerCase());const r=function(e){const t=[];let n=e.closest("[data-cite]");for(;n;){const r=n.dataset.cite.toLowerCase().replace(/[!?]/g,"").split(/\s+/).filter(e=>e);if(r.length&&t.push(r),n===e)break;n=n.parentElement.closest("[data-cite]")}if(n!==e){const n=e.closest("section"),r=[...n?n.querySelectorAll("a.bibref"):[]].map(e=>e.textContent.toLowerCase());r.length&&t.push(r)}return function(e){const t=[];for(const n of e){const e=t[t.length-1]||[],r=[...new Set(n)].filter(t=>!e.includes(t));t.push(r.sort())}return t}(t)}(e),s=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),i=function(e,t){if(e.dataset.xrefFor)return Kt(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return Kt(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function Ca(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=Kt(n),"the-empty-string"===n?"":n}function Ra(e,t,n,r){const{term:s,specs:i=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=i.flat().includes(c)?c:a,f=new URL(o,"https://partial"),{pathname:h}=f,m={cite:p,citePath:h,citeFrag:f.hash.slice(1),type:u};d&&(m.linkFor=d[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,s){if(!function(e){const t=e.closest(".normative"),n=e.closest(Mt);return!n||e===t||t&&n&&n.contains(t)}(e))return void(s.normativeReferences.has(t)||s.informativeReferences.add(t));if(n){const e=s.informativeReferences.has(t)?s.informativeReferences.getCanonicalKey(t):t;return s.normativeReferences.add(e),void s.informativeReferences.delete(e)}wn(`Normative reference to "${r}" found but term is defined "informatively" in "${t}".`,$a,{title:"Normative reference to non-normative term.",elements:[e]})}(e,p,l,s,r)}function Ea(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Aa)}function Aa(e){return[...new Uint8Array(e)].map(e=>e.toString(16).padStart(2,"0")).join("")}function La(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 Ta=Object.freeze({__proto__:null,name:$a,API_URL:_a,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:_a,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in xa?Object.assign(n,{specs:xa[e.toLowerCase()]}):r(e);break;case"array":Object.assign(n,{specs:e});break;case"object":if(Object.assign(n,e),e.profile){const t=e.profile.toLowerCase();if(t in xa){const r=(e.specs??[]).concat(xa[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:yn(`Invalid value for \`xref\` configuration option. Received: "${e}".`,$a)}return n;function r(e){yn(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${Gt(Object.keys(xa),e=>`"${e}"`)}.`,$a)}}(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=ua.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=Sa(e);t.id=await Ea(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 ka(r),i=r.filter(e=>!s.get(e.id)),o=await async function(e,t){if(!e.length)return new Map;const n={keys:e},r={method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}},s=await fetch(t,r),i=await s.json();return new Map(i.result)}(i,t);o.size&&await async function(e,t){try{const n=(await va()).transaction(ya,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(ya).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...s,...o])}(r,t.url);!function(e,t,n,r){const s={ambiguous:new Map,notFound:new Map};for(let i=0,o=e.length;i<o;i++){if(e[i].closest("[data-no-xref]"))continue;const o=e[i],a=t[i],{id:c}=a,l=n.get(c);if(1===l.length)Ra(o,a,l[0],r);else{const e=s[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c).elems.push(o)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(_a);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)=>_n`
899
899
  [See search matches for "${t}"](${e}) or
900
- ${"[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=Ca(s[0]),o=n(i,e),a=Ht(t,e=>`**[${e}]**`),c=r(o,i);yn(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,$a,{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=Ht(e,e=>`**[${e}]**`),a=Ca(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=_n`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification. ${r(c,a)}.`;yn(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,$a,{title:"Definition is ambiguous.",elements:s,hint:u})}}(s)}(n,r,s,e),En("beforesave",La)},getTermFromElement:Ca});var Pa=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(Mt));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),ln(r,document.createElement("code")),Jo(r)}});var Ia=String.raw`ul.index{columns:30ch;column-gap:1.5em}
900
+ ${"[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=Ca(s[0]),o=n(i,e),a=Ht(t,e=>`**[${e}]**`),c=r(o,i);yn(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,$a,{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=Ht(e,e=>`**[${e}]**`),a=Ca(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=_n`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification. ${r(c,a)}.`;yn(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,$a,{title:"Definition is ambiguous.",elements:s,hint:u})}}(s)}(n,r,s,e),En("beforesave",La)},getTermFromElement:Ca});var Pa=String.raw`ul.index{columns:30ch;column-gap:1.5em}
901
901
  ul.index li{list-style:inherit}
902
902
  ul.index li span{color:inherit;cursor:pointer;white-space:normal}
903
903
  #index-defined-here ul.index li{font-size:.9rem}
@@ -905,31 +905,31 @@ ul.index code{color:inherit}
905
905
  #index-defined-here .print-only{display:none}
906
906
  @media print{
907
907
  #index-defined-here .print-only{display:initial}
908
- }`;const Da=Zt({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),Na=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function ja(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Oa(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function za(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${Oa(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${Oa(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${Oa(e)}</code>`;default:return""}}function Ma(){document.querySelectorAll("#index-defined-here li[data-id]").forEach(e=>e.append((e=>{const t="§"+document.getElementById(e).closest("section").querySelector(".secno").textContent.trim();return It`<span class="print-only">${t}</span>`})(e.dataset.id)))}function qa(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const n=r.href;if(e.has(n))continue;const{type:s,linkFor:i}=r.dataset,o=Ca(r);if(!o)continue;const a=oa(r).key.toUpperCase();(t.get(a)||t.set(a,[]).get(a)).push({term:o,type:s,linkFor:i,elem:r}),e.add(n)}return t}function Ua(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=t;Na.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`<code>${s}</code>`);const i=Fa.has(t)?"type":Wa.get(n);i&&(s+=" "+i);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return It`<li>
908
+ }`;const Ia=Zt({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),Da=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Na(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function ja(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function Oa(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${ja(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${ja(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${ja(e)}</code>`;default:return""}}function za(){document.querySelectorAll("#index-defined-here li[data-id]").forEach(e=>e.append((e=>{const t="§"+document.getElementById(e).closest("section").querySelector(".secno").textContent.trim();return It`<span class="print-only">${t}</span>`})(e.dataset.id)))}function Ma(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const n=r.href;if(e.has(n))continue;const{type:s,linkFor:i}=r.dataset,o=Ca(r);if(!o)continue;const a=oa(r).key.toUpperCase();(t.get(a)||t.set(a,[]).get(a)).push({term:o,type:s,linkFor:i,elem:r}),e.add(n)}return t}function qa(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=t;Da.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`<code>${s}</code>`);const i=Ua.has(t)?"type":Wa.get(n);i&&(s+=" "+i);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return It`<li>
909
909
  <span class="index-term" data-href="${t.href}">${{html:n}}</span>
910
- </li>`}const Wa=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Fa=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 Ba(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 Ha=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void En("toc",()=>{},{once:!0});const t=document.createElement("style");t.textContent=Ia,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2")||e.prepend(It`<h2>${Da.heading}</h2>`);const n=It`<section id="index-defined-here">
911
- <h3>${Da.headlingLocal}</h3>
910
+ </li>`}const Wa=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Ua=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 Fa(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 Ba=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void En("toc",()=>{},{once:!0});const t=document.createElement("style");t.textContent=Pa,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2")||e.prepend(It`<h2>${Ia.heading}</h2>`);const n=It`<section id="index-defined-here">
911
+ <h3>${Ia.headlingLocal}</h3>
912
912
  ${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=Kt(n.textContent);(e.get(t)||e.set(t,[]).get(t)).push(n)}return[...e].sort(([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/))))}();return It`<ul class="index">
913
913
  ${e.map(([e,t])=>function(e,t){const n=(e,t,n)=>{const r="#"+e.id;return It`<li data-id=${e.id}>
914
914
  <a class="index-term" href="${r}">${{html:t}}</a> ${n?{html:n}:""}
915
- </li>`};if(1===t.length){const r=t[0],s=ja(r),i=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(Na.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,s,e),o=za(r,s,e);return n(r,i,o)}return It`<li>
915
+ </li>`};if(1===t.length){const r=t[0],s=Na(r),i=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(Da.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,s,e),o=Oa(r,s,e);return n(r,i,o)}return It`<li>
916
916
  ${e}
917
917
  <ul>
918
- ${t.map(t=>{const r=za(t,ja(t),e)||Da.dfnOf;return n(t,r)})}
918
+ ${t.map(t=>{const r=Oa(t,Na(t),e)||Ia.dfnOf;return n(t,r)})}
919
919
  </ul>
920
920
  </li>`}(e,t))}
921
921
  </ul>`}()}
922
922
  </section>`;e.append(n);const r=It`<section id="index-defined-elsewhere">
923
- <h3>${Da.headingExternal}</h3>
924
- ${function(){const e=[...qa().entries()].sort(([e],[t])=>e.localeCompare(t));return It`<ul class="index">
923
+ <h3>${Ia.headingExternal}</h3>
924
+ ${function(){const e=[...Ma().entries()].sort(([e],[t])=>e.localeCompare(t));return It`<ul class="index">
925
925
  ${e.map(([e,t])=>It`<li data-spec="${e}">
926
926
  ${Ci(e)} defines the following:
927
927
  <ul>
928
- ${t.sort((e,t)=>e.term.localeCompare(t.term)).map(Ua)}
928
+ ${t.sort((e,t)=>e.term.localeCompare(t.term)).map(qa)}
929
929
  </ul>
930
930
  </li>`)}
931
931
  </ul>`}()}
932
- </section>`;e.append(r);for(const e of r.querySelectorAll(".index-term"))sn(e,"index-term");En("toc",Ma,{once:!0}),En("beforesave",Ba)}});const Ga="core/contrib";var Va=Object.freeze({__proto__:null,name:Ga,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void yn(_n`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Ga)}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 It(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=Ht(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await en(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))}catch(e){return yn("Error loading contributors from GitHub.",Ga),console.error(e),null}}}(t,n)}});var Ka=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map(e=>e.querySelector("h1, h2, h3, h4, h5, h6")).filter(e=>e).forEach(e=>{an(e,"h"+Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6))})}});const Ya=["h2","h3","h4","h5","h6"],Za="core/structure",Ja=Zt({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Qa(e,t,{prefix:n=""}={}){let r=!1,s=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=It`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(s=i,r=!0);let e=a.isIntro?"":r?Xa(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(It`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=tc(a.header,n),s=Qa(a.subsections,t,{prefix:e});s&&r.append(s),o.append(r)}}return o}function Xa(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function ec(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(!Ya.includes(r.localName))continue;const s=r.textContent;sn(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:ec(e)})}return n}function tc(e,t){const n=It`<a href="${"#"+t}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach(e=>{const t=an(e,"span");t.className="formerLink",t.removeAttribute("href")}),r.querySelectorAll("dfn").forEach(e=>{an(e,"span").removeAttribute("id")}),It`<li class="tocline">${n}</li>`}var nc=Object.freeze({__proto__:null,name:Za,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter(e=>!e.closest("section.introductory"));if(!e.length)return;e.forEach(e=>{const t="h"+Math.min(un(e,"section").length+1,6);e.localName!==t&&an(e,t)})}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){yn("`data-max-toc` must have a value between 0-6 (inclusive).",Za,{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=Qa(ec(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=It`<nav id="toc"></nav>`,n=It`<h2 class="introductory">${Ja.toc}</h2>`;sn(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=It`<p role="navigation" id="back-to-top">
932
+ </section>`;e.append(r);for(const e of r.querySelectorAll(".index-term"))sn(e,"index-term");En("toc",za,{once:!0}),En("beforesave",Fa)}});const Ha="core/contrib";var Ga=Object.freeze({__proto__:null,name:Ha,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void yn(_n`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Ha)}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 It(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=Ht(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await en(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))}catch(e){return yn("Error loading contributors from GitHub.",Ha),console.error(e),null}}}(t,n)}});var Va=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map(e=>e.querySelector("h1, h2, h3, h4, h5, h6")).filter(e=>e).forEach(e=>{an(e,"h"+Math.min(function(e,t){const n=[];for(;e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6))})}});var Ka=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(Mt));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),ln(r,document.createElement("code")),Jo(r)}});const Ya=["h2","h3","h4","h5","h6"],Za="core/structure",Ja=Zt({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Qa(e,t,{prefix:n=""}={}){let r=!1,s=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=It`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(s=i,r=!0);let e=a.isIntro?"":r?Xa(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(It`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=tc(a.header,n),s=Qa(a.subsections,t,{prefix:e});s&&r.append(s),o.append(r)}}return o}function Xa(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function ec(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(!Ya.includes(r.localName))continue;const s=r.textContent;sn(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:ec(e)})}return n}function tc(e,t){const n=It`<a href="${"#"+t}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach(e=>{const t=an(e,"span");t.className="formerLink",t.removeAttribute("href")}),r.querySelectorAll("dfn").forEach(e=>{an(e,"span").removeAttribute("id")}),It`<li class="tocline">${n}</li>`}var nc=Object.freeze({__proto__:null,name:Za,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter(e=>!e.closest("section.introductory"));if(!e.length)return;e.forEach(e=>{const t="h"+Math.min(un(e,"section").length+1,6);e.localName!==t&&an(e,t)})}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc,10);if(e<0||e>6||Number.isNaN(e)){yn("`data-max-toc` must have a value between 0-6 (inclusive).",Za,{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=Qa(ec(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=It`<nav id="toc"></nav>`,n=It`<h2 class="introductory">${Ja.toc}</h2>`;sn(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=It`<p role="navigation" id="back-to-top">
933
933
  <a href="#title"><abbr title="Back to Top">&uarr;</abbr></a>
934
934
  </p>`;document.body.append(s)}(t)}Rn("toc")}});const rc=Zt({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"}});var sc=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map(e=>e.querySelector("h2, h3, h4, h5, h6")).filter(e=>e).forEach(e=>{e.after(It`<p><em>${rc.informative}</em></p>`)})}});const ic=Zt({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=" "+Kt(t.textContent)),n}}});var oc=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(sn(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=ic.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno"));n.insertAdjacentElement("afterend",It`<a href="${"#"+t}" class="self-link" aria-label="${r}"></a>`)}}});var ac=String.raw`.caniuse-stats{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:baseline}
935
935
  button.caniuse-cell{margin:1px 1px 0 0;border:none}
@@ -1000,16 +1000,16 @@ li.caniuse-cell{margin-bottom:1px}
1000
1000
  download="${c}.${s}"
1001
1001
  type="${o}"
1002
1002
  class="respec-save-button"
1003
- onclick=${()=>pr.closeModal()}
1003
+ onclick=${()=>lr.closeModal()}
1004
1004
  >${i}</a
1005
1005
  >`}(t,e))}
1006
- </div>`;pr.freshModal(kc.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=pr.addCommand(kc.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))},exportDocument:function(e,t){return wn("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",vc,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Tn(t)}});const _c="https://respec.org/specref/",Sc=Zt({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"}}),Cc=pr.addCommand(Sc.search_specref,(function(){const e=It`
1006
+ </div>`;lr.freshModal(kc.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=lr.addCommand(kc.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))},exportDocument:function(e,t){return wn("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",vc,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Tn(t)}});const _c="https://respec.org/specref/",Sc=Zt({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"}}),Cc=lr.addCommand(Sc.search_specref,(function(){const e=It`
1007
1007
  <iframe class="respec-iframe" src="${_c}" onload=${e=>e.target.classList.add("ready")}></iframe>
1008
1008
  <a href="${_c}" target="_blank">Open Search UI in a new tab</a>
1009
- `;pr.freshModal(Sc.search_specref,e,Cc)}),"Ctrl+Shift+Alt+space","🔎");var Rc=Object.freeze({__proto__:null});const Ec="https://respec.org/xref/",Ac={en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"}},Lc=Ac[s in Ac?s:"en"],Tc=pr.addCommand(Lc.title,(function(){const e=It`
1009
+ `;lr.freshModal(Sc.search_specref,e,Cc)}),"Ctrl+Shift+Alt+space","🔎");var Rc=Object.freeze({__proto__:null});const Ec="https://respec.org/xref/",Ac={en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"}},Lc=Ac[s in Ac?s:"en"],Tc=lr.addCommand(Lc.title,(function(){const e=It`
1010
1010
  <iframe class="respec-iframe" src="${Ec}" onload="${e=>e.target.classList.add("ready")}"></iframe>
1011
1011
  <a href="${Ec}" target="_blank">Open Search UI in a new tab</a>
1012
- `;pr.freshModal(Lc.title,e,Tc)}),"Ctrl+Shift+Alt+x","📚");var Pc=Object.freeze({__proto__:null});const Ic=Zt({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const Dc=document.createElement("div"),Nc=It.bind(Dc),jc=pr.addCommand(`${Ic.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(Oc).forEach(t=>{e.push(t)});Nc`
1012
+ `;lr.freshModal(Lc.title,e,Tc)}),"Ctrl+Shift+Alt+x","📚");var Pc=Object.freeze({__proto__:null});const Ic=Zt({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const Dc=document.createElement("div"),Nc=It.bind(Dc),jc=lr.addCommand(`${Ic.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(Oc).forEach(t=>{e.push(t)});Nc`
1013
1013
  <p>
1014
1014
  ReSpec is a document production toolchain, with a notable focus on W3C specifications.
1015
1015
  </p>
@@ -1033,12 +1033,12 @@ li.caniuse-cell{margin-bottom:1px}
1033
1033
  </thead>
1034
1034
  <tbody>${e}</tbody>
1035
1035
  </table>
1036
- `,pr.freshModal(`${Ic.about_respec} - ${window.respecVersion}`,Dc,jc)}),"Ctrl+Shift+Alt+A","ℹ️");function Oc({name:e,duration:t}){return It`
1036
+ `,lr.freshModal(`${Ic.about_respec} - ${window.respecVersion}`,Dc,jc)}),"Ctrl+Shift+Alt+A","ℹ️");function Oc({name:e,duration:t}){return It`
1037
1037
  <tr>
1038
1038
  <td><a href="${`https://github.com/w3c/respec/blob/develop/src/${e}.js`}">${e}</a></td>
1039
1039
  <td>${t}</td>
1040
1040
  </tr>
1041
- `}var zc=Object.freeze({__proto__:null});var Mc=Object.freeze({__proto__:null,name:"core/seo",run:function(){const e=document.querySelector("#abstract p:first-of-type");if(!e)return;const t=e.textContent.replace(/\s+/," ").trim(),n=document.createElement("meta");n.name="description",n.content=t,document.head.appendChild(n)}});const qc="w3c/seo",Uc={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",PER:"w3p:PER",RSCND:"w3p:RSCND"},Wc=new Set([...Kr,...Yr,...Zr,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Fc({name:e,url:t,mailto:n,company:r,companyURL:s}){const i={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||s)&&(i.worksFor={name:r,url:s}),i}function Bc(e){const{href:t,title:n,href:r}=e,s={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(s.creator=e.authors.map(e=>({name:e}))),e.rawDate&&(s.publishedDate=e.rawDate),e.isbn&&(s.identifier=e.isbn),e.publisher&&(s.publisher={name:e.publisher}),s}var Hc=Object.freeze({__proto__:null,name:qc,requiresCanonicalLink:Wc,run:async function(e){if((e.canonicalURI||Wc.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{wn("Canonical URI set to edDraft, but no edDraftURI is set in configuration",qc),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{wn("Canonical URI set to TR, but no shortName is set in configuration",qc),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=It`<link rel="canonical" href="${e.canonicalURI}" />`;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Uc[e.specStatus],r=["TechArticle"];n&&r.push(n);const s={"@context":["http://schema.org",{"@vocab":"http://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:r,name:document.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo?.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];s.copyrightHolder=[s.copyrightHolder,...t.map(e=>({name:e}))]}const i=t.head.querySelector("meta[name=description]");i&&(s.description=i.content);e.editors&&(s.editor=e.editors.map(Fc));e.authors&&(s.contributor=e.authors.map(Fc));const o=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(o.map(e=>bi(e)));s.citation=a.filter(e=>"object"==typeof e).map(Bc);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(s,null,2),t.head.appendChild(c)}(e,document)}}});var Gc=String.raw`.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa}
1041
+ `}var zc=Object.freeze({__proto__:null});var Mc=Object.freeze({__proto__:null,name:"core/seo",run:function(){const e=document.querySelector("#abstract p:first-of-type");if(!e)return;const t=e.textContent.replace(/\s+/," ").trim(),n=document.createElement("meta");n.name="description",n.content=t,document.head.appendChild(n)}});const qc="w3c/seo",Wc={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",PER:"w3p:PER",RSCND:"w3p:RSCND"},Uc=new Set([...Hr,...Gr,...Vr,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Fc({name:e,url:t,mailto:n,company:r,companyURL:s}){const i={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||s)&&(i.worksFor={name:r,url:s}),i}function Bc(e){const{href:t,title:n,href:r}=e,s={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(s.creator=e.authors.map(e=>({name:e}))),e.rawDate&&(s.publishedDate=e.rawDate),e.isbn&&(s.identifier=e.isbn),e.publisher&&(s.publisher={name:e.publisher}),s}var Hc=Object.freeze({__proto__:null,name:qc,requiresCanonicalLink:Uc,run:async function(e){if((e.canonicalURI||Uc.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{wn("Canonical URI set to edDraft, but no edDraftURI is set in configuration",qc),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{wn("Canonical URI set to TR, but no shortName is set in configuration",qc),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=It`<link rel="canonical" href="${e.canonicalURI}" />`;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Wc[e.specStatus],r=["TechArticle"];n&&r.push(n);const s={"@context":["http://schema.org",{"@vocab":"http://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:r,name:document.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo?.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];s.copyrightHolder=[s.copyrightHolder,...t.map(e=>({name:e}))]}const i=t.head.querySelector("meta[name=description]");i&&(s.description=i.content);e.editors&&(s.editor=e.editors.map(Fc));e.authors&&(s.contributor=e.authors.map(Fc));const o=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(o.map(e=>bi(e)));s.citation=a.filter(e=>"object"==typeof e).map(Bc);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(s,null,2),t.head.appendChild(c)}(e,document)}}});var Gc=String.raw`.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa}
1042
1042
  .hljs-comment,.hljs-quote{color:#717277;font-style:italic}
1043
1043
  .hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}
1044
1044
  .hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#ca4706;font-weight:700}
@@ -1136,15 +1136,15 @@ var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6p
1136
1136
  var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#000;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400}
1137
1137
  var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var kl=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=vl,document.head.appendChild(t);let n=null;const r=new Map,s=document.querySelectorAll("section var");for(const e of s){const t=e.closest("section");if(n!==t&&(n=t,r.clear()),e.dataset.type){r.set(e.textContent.trim(),e.dataset.type);continue}const s=r.get(e.textContent.trim());s&&(e.dataset.type=s)}}});var $l=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var xl=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){if(Array.from(document.querySelectorAll("ol.algorithm li")).filter(e=>e.textContent.trim().startsWith("Assert: ")).forEach(e=>e.classList.add("assert")),document.querySelector(".assert")){const e=document.createElement("style");e.textContent=$l,document.head.appendChild(e)}}});const _l="core/anchor-expander";function Sl(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void yn(`Found matching element "${t}", but it has no title or marker.`,_l,{title:"Missing title.",elements:[n]})}const s=fn(r);n.append(...s.childNodes),n.classList.add("box-ref")}function Cl(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void yn(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,_l,{title:"Missing figcaption in referenced figure.",elements:[n]})}const s=[...fn(r).childNodes].filter(e=>!e.classList||!e.classList.contains("fig-title"));s.pop(),n.append(...s),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=Kt(i.textContent))}function Rl(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)El(r,n),Al(r,n);else{n.textContent=n.getAttribute("href");yn("Found matching section, but the section was lacking a heading element.",_l,{title:`No matching id in document: "${t}".`,elements:[n]})}}function El(e,t){const n=e.querySelector(".self-link"),r=[...fn(e).childNodes].filter(e=>!e.classList||!e.classList.contains("self-link"));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=t.lastChild.textContent.trimEnd()),t.querySelectorAll("a").forEach(e=>{const t=an(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)})}function Al(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const s=t.closest(`[${n}]`);s&&s.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Ll=Object.freeze({__proto__:null,name:_l,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":El(n,t);break;case"section":Rl(n,e,t);break;case"figure":Cl(n,e,t);break;case"aside":case"div":Sl(n,e,t);break;default:t.textContent=t.getAttribute("href");yn("ReSpec doesn't support expanding this kind of reference.",_l,{title:`Can't expand "#${e}".`,elements:[t]})}Al(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");yn(`Couldn't expand inline reference. The id "${e}" is not in the document.`,_l,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});const Tl="rs-changelog",Pl=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;It.bind(this)`
1138
1138
  <ul>
1139
- ${{any:Il(e,t,n).then(e=>async function(e){const{repoURL:t}=await _s;return e.map(e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,i=r&&It` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return It`<li><a href="${s}">${n.trim()}</a>${i}</li>`})}(e)).catch(e=>yn(e.message,Tl,{elements:[this]})).finally(()=>{this.dispatchEvent(new CustomEvent("done"))}),placeholder:"Loading list of commits..."}}
1139
+ ${{any:Il(e,t,n).then(e=>async function(e){const{repoURL:t}=await vs;return e.map(e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,i=r&&It` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return It`<li><a href="${s}">${n.trim()}</a>${i}</li>`})}(e)).catch(e=>yn(e.message,Tl,{elements:[this]})).finally(()=>{this.dispatchEvent(new CustomEvent("done"))}),placeholder:"Loading list of commits..."}}
1140
1140
  </ul>
1141
- `}};async function Il(e,t,n){let r;try{const s=await _s;if(!s)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${s.apiBase}/${s.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const o=await fetch(i.href);if(!o.ok)throw new Error(`Request to ${i} failed with status code ${o.status}`);if(r=await o.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t="Error loading commits from GitHub. "+e.message;throw console.error(e),new Error(t)}return r}const Dl=[Object.freeze({__proto__:null,name:Tl,element:Pl})];var Nl=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Dl.forEach(e=>{customElements.define(e.name,e.element)});const e=Dl.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 jl=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),s=n?"removeOnSave":null;document.head.append(It`<meta
1141
+ `}};async function Il(e,t,n){let r;try{const s=await vs;if(!s)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${s.apiBase}/${s.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const o=await fetch(i.href);if(!o.ok)throw new Error(`Request to ${i} failed with status code ${o.status}`);if(r=await o.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t="Error loading commits from GitHub. "+e.message;throw console.error(e),new Error(t)}return r}const Dl=[Object.freeze({__proto__:null,name:Tl,element:Pl})];var Nl=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Dl.forEach(e=>{customElements.define(e.name,e.element)});const e=Dl.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 jl=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),s=n?"removeOnSave":null;document.head.append(It`<meta
1142
1142
  name="monetization"
1143
1143
  content="${r}"
1144
1144
  class="${s}"
1145
- />`)}});const Ol="core/before-save";var zl=Object.freeze({__proto__:null,name:Ol,run:function(e){if(e.beforeSave)if(Array.isArray(e.beforeSave)&&!e.beforeSave.some(e=>"function"!=typeof e||"AsyncFunction"===e.constructor.name))En("beforesave",t=>{!function(e,t){let n=0;for(const r of e)try{r(t)}catch(e){yn(_n`Function ${`\`${r.name}\``||"at position "+n}\` threw an error during processing of ${"[beforeSave]"}.`,Ol,{hint:"See developer console."}),console.error(e)}finally{n++}}(e.beforeSave,t.ownerDocument)},{once:!0});else{yn(_n`${"[beforeSave]"} configuration option must be an array of synchronous JS functions.`,Ol)}}});const Ml="check-charset",ql="core/linter-rules/check-charset",Ul=Zt({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var Wl=Object.freeze({__proto__:null,name:ql,run:function(e){if(!e.lint?.[Ml])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||wn(Ul.msg,ql,{hint:Ul.hint,elements:[...t]})}});const Fl="check-punctuation",Bl="core/linter-rules/check-punctuation",Hl=[".",":","!","?"],Gl=Zt({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Hl.map(e=>`"${e}"`).join(", ")}.`}});var Vl=Object.freeze({__proto__:null,name:Bl,run:function(e){if(!e.lint?.[Fl])return;const t=new RegExp(`[${Hl.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter(e=>!t.test(e.textContent.trim()));n.length&&wn(Gl.msg,Bl,{hint:Gl.hint,elements:n})}});const Kl="check-internal-slots",Yl="core/linter-rules/check-internal-slots",Zl=Zt({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var Jl=Object.freeze({__proto__:null,name:Yl,run:function(e){if(!e.lint?.[Kl])return;const t=[...document.querySelectorAll("var+a")].filter(({previousSibling:{nodeName:e}})=>e&&"VAR"===e);t.length&&wn(Zl.msg,Yl,{hint:Zl.hint,elements:t})}});const Ql="local-refs-exist",Xl="core/linter-rules/local-refs-exist",eu=Zt({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function tu(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var nu=Object.freeze({__proto__:null,name:Xl,run:function(e){if(!e.lint?.[Ql])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(tu);t.length&&wn(eu.msg,Xl,{hint:eu.hint,elements:t})}});const ru="no-unused-dfns",su="core/linter-rules/no-unused-dfns",iu=Zt({en:{msg:e=>`Found definition for "${e}", but nothing links to it. This is usually a spec bug!`,get hint(){return _n`Either remove the definition, or add a \`"lint-ignore"\` CSS class. If you meant to export it, add the ${"[export|#data-export]"} CSS.`}}});function ou(e){return!document.querySelector(`a[href="#${e.id}"]:not(.index-term, .self-link)`)}var au=Object.freeze({__proto__:null,name:su,run:function(e){if(!e.lint?.[ru])return;const t="error"===e.lint[ru]?yn:wn;[...document.querySelectorAll("dfn:not(.lint-ignore, [data-export], [data-cite])")].filter(ou).forEach(e=>{const n=[e],r=Kt(e.textContent);t(iu.msg(r),su,{elements:n,hint:iu.hint})})}});const cu="no-headingless-sections",lu="core/linter-rules/no-headingless-sections",uu=Zt({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>`。"}}),du=({firstElementChild:e})=>null===e||!1===/^h[1-6]$/.test(e.localName);var pu=Object.freeze({__proto__:null,name:lu,run:function(e){if(!e.lint?.[cu])return;const t=[...document.querySelectorAll("section")].filter(du);t.length&&wn(uu.msg,lu,{hint:uu.hint,elements:t})}});const fu="no-unused-vars",hu="core/linter-rules/no-unused-vars",mu=Zt({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var gu=Object.freeze({__proto__:null,name:hu,run:function(e){if(!e.lint?.[fu])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const s=new Map;for(const e of r){const t=Kt(e.textContent);(s.get(t)||s.set(t,[]).get(t)).push(e)}for(const e of s.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&wn(mu.msg,hu,{hint:mu.hint,elements:t})}});const bu="required-sections",yu="w3c/linter-rules/required-sections",wu={en:{msg:e=>`W3C Recommendation track documents require a separate "${e}" section.`,hint:e=>_n`Add a \`<section>\` with a "${e}" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1145
+ />`)}});const Ol="core/before-save";var zl=Object.freeze({__proto__:null,name:Ol,run:function(e){if(e.beforeSave)if(Array.isArray(e.beforeSave)&&!e.beforeSave.some(e=>"function"!=typeof e||"AsyncFunction"===e.constructor.name))En("beforesave",t=>{!function(e,t){let n=0;for(const r of e)try{r(t)}catch(e){yn(_n`Function ${`\`${r.name}\``||"at position "+n}\` threw an error during processing of ${"[beforeSave]"}.`,Ol,{hint:"See developer console."}),console.error(e)}finally{n++}}(e.beforeSave,t.ownerDocument)},{once:!0});else{yn(_n`${"[beforeSave]"} configuration option must be an array of synchronous JS functions.`,Ol)}}});const Ml="check-charset",ql="core/linter-rules/check-charset",Wl=Zt({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var Ul=Object.freeze({__proto__:null,name:ql,run:function(e){if(!e.lint?.[Ml])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||wn(Wl.msg,ql,{hint:Wl.hint,elements:[...t]})}});const Fl="check-punctuation",Bl="core/linter-rules/check-punctuation",Hl=[".",":","!","?"],Gl=Zt({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Hl.map(e=>`"${e}"`).join(", ")}.`}});var Vl=Object.freeze({__proto__:null,name:Bl,run:function(e){if(!e.lint?.[Fl])return;const t=new RegExp(`[${Hl.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter(e=>!t.test(e.textContent.trim()));n.length&&wn(Gl.msg,Bl,{hint:Gl.hint,elements:n})}});const Kl="check-internal-slots",Yl="core/linter-rules/check-internal-slots",Zl=Zt({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var Jl=Object.freeze({__proto__:null,name:Yl,run:function(e){if(!e.lint?.[Kl])return;const t=[...document.querySelectorAll("var+a")].filter(({previousSibling:{nodeName:e}})=>e&&"VAR"===e);t.length&&wn(Zl.msg,Yl,{hint:Zl.hint,elements:t})}});const Ql="local-refs-exist",Xl="core/linter-rules/local-refs-exist",eu=Zt({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function tu(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var nu=Object.freeze({__proto__:null,name:Xl,run:function(e){if(!e.lint?.[Ql])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(tu);t.length&&wn(eu.msg,Xl,{hint:eu.hint,elements:t})}});const ru="no-unused-dfns",su="core/linter-rules/no-unused-dfns",iu=Zt({en:{msg:e=>`Found definition for "${e}", but nothing links to it. This is usually a spec bug!`,get hint(){return _n`Either remove the definition, or add a \`"lint-ignore"\` CSS class. If you meant to export it, add the ${"[export|#data-export]"} CSS.`}}});function ou(e){return!document.querySelector(`a[href="#${e.id}"]:not(.index-term, .self-link)`)}var au=Object.freeze({__proto__:null,name:su,run:function(e){if(!e.lint?.[ru])return;const t="error"===e.lint[ru]?yn:wn;[...document.querySelectorAll("dfn:not(.lint-ignore, [data-export], [data-cite])")].filter(ou).forEach(e=>{const n=[e],r=Kt(e.textContent);t(iu.msg(r),su,{elements:n,hint:iu.hint})})}});const cu="no-headingless-sections",lu="core/linter-rules/no-headingless-sections",uu=Zt({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>`。"}}),du=({firstElementChild:e})=>null===e||!1===/^h[1-6]$/.test(e.localName);var pu=Object.freeze({__proto__:null,name:lu,run:function(e){if(!e.lint?.[cu])return;const t=[...document.querySelectorAll("section")].filter(du);t.length&&wn(uu.msg,lu,{hint:uu.hint,elements:t})}});const fu="no-unused-vars",hu="core/linter-rules/no-unused-vars",mu=Zt({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var gu=Object.freeze({__proto__:null,name:hu,run:function(e){if(!e.lint?.[fu])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const s=new Map;for(const e of r){const t=Kt(e.textContent);(s.get(t)||s.set(t,[]).get(t)).push(e)}for(const e of s.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&wn(mu.msg,hu,{hint:mu.hint,elements:t})}});const bu="required-sections",yu="w3c/linter-rules/required-sections",wu={en:{msg:e=>`W3C Recommendation track documents require a separate "${e}" section.`,hint:e=>_n`Add a \`<section>\` with a "${e}" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1146
1146
  If the document is not intended for the W3C Recommendation track, set ${"[noRecTrack]"} to \`true\`
1147
1147
  or turn off the ${`[${bu}]`} linter rule.`,privacy_considerations:"Privacy Considerations",security_considerations:"Security Considerations"},es:{msg:e=>`Documentos que van a ser "W3C Recommendation" requieren una sección "${e}" separada.`,hint:e=>_n`Agrega una \`<section>\` con título "${e}". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1148
1148
  Si el documento no está destinado a ser un W3C Recommendation, puedes poner ${"[noRecTrack]"} a \`true\`
1149
- o apaga la regla de linter ${`[${bu}]`}.`,privacy_considerations:"Consideraciones de privacidad",security_considerations:"Consideraciones de Seguridad"}},vu=Zt(wu),ku=new Set([...Yr,"ED"]);ku.delete("DISC");var $u=Object.freeze({__proto__:null,name:yu,requiresSomeSectionStatus:ku,run:function(e){if(!e.lint?.[bu])return;if(!wu[Yt(s)])return void console.warn(`Missing localization strings for ${s}.`);if(e.noRecTrack||!ku.has(e.specStatus))return;const t="error"===e.lint[bu]?yn:wn,n=new pn([vu.privacy_considerations,vu.security_considerations]),r=document.querySelectorAll("h2, h3, h4, h5, h6");for(const e of r){const t=e.cloneNode(!0);t.querySelectorAll("bdi, .self-link")?.forEach(e=>e.remove());const r=Kt(t.textContent);if(n.has(r)&&(n.delete(r),0===n.size))return}for(const e of n)t(vu.msg(e),yu,{hint:vu.hint(e)})}});const xu="wpt-tests-exist",_u="core/linter-rules/wpt-tests-exist",Su=Zt({en:{msg:"The following test could not be found in Web Platform Tests:",hint:"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed."}});var Cu=Object.freeze({__proto__:null,name:_u,run:async function(e){if(!e.lint?.[xu])return;const t=await async function(e,t){let n;try{const t=new URL(e);if(t.pathname.startsWith("/web-platform-tests/wpt/tree/master/")){const e=/web-platform-tests\/wpt\/tree\/master\/(.+)/;n=t.pathname.match(e)[1].replace(/\//g,"")}else n=t.pathname.replace(/\//g,"")}catch(e){return wn("Failed to parse WPT directory from testSuiteURI","linter/"+_u),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",t+"/");r.searchParams.set("path",n);const s=await fetch(r);if(!s.ok){return wn(`Failed to fetch files from WPT repository. Request failed with error: ${await s.text()} (${s.status})`,"linter/"+_u),null}const{entries:i}=await s.json(),o=i.filter(e=>!e.endsWith("/"));return new Set(o)}(e.testSuiteURI,e.githubAPI);if(!t)return;const n=[...document.querySelectorAll("[data-tests]")].filter(e=>e.dataset.tests);for(const e of n)e.dataset.tests.split(/,/gm).map(e=>e.trim().split("#")[0]).filter(e=>e&&!t.has(e)).map(t=>{wn(`${Su.msg} \`${t}\`.`,_u,{hint:Su.hint,elements:[e]})})}});const Ru="no-http-props",Eu="core/linter-rules/no-http-props",Au=Zt({en:{msg:_n`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:_n`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var Lu=Object.freeze({__proto__:null,name:Eu,run:function(e){if(!e.lint?.[Ru])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=Ht(t,e=>_n`${`[${e}]`}`);wn(Au.msg,Eu,{hint:Au.hint+e})}}});const Tu="core/linter-rules/a11y",Pu=["color-contrast","landmark-one-main","landmark-unique","region"];function Iu(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),s=r.map(e=>"- "+e.trimEnd()).join("\n");t.push(`${e}${s}`)}return t.join("\n\n")}var Du=Object.freeze({__proto__:null,name:Tu,run:async function(e){if(!e.lint?.a11y&&!e.a11y)return;const t=e.lint?.a11y||e.a11y,n=!0===t?{}:t,r=await async function(e){const{rules:t,...n}=e,r={rules:{...Object.fromEntries(Pu.map(e=>[e,{enabled:!1}])),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let s;try{s=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://unpkg.com/axe-core@4/axe.min.js",document.head.appendChild(e),new Promise((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n})}()}catch(e){return yn("Failed to load a11y linter.",Tu),console.error(e),[]}try{return(await s.run(document,r)).violations}catch(e){return yn("Error while looking for a11y issues.",Tu),console.error(e),[]}}(n);for(const e of r){const t=new Map;for(const n of e.nodes){const{failureSummary:e,element:r}=n;(t.get(e)||t.set(e,[]).get(e)).push(r)}const{id:n,help:r,description:s,helpUrl:i}=e,o=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=Iu(e);wn(o,Tu,{details:`\n\n${s}.\n\n${t}. ([Learn more](${i}))`,elements:n})}}}}),Nu=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),ju=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}();
1149
+ o apaga la regla de linter ${`[${bu}]`}.`,privacy_considerations:"Consideraciones de privacidad",security_considerations:"Consideraciones de Seguridad"}},vu=Zt(wu),ku=new Set([...Gr,"ED"]);ku.delete("DISC");var $u=Object.freeze({__proto__:null,name:yu,requiresSomeSectionStatus:ku,run:function(e){if(!e.lint?.[bu])return;if(!wu[Yt(s)])return void console.warn(`Missing localization strings for ${s}.`);if(e.noRecTrack||!ku.has(e.specStatus))return;const t="error"===e.lint[bu]?yn:wn,n=new pn([vu.privacy_considerations,vu.security_considerations]),r=document.querySelectorAll("h2, h3, h4, h5, h6");for(const e of r){const t=e.cloneNode(!0);t.querySelectorAll("bdi, .self-link")?.forEach(e=>e.remove());const r=Kt(t.textContent);if(n.has(r)&&(n.delete(r),0===n.size))return}for(const e of n)t(vu.msg(e),yu,{hint:vu.hint(e)})}});const xu="wpt-tests-exist",_u="core/linter-rules/wpt-tests-exist",Su=Zt({en:{msg:"The following test could not be found in Web Platform Tests:",hint:"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed."}});var Cu=Object.freeze({__proto__:null,name:_u,run:async function(e){if(!e.lint?.[xu])return;const t=await async function(e,t){let n;try{const t=new URL(e);if(t.pathname.startsWith("/web-platform-tests/wpt/tree/master/")){const e=/web-platform-tests\/wpt\/tree\/master\/(.+)/;n=t.pathname.match(e)[1].replace(/\//g,"")}else n=t.pathname.replace(/\//g,"")}catch(e){return wn("Failed to parse WPT directory from testSuiteURI","linter/"+_u),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",t+"/");r.searchParams.set("path",n);const s=await fetch(r);if(!s.ok){return wn(`Failed to fetch files from WPT repository. Request failed with error: ${await s.text()} (${s.status})`,"linter/"+_u),null}const{entries:i}=await s.json(),o=i.filter(e=>!e.endsWith("/"));return new Set(o)}(e.testSuiteURI,e.githubAPI);if(!t)return;const n=[...document.querySelectorAll("[data-tests]")].filter(e=>e.dataset.tests);for(const e of n)e.dataset.tests.split(/,/gm).map(e=>e.trim().split("#")[0]).filter(e=>e&&!t.has(e)).map(t=>{wn(`${Su.msg} \`${t}\`.`,_u,{hint:Su.hint,elements:[e]})})}});const Ru="no-http-props",Eu="core/linter-rules/no-http-props",Au=Zt({en:{msg:_n`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:_n`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"}});var Lu=Object.freeze({__proto__:null,name:Eu,run:function(e){if(!e.lint?.[Ru])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=Ht(t,e=>_n`${`[${e}]`}`);wn(Au.msg,Eu,{hint:Au.hint+e})}}});const Tu="core/linter-rules/a11y",Pu=["color-contrast","landmark-one-main","landmark-unique","region"];function Iu(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),s=r.map(e=>"- "+e.trimEnd()).join("\n");t.push(`${e}${s}`)}return t.join("\n\n")}var Du=Object.freeze({__proto__:null,name:Tu,run:async function(e){if(!e.lint?.a11y&&!e.a11y)return;const t=e.lint?.a11y||e.a11y,n=!0===t?{}:t,r=await async function(e){const{rules:t,...n}=e,r={rules:{...Object.fromEntries(Pu.map(e=>[e,{enabled:!1}])),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let s;try{s=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://unpkg.com/axe-core@4/axe.min.js",document.head.appendChild(e),new Promise((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n})}()}catch(e){return yn("Failed to load a11y linter.",Tu),console.error(e),[]}try{return(await s.run(document,r)).violations}catch(e){return yn("Error while looking for a11y issues.",Tu),console.error(e),[]}}(n);for(const e of r){const t=new Map;for(const n of e.nodes){const{failureSummary:e,element:r}=n;(t.get(e)||t.set(e,[]).get(e)).push(r)}const{id:n,help:r,description:s,helpUrl:i}=e,o=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=Iu(e);wn(o,Tu,{details:`\n\n${s}.\n\n${t}. ([Learn more](${i}))`,elements:n})}}}}),Nu=Object.freeze({__proto__:null,default:'// ReSpec Worker v1.0.0\n"use strict";\ntry {\n importScripts("https://www.w3.org/Tools/respec/respec-highlight");\n} catch (err) {\n console.error("Network error loading highlighter", err);\n}\n\nself.addEventListener("message", ({ data: originalData }) => {\n const data = Object.assign({}, originalData);\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, propName, lang } = data;\n importScripts(langURL);\n self.hljs.registerLanguage(lang, self[propName]);\n break;\n }\n case "highlight": {\n const { code } = data;\n const langs = data.languages.length ? data.languages : undefined;\n try {\n const { value, language } = self.hljs.highlightAuto(code, langs);\n Object.assign(data, { value, language });\n } catch (err) {\n console.error("Could not transform some code?", err);\n // Post back the original code\n Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'}),ju=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (document.respec) {\n document.respec.ready.then(setupPanel);\n} else {\n setupPanel();\n}\n\nfunction setupPanel() {\n const listener = panelListener();\n document.body.addEventListener("keydown", listener);\n document.body.addEventListener("click", listener);\n}\n\nfunction panelListener() {\n /** @type {HTMLElement} */\n let panel = null;\n return event => {\n const { target, type } = event;\n\n if (!(target instanceof HTMLElement)) return;\n\n // For keys, we only care about Enter key to activate the panel\n // otherwise it\'s activated via a click.\n if (type === "keydown" && event.key !== "Enter") return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement} */\n const dfn = target.closest("dfn, .index-term");\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n const coords = deriveCoordinates(event);\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n panel.style.left = null;\n panel.style.top = null;\n panel.classList.add("docked");\n break;\n }\n case "hide": {\n hidePanel(panel);\n panel = null;\n break;\n }\n }\n };\n}\n\n/**\n * @param {MouseEvent|KeyboardEvent} event\n */\nfunction deriveCoordinates(event) {\n const target = /** @type HTMLElement */ (event.target);\n\n // We prevent synthetic AT clicks from putting\n // the dialog in a weird place. The AT events sometimes\n // lack coordinates, so they have clientX/Y = 0\n const rect = target.getBoundingClientRect();\n if (\n event instanceof MouseEvent &&\n event.clientX >= rect.left &&\n event.clientY >= rect.top\n ) {\n // The event probably happened inside the bounding rect...\n return { x: event.clientX, y: event.clientY };\n }\n\n // Offset to the middle of the element\n const x = rect.x + rect.width / 2;\n // Placed at the bottom of the element\n const y = rect.y + rect.height;\n return { x, y };\n}\n\n/**\n * @param {Event} event\n */\nfunction deriveAction(event) {\n const target = /** @type {HTMLElement} */ (event.target);\n const hitALink = !!target.closest("a");\n if (target.closest("dfn:not([data-cite]), .index-term")) {\n return hitALink ? "none" : "show";\n }\n if (target.closest(".dfn-panel")) {\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n const panel = target.closest(".dfn-panel");\n return panel.classList.contains("docked") ? "hide" : "none";\n }\n if (document.querySelector(".dfn-panel:not([hidden])")) {\n return "hide";\n }\n return "none";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {HTMLElement} panel\n * @param {{ x: number, y: number }} clickPosition\n */\nfunction displayPanel(dfn, panel, { x, y }) {\n panel.hidden = false;\n // distance (px) between edge of panel and the pointing triangle (caret)\n const MARGIN = 20;\n\n const dfnRects = dfn.getClientRects();\n // Find the `top` offset when the `dfn` can be spread across multiple lines\n let closestTop = 0;\n let minDiff = Infinity;\n for (const rect of dfnRects) {\n const { top, bottom } = rect;\n const diffFromClickY = Math.abs((top + bottom) / 2 - y);\n if (diffFromClickY < minDiff) {\n minDiff = diffFromClickY;\n closestTop = top;\n }\n }\n\n const top = window.scrollY + closestTop + dfnRects[0].height;\n const left = x - MARGIN;\n panel.style.left = `${left}px`;\n panel.style.top = `${top}px`;\n\n // Find if the panel is flowing out of the window\n const panelRect = panel.getBoundingClientRect();\n const SCREEN_WIDTH = Math.min(window.innerWidth, window.screen.width);\n if (panelRect.right > SCREEN_WIDTH) {\n const newLeft = Math.max(MARGIN, x + MARGIN - panelRect.width);\n const newCaretOffset = left - newLeft;\n panel.style.left = `${newLeft}px`;\n /** @type {HTMLElement} */\n const caret = panel.querySelector(".caret");\n caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}();
1150
1150
  //# sourceMappingURL=respec-w3c.js.map