html-standard 0.0.7 → 0.0.9

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.
package/README.md CHANGED
@@ -1,67 +1,56 @@
1
1
  # html-standard
2
2
 
3
- A TypeScript library that provides utilities for working with the HTML Living Standard specification.
3
+ A TypeScript library for working with the HTML Living Standard specification.
4
4
 
5
- > ⚠️ **Experimental**: This project is currently in an experimental stage and may introduce breaking changes frequently.
5
+ > ⚠️ **Experimental**: This project may introduce breaking changes frequently.
6
6
 
7
- ## Features
7
+ ## Installation
8
8
 
9
- ### `getImplicitRole`
9
+ ```bash
10
+ npm install html-standard
11
+ ```
10
12
 
11
- Returns the implicit ARIA role of an HTML element according to the [HTML-ARIA specification](https://www.w3.org/TR/html-aria/). This provides the default role that each HTML element has.
13
+ ## Usage
14
+
15
+ ### Get Implicit ARIA Roles
12
16
 
13
17
  ```typescript
14
- import { getImplicitRole } from "html-standard";
18
+ import { element } from "html-standard";
15
19
 
16
- // Basic usage
17
- getImplicitRole("button"); // 'button'
18
- getImplicitRole("nav"); // 'navigation'
19
- getImplicitRole("div"); // 'generic'
20
+ // Basic elements
21
+ element("button").implicitRole(); // 'button'
22
+ element("nav").implicitRole(); // 'navigation'
20
23
 
21
- // Elements with attribute-dependent roles
22
- getImplicitRole("a", {
23
- attribute: (key) => (key === "href" ? "https://example.com" : null),
24
- }); // 'link'
24
+ // Attribute-dependent roles
25
+ element("a", {
26
+ attributes: { get: (key) => key === "href" ? "https://example.com" : null }
27
+ }).implicitRole(); // 'link'
25
28
 
26
- getImplicitRole("a", {
27
- attribute: () => null,
28
- }); // 'generic' (without href)
29
+ element("a").implicitRole(); // 'generic' (no href)
29
30
 
30
- getImplicitRole("input", {
31
- attribute: (key) => (key === "type" ? "checkbox" : null),
32
- }); // 'checkbox'
31
+ element("input", {
32
+ attributes: { get: (key) => key === "type" ? "checkbox" : null }
33
+ }).implicitRole(); // 'checkbox'
33
34
  ```
34
35
 
35
- **Key Features:**
36
+ ### Validate Attributes
36
37
 
37
- - Implements implicit role mapping from the HTML Living Standard
38
- - Supports attribute-dependent roles (e.g., `<a>`, `<input>`, `<img>`, `<select>`)
39
- - Case-insensitive element name handling
38
+ ```typescript
39
+ import { element } from "html-standard";
40
40
 
41
- ## Installation
41
+ const link = element("link");
42
42
 
43
- ```bash
44
- npm install html-standard
43
+ // Validate 'rel' attribute
44
+ link.attributes.get("rel")?.validate("stylesheet"); // { valid: true, ... }
45
+ link.attributes.get("rel")?.validate("invalid-value"); // { valid: false, ... }
45
46
  ```
46
47
 
47
- ## Development
48
-
49
- ```bash
50
- # Run tests
51
- npm test
52
-
53
- # Run tests in watch mode
54
- npm run test:watch
55
-
56
- # Run tests with UI
57
- npm run test:ui
58
-
59
- # Type check
60
- npm run ts
48
+ ## Features
61
49
 
62
- # Build
63
- npm run build
64
- ```
50
+ - Implicit ARIA roles per [HTML-ARIA spec](https://www.w3.org/TR/html-aria/)
51
+ - Attribute validation based on HTML Standard
52
+ - Case-insensitive element names
53
+ - TypeScript support
65
54
 
66
55
  ## License
67
56
 
package/dist/index.cjs CHANGED
@@ -1,252 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- getImplicitRole: () => getImplicitRole
24
- });
25
- module.exports = __toCommonJS(index_exports);
26
-
27
- // src/constants/roles.ts
28
- var ROLES = {
29
- ARTICLE: "article",
30
- BLOCKQUOTE: "blockquote",
31
- BUTTON: "button",
32
- CAPTION: "caption",
33
- CELL: "cell",
34
- CHECKBOX: "checkbox",
35
- CODE: "code",
36
- COMBOBOX: "combobox",
37
- COMPLEMENTARY: "complementary",
38
- DELETION: "deletion",
39
- DIALOG: "dialog",
40
- DOCUMENT: "document",
41
- EMPHASIS: "emphasis",
42
- FIGURE: "figure",
43
- FORM: "form",
44
- GENERIC: "generic",
45
- GROUP: "group",
46
- HEADING: "heading",
47
- IMG: "img",
48
- INSERTION: "insertion",
49
- LINK: "link",
50
- LIST: "list",
51
- LISTBOX: "listbox",
52
- MAIN: "main",
53
- METER: "meter",
54
- NAVIGATION: "navigation",
55
- OPTION: "option",
56
- PARAGRAPH: "paragraph",
57
- PROGRESSBAR: "progressbar",
58
- RADIO: "radio",
59
- ROW: "row",
60
- ROWGROUP: "rowgroup",
61
- SEARCH: "search",
62
- SEARCHBOX: "searchbox",
63
- SEPARATOR: "separator",
64
- SLIDER: "slider",
65
- SPINBUTTON: "spinbutton",
66
- STATUS: "status",
67
- STRONG: "strong",
68
- TABLE: "table",
69
- TERM: "term",
70
- TEXTBOX: "textbox",
71
- TIME: "time"
72
- };
73
-
74
- // src/html-aria/implicit-role/implicit-role.ts
75
- var IMPLICIT_ROLE = {
76
- a: ({ has }) => has("href") ? ROLES.LINK : ROLES.GENERIC,
77
- abbr: () => null,
78
- address: () => ROLES.GROUP,
79
- area: ({ has }) => has("href") ? ROLES.LINK : ROLES.GENERIC,
80
- article: () => ROLES.ARTICLE,
81
- aside: () => ROLES.COMPLEMENTARY,
82
- audio: () => null,
83
- b: () => ROLES.GENERIC,
84
- base: () => null,
85
- bdi: () => ROLES.GENERIC,
86
- bdo: () => ROLES.GENERIC,
87
- blockquote: () => ROLES.BLOCKQUOTE,
88
- body: () => ROLES.GENERIC,
89
- br: () => null,
90
- button: () => ROLES.BUTTON,
91
- canvas: () => null,
92
- caption: () => ROLES.CAPTION,
93
- cite: () => null,
94
- code: () => ROLES.CODE,
95
- col: () => null,
96
- colgroup: () => null,
97
- data: () => ROLES.GENERIC,
98
- datalist: () => ROLES.LISTBOX,
99
- dd: () => null,
100
- del: () => ROLES.DELETION,
101
- details: () => ROLES.GROUP,
102
- dfn: () => ROLES.TERM,
103
- dialog: () => ROLES.DIALOG,
104
- div: () => ROLES.GENERIC,
105
- dl: () => null,
106
- dt: () => null,
107
- em: () => ROLES.EMPHASIS,
108
- embed: () => null,
109
- fieldset: () => ROLES.GROUP,
110
- figcaption: () => null,
111
- figure: () => ROLES.FIGURE,
112
- footer: () => null,
113
- form: () => ROLES.FORM,
114
- h1: () => ROLES.HEADING,
115
- h2: () => ROLES.HEADING,
116
- h3: () => ROLES.HEADING,
117
- h4: () => ROLES.HEADING,
118
- h5: () => ROLES.HEADING,
119
- h6: () => ROLES.HEADING,
120
- head: () => null,
121
- header: () => null,
122
- hgroup: () => ROLES.GROUP,
123
- hr: () => ROLES.SEPARATOR,
124
- html: () => ROLES.DOCUMENT,
125
- i: () => ROLES.GENERIC,
126
- iframe: () => null,
127
- img: ({ get }) => {
128
- const alt = get("alt");
129
- if (alt === "") return null;
130
- return ROLES.IMG;
131
- },
132
- input: ({ get }) => {
133
- const type = get("type") || "text";
134
- switch (type) {
135
- case "button":
136
- case "image":
137
- case "reset":
138
- case "submit":
139
- return ROLES.BUTTON;
140
- case "checkbox":
141
- return ROLES.CHECKBOX;
142
- case "color":
143
- case "date":
144
- case "datetime-local":
145
- case "file":
146
- case "hidden":
147
- case "month":
148
- case "password":
149
- case "time":
150
- case "week":
151
- return null;
152
- case "email":
153
- case "tel":
154
- case "text":
155
- case "url":
156
- return ROLES.TEXTBOX;
157
- case "number":
158
- return ROLES.SPINBUTTON;
159
- case "radio":
160
- return ROLES.RADIO;
161
- case "range":
162
- return ROLES.SLIDER;
163
- case "search":
164
- return ROLES.SEARCHBOX;
165
- default:
166
- return ROLES.TEXTBOX;
167
- }
168
- },
169
- ins: () => ROLES.INSERTION,
170
- kbd: () => null,
171
- label: () => null,
172
- legend: () => null,
173
- li: () => null,
174
- link: () => null,
175
- main: () => ROLES.MAIN,
176
- map: () => null,
177
- mark: () => null,
178
- menu: () => ROLES.LIST,
179
- meta: () => null,
180
- meter: () => ROLES.METER,
181
- nav: () => ROLES.NAVIGATION,
182
- noscript: () => null,
183
- object: () => null,
184
- ol: () => ROLES.LIST,
185
- optgroup: () => ROLES.GROUP,
186
- option: () => ROLES.OPTION,
187
- output: () => ROLES.STATUS,
188
- p: () => ROLES.PARAGRAPH,
189
- param: () => null,
190
- picture: () => null,
191
- pre: () => ROLES.GENERIC,
192
- progress: () => ROLES.PROGRESSBAR,
193
- q: () => ROLES.GENERIC,
194
- rp: () => null,
195
- rt: () => null,
196
- ruby: () => null,
197
- s: () => ROLES.DELETION,
198
- samp: () => ROLES.GENERIC,
199
- script: () => null,
200
- search: () => ROLES.SEARCH,
201
- section: () => null,
202
- select: ({ has }) => has("multiple") ? ROLES.LISTBOX : ROLES.COMBOBOX,
203
- slot: () => null,
204
- small: () => ROLES.GENERIC,
205
- span: () => ROLES.GENERIC,
206
- strong: () => ROLES.STRONG,
207
- style: () => null,
208
- sub: () => null,
209
- summary: () => ROLES.BUTTON,
210
- sup: () => null,
211
- svg: () => null,
212
- table: () => ROLES.TABLE,
213
- tbody: () => ROLES.ROWGROUP,
214
- td: () => ROLES.CELL,
215
- template: () => null,
216
- textarea: () => ROLES.TEXTBOX,
217
- tfoot: () => ROLES.ROWGROUP,
218
- th: () => null,
219
- thead: () => ROLES.ROWGROUP,
220
- time: () => ROLES.TIME,
221
- title: () => null,
222
- tr: () => ROLES.ROW,
223
- track: () => null,
224
- u: () => null,
225
- ul: () => ROLES.LIST,
226
- var: () => null,
227
- video: () => null,
228
- wbr: () => null
229
- };
230
- var getImplicitRoleInternal = (name, attribute) => {
231
- const getRoleFn = IMPLICIT_ROLE[name.toLowerCase()];
232
- if (!getRoleFn) {
233
- return null;
234
- }
235
- return getRoleFn({
236
- get: (key) => attribute(key),
237
- has: (key) => attribute(key) !== null
238
- });
239
- };
240
-
241
- // src/html-aria/implicit-role/get-implicit-role.ts
242
- var DEFAULT_OPTIONS = {
243
- attribute: () => null
244
- };
245
- function getImplicitRole(element, options = DEFAULT_OPTIONS) {
246
- return getImplicitRoleInternal(element, options.attribute);
247
- }
248
- // Annotate the CommonJS export names for ESM import in node:
249
- 0 && (module.exports = {
250
- getImplicitRole
251
- });
1
+ "use strict";var W=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var it=Object.prototype.hasOwnProperty;var ot=(s,t)=>{for(var o in t)W(s,o,{get:t[o],enumerable:!0})},pt=(s,t,o,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of rt(t))!it.call(s,c)&&c!==o&&W(s,c,{get:()=>t[c],enumerable:!(u=et(t,c))||u.enumerable});return s};var st=s=>pt(W({},"__esModule",{value:!0}),s);var ut={};ot(ut,{element:()=>tt});module.exports=st(ut);var e={ARTICLE:"article",BLOCKQUOTE:"blockquote",BUTTON:"button",CAPTION:"caption",CELL:"cell",CHECKBOX:"checkbox",CODE:"code",COMBOBOX:"combobox",COMPLEMENTARY:"complementary",CONTENTINFO:"contentinfo",DELETION:"deletion",DIALOG:"dialog",DOCUMENT:"document",EMPHASIS:"emphasis",FIGURE:"figure",FORM:"form",GENERIC:"generic",GROUP:"group",HEADING:"heading",IMG:"img",INSERTION:"insertion",LINK:"link",LIST:"list",LISTBOX:"listbox",MAIN:"main",METER:"meter",NAVIGATION:"navigation",OPTION:"option",PARAGRAPH:"paragraph",PROGRESSBAR:"progressbar",RADIO:"radio",ROW:"row",ROWGROUP:"rowgroup",SEARCH:"search",SEARCHBOX:"searchbox",SEPARATOR:"separator",SLIDER:"slider",SPINBUTTON:"spinbutton",STATUS:"status",STRONG:"strong",TABLE:"table",TERM:"term",TEXTBOX:"textbox",TIME:"time"};var Z={get(s){return null}};var q=class{constructor(t=Z){this.options=t}get(t){return this.options.get(t)}has(t){return this.options.get(t)!==null}};var z=class s{constructor(t,o){this.options=o;this.name=t.toLowerCase()}get attributes(){return new q(this.options.attributes)}parent(){if(!this.options.ancestors)return null;let o=this.options.ancestors()[Symbol.iterator]().next();return o.done||!o.value?null:new s(o.value.name,o.value)}ancestors(){var t,o;return((o=(t=this.options).ancestors)==null?void 0:o.call(t))||[]}};var Y={a:s=>s.attributes.has("href")?e.LINK:e.GENERIC,abbr:()=>null,address:()=>e.GROUP,area:s=>s.attributes.has("href")?e.LINK:e.GENERIC,article:()=>e.ARTICLE,aside:()=>e.COMPLEMENTARY,audio:()=>null,b:()=>e.GENERIC,base:()=>null,bdi:()=>e.GENERIC,bdo:()=>e.GENERIC,blockquote:()=>e.BLOCKQUOTE,body:()=>e.GENERIC,br:()=>null,button:()=>e.BUTTON,canvas:()=>null,caption:()=>e.CAPTION,cite:()=>null,code:()=>e.CODE,col:()=>null,colgroup:()=>null,data:()=>e.GENERIC,datalist:()=>e.LISTBOX,dd:()=>null,del:()=>e.DELETION,details:()=>e.GROUP,dfn:()=>e.TERM,dialog:()=>e.DIALOG,div:()=>e.GENERIC,dl:()=>null,dt:()=>null,em:()=>e.EMPHASIS,embed:()=>null,fieldset:()=>e.GROUP,figcaption:()=>null,figure:()=>e.FIGURE,footer:s=>{let t=["article","aside","main","nav","section"];for(let o of s.ancestors())if(t.includes(o.name.toLowerCase()))return e.GENERIC;return e.CONTENTINFO},form:()=>e.FORM,h1:()=>e.HEADING,h2:()=>e.HEADING,h3:()=>e.HEADING,h4:()=>e.HEADING,h5:()=>e.HEADING,h6:()=>e.HEADING,head:()=>null,header:()=>null,hgroup:()=>e.GROUP,hr:()=>e.SEPARATOR,html:()=>e.DOCUMENT,i:()=>e.GENERIC,iframe:()=>null,img:s=>s.attributes.get("alt")===""?null:e.IMG,input:s=>{switch(s.attributes.get("type")||"text"){case"button":case"image":case"reset":case"submit":return e.BUTTON;case"checkbox":return e.CHECKBOX;case"color":case"date":case"datetime-local":case"file":case"hidden":case"month":case"password":case"time":case"week":return null;case"email":case"tel":case"text":case"url":return e.TEXTBOX;case"number":return e.SPINBUTTON;case"radio":return e.RADIO;case"range":return e.SLIDER;case"search":return e.SEARCHBOX;default:return e.TEXTBOX}},ins:()=>e.INSERTION,kbd:()=>null,label:()=>null,legend:()=>null,li:()=>null,link:()=>null,main:()=>e.MAIN,map:()=>null,mark:()=>null,menu:()=>e.LIST,meta:()=>null,meter:()=>e.METER,nav:()=>e.NAVIGATION,noscript:()=>null,object:()=>null,ol:()=>e.LIST,optgroup:()=>e.GROUP,option:()=>e.OPTION,output:()=>e.STATUS,p:()=>e.PARAGRAPH,param:()=>null,picture:()=>null,pre:()=>e.GENERIC,progress:()=>e.PROGRESSBAR,q:()=>e.GENERIC,rp:()=>null,rt:()=>null,ruby:()=>null,s:()=>e.DELETION,samp:()=>e.GENERIC,script:()=>null,search:()=>e.SEARCH,section:()=>null,select:s=>s.attributes.has("multiple")?e.LISTBOX:e.COMBOBOX,slot:()=>null,small:()=>e.GENERIC,span:()=>e.GENERIC,strong:()=>e.STRONG,style:()=>null,sub:()=>null,summary:()=>e.BUTTON,sup:()=>null,svg:()=>null,table:()=>e.TABLE,tbody:()=>e.ROWGROUP,td:()=>e.CELL,template:()=>null,textarea:()=>e.TEXTBOX,tfoot:()=>e.ROWGROUP,th:()=>null,thead:()=>e.ROWGROUP,time:()=>e.TIME,title:()=>null,tr:()=>e.ROW,track:()=>null,u:()=>null,ul:()=>e.LIST,var:()=>null,video:()=>null,wbr:()=>null};var at={valid:!0};function l(){return at}function r(s){return{valid:!1,message:s}}var a=class{constructor(t){this.attributeKey=t}validate(t){return!t||t===!0?l():this.attributeKey===(t==null?void 0:t.toLowerCase())?l():r(`Boolean attribute value must be empty or match the attribute name "${this.attributeKey}", got: "${t}"`)}};a.type="BooleanAttribute";var b={VALUE_MUST_BE_STRING:"Value must be a string",VALUE_CANNOT_BE_EMPTY:"Value cannot be empty"};var i=class{constructor(t){this.options=t}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);let o=t.toLowerCase();return this.options.keywords.includes(o)?l():r(`Value "${t}" is not a valid keyword. Expected one of: ${this.options.keywords.join(", ")}`)}};i.type="EnumeratedAttribute";var C=class C{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):C.PATTERN.test(t)?l():r(`Invalid signed integer: "${t}"`)}};C.type="SignedInteger",C.PATTERN=/^-?\d+$/;var x=C;var Q=/[\u0009\u000A\u000C\u000D\u0020]/;var d=class{constructor(t){this.options=t}parse(t){return t.split(Q)}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);let o=this.parse(t).filter(u=>u!=="");if(this.options.unique){let u=new Set(o);if(o.length!==u.size)return r("Tokens must be unique")}if(this.options.allowed){for(let u of o)if(!this.options.allowed.some(A=>u.toLowerCase()===A.toLowerCase()))return r(`Invalid token: "${u}". Allowed tokens: ${this.options.allowed.join(", ")}`)}if(typeof this.options.validateToken=="function"){for(let u of o)if(!this.options.validateToken(u))return r(`Invalid token: "${u}"`)}return l()}};d.type="SpaceSeparatedTokens";var n=class{validate(t){return l()}};n.type="Text";var m=class{validate(t){return l()}};m.type="ValidURL";var P=class P{constructor(t){this.options=t}validate(t){var u,c;if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(!P.PATTERN.test(t))return r(`Invalid non-negative integer: "${t}"`);let o=parseInt(t,10);return((u=this.options)==null?void 0:u.min)!==void 0&&o<this.options.min?r(`Value must be at least ${this.options.min}: "${t}"`):((c=this.options)==null?void 0:c.max)!==void 0&&o>this.options.max?r(`Value must be at most ${this.options.max}: "${t}"`):l()}};P.type="NonNegativeInteger",P.PATTERN=/^\d+$/;var y=P;var g=class{constructor(){}validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):l()}};g.type="ID";var B=class B{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):B.PATTERN.test(t)?l():r(`Invalid floating-point number: "${t}"`)}};B.type="FloatingPointNumber",B.PATTERN=/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;var f=B;var O=class{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):l()}};O.type="CommaSeparatedTokens";var V=class{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):l()}};V.type="CSSColor";var $=class ${validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(t==="")return l();if(!$.PATTERN.test(t))return r(`Invalid BCP 47 language tag: "${t}"`);let o=t.split("-");for(let u=0;u<o.length;u++){let c=o[u];if(c.length===0)return r(`Invalid BCP 47 language tag: empty subtag in "${t}"`);if(u===0){if(c==="x")continue;if(!/^[a-zA-Z]{2,8}$/.test(c))return r(`Invalid language subtag in "${t}": "${c}"`)}}return l()}};$.type="BCP47",$.PATTERN=/^[a-zA-Z]{2,3}(?:-[a-zA-Z]{3}){0,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|[0-9]{3}))?(?:-(?:[a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*(?:-[0-9a-wyzA-WYZ](?:-[a-zA-Z0-9]{2,8})+)*(?:-x(?:-[a-zA-Z0-9]{1,8})+)?$|^x(?:-[a-zA-Z0-9]{1,8})+$|^[a-zA-Z]{4,8}$/;var R=$;var D=class D{constructor(){}validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):D.PATTERN.test(t)?l():r(`Invalid MIME type: "${t}"`)}};D.type="MIMEType",D.PATTERN=/^[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+\/[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+(?:\s*;\s*[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+=(?:[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+|"[^"]*"))*$/;var h=D;var G=class G{constructor(){}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(!G.DATE_PATTERN.test(t)&&!G.DATETIME_PATTERN.test(t))return r(`Invalid date or datetime string: "${t}"`);let o=t.match(/^(\d{4,})-(\d{2})-(\d{2})/);if(o){let c=parseInt(o[1],10),A=parseInt(o[2],10),E=parseInt(o[3],10);if(c===0)return r(`Year must be greater than 0: "${t}"`);if(A<1||A>12)return r(`Month must be between 1 and 12: "${t}"`);if(E<1||E>31)return r(`Day must be between 1 and 31: "${t}"`)}let u=t.match(/[T ](\d{2}):(\d{2})/);if(u){let c=parseInt(u[1],10),A=parseInt(u[2],10);if(c>23)return r(`Hour must be between 0 and 23: "${t}"`);if(A>59)return r(`Minute must be between 0 and 59: "${t}"`);let E=t.match(/[T ]\d{2}:\d{2}:(\d{2})/);if(E&&parseInt(E[1],10)>59)return r(`Second must be between 0 and 59: "${t}"`)}return l()}};G.type="DateString",G.DATE_PATTERN=/^\d{4,}-\d{2}-\d{2}$/,G.DATETIME_PATTERN=/^\d{4,}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})?$/;var N=G;var v=class{constructor(){}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);try{return new RegExp(t),l()}catch(o){return r(`Invalid regular expression: "${t}" - ${o instanceof Error?o.message:String(o)}`)}}};v.type="RegularExpression";var _=class{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):t.startsWith("#")?t.length===1?r(`Hash-name reference must have a name after "#": "${t}"`):l():r(`Hash-name reference must start with "#": "${t}"`)}};_.type="HashNameReference";var j=class j{constructor(){}validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):t.length===0?r("Navigable target name must have at least one character"):t.startsWith("_")?r(`Navigable target name cannot start with "_" (reserved for keywords like _blank, _self): "${t}"`):j.INVALID_CHARS_PATTERN.test(t)?r(`Navigable target name cannot contain tab, newline, or "<" character: "${t}"`):l()}};j.type="NavigableTargetName",j.INVALID_CHARS_PATTERN=/[\t\n<]/;var S=j;var I=class{validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(t.trim()==="")return r("Srcset cannot be empty");let o=t.split(",");for(let u=0;u<o.length;u++){let c=o[u].trim();if(c==="")return r(`Image candidate string ${u+1} is empty`);let A=c.split(/\s+/),E=A[0];if(E.startsWith(",")||E.endsWith(","))return r(`URL cannot start or end with comma: "${E}"`);if(E==="")return r(`URL in candidate string ${u+1} is empty`);if(A.length>1){let T=A[A.length-1];if(T.endsWith("w")){let M=T.slice(0,-1),U=parseInt(M,10);if(!/^\d+$/.test(M)||U<=0)return r(`Invalid width descriptor: "${T}" (must be positive integer followed by 'w')`)}else if(T.endsWith("x")){let M=T.slice(0,-1),U=parseFloat(M);if(!/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(M)||U<=0)return r(`Invalid pixel density descriptor: "${T}" (must be positive number followed by 'x')`)}else return r(`Invalid descriptor: "${T}" (must end with 'w' or 'x')`);if(A.length>2&&A.slice(1,-1).some(U=>U!==""))return r(`Invalid image candidate string: "${c}" (extra tokens found)`)}}return l()}};I.type="SrcsetAttribute";var w=class{validate(t){return!t||t===!0?r(b.VALUE_MUST_BE_STRING):l()}};w.type="MediaQueryList";var k=class{validate(t){return!t||t===!0?r(b.VALUE_MUST_BE_STRING):l()}};k.type="SourceSizeList";var L=class{constructor(){this.floatingPointNumberValidator=new f}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(t.length===0)return r(b.VALUE_CANNOT_BE_EMPTY);let o=t.split(",");for(let u=0;u<o.length;u++){let c=o[u];if(c.length===0)return r(`Empty value at position ${u+1}`);if(!this.floatingPointNumberValidator.validate(c).valid)return r(`Invalid floating-point number at position ${u+1}: "${c}"`)}return l()}};L.type="FloatingPointNumberList";var H=class{constructor(t,o){this.key=t;this.definition=o}validate(t){return nt(this.key,this.definition).validate(t)}};function nt(s,t){switch(t.type){case d.type:return new d(t.options);case i.type:return new i(t.options);case a.type:return new a(s);case x.type:return new x;case n.type:return new n;case m.type:return new m;case y.type:return new y(t.options);case g.type:return new g;case f.type:return new f;case O.type:return new O;case V.type:return new V;case R.type:return new R;case h.type:return new h;case N.type:return new N;case v.type:return new v;case _.type:return new _;case S.type:return new S;case I.type:return new I;case w.type:return new w;case k.type:return new k;case L.type:return new L;case"#or":throw new Error("#or type handling not implemented yet")}}var K=new Map([["accesskey",{type:d.type,options:{unique:!0,validateToken(s){return Array.from(s).length===1}}}],["autocapitalize",{type:i.type,options:{keywords:["off","none","on","sentences","words","characters"]}}],["autocorrect",{type:i.type,options:{keywords:["on","off"]}}],["autofocus",{type:a.type}],["contenteditable",{type:i.type,options:{keywords:["true","false","plaintext-only"]}}],["dir",{type:i.type,options:{keywords:["ltr","rtl","auto"]}}],["draggable",{type:i.type,options:{keywords:["true","false"]}}],["enterkeyhint",{type:i.type,options:{keywords:["enter","done","go","next","previous","search","send"]}}],["headingoffset",{type:y.type,options:{min:0,max:8}}],["headingreset",{type:a.type}],["hidden",{type:i.type,options:{keywords:["until-found","hidden"]}}],["inert",{type:a.type}],["inputmode",{type:i.type,options:{keywords:["none","text","tel","url","email","numeric","decimal","search"]}}],["is",{type:n.type}],["itemid",{type:m.type}],["itemprop",{type:d.type,options:{unique:!0}}],["itemref",{type:d.type,options:{unique:!0}}],["itemscope",{type:a.type}],["itemtype",{type:d.type,options:{unique:!0,validateToken(s){try{return new URL(s),!0}catch(t){return!1}}}}],["lang",{type:R.type}],["nonce",{type:n.type}],["popover",{type:"#or",items:[{type:a.type},{type:i.type,options:{keywords:["auto","manual","hint"]}}]}],["spellcheck",{type:i.type,options:{keywords:["true","false"]}}],["style",{type:n.type}],["tabindex",{type:x.type}],["title",{type:n.type}],["translate",{type:i.type,options:{keywords:["yes","no"]}}],["writingsuggestions",{type:i.type,options:{keywords:["true","false"]}}]]);var p=[],J={html:{globalAttributes:!0,attributes:p},head:{globalAttributes:!0,attributes:p},title:{globalAttributes:!0,attributes:p},base:{globalAttributes:!0,attributes:[["href",{type:m.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}]]},link:{globalAttributes:!0,attributes:[["href",{type:m.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["rel",{type:d.type,options:{unique:!1,allowed:["alternate","canonical","author","dns-prefetch","expect","help","icon","manifest","modulepreload","license","next","pingback","preconnect","prefetch","preload","prev","privacy-policy","search","stylesheet","terms-of-service"]}}],["media",{type:w.type}],["integrity",{type:n.type}],["hreflang",{type:R.type}],["type",{type:h.type}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["sizes",{type:d.type,options:{unique:!0,validateToken(s){if(s.toLowerCase()==="any")return!0;let t=/^([1-9]\d*|0)[xX]([1-9]\d*|0)$/,o=s.match(t);if(!o)return!1;let[,u,c]=o;return!(u.length>1&&u.startsWith("0")||c.length>1&&c.startsWith("0"))}}}],["imagesrcset",{type:I.type}],["imagesizes",{type:k.type}],["as",{type:i.type,options:{keywords:["fetch","font","image","script","style","track","json","style","audioworklet","paintworklet","script","serviceworker","sharedworker","worker"]}}],["blocking",{type:d.type,options:{unique:!0,allowed:["render"]}}],["color",{type:V.type}],["disabled",{type:a.type}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},meta:{globalAttributes:!0,attributes:[["name",{type:n.type}],["http-equiv",{type:i.type,options:{keywords:["content-language","content-type","default-style","refresh","set-cookie","x-ua-compatible","content-security-policy"]}}],["content",{type:n.type}],["charset",{type:i.type,options:{keywords:["utf-8"]}}],["media",{type:w.type}]]},style:{globalAttributes:!0,attributes:[["media",{type:w.type}],["blocking",{type:d.type,options:{unique:!0,allowed:["render"]}}]]},body:{globalAttributes:!0,attributes:p},article:{globalAttributes:!0,attributes:p},section:{globalAttributes:!0,attributes:p},nav:{globalAttributes:!0,attributes:p},aside:{globalAttributes:!0,attributes:p},hgroup:{globalAttributes:!0,attributes:p},header:{globalAttributes:!0,attributes:p},footer:{globalAttributes:!0,attributes:p},address:{globalAttributes:!0,attributes:p},p:{globalAttributes:!0,attributes:p},hr:{globalAttributes:!0,attributes:p},pre:{globalAttributes:!0,attributes:p},blockquote:{globalAttributes:!0,attributes:[["cite",{type:m.type}]]},ol:{globalAttributes:!0,attributes:[["reversed",{type:a.type}],["start",{type:x.type}],["type",{type:i.type,options:{keywords:["1","a","A","i","I"]}}]]},ul:{globalAttributes:!0,attributes:p},menu:{globalAttributes:!0,attributes:p},li:{globalAttributes:!0,attributes:[["value",{type:x.type}]]},dl:{globalAttributes:!0,attributes:p},dt:{globalAttributes:!0,attributes:p},dd:{globalAttributes:!0,attributes:p},figure:{globalAttributes:!0,attributes:p},figcaption:{globalAttributes:!0,attributes:p},main:{globalAttributes:!0,attributes:p},search:{globalAttributes:!0,attributes:p},div:{globalAttributes:!0,attributes:p},a:{globalAttributes:!0,attributes:[["href",{type:m.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["download",{type:n.type}],["ping",{type:d.type,options:{unique:!1,validateToken(s){if(s.length===0)return!1;try{let t=new URL(s);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}}],["rel",{type:d.type,options:{unique:!1,allowed:["alternate","author","bookmark","external","help","license","next","nofollow","noopener","noreferrer","opener","prev","privacy-policy","search","tag","terms-of-service"]}}],["hreflang",{type:R.type}],["type",{type:h.type}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}]]},em:{globalAttributes:!0,attributes:p},strong:{globalAttributes:!0,attributes:p},small:{globalAttributes:!0,attributes:p},s:{globalAttributes:!0,attributes:p},cite:{globalAttributes:!0,attributes:p},q:{globalAttributes:!0,attributes:[["cite",{type:m.type}]]},dfn:{globalAttributes:!0,attributes:p},abbr:{globalAttributes:!0,attributes:p},ruby:{globalAttributes:!0,attributes:p},rt:{globalAttributes:!0,attributes:p},rp:{globalAttributes:!0,attributes:p},data:{globalAttributes:!0,attributes:[["value",{type:n.type}]]},time:{globalAttributes:!0,attributes:[["datetime",{type:N.type}]]},code:{globalAttributes:!0,attributes:p},var:{globalAttributes:!0,attributes:p},samp:{globalAttributes:!0,attributes:p},kbd:{globalAttributes:!0,attributes:p},i:{globalAttributes:!0,attributes:p},b:{globalAttributes:!0,attributes:p},u:{globalAttributes:!0,attributes:p},mark:{globalAttributes:!0,attributes:p},bdi:{globalAttributes:!0,attributes:p},bdo:{globalAttributes:!0,attributes:p},span:{globalAttributes:!0,attributes:p},br:{globalAttributes:!0,attributes:p},wbr:{globalAttributes:!0,attributes:p},ins:{globalAttributes:!0,attributes:[["cite",{type:m.type}],["datetime",{type:N.type}]]},del:{globalAttributes:!0,attributes:[["cite",{type:m.type}],["datetime",{type:N.type}]]},picture:{globalAttributes:!0,attributes:p},source:{globalAttributes:!0,attributes:[["type",{type:h.type}],["media",{type:w.type}],["src",{type:m.type}],["srcset",{type:I.type}],["sizes",{type:k.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]},img:{globalAttributes:!0,attributes:[["alt",{type:n.type}],["src",{type:m.type}],["srcset",{type:I.type}],["sizes",{type:k.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["usemap",{type:_.type}],["ismap",{type:a.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["decoding",{type:i.type,options:{keywords:["sync","async","auto"]}}],["loading",{type:i.type,options:{keywords:["eager","lazy"]}}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},iframe:{globalAttributes:!0,attributes:[["src",{type:m.type}],["srcdoc",{type:n.type}],["name",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["sandbox",{type:d.type,options:{unique:!0,allowed:["allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols"]}}],["allow",{type:n.type}],["allowfullscreen",{type:a.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["loading",{type:i.type,options:{keywords:["eager","lazy"]}}]]},embed:{globalAttributes:!0,attributes:[["src",{type:m.type}],["type",{type:h.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]},object:{globalAttributes:!0,attributes:[["data",{type:m.type}],["type",{type:h.type}],["name",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["form",{type:g.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]},video:{globalAttributes:!0,attributes:[["src",{type:m.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["poster",{type:m.type}],["preload",{type:i.type,options:{keywords:["none","metadata","auto"]}}],["autoplay",{type:a.type}],["playsinline",{type:a.type}],["loop",{type:a.type}],["muted",{type:a.type}],["controls",{type:a.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]},audio:{globalAttributes:!0,attributes:[["src",{type:m.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["preload",{type:i.type,options:{keywords:["none","metadata","auto"]}}],["autoplay",{type:a.type}],["loop",{type:a.type}],["muted",{type:a.type}],["controls",{type:a.type}]]},track:{globalAttributes:!0,attributes:[["kind",{type:i.type,options:{keywords:["subtitles","captions","descriptions","chapters","metadata"]}}],["src",{type:m.type}],["srclang",{type:R.type}],["label",{type:n.type}],["default",{type:a.type}]]},map:{globalAttributes:!0,attributes:[["name",{type:n.type}]]},area:{globalAttributes:!0,attributes:[["alt",{type:n.type}],["coords",{type:L.type}],["shape",{type:i.type,options:{keywords:["circle","default","poly","rect"]}}],["href",{type:m.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["download",{type:n.type}],["ping",{type:d.type,options:{unique:!1,validateToken(s){if(s.length===0)return!1;try{let t=new URL(s);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}}],["rel",{type:d.type,options:{unique:!1,allowed:["alternate","author","bookmark","external","help","license","next","nofollow","noopener","noreferrer","opener","prev","privacy-policy","search","tag","terms-of-service"]}}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}]]},table:{globalAttributes:!0,attributes:p},caption:{globalAttributes:!0,attributes:p},colgroup:{globalAttributes:!0,attributes:[["span",{type:y.type,options:{min:1}}]]},col:{globalAttributes:!0,attributes:[["span",{type:y.type,options:{min:1}}]]},tbody:{globalAttributes:!0,attributes:p},thead:{globalAttributes:!0,attributes:p},tfoot:{globalAttributes:!0,attributes:p},tr:{globalAttributes:!0,attributes:p},td:{globalAttributes:!0,attributes:[["colspan",{type:y.type,options:{min:1}}],["rowspan",{type:y.type,options:{}}],["headers",{type:d.type,options:{unique:!0}}]]},th:{globalAttributes:!0,attributes:[["colspan",{type:y.type,options:{min:1}}],["rowspan",{type:y.type,options:{}}],["headers",{type:d.type,options:{unique:!0}}],["scope",{type:i.type,options:{keywords:["row","col","rowgroup","colgroup"]}}],["abbr",{type:n.type}]]},form:{globalAttributes:!0,attributes:[["accept-charset",{type:d.type,options:{unique:!0}}],["action",{type:m.type}],["autocomplete",{type:i.type,options:{keywords:["on","off"]}}],["enctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["method",{type:i.type,options:{keywords:["get","post","dialog"]}}],["name",{type:n.type}],["novalidate",{type:a.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["rel",{type:d.type,options:{unique:!1,allowed:["external","help","license","next","nofollow","noopener","noreferrer","opener","prev","search"]}}]]},label:{globalAttributes:!0,attributes:[["for",{type:g.type}]]},input:{globalAttributes:!0,attributes:[["accept",{type:O.type}],["alt",{type:n.type}],["autocomplete",{type:n.type}],["checked",{type:a.type}],["dirname",{type:n.type}],["disabled",{type:a.type}],["form",{type:g.type}],["formaction",{type:m.type}],["formenctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["formmethod",{type:i.type,options:{keywords:["get","post","dialog"]}}],["formnovalidate",{type:a.type}],["formtarget",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["height",{type:y.type,options:{}}],["list",{type:g.type}],["max",{type:n.type}],["maxlength",{type:y.type,options:{}}],["min",{type:n.type}],["minlength",{type:y.type,options:{}}],["multiple",{type:a.type}],["name",{type:n.type}],["pattern",{type:v.type}],["placeholder",{type:n.type}],["popovertarget",{type:n.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["readonly",{type:a.type}],["required",{type:a.type}],["size",{type:y.type,options:{min:1}}],["src",{type:m.type}],["step",{type:"#or",items:[{type:f.type},{type:i.type,options:{keywords:["any"]}}]}],["type",{type:i.type,options:{keywords:["hidden","text","search","tel","url","email","password","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}}],["value",{type:n.type}],["width",{type:y.type,options:{}}]]},button:{globalAttributes:!0,attributes:[["disabled",{type:a.type}],["form",{type:g.type}],["formaction",{type:m.type}],["formenctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["formmethod",{type:i.type,options:{keywords:["get","post","dialog"]}}],["formnovalidate",{type:a.type}],["formtarget",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["name",{type:n.type}],["popovertarget",{type:n.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["type",{type:i.type,options:{keywords:["submit","reset","button"]}}],["value",{type:n.type}]]},select:{globalAttributes:!0,attributes:[["autocomplete",{type:n.type}],["disabled",{type:a.type}],["form",{type:g.type}],["multiple",{type:a.type}],["name",{type:n.type}],["required",{type:a.type}],["size",{type:y.type,options:{min:1}}]]},datalist:{globalAttributes:!0,attributes:p},optgroup:{globalAttributes:!0,attributes:[["disabled",{type:a.type}],["label",{type:n.type}]]},option:{globalAttributes:!0,attributes:[["disabled",{type:a.type}],["label",{type:n.type}],["selected",{type:a.type}],["value",{type:n.type}]]},textarea:{globalAttributes:!0,attributes:[["autocomplete",{type:n.type}],["cols",{type:y.type,options:{min:1}}],["dirname",{type:n.type}],["disabled",{type:a.type}],["form",{type:g.type}],["maxlength",{type:y.type,options:{}}],["minlength",{type:y.type,options:{}}],["name",{type:n.type}],["placeholder",{type:n.type}],["readonly",{type:a.type}],["required",{type:a.type}],["rows",{type:y.type,options:{min:1}}],["wrap",{type:i.type,options:{keywords:["soft","hard"]}}]]},output:{globalAttributes:!0,attributes:[["for",{type:d.type,options:{unique:!0}}],["form",{type:g.type}],["name",{type:n.type}]]},progress:{globalAttributes:!0,attributes:[["value",{type:f.type}],["max",{type:f.type}]]},meter:{globalAttributes:!0,attributes:[["value",{type:f.type}],["min",{type:f.type}],["max",{type:f.type}],["low",{type:f.type}],["high",{type:f.type}],["optimum",{type:f.type}]]},fieldset:{globalAttributes:!0,attributes:[["disabled",{type:a.type}],["form",{type:g.type}],["name",{type:n.type}]]},legend:{globalAttributes:!0,attributes:p},selectedcontent:{globalAttributes:!0,attributes:p},details:{globalAttributes:!0,attributes:[["open",{type:a.type}],["name",{type:n.type}]]},summary:{globalAttributes:!0,attributes:p},dialog:{globalAttributes:!0,attributes:[["open",{type:a.type}]]},script:{globalAttributes:!0,attributes:[["src",{type:m.type}],["type",{type:h.type}],["nomodule",{type:a.type}],["async",{type:a.type}],["defer",{type:a.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["integrity",{type:n.type}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["blocking",{type:d.type,options:{unique:!0}}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},noscript:{globalAttributes:!0,attributes:p},template:{globalAttributes:!0,attributes:[["shadowrootmode",{type:i.type,options:{keywords:["open","closed"]}}],["shadowrootdelegatesfocus",{type:a.type}],["shadowrootclonable",{type:a.type}],["shadowrootserializable",{type:a.type}]]},slot:{globalAttributes:!0,attributes:[["name",{type:n.type}]]},canvas:{globalAttributes:!0,attributes:[["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]}};var X=class{constructor(t){this.state=t;this.get=t=>{var c,A,E;let o=this.getSpecDefinition();if(!o)return null;let u=null;return o.globalAttributes&&(u=(c=K.get(t))!=null?c:null,!u)?null:(u=(E=(A=o==null?void 0:o.attributes.find(([T])=>t.toLowerCase()===T))==null?void 0:A[1])!=null?E:null,u?new H(t,u):null)};this.has=t=>{let o=this.getSpecDefinition();return o!=null&&o.globalAttributes&&K.has(t)?!0:!!(o==null?void 0:o.attributes.find(([c])=>t.toLowerCase()===c))}}getSpecDefinition(){let t=J[this.state.name];return t!=null?t:null}};var F=class{constructor(t,o){this.implicitRole=()=>{let t=Y[this.state.name];return t?t(this.state):null};this.state=new z(t,o)}get attributes(){return new X(this.state)}};function tt(s,t={}){return new F(s,t)}0&&(module.exports={element});
252
2
  //# sourceMappingURL=index.cjs.map