@fluixi/template-parser 0.1.0-alpha.2 → 0.1.0-alpha.3
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/dist/ast.d.ts +17 -2
- package/dist/ast.d.ts.map +1 -1
- package/dist/directives.cjs +1 -1
- package/dist/directives.d.ts.map +1 -1
- package/dist/directives.js +12 -0
- package/dist/directives.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/parser.cjs +1 -1
- package/dist/parser.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/ast.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface SourceSpan {
|
|
|
23
23
|
/** Namespaces the parser tracks so SVG (and foreign content) lower correctly. */
|
|
24
24
|
export type Namespace = 'html' | 'svg' | 'mathml';
|
|
25
25
|
export type NodeKind = 'Root' | 'Element' | 'Component' | 'Fragment' | 'Text' | 'Comment' | 'Expression';
|
|
26
|
-
export type AttrKind = 'Attribute' | 'PropertyBinding' | 'EventBinding' | 'RefBinding' | 'Spread' | 'IfDirective' | 'ElseDirective' | 'EachDirective' | 'BindDirective' | 'ClassDirective' | 'StyleDirective' | 'UseDirective' | 'Slot';
|
|
26
|
+
export type AttrKind = 'Attribute' | 'PropertyBinding' | 'EventBinding' | 'RefBinding' | 'Spread' | 'IfDirective' | 'ElseDirective' | 'EachDirective' | 'BindDirective' | 'ClassDirective' | 'StyleDirective' | 'UseDirective' | 'LoadDirective' | 'Slot';
|
|
27
27
|
/** Fields shared by every node. `parent` is wired by {@link setParents}. */
|
|
28
28
|
export interface NodeBase {
|
|
29
29
|
loc: SourceSpan;
|
|
@@ -33,7 +33,7 @@ export interface NodeBase {
|
|
|
33
33
|
}
|
|
34
34
|
export type TemplateNode = RootNode | ElementNode | ComponentNode | FragmentNode | TextNode | CommentNode | ExpressionNode;
|
|
35
35
|
/** Anything that can attach to an element/component opening tag. */
|
|
36
|
-
export type AttributeLikeNode = AttributeNode | PropertyBindingNode | EventBindingNode | RefBindingNode | SpreadNode | IfDirectiveNode | ElseDirectiveNode | EachDirectiveNode | BindDirectiveNode | ClassDirectiveNode | StyleDirectiveNode | UseDirectiveNode | SlotNode;
|
|
36
|
+
export type AttributeLikeNode = AttributeNode | PropertyBindingNode | EventBindingNode | RefBindingNode | SpreadNode | IfDirectiveNode | ElseDirectiveNode | EachDirectiveNode | BindDirectiveNode | ClassDirectiveNode | StyleDirectiveNode | UseDirectiveNode | LoadDirectiveNode | SlotNode;
|
|
37
37
|
export interface RootNode extends NodeBase {
|
|
38
38
|
kind: 'Root';
|
|
39
39
|
children: TemplateNode[];
|
|
@@ -177,6 +177,21 @@ export interface StyleDirectiveNode extends NodeBase {
|
|
|
177
177
|
name: string;
|
|
178
178
|
hole: number;
|
|
179
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* `load:visible`, `load:interaction="click"`, … — when the component's module is
|
|
182
|
+
* fetched.
|
|
183
|
+
*
|
|
184
|
+
* The node carries the strategy and its literal modifier as written; turning that into
|
|
185
|
+
* a load plan is the compiler's job, so the parser stays free of module semantics —
|
|
186
|
+
* the same reason resolution has no syntax here either.
|
|
187
|
+
*/
|
|
188
|
+
export interface LoadDirectiveNode extends NodeBase {
|
|
189
|
+
kind: 'LoadDirective';
|
|
190
|
+
/** The part after `load:`, unvalidated — the compiler reports unknown strategies. */
|
|
191
|
+
strategy: string;
|
|
192
|
+
/** `load:visible="200px"` → `'200px'`. Null for a bare directive. */
|
|
193
|
+
modifier: string | null;
|
|
194
|
+
}
|
|
180
195
|
/** `use=${directive}` or `use:tooltip` (optionally `use:tooltip=${opts}`). */
|
|
181
196
|
export interface UseDirectiveNode extends NodeBase {
|
|
182
197
|
kind: 'UseDirective';
|
package/dist/ast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../src/ast.ts"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../src/ast.ts"],"names":[],"mappings":"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"}
|
package/dist/directives.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var b=(e,i)=>{for(var t in i)c(e,t,{get:i[t],enumerable:!0})},p=(e,i,t,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of m(i))!h.call(e,o)&&o!==t&&c(e,o,{get:()=>i[o],enumerable:!(n=v(i,o))||n.enumerable});return e};var f=e=>p(c({},"__esModule",{value:!0}),e);var g={};b(g,{CORE_DIRECTIVES:()=>a,EVENT_MODIFIERS:()=>d,resolveAttribute:()=>D});module.exports=f(g);var d=new Set(["capture","once","passive","prevent","stop","self"]);function l(e,i){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${i} requires an expression value: ${e.name}=\${…}`),-1)}var s=(e,i)=>({kind:"Attribute",name:i?e.name.slice(1):e.name,value:e.value,boolean:i,loc:e.loc}),a=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let i,t;e.name[0]==="@"?(i="at",t=e.name.slice(1)):e.name.startsWith("on:")?(i="colon",t=e.name.slice(3)):(i="on",t=e.name.slice(2));let[n,...o]=t.split("."),u=n.toLowerCase();for(let r of o)d.has(r)||e.report("invalid-directive",`Unknown event modifier ".${r}" — expected one of ${[...d].join(", ")}`);return{kind:"EventBinding",name:u,syntax:i,modifiers:o,hole:l(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:l(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:l(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:l(e,"style directive"),loc:e.loc})},{id:"load",match:e=>e.startsWith("load:"),build:e=>({kind:"LoadDirective",strategy:e.name.slice(5),modifier:e.value&&e.value.kind==="static"?e.value.value:null,loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:l(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:l(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:l(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:l(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>s(e,!0)}];function D(e,i=a,t={component:!1}){for(let n of i)if(!(n.elementOnly&&t.component)&&n.match(e.name))return n.build(e);return s(e,!1)}
|
package/dist/directives.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EACV,iBAAiB,EAEjB,SAAS,EAGT,UAAU,EACV,cAAc,EAOd,UAAU,
|
|
1
|
+
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EACV,iBAAiB,EAEjB,SAAS,EAGT,UAAU,EACV,cAAc,EAOd,UAAU,EAIX,MAAM,UAAU,CAAC;AAElB,iFAAiF;AACjF,eAAO,MAAM,eAAe,aAAqE,CAAC;AAElG,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC3B,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,UAAU,CAAC;IACpB,kCAAkC;IAClC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,GAAG,EAAE,UAAU,CAAC;IAChB,0DAA0D;IAC1D,MAAM,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,iBAAiB,CAAC;CAC7C;AAED,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,OAAO,CAAC;CACpB;AAkBD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,mBAAmB,EA4JhD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,YAAY,EACjB,UAAU,GAAE,mBAAmB,EAAoB,EACnD,GAAG,GAAE,WAAkC,GACtC,iBAAiB,CAMnB;AAED,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/directives.js
CHANGED
|
@@ -98,6 +98,18 @@ export const CORE_DIRECTIVES = [
|
|
|
98
98
|
loc: raw.loc,
|
|
99
99
|
}),
|
|
100
100
|
},
|
|
101
|
+
// Load strategy: `load:visible[="200px"]`. Components only — an intrinsic element
|
|
102
|
+
// has no module to defer.
|
|
103
|
+
{
|
|
104
|
+
id: 'load',
|
|
105
|
+
match: (n) => n.startsWith('load:'),
|
|
106
|
+
build: (raw) => ({
|
|
107
|
+
kind: 'LoadDirective',
|
|
108
|
+
strategy: raw.name.slice('load:'.length),
|
|
109
|
+
modifier: raw.value && raw.value.kind === 'static' ? raw.value.value : null,
|
|
110
|
+
loc: raw.loc,
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
101
113
|
// Custom directive: `use=${d}` or `use:tooltip[=${opts}]`.
|
|
102
114
|
{
|
|
103
115
|
id: 'use',
|
package/dist/directives.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d=new Set(["capture","once","passive","prevent","stop","self"]);function t(e,i){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${i} requires an expression value: ${e.name}=\${…}`),-1)}var r=(e,i)=>({kind:"Attribute",name:i?e.name.slice(1):e.name,value:e.value,boolean:i,loc:e.loc}),a=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let i,n;e.name[0]==="@"?(i="at",n=e.name.slice(1)):e.name.startsWith("on:")?(i="colon",n=e.name.slice(3)):(i="on",n=e.name.slice(2));let[o,...l]=n.split("."),s=o.toLowerCase();for(let c of l)d.has(c)||e.report("invalid-directive",`Unknown event modifier ".${c}" — expected one of ${[...d].join(", ")}`);return{kind:"EventBinding",name:s,syntax:i,modifiers:l,hole:t(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:t(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:t(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:t(e,"style directive"),loc:e.loc})},{id:"load",match:e=>e.startsWith("load:"),build:e=>({kind:"LoadDirective",strategy:e.name.slice(5),modifier:e.value&&e.value.kind==="static"?e.value.value:null,loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:t(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:t(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:t(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:t(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>r(e,!0)}];function u(e,i=a,n={component:!1}){for(let o of i)if(!(o.elementOnly&&n.component)&&o.match(e.name))return o.build(e);return r(e,!1)}export{a as CORE_DIRECTIVES,d as EVENT_MODIFIERS,u as resolveAttribute};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var N=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var i in t)N(e,i,{get:t[i],enumerable:!0})},L=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of H(t))!V.call(e,r)&&r!==i&&N(e,r,{get:()=>t[r],enumerable:!(n=w(t,r))||n.enumerable});return e};var O=e=>L(N({},"__esModule",{value:!0}),e);var G={};I(G,{CORE_DIRECTIVES:()=>f,Reader:()=>u,childrenOf:()=>E,parse:()=>z,parseTemplate:()=>k,piecesFromStrings:()=>W,resolveAttribute:()=>v,setParents:()=>x});module.exports=O(G);function x(e){let t=(i,n)=>{i.parent=n;let r=E(i);for(let s of r)t(s,i)};return t(e,null),e}function E(e){switch(e.kind){case"Root":case"Element":case"Component":case"Fragment":return e.children;default:return[]}}var u=class{constructor(t){this.pieces=t;this.pi=0;this.oi=0;this.normalize()}normalize(){for(;this.pi<this.pieces.length;){let t=this.pieces[this.pi];if(t.kind==="static"&&this.oi>=t.text.length){this.pi++,this.oi=0;continue}break}}eof(){return this.pi>=this.pieces.length}pos(){if(this.eof()){let i=this.pieces[this.pieces.length-1];return i?i.kind==="static"?i.start+i.text.length:i.end:0}let t=this.pieces[this.pi];return t.kind==="static"?t.start+this.oi:t.start}atHole(){return!this.eof()&&this.pieces[this.pi].kind==="hole"}holeFollows(){if(this.eof())return!1;let t=this.pieces[this.pi];if(t.kind!=="static"||this.oi+1<t.text.length)return!1;let i=this.pieces[this.pi+1];return i!==void 0&&i.kind==="hole"}takeHole(){let t=this.pieces[this.pi];if(t.kind!=="hole")throw new Error("takeHole called off a hole");return this.pi++,this.oi=0,this.normalize(),{index:t.index,loc:{start:t.start,end:t.end}}}peek(t=0){if(this.eof())return"";let i=this.pieces[this.pi];return i.kind!=="static"?"":i.text[this.oi+t]??""}startsWith(t){if(this.eof())return!1;let i=this.pieces[this.pi];return i.kind!=="static"?!1:i.text.startsWith(t,this.oi)}advance(){if(this.eof())return"";let t=this.pieces[this.pi];if(t.kind!=="static")return"";let i=t.text[this.oi++]??"";return this.normalize(),i}readWhile(t){let i="";for(;!this.eof()&&!this.atHole();){let n=this.peek();if(n===""||!t(n))break;i+=n,this.oi++}return this.normalize(),i}skipWhitespace(){this.readWhile(t=>/\s/.test(t))}span(t){return{start:t,end:this.pos()}}};var D=new Set(["capture","once","passive","prevent","stop","self"]);function p(e,t){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${t} requires an expression value: ${e.name}=\${…}`),-1)}var S=(e,t)=>({kind:"Attribute",name:t?e.name.slice(1):e.name,value:e.value,boolean:t,loc:e.loc}),f=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let t,i;e.name[0]==="@"?(t="at",i=e.name.slice(1)):e.name.startsWith("on:")?(t="colon",i=e.name.slice(3)):(t="on",i=e.name.slice(2));let[n,...r]=i.split("."),s=n.toLowerCase();for(let o of r)D.has(o)||e.report("invalid-directive",`Unknown event modifier ".${o}" — expected one of ${[...D].join(", ")}`);return{kind:"EventBinding",name:s,syntax:t,modifiers:r,hole:p(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:p(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:p(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:p(e,"style directive"),loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:p(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:p(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:p(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:p(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>S(e,!0)}];function v(e,t=f,i={component:!1}){for(let n of t)if(!(n.elementOnly&&i.component)&&n.match(e.name))return n.build(e);return S(e,!1)}var T=new Set(["svg","path","circle","rect","line","polygon","polyline","ellipse","g","defs","clipPath","text"]),C=new Set(["script","style","textarea","title"]),A=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function R(e){return e.length>0&&(e[0]!==e[0].toLowerCase()||e.includes("."))}var F=new Set(["a","button","input","select","textarea","summary","details","option","label"]),_=new Set(["keydown","keyup","keypress"]);function m(e,t){return e.attributes.find(i=>"name"in i&&i.name===t)}function U(e){return e.attributes.some(t=>t.kind==="Spread")}function g(e,t){let i=m(e,t);if(!i||i.kind!=="Attribute"||!i.value)return;let n=i.value;return n.kind==="static"?n.value:void 0}function $(e){let t=g(e,"role");return t==="presentation"||t==="none"?!0:g(e,"aria-hidden")==="true"}function B(e,t){return e.attributes.some(i=>i.kind==="EventBinding"&&t(i.name))}function P(e){let t=[],i=(r,s,o)=>{t.push({code:s,message:o,severity:"warning",loc:r.loc})},n=r=>{for(let s of r){s.kind==="Element"&&M(s,i);let o="children"in s?s.children:void 0;o&&n(o)}};return n(e.children),t}function M(e,t){if(U(e))return;let i=e.tag.toLowerCase();i==="img"&&!m(e,"alt")&&!$(e)&&t(e,"a11y-img-alt",'An `img` needs an `alt`. Use `alt=""` when the image is decorative.'),i==="a"&&!m(e,"href")&&!m(e,"role")&&t(e,"a11y-anchor-href","An `a` without `href` is not a link. Use a `button` for an action."),i==="iframe"&&!m(e,"title")&&t(e,"a11y-iframe-title","An `iframe` needs a `title` describing its content.");let n=g(e,"tabindex")??g(e,"tabIndex");n!==void 0&&Number(n)>0&&t(e,"a11y-positive-tabindex","A positive `tabindex` reorders tab navigation for the entire page. Use `0`, or restructure the markup."),!F.has(i)&&B(e,r=>r==="click")&&!m(e,"role")&&!B(e,r=>_.has(r))&&t(e,"a11y-click-without-keyboard",`A click handler on \`${i}\` is unreachable by keyboard. Use a \`button\`, or add a \`role\` and a key handler.`)}var j=/[A-Za-z0-9\-_:@.?]/,y=class{constructor(t,i){this.diagnostics=[];this.r=new u(t),this.svg=i.svg??!1,this.directives=i.directives??f,this.accessibility=i.accessibility??!0}parse(){let t=this.r.pos(),i=[];for(;!this.r.eof()&&(i.push(...this.parseChildren()),!this.r.eof());){let r=this.r.pos();this.consumeCloseTag(),this.report("stray-close-tag","error","Close tag without a matching open tag",this.r.span(r))}let n={kind:"Root",children:i,loc:this.r.span(t)};return x(n),this.validateTree(n),this.accessibility&&this.diagnostics.push(...P(n)),{root:n,diagnostics:this.diagnostics}}validateTree(t){let i=n=>{let r=null;for(let s of n)s.kind==="Text"&&/^\s*$/.test(s.value)||(s.kind==="Element"||s.kind==="Component"?(s.attributes.some(l=>l.kind==="ElseDirective")&&(r!=null&&(r.kind==="Element"||r.kind==="Component")&&r.attributes.some(a=>a.kind==="IfDirective")||this.report("else-without-if","error","`else` must immediately follow an element with `if`",s.loc)),r=s):r=null,"children"in s&&s.children&&i(s.children))};i(t.children)}parseChildren(){let t=[];for(;!this.r.eof()&&!this.r.startsWith("</");){if(this.r.startsWith("<!--")){t.push(this.parseComment());continue}if(this.isFragmentStart()){t.push(this.parseFragment());continue}if(this.isDynamicTagStart()){t.push(this.parseDynamicComponent());continue}if(this.isTagStart()){t.push(this.parseElement());continue}if(this.r.atHole()){let n=this.r.takeHole(),r={kind:"Expression",hole:n.index,loc:n.loc};t.push(r);continue}let i=this.readText();i&&t.push(i)}return t}isTagStart(){return this.r.peek()==="<"&&/[A-Za-z]/.test(this.r.peek(1))}isFragmentStart(){return this.r.peek()==="<"&&this.r.peek(1)===">"}isDynamicTagStart(){return this.r.peek()==="<"&&this.r.holeFollows()}parseDynamicComponent(){let t=this.r.pos();this.r.advance();let i=this.r.takeHole().index,n=this.parseAttributes(!0);this.r.skipWhitespace();let r=!1,s=[];return this.r.startsWith("/>")?(this.r.advance(),this.r.advance(),r=!0):(this.r.peek()===">"&&this.r.advance(),s=this.parseChildren(),this.r.startsWith("</")?(this.r.advance(),this.r.advance(),this.r.atHole()?this.r.takeHole():this.readName(),this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance()):this.report("unclosed-tag","error","Unclosed dynamic component",this.r.span(t))),{kind:"Component",tag:"",tagHole:i,attributes:n,children:s,selfClosing:r,loc:this.r.span(t)}}readText(){let t=this.r.pos(),i="";for(;!this.r.eof()&&!this.r.atHole()&&!(this.r.startsWith("</")||this.r.startsWith("<!--")||this.isTagStart()||this.isFragmentStart()||this.isDynamicTagStart());)i+=this.r.advance();return i?{kind:"Text",value:i,raw:!1,loc:this.r.span(t)}:null}parseComment(){let t=this.r.pos();this.r.advance(),this.r.advance(),this.r.advance(),this.r.advance();let i="";for(;!this.r.eof()&&!this.r.startsWith("-->");){if(this.r.atHole()){this.r.takeHole(),i+="\0";continue}i+=this.r.advance()}return this.r.startsWith("-->")?(this.r.advance(),this.r.advance(),this.r.advance()):this.report("unclosed-comment","warning","Unterminated comment",this.r.span(t)),{kind:"Comment",value:i,loc:this.r.span(t)}}parseFragment(){let t=this.r.pos();this.r.advance(),this.r.advance();let i=this.parseChildren();if(this.r.startsWith("</")){let n=this.consumeCloseTag();n&&this.report("mismatched-close-tag","error",`Expected </> to close fragment, got </${n}>`,this.r.span(t))}else this.report("unclosed-tag","error","Unterminated fragment",this.r.span(t));return{kind:"Fragment",children:i,loc:this.r.span(t)}}parseElement(){let t=this.r.pos();this.r.advance();let i=this.readName(),n=R(i),r=this.parseAttributes(n);this.foldEachKey(r,t),this.r.skipWhitespace();let s=i.toLowerCase(),o=!n&&C.has(s),l=!n&&A.has(s),a=!1,c=[];if(this.r.startsWith("/>"))this.r.advance(),this.r.advance(),a=!0;else if(this.r.peek()===">"&&this.r.advance(),!l)if(c=o?this.parseRawText(i):this.parseChildren(),this.r.startsWith("</")){let b=this.consumeCloseTag();b&&b!==i&&this.report("mismatched-close-tag","error",`Expected </${i}>, got </${b}>`,this.r.span(t))}else this.report("unclosed-tag","error",`Unclosed <${i}>`,this.r.span(t));let h=this.r.span(t);if(n)return{kind:"Component",tag:i,tagHole:null,attributes:r,children:c,selfClosing:a,loc:h};let d=this.svg||T.has(i)?"svg":"html";return{kind:"Element",tag:i,namespace:d,attributes:r,children:c,selfClosing:a,rawText:o,loc:h}}parseRawText(t){let i=[],n="</"+t.toLowerCase(),r="",s=this.r.pos(),o=()=>{r&&i.push({kind:"Text",value:r,raw:!0,loc:this.r.span(s)}),r=""};for(;!this.r.eof()&&!this.startsWithCloseFor(n);){if(this.r.atHole()){o();let l=this.r.takeHole();i.push({kind:"Expression",hole:l.index,loc:l.loc}),s=this.r.pos();continue}r||(s=this.r.pos()),r+=this.r.advance()}return o(),i}startsWithCloseFor(t){let i=0;for(;i<t.length;){let n=this.r.peek(i);if(n===""||n.toLowerCase()!==t[i])return!1;i++}return!0}parseAttributes(t){let i=[];for(;!this.r.eof()&&(this.r.skipWhitespace(),!(this.r.peek()===">"||this.r.startsWith("/>")));){if(this.r.atHole()){let a=this.r.takeHole();i.push({kind:"Spread",hole:a.index,loc:a.loc});continue}if(this.r.startsWith("...")){let a=this.r.pos();if(this.r.advance(),this.r.advance(),this.r.advance(),this.r.atHole()){let c=this.r.takeHole();i.push({kind:"Spread",hole:c.index,loc:this.r.span(a)})}else this.report("invalid-binding","error","Spread `...` must be followed by ${…}",this.r.span(a));continue}let n=this.r.pos(),r=this.readName();if(!r){this.r.advance();continue}let s=this.r.span(n);this.r.skipWhitespace();let o=null;this.r.peek()==="="&&(this.r.advance(),this.r.skipWhitespace(),o=this.parseAttrValue());let l={name:r,nameLoc:s,value:o,loc:this.r.span(n),report:(a,c)=>this.report(a,"error",c,this.r.span(n))};i.push(v(l,this.directives,{component:t}))}return i}parseAttrValue(){if(this.r.atHole())return{kind:"hole",hole:this.r.takeHole().index};let t=this.r.peek();return t==='"'||t==="'"?this.classifyParts(this.readQuotedParts(t)):{kind:"static",value:this.r.readWhile(n=>!/[\s>]/.test(n))}}readQuotedParts(t){this.r.advance();let i=[],n="";for(;!this.r.eof()&&this.r.peek()!==t;){if(this.r.atHole()){n&&(i.push({text:n}),n=""),i.push({hole:this.r.takeHole().index});continue}let r=this.r.advance();if(r==="")break;n+=r}return n&&i.push({text:n}),this.r.peek()===t&&this.r.advance(),i}classifyParts(t){let i=t.filter(n=>"hole"in n);return i.length===0?{kind:"static",value:t.map(n=>"text"in n?n.text:"").join("")}:t.length===1?{kind:"hole",hole:i[0].hole}:{kind:"mixed",parts:t}}foldEachKey(t,i){let n=null,r=0,s=0,o=0,l=0;for(let d of t)d.kind==="EachDirective"?(n=d,s++):d.kind==="IfDirective"?r++:d.kind==="ElseDirective"?o++:d.kind==="RefBinding"&&l++;let a=this.r.span(i);s>1&&this.report("duplicate-directive","error","Multiple `each` directives on one element",a),r>1&&this.report("duplicate-directive","error","Multiple `if` directives on one element",a),l>1&&this.report("duplicate-directive","error","Multiple `ref` bindings on one element",a),r>0&&s>0&&this.report("unsupported-combination","error","`if` and `each` cannot both apply to one element — wrap one in another element",a),r>0&&o>0&&this.report("invalid-directive","error","`if` and `else` cannot be on the same element",a);let c=t.findIndex(d=>d.kind==="Attribute"&&d.name==="key");if(!n){c!==-1&&this.report("invalid-directive","error","`key` requires an `each` directive on the same element",a);return}if(c===-1)return;let h=t[c];h.kind==="Attribute"&&h.value&&(h.value.kind==="static"?n.key={static:h.value.value}:h.value.kind==="hole"&&(n.key={hole:h.value.hole})),t.splice(c,1)}readName(){return this.r.readWhile(t=>j.test(t))}consumeCloseTag(){this.r.advance(),this.r.advance();let t=this.readName();return this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance(),t}report(t,i,n,r){this.diagnostics.push({code:t,severity:i,message:n,loc:r})}};function k(e,t={}){return new y(e,t).parse()}function W(e){let t=[],i=0;return e.forEach((n,r)=>{t.push({kind:"static",text:n,start:i}),i+=n.length,r<e.length-1&&t.push({kind:"hole",index:r,start:i,end:i})}),t}function z(e,t={}){return k(W(e),t)}
|
|
1
|
+
"use strict";var b=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var i in t)b(e,i,{get:t[i],enumerable:!0})},I=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of H(t))!L.call(e,r)&&r!==i&&b(e,r,{get:()=>t[r],enumerable:!(n=w(t,r))||n.enumerable});return e};var O=e=>I(b({},"__esModule",{value:!0}),e);var G={};V(G,{CORE_DIRECTIVES:()=>f,Reader:()=>u,childrenOf:()=>D,parse:()=>z,parseTemplate:()=>k,piecesFromStrings:()=>W,resolveAttribute:()=>v,setParents:()=>x});module.exports=O(G);function x(e){let t=(i,n)=>{i.parent=n;let r=D(i);for(let s of r)t(s,i)};return t(e,null),e}function D(e){switch(e.kind){case"Root":case"Element":case"Component":case"Fragment":return e.children;default:return[]}}var u=class{constructor(t){this.pieces=t;this.pi=0;this.oi=0;this.normalize()}normalize(){for(;this.pi<this.pieces.length;){let t=this.pieces[this.pi];if(t.kind==="static"&&this.oi>=t.text.length){this.pi++,this.oi=0;continue}break}}eof(){return this.pi>=this.pieces.length}pos(){if(this.eof()){let i=this.pieces[this.pieces.length-1];return i?i.kind==="static"?i.start+i.text.length:i.end:0}let t=this.pieces[this.pi];return t.kind==="static"?t.start+this.oi:t.start}atHole(){return!this.eof()&&this.pieces[this.pi].kind==="hole"}holeFollows(){if(this.eof())return!1;let t=this.pieces[this.pi];if(t.kind!=="static"||this.oi+1<t.text.length)return!1;let i=this.pieces[this.pi+1];return i!==void 0&&i.kind==="hole"}takeHole(){let t=this.pieces[this.pi];if(t.kind!=="hole")throw new Error("takeHole called off a hole");return this.pi++,this.oi=0,this.normalize(),{index:t.index,loc:{start:t.start,end:t.end}}}peek(t=0){if(this.eof())return"";let i=this.pieces[this.pi];return i.kind!=="static"?"":i.text[this.oi+t]??""}startsWith(t){if(this.eof())return!1;let i=this.pieces[this.pi];return i.kind!=="static"?!1:i.text.startsWith(t,this.oi)}advance(){if(this.eof())return"";let t=this.pieces[this.pi];if(t.kind!=="static")return"";let i=t.text[this.oi++]??"";return this.normalize(),i}readWhile(t){let i="";for(;!this.eof()&&!this.atHole();){let n=this.peek();if(n===""||!t(n))break;i+=n,this.oi++}return this.normalize(),i}skipWhitespace(){this.readWhile(t=>/\s/.test(t))}span(t){return{start:t,end:this.pos()}}};var E=new Set(["capture","once","passive","prevent","stop","self"]);function p(e,t){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${t} requires an expression value: ${e.name}=\${…}`),-1)}var S=(e,t)=>({kind:"Attribute",name:t?e.name.slice(1):e.name,value:e.value,boolean:t,loc:e.loc}),f=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let t,i;e.name[0]==="@"?(t="at",i=e.name.slice(1)):e.name.startsWith("on:")?(t="colon",i=e.name.slice(3)):(t="on",i=e.name.slice(2));let[n,...r]=i.split("."),s=n.toLowerCase();for(let o of r)E.has(o)||e.report("invalid-directive",`Unknown event modifier ".${o}" — expected one of ${[...E].join(", ")}`);return{kind:"EventBinding",name:s,syntax:t,modifiers:r,hole:p(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:p(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:p(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:p(e,"style directive"),loc:e.loc})},{id:"load",match:e=>e.startsWith("load:"),build:e=>({kind:"LoadDirective",strategy:e.name.slice(5),modifier:e.value&&e.value.kind==="static"?e.value.value:null,loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:p(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:p(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:p(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:p(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>S(e,!0)}];function v(e,t=f,i={component:!1}){for(let n of t)if(!(n.elementOnly&&i.component)&&n.match(e.name))return n.build(e);return S(e,!1)}var T=new Set(["svg","path","circle","rect","line","polygon","polyline","ellipse","g","defs","clipPath","text"]),C=new Set(["script","style","textarea","title"]),A=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function B(e){return e.length>0&&(e[0]!==e[0].toLowerCase()||e.includes("."))}var F=new Set(["a","button","input","select","textarea","summary","details","option","label"]),_=new Set(["keydown","keyup","keypress"]);function m(e,t){return e.attributes.find(i=>"name"in i&&i.name===t)}function U(e){return e.attributes.some(t=>t.kind==="Spread")}function g(e,t){let i=m(e,t);if(!i||i.kind!=="Attribute"||!i.value)return;let n=i.value;return n.kind==="static"?n.value:void 0}function $(e){let t=g(e,"role");return t==="presentation"||t==="none"?!0:g(e,"aria-hidden")==="true"}function R(e,t){return e.attributes.some(i=>i.kind==="EventBinding"&&t(i.name))}function P(e){let t=[],i=(r,s,o)=>{t.push({code:s,message:o,severity:"warning",loc:r.loc})},n=r=>{for(let s of r){s.kind==="Element"&&M(s,i);let o="children"in s?s.children:void 0;o&&n(o)}};return n(e.children),t}function M(e,t){if(U(e))return;let i=e.tag.toLowerCase();i==="img"&&!m(e,"alt")&&!$(e)&&t(e,"a11y-img-alt",'An `img` needs an `alt`. Use `alt=""` when the image is decorative.'),i==="a"&&!m(e,"href")&&!m(e,"role")&&t(e,"a11y-anchor-href","An `a` without `href` is not a link. Use a `button` for an action."),i==="iframe"&&!m(e,"title")&&t(e,"a11y-iframe-title","An `iframe` needs a `title` describing its content.");let n=g(e,"tabindex")??g(e,"tabIndex");n!==void 0&&Number(n)>0&&t(e,"a11y-positive-tabindex","A positive `tabindex` reorders tab navigation for the entire page. Use `0`, or restructure the markup."),!F.has(i)&&R(e,r=>r==="click")&&!m(e,"role")&&!R(e,r=>_.has(r))&&t(e,"a11y-click-without-keyboard",`A click handler on \`${i}\` is unreachable by keyboard. Use a \`button\`, or add a \`role\` and a key handler.`)}var j=/[A-Za-z0-9\-_:@.?]/,y=class{constructor(t,i){this.diagnostics=[];this.r=new u(t),this.svg=i.svg??!1,this.directives=i.directives??f,this.accessibility=i.accessibility??!0}parse(){let t=this.r.pos(),i=[];for(;!this.r.eof()&&(i.push(...this.parseChildren()),!this.r.eof());){let r=this.r.pos();this.consumeCloseTag(),this.report("stray-close-tag","error","Close tag without a matching open tag",this.r.span(r))}let n={kind:"Root",children:i,loc:this.r.span(t)};return x(n),this.validateTree(n),this.accessibility&&this.diagnostics.push(...P(n)),{root:n,diagnostics:this.diagnostics}}validateTree(t){let i=n=>{let r=null;for(let s of n)s.kind==="Text"&&/^\s*$/.test(s.value)||(s.kind==="Element"||s.kind==="Component"?(s.attributes.some(l=>l.kind==="ElseDirective")&&(r!=null&&(r.kind==="Element"||r.kind==="Component")&&r.attributes.some(a=>a.kind==="IfDirective")||this.report("else-without-if","error","`else` must immediately follow an element with `if`",s.loc)),r=s):r=null,"children"in s&&s.children&&i(s.children))};i(t.children)}parseChildren(){let t=[];for(;!this.r.eof()&&!this.r.startsWith("</");){if(this.r.startsWith("<!--")){t.push(this.parseComment());continue}if(this.isFragmentStart()){t.push(this.parseFragment());continue}if(this.isDynamicTagStart()){t.push(this.parseDynamicComponent());continue}if(this.isTagStart()){t.push(this.parseElement());continue}if(this.r.atHole()){let n=this.r.takeHole(),r={kind:"Expression",hole:n.index,loc:n.loc};t.push(r);continue}let i=this.readText();i&&t.push(i)}return t}isTagStart(){return this.r.peek()==="<"&&/[A-Za-z]/.test(this.r.peek(1))}isFragmentStart(){return this.r.peek()==="<"&&this.r.peek(1)===">"}isDynamicTagStart(){return this.r.peek()==="<"&&this.r.holeFollows()}parseDynamicComponent(){let t=this.r.pos();this.r.advance();let i=this.r.takeHole().index,n=this.parseAttributes(!0);this.r.skipWhitespace();let r=!1,s=[];return this.r.startsWith("/>")?(this.r.advance(),this.r.advance(),r=!0):(this.r.peek()===">"&&this.r.advance(),s=this.parseChildren(),this.r.startsWith("</")?(this.r.advance(),this.r.advance(),this.r.atHole()?this.r.takeHole():this.readName(),this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance()):this.report("unclosed-tag","error","Unclosed dynamic component",this.r.span(t))),{kind:"Component",tag:"",tagHole:i,attributes:n,children:s,selfClosing:r,loc:this.r.span(t)}}readText(){let t=this.r.pos(),i="";for(;!this.r.eof()&&!this.r.atHole()&&!(this.r.startsWith("</")||this.r.startsWith("<!--")||this.isTagStart()||this.isFragmentStart()||this.isDynamicTagStart());)i+=this.r.advance();return i?{kind:"Text",value:i,raw:!1,loc:this.r.span(t)}:null}parseComment(){let t=this.r.pos();this.r.advance(),this.r.advance(),this.r.advance(),this.r.advance();let i="";for(;!this.r.eof()&&!this.r.startsWith("-->");){if(this.r.atHole()){this.r.takeHole(),i+="\0";continue}i+=this.r.advance()}return this.r.startsWith("-->")?(this.r.advance(),this.r.advance(),this.r.advance()):this.report("unclosed-comment","warning","Unterminated comment",this.r.span(t)),{kind:"Comment",value:i,loc:this.r.span(t)}}parseFragment(){let t=this.r.pos();this.r.advance(),this.r.advance();let i=this.parseChildren();if(this.r.startsWith("</")){let n=this.consumeCloseTag();n&&this.report("mismatched-close-tag","error",`Expected </> to close fragment, got </${n}>`,this.r.span(t))}else this.report("unclosed-tag","error","Unterminated fragment",this.r.span(t));return{kind:"Fragment",children:i,loc:this.r.span(t)}}parseElement(){let t=this.r.pos();this.r.advance();let i=this.readName(),n=B(i),r=this.parseAttributes(n);this.foldEachKey(r,t),this.r.skipWhitespace();let s=i.toLowerCase(),o=!n&&C.has(s),l=!n&&A.has(s),a=!1,c=[];if(this.r.startsWith("/>"))this.r.advance(),this.r.advance(),a=!0;else if(this.r.peek()===">"&&this.r.advance(),!l)if(c=o?this.parseRawText(i):this.parseChildren(),this.r.startsWith("</")){let N=this.consumeCloseTag();N&&N!==i&&this.report("mismatched-close-tag","error",`Expected </${i}>, got </${N}>`,this.r.span(t))}else this.report("unclosed-tag","error",`Unclosed <${i}>`,this.r.span(t));let h=this.r.span(t);if(n)return{kind:"Component",tag:i,tagHole:null,attributes:r,children:c,selfClosing:a,loc:h};let d=this.svg||T.has(i)?"svg":"html";return{kind:"Element",tag:i,namespace:d,attributes:r,children:c,selfClosing:a,rawText:o,loc:h}}parseRawText(t){let i=[],n="</"+t.toLowerCase(),r="",s=this.r.pos(),o=()=>{r&&i.push({kind:"Text",value:r,raw:!0,loc:this.r.span(s)}),r=""};for(;!this.r.eof()&&!this.startsWithCloseFor(n);){if(this.r.atHole()){o();let l=this.r.takeHole();i.push({kind:"Expression",hole:l.index,loc:l.loc}),s=this.r.pos();continue}r||(s=this.r.pos()),r+=this.r.advance()}return o(),i}startsWithCloseFor(t){let i=0;for(;i<t.length;){let n=this.r.peek(i);if(n===""||n.toLowerCase()!==t[i])return!1;i++}return!0}parseAttributes(t){let i=[];for(;!this.r.eof()&&(this.r.skipWhitespace(),!(this.r.peek()===">"||this.r.startsWith("/>")));){if(this.r.atHole()){let a=this.r.takeHole();i.push({kind:"Spread",hole:a.index,loc:a.loc});continue}if(this.r.startsWith("...")){let a=this.r.pos();if(this.r.advance(),this.r.advance(),this.r.advance(),this.r.atHole()){let c=this.r.takeHole();i.push({kind:"Spread",hole:c.index,loc:this.r.span(a)})}else this.report("invalid-binding","error","Spread `...` must be followed by ${…}",this.r.span(a));continue}let n=this.r.pos(),r=this.readName();if(!r){this.r.advance();continue}let s=this.r.span(n);this.r.skipWhitespace();let o=null;this.r.peek()==="="&&(this.r.advance(),this.r.skipWhitespace(),o=this.parseAttrValue());let l={name:r,nameLoc:s,value:o,loc:this.r.span(n),report:(a,c)=>this.report(a,"error",c,this.r.span(n))};i.push(v(l,this.directives,{component:t}))}return i}parseAttrValue(){if(this.r.atHole())return{kind:"hole",hole:this.r.takeHole().index};let t=this.r.peek();return t==='"'||t==="'"?this.classifyParts(this.readQuotedParts(t)):{kind:"static",value:this.r.readWhile(n=>!/[\s>]/.test(n))}}readQuotedParts(t){this.r.advance();let i=[],n="";for(;!this.r.eof()&&this.r.peek()!==t;){if(this.r.atHole()){n&&(i.push({text:n}),n=""),i.push({hole:this.r.takeHole().index});continue}let r=this.r.advance();if(r==="")break;n+=r}return n&&i.push({text:n}),this.r.peek()===t&&this.r.advance(),i}classifyParts(t){let i=t.filter(n=>"hole"in n);return i.length===0?{kind:"static",value:t.map(n=>"text"in n?n.text:"").join("")}:t.length===1?{kind:"hole",hole:i[0].hole}:{kind:"mixed",parts:t}}foldEachKey(t,i){let n=null,r=0,s=0,o=0,l=0;for(let d of t)d.kind==="EachDirective"?(n=d,s++):d.kind==="IfDirective"?r++:d.kind==="ElseDirective"?o++:d.kind==="RefBinding"&&l++;let a=this.r.span(i);s>1&&this.report("duplicate-directive","error","Multiple `each` directives on one element",a),r>1&&this.report("duplicate-directive","error","Multiple `if` directives on one element",a),l>1&&this.report("duplicate-directive","error","Multiple `ref` bindings on one element",a),r>0&&s>0&&this.report("unsupported-combination","error","`if` and `each` cannot both apply to one element — wrap one in another element",a),r>0&&o>0&&this.report("invalid-directive","error","`if` and `else` cannot be on the same element",a);let c=t.findIndex(d=>d.kind==="Attribute"&&d.name==="key");if(!n){c!==-1&&this.report("invalid-directive","error","`key` requires an `each` directive on the same element",a);return}if(c===-1)return;let h=t[c];h.kind==="Attribute"&&h.value&&(h.value.kind==="static"?n.key={static:h.value.value}:h.value.kind==="hole"&&(n.key={hole:h.value.hole})),t.splice(c,1)}readName(){return this.r.readWhile(t=>j.test(t))}consumeCloseTag(){this.r.advance(),this.r.advance();let t=this.readName();return this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance(),t}report(t,i,n,r){this.diagnostics.push({code:t,severity:i,message:n,loc:r})}};function k(e,t={}){return new y(e,t).parse()}function W(e){let t=[],i=0;return e.forEach((n,r)=>{t.push({kind:"static",text:n,start:i}),i+=n.length,r<e.length-1&&t.push({kind:"hole",index:r,start:i,end:i})}),t}function z(e,t={}){return k(W(e),t)}
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function x(e){let t=(i,n)=>{i.parent=n;let r=B(i);for(let s of r)t(s,i)};return t(e,null),e}function B(e){switch(e.kind){case"Root":case"Element":case"Component":case"Fragment":return e.children;default:return[]}}var m=class{constructor(t){this.pieces=t;this.pi=0;this.oi=0;this.normalize()}normalize(){for(;this.pi<this.pieces.length;){let t=this.pieces[this.pi];if(t.kind==="static"&&this.oi>=t.text.length){this.pi++,this.oi=0;continue}break}}eof(){return this.pi>=this.pieces.length}pos(){if(this.eof()){let i=this.pieces[this.pieces.length-1];return i?i.kind==="static"?i.start+i.text.length:i.end:0}let t=this.pieces[this.pi];return t.kind==="static"?t.start+this.oi:t.start}atHole(){return!this.eof()&&this.pieces[this.pi].kind==="hole"}holeFollows(){if(this.eof())return!1;let t=this.pieces[this.pi];if(t.kind!=="static"||this.oi+1<t.text.length)return!1;let i=this.pieces[this.pi+1];return i!==void 0&&i.kind==="hole"}takeHole(){let t=this.pieces[this.pi];if(t.kind!=="hole")throw new Error("takeHole called off a hole");return this.pi++,this.oi=0,this.normalize(),{index:t.index,loc:{start:t.start,end:t.end}}}peek(t=0){if(this.eof())return"";let i=this.pieces[this.pi];return i.kind!=="static"?"":i.text[this.oi+t]??""}startsWith(t){if(this.eof())return!1;let i=this.pieces[this.pi];return i.kind!=="static"?!1:i.text.startsWith(t,this.oi)}advance(){if(this.eof())return"";let t=this.pieces[this.pi];if(t.kind!=="static")return"";let i=t.text[this.oi++]??"";return this.normalize(),i}readWhile(t){let i="";for(;!this.eof()&&!this.atHole();){let n=this.peek();if(n===""||!t(n))break;i+=n,this.oi++}return this.normalize(),i}skipWhitespace(){this.readWhile(t=>/\s/.test(t))}span(t){return{start:t,end:this.pos()}}};var y=new Set(["capture","once","passive","prevent","stop","self"]);function p(e,t){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${t} requires an expression value: ${e.name}=\${…}`),-1)}var E=(e,t)=>({kind:"Attribute",name:t?e.name.slice(1):e.name,value:e.value,boolean:t,loc:e.loc}),f=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let t,i;e.name[0]==="@"?(t="at",i=e.name.slice(1)):e.name.startsWith("on:")?(t="colon",i=e.name.slice(3)):(t="on",i=e.name.slice(2));let[n,...r]=i.split("."),s=n.toLowerCase();for(let o of r)y.has(o)||e.report("invalid-directive",`Unknown event modifier ".${o}" — expected one of ${[...y].join(", ")}`);return{kind:"EventBinding",name:s,syntax:t,modifiers:r,hole:p(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:p(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:p(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:p(e,"style directive"),loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:p(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:p(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:p(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:p(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>E(e,!0)}];function k(e,t=f,i={component:!1}){for(let n of t)if(!(n.elementOnly&&i.component)&&n.match(e.name))return n.build(e);return E(e,!1)}var D=new Set(["svg","path","circle","rect","line","polygon","polyline","ellipse","g","defs","clipPath","text"]),S=new Set(["script","style","textarea","title"]),T=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function C(e){return e.length>0&&(e[0]!==e[0].toLowerCase()||e.includes("."))}var P=new Set(["a","button","input","select","textarea","summary","details","option","label"]),W=new Set(["keydown","keyup","keypress"]);function u(e,t){return e.attributes.find(i=>"name"in i&&i.name===t)}function w(e){return e.attributes.some(t=>t.kind==="Spread")}function v(e,t){let i=u(e,t);if(!i||i.kind!=="Attribute"||!i.value)return;let n=i.value;return n.kind==="static"?n.value:void 0}function H(e){let t=v(e,"role");return t==="presentation"||t==="none"?!0:v(e,"aria-hidden")==="true"}function A(e,t){return e.attributes.some(i=>i.kind==="EventBinding"&&t(i.name))}function R(e){let t=[],i=(r,s,o)=>{t.push({code:s,message:o,severity:"warning",loc:r.loc})},n=r=>{for(let s of r){s.kind==="Element"&&V(s,i);let o="children"in s?s.children:void 0;o&&n(o)}};return n(e.children),t}function V(e,t){if(w(e))return;let i=e.tag.toLowerCase();i==="img"&&!u(e,"alt")&&!H(e)&&t(e,"a11y-img-alt",'An `img` needs an `alt`. Use `alt=""` when the image is decorative.'),i==="a"&&!u(e,"href")&&!u(e,"role")&&t(e,"a11y-anchor-href","An `a` without `href` is not a link. Use a `button` for an action."),i==="iframe"&&!u(e,"title")&&t(e,"a11y-iframe-title","An `iframe` needs a `title` describing its content.");let n=v(e,"tabindex")??v(e,"tabIndex");n!==void 0&&Number(n)>0&&t(e,"a11y-positive-tabindex","A positive `tabindex` reorders tab navigation for the entire page. Use `0`, or restructure the markup."),!P.has(i)&&A(e,r=>r==="click")&&!u(e,"role")&&!A(e,r=>W.has(r))&&t(e,"a11y-click-without-keyboard",`A click handler on \`${i}\` is unreachable by keyboard. Use a \`button\`, or add a \`role\` and a key handler.`)}var I=/[A-Za-z0-9\-_:@.?]/,b=class{constructor(t,i){this.diagnostics=[];this.r=new m(t),this.svg=i.svg??!1,this.directives=i.directives??f,this.accessibility=i.accessibility??!0}parse(){let t=this.r.pos(),i=[];for(;!this.r.eof()&&(i.push(...this.parseChildren()),!this.r.eof());){let r=this.r.pos();this.consumeCloseTag(),this.report("stray-close-tag","error","Close tag without a matching open tag",this.r.span(r))}let n={kind:"Root",children:i,loc:this.r.span(t)};return x(n),this.validateTree(n),this.accessibility&&this.diagnostics.push(...R(n)),{root:n,diagnostics:this.diagnostics}}validateTree(t){let i=n=>{let r=null;for(let s of n)s.kind==="Text"&&/^\s*$/.test(s.value)||(s.kind==="Element"||s.kind==="Component"?(s.attributes.some(l=>l.kind==="ElseDirective")&&(r!=null&&(r.kind==="Element"||r.kind==="Component")&&r.attributes.some(a=>a.kind==="IfDirective")||this.report("else-without-if","error","`else` must immediately follow an element with `if`",s.loc)),r=s):r=null,"children"in s&&s.children&&i(s.children))};i(t.children)}parseChildren(){let t=[];for(;!this.r.eof()&&!this.r.startsWith("</");){if(this.r.startsWith("<!--")){t.push(this.parseComment());continue}if(this.isFragmentStart()){t.push(this.parseFragment());continue}if(this.isDynamicTagStart()){t.push(this.parseDynamicComponent());continue}if(this.isTagStart()){t.push(this.parseElement());continue}if(this.r.atHole()){let n=this.r.takeHole(),r={kind:"Expression",hole:n.index,loc:n.loc};t.push(r);continue}let i=this.readText();i&&t.push(i)}return t}isTagStart(){return this.r.peek()==="<"&&/[A-Za-z]/.test(this.r.peek(1))}isFragmentStart(){return this.r.peek()==="<"&&this.r.peek(1)===">"}isDynamicTagStart(){return this.r.peek()==="<"&&this.r.holeFollows()}parseDynamicComponent(){let t=this.r.pos();this.r.advance();let i=this.r.takeHole().index,n=this.parseAttributes(!0);this.r.skipWhitespace();let r=!1,s=[];return this.r.startsWith("/>")?(this.r.advance(),this.r.advance(),r=!0):(this.r.peek()===">"&&this.r.advance(),s=this.parseChildren(),this.r.startsWith("</")?(this.r.advance(),this.r.advance(),this.r.atHole()?this.r.takeHole():this.readName(),this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance()):this.report("unclosed-tag","error","Unclosed dynamic component",this.r.span(t))),{kind:"Component",tag:"",tagHole:i,attributes:n,children:s,selfClosing:r,loc:this.r.span(t)}}readText(){let t=this.r.pos(),i="";for(;!this.r.eof()&&!this.r.atHole()&&!(this.r.startsWith("</")||this.r.startsWith("<!--")||this.isTagStart()||this.isFragmentStart()||this.isDynamicTagStart());)i+=this.r.advance();return i?{kind:"Text",value:i,raw:!1,loc:this.r.span(t)}:null}parseComment(){let t=this.r.pos();this.r.advance(),this.r.advance(),this.r.advance(),this.r.advance();let i="";for(;!this.r.eof()&&!this.r.startsWith("-->");){if(this.r.atHole()){this.r.takeHole(),i+="\0";continue}i+=this.r.advance()}return this.r.startsWith("-->")?(this.r.advance(),this.r.advance(),this.r.advance()):this.report("unclosed-comment","warning","Unterminated comment",this.r.span(t)),{kind:"Comment",value:i,loc:this.r.span(t)}}parseFragment(){let t=this.r.pos();this.r.advance(),this.r.advance();let i=this.parseChildren();if(this.r.startsWith("</")){let n=this.consumeCloseTag();n&&this.report("mismatched-close-tag","error",`Expected </> to close fragment, got </${n}>`,this.r.span(t))}else this.report("unclosed-tag","error","Unterminated fragment",this.r.span(t));return{kind:"Fragment",children:i,loc:this.r.span(t)}}parseElement(){let t=this.r.pos();this.r.advance();let i=this.readName(),n=C(i),r=this.parseAttributes(n);this.foldEachKey(r,t),this.r.skipWhitespace();let s=i.toLowerCase(),o=!n&&S.has(s),l=!n&&T.has(s),a=!1,c=[];if(this.r.startsWith("/>"))this.r.advance(),this.r.advance(),a=!0;else if(this.r.peek()===">"&&this.r.advance(),!l)if(c=o?this.parseRawText(i):this.parseChildren(),this.r.startsWith("</")){let g=this.consumeCloseTag();g&&g!==i&&this.report("mismatched-close-tag","error",`Expected </${i}>, got </${g}>`,this.r.span(t))}else this.report("unclosed-tag","error",`Unclosed <${i}>`,this.r.span(t));let h=this.r.span(t);if(n)return{kind:"Component",tag:i,tagHole:null,attributes:r,children:c,selfClosing:a,loc:h};let d=this.svg||D.has(i)?"svg":"html";return{kind:"Element",tag:i,namespace:d,attributes:r,children:c,selfClosing:a,rawText:o,loc:h}}parseRawText(t){let i=[],n="</"+t.toLowerCase(),r="",s=this.r.pos(),o=()=>{r&&i.push({kind:"Text",value:r,raw:!0,loc:this.r.span(s)}),r=""};for(;!this.r.eof()&&!this.startsWithCloseFor(n);){if(this.r.atHole()){o();let l=this.r.takeHole();i.push({kind:"Expression",hole:l.index,loc:l.loc}),s=this.r.pos();continue}r||(s=this.r.pos()),r+=this.r.advance()}return o(),i}startsWithCloseFor(t){let i=0;for(;i<t.length;){let n=this.r.peek(i);if(n===""||n.toLowerCase()!==t[i])return!1;i++}return!0}parseAttributes(t){let i=[];for(;!this.r.eof()&&(this.r.skipWhitespace(),!(this.r.peek()===">"||this.r.startsWith("/>")));){if(this.r.atHole()){let a=this.r.takeHole();i.push({kind:"Spread",hole:a.index,loc:a.loc});continue}if(this.r.startsWith("...")){let a=this.r.pos();if(this.r.advance(),this.r.advance(),this.r.advance(),this.r.atHole()){let c=this.r.takeHole();i.push({kind:"Spread",hole:c.index,loc:this.r.span(a)})}else this.report("invalid-binding","error","Spread `...` must be followed by ${…}",this.r.span(a));continue}let n=this.r.pos(),r=this.readName();if(!r){this.r.advance();continue}let s=this.r.span(n);this.r.skipWhitespace();let o=null;this.r.peek()==="="&&(this.r.advance(),this.r.skipWhitespace(),o=this.parseAttrValue());let l={name:r,nameLoc:s,value:o,loc:this.r.span(n),report:(a,c)=>this.report(a,"error",c,this.r.span(n))};i.push(k(l,this.directives,{component:t}))}return i}parseAttrValue(){if(this.r.atHole())return{kind:"hole",hole:this.r.takeHole().index};let t=this.r.peek();return t==='"'||t==="'"?this.classifyParts(this.readQuotedParts(t)):{kind:"static",value:this.r.readWhile(n=>!/[\s>]/.test(n))}}readQuotedParts(t){this.r.advance();let i=[],n="";for(;!this.r.eof()&&this.r.peek()!==t;){if(this.r.atHole()){n&&(i.push({text:n}),n=""),i.push({hole:this.r.takeHole().index});continue}let r=this.r.advance();if(r==="")break;n+=r}return n&&i.push({text:n}),this.r.peek()===t&&this.r.advance(),i}classifyParts(t){let i=t.filter(n=>"hole"in n);return i.length===0?{kind:"static",value:t.map(n=>"text"in n?n.text:"").join("")}:t.length===1?{kind:"hole",hole:i[0].hole}:{kind:"mixed",parts:t}}foldEachKey(t,i){let n=null,r=0,s=0,o=0,l=0;for(let d of t)d.kind==="EachDirective"?(n=d,s++):d.kind==="IfDirective"?r++:d.kind==="ElseDirective"?o++:d.kind==="RefBinding"&&l++;let a=this.r.span(i);s>1&&this.report("duplicate-directive","error","Multiple `each` directives on one element",a),r>1&&this.report("duplicate-directive","error","Multiple `if` directives on one element",a),l>1&&this.report("duplicate-directive","error","Multiple `ref` bindings on one element",a),r>0&&s>0&&this.report("unsupported-combination","error","`if` and `each` cannot both apply to one element — wrap one in another element",a),r>0&&o>0&&this.report("invalid-directive","error","`if` and `else` cannot be on the same element",a);let c=t.findIndex(d=>d.kind==="Attribute"&&d.name==="key");if(!n){c!==-1&&this.report("invalid-directive","error","`key` requires an `each` directive on the same element",a);return}if(c===-1)return;let h=t[c];h.kind==="Attribute"&&h.value&&(h.value.kind==="static"?n.key={static:h.value.value}:h.value.kind==="hole"&&(n.key={hole:h.value.hole})),t.splice(c,1)}readName(){return this.r.readWhile(t=>I.test(t))}consumeCloseTag(){this.r.advance(),this.r.advance();let t=this.readName();return this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance(),t}report(t,i,n,r){this.diagnostics.push({code:t,severity:i,message:n,loc:r})}};function N(e,t={}){return new b(e,t).parse()}function L(e){let t=[],i=0;return e.forEach((n,r)=>{t.push({kind:"static",text:n,start:i}),i+=n.length,r<e.length-1&&t.push({kind:"hole",index:r,start:i,end:i})}),t}function Q(e,t={}){return N(L(e),t)}export{f as CORE_DIRECTIVES,m as Reader,B as childrenOf,Q as parse,N as parseTemplate,L as piecesFromStrings,k as resolveAttribute,x as setParents};
|
|
1
|
+
function x(e){let t=(i,n)=>{i.parent=n;let r=R(i);for(let s of r)t(s,i)};return t(e,null),e}function R(e){switch(e.kind){case"Root":case"Element":case"Component":case"Fragment":return e.children;default:return[]}}var m=class{constructor(t){this.pieces=t;this.pi=0;this.oi=0;this.normalize()}normalize(){for(;this.pi<this.pieces.length;){let t=this.pieces[this.pi];if(t.kind==="static"&&this.oi>=t.text.length){this.pi++,this.oi=0;continue}break}}eof(){return this.pi>=this.pieces.length}pos(){if(this.eof()){let i=this.pieces[this.pieces.length-1];return i?i.kind==="static"?i.start+i.text.length:i.end:0}let t=this.pieces[this.pi];return t.kind==="static"?t.start+this.oi:t.start}atHole(){return!this.eof()&&this.pieces[this.pi].kind==="hole"}holeFollows(){if(this.eof())return!1;let t=this.pieces[this.pi];if(t.kind!=="static"||this.oi+1<t.text.length)return!1;let i=this.pieces[this.pi+1];return i!==void 0&&i.kind==="hole"}takeHole(){let t=this.pieces[this.pi];if(t.kind!=="hole")throw new Error("takeHole called off a hole");return this.pi++,this.oi=0,this.normalize(),{index:t.index,loc:{start:t.start,end:t.end}}}peek(t=0){if(this.eof())return"";let i=this.pieces[this.pi];return i.kind!=="static"?"":i.text[this.oi+t]??""}startsWith(t){if(this.eof())return!1;let i=this.pieces[this.pi];return i.kind!=="static"?!1:i.text.startsWith(t,this.oi)}advance(){if(this.eof())return"";let t=this.pieces[this.pi];if(t.kind!=="static")return"";let i=t.text[this.oi++]??"";return this.normalize(),i}readWhile(t){let i="";for(;!this.eof()&&!this.atHole();){let n=this.peek();if(n===""||!t(n))break;i+=n,this.oi++}return this.normalize(),i}skipWhitespace(){this.readWhile(t=>/\s/.test(t))}span(t){return{start:t,end:this.pos()}}};var y=new Set(["capture","once","passive","prevent","stop","self"]);function p(e,t){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${t} requires an expression value: ${e.name}=\${…}`),-1)}var D=(e,t)=>({kind:"Attribute",name:t?e.name.slice(1):e.name,value:e.value,boolean:t,loc:e.loc}),f=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let t,i;e.name[0]==="@"?(t="at",i=e.name.slice(1)):e.name.startsWith("on:")?(t="colon",i=e.name.slice(3)):(t="on",i=e.name.slice(2));let[n,...r]=i.split("."),s=n.toLowerCase();for(let o of r)y.has(o)||e.report("invalid-directive",`Unknown event modifier ".${o}" — expected one of ${[...y].join(", ")}`);return{kind:"EventBinding",name:s,syntax:t,modifiers:r,hole:p(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:p(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:p(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:p(e,"style directive"),loc:e.loc})},{id:"load",match:e=>e.startsWith("load:"),build:e=>({kind:"LoadDirective",strategy:e.name.slice(5),modifier:e.value&&e.value.kind==="static"?e.value.value:null,loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:p(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:p(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:p(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:p(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>D(e,!0)}];function k(e,t=f,i={component:!1}){for(let n of t)if(!(n.elementOnly&&i.component)&&n.match(e.name))return n.build(e);return D(e,!1)}var E=new Set(["svg","path","circle","rect","line","polygon","polyline","ellipse","g","defs","clipPath","text"]),S=new Set(["script","style","textarea","title"]),T=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function C(e){return e.length>0&&(e[0]!==e[0].toLowerCase()||e.includes("."))}var P=new Set(["a","button","input","select","textarea","summary","details","option","label"]),W=new Set(["keydown","keyup","keypress"]);function u(e,t){return e.attributes.find(i=>"name"in i&&i.name===t)}function w(e){return e.attributes.some(t=>t.kind==="Spread")}function v(e,t){let i=u(e,t);if(!i||i.kind!=="Attribute"||!i.value)return;let n=i.value;return n.kind==="static"?n.value:void 0}function H(e){let t=v(e,"role");return t==="presentation"||t==="none"?!0:v(e,"aria-hidden")==="true"}function A(e,t){return e.attributes.some(i=>i.kind==="EventBinding"&&t(i.name))}function B(e){let t=[],i=(r,s,o)=>{t.push({code:s,message:o,severity:"warning",loc:r.loc})},n=r=>{for(let s of r){s.kind==="Element"&&L(s,i);let o="children"in s?s.children:void 0;o&&n(o)}};return n(e.children),t}function L(e,t){if(w(e))return;let i=e.tag.toLowerCase();i==="img"&&!u(e,"alt")&&!H(e)&&t(e,"a11y-img-alt",'An `img` needs an `alt`. Use `alt=""` when the image is decorative.'),i==="a"&&!u(e,"href")&&!u(e,"role")&&t(e,"a11y-anchor-href","An `a` without `href` is not a link. Use a `button` for an action."),i==="iframe"&&!u(e,"title")&&t(e,"a11y-iframe-title","An `iframe` needs a `title` describing its content.");let n=v(e,"tabindex")??v(e,"tabIndex");n!==void 0&&Number(n)>0&&t(e,"a11y-positive-tabindex","A positive `tabindex` reorders tab navigation for the entire page. Use `0`, or restructure the markup."),!P.has(i)&&A(e,r=>r==="click")&&!u(e,"role")&&!A(e,r=>W.has(r))&&t(e,"a11y-click-without-keyboard",`A click handler on \`${i}\` is unreachable by keyboard. Use a \`button\`, or add a \`role\` and a key handler.`)}var V=/[A-Za-z0-9\-_:@.?]/,N=class{constructor(t,i){this.diagnostics=[];this.r=new m(t),this.svg=i.svg??!1,this.directives=i.directives??f,this.accessibility=i.accessibility??!0}parse(){let t=this.r.pos(),i=[];for(;!this.r.eof()&&(i.push(...this.parseChildren()),!this.r.eof());){let r=this.r.pos();this.consumeCloseTag(),this.report("stray-close-tag","error","Close tag without a matching open tag",this.r.span(r))}let n={kind:"Root",children:i,loc:this.r.span(t)};return x(n),this.validateTree(n),this.accessibility&&this.diagnostics.push(...B(n)),{root:n,diagnostics:this.diagnostics}}validateTree(t){let i=n=>{let r=null;for(let s of n)s.kind==="Text"&&/^\s*$/.test(s.value)||(s.kind==="Element"||s.kind==="Component"?(s.attributes.some(l=>l.kind==="ElseDirective")&&(r!=null&&(r.kind==="Element"||r.kind==="Component")&&r.attributes.some(a=>a.kind==="IfDirective")||this.report("else-without-if","error","`else` must immediately follow an element with `if`",s.loc)),r=s):r=null,"children"in s&&s.children&&i(s.children))};i(t.children)}parseChildren(){let t=[];for(;!this.r.eof()&&!this.r.startsWith("</");){if(this.r.startsWith("<!--")){t.push(this.parseComment());continue}if(this.isFragmentStart()){t.push(this.parseFragment());continue}if(this.isDynamicTagStart()){t.push(this.parseDynamicComponent());continue}if(this.isTagStart()){t.push(this.parseElement());continue}if(this.r.atHole()){let n=this.r.takeHole(),r={kind:"Expression",hole:n.index,loc:n.loc};t.push(r);continue}let i=this.readText();i&&t.push(i)}return t}isTagStart(){return this.r.peek()==="<"&&/[A-Za-z]/.test(this.r.peek(1))}isFragmentStart(){return this.r.peek()==="<"&&this.r.peek(1)===">"}isDynamicTagStart(){return this.r.peek()==="<"&&this.r.holeFollows()}parseDynamicComponent(){let t=this.r.pos();this.r.advance();let i=this.r.takeHole().index,n=this.parseAttributes(!0);this.r.skipWhitespace();let r=!1,s=[];return this.r.startsWith("/>")?(this.r.advance(),this.r.advance(),r=!0):(this.r.peek()===">"&&this.r.advance(),s=this.parseChildren(),this.r.startsWith("</")?(this.r.advance(),this.r.advance(),this.r.atHole()?this.r.takeHole():this.readName(),this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance()):this.report("unclosed-tag","error","Unclosed dynamic component",this.r.span(t))),{kind:"Component",tag:"",tagHole:i,attributes:n,children:s,selfClosing:r,loc:this.r.span(t)}}readText(){let t=this.r.pos(),i="";for(;!this.r.eof()&&!this.r.atHole()&&!(this.r.startsWith("</")||this.r.startsWith("<!--")||this.isTagStart()||this.isFragmentStart()||this.isDynamicTagStart());)i+=this.r.advance();return i?{kind:"Text",value:i,raw:!1,loc:this.r.span(t)}:null}parseComment(){let t=this.r.pos();this.r.advance(),this.r.advance(),this.r.advance(),this.r.advance();let i="";for(;!this.r.eof()&&!this.r.startsWith("-->");){if(this.r.atHole()){this.r.takeHole(),i+="\0";continue}i+=this.r.advance()}return this.r.startsWith("-->")?(this.r.advance(),this.r.advance(),this.r.advance()):this.report("unclosed-comment","warning","Unterminated comment",this.r.span(t)),{kind:"Comment",value:i,loc:this.r.span(t)}}parseFragment(){let t=this.r.pos();this.r.advance(),this.r.advance();let i=this.parseChildren();if(this.r.startsWith("</")){let n=this.consumeCloseTag();n&&this.report("mismatched-close-tag","error",`Expected </> to close fragment, got </${n}>`,this.r.span(t))}else this.report("unclosed-tag","error","Unterminated fragment",this.r.span(t));return{kind:"Fragment",children:i,loc:this.r.span(t)}}parseElement(){let t=this.r.pos();this.r.advance();let i=this.readName(),n=C(i),r=this.parseAttributes(n);this.foldEachKey(r,t),this.r.skipWhitespace();let s=i.toLowerCase(),o=!n&&S.has(s),l=!n&&T.has(s),a=!1,c=[];if(this.r.startsWith("/>"))this.r.advance(),this.r.advance(),a=!0;else if(this.r.peek()===">"&&this.r.advance(),!l)if(c=o?this.parseRawText(i):this.parseChildren(),this.r.startsWith("</")){let g=this.consumeCloseTag();g&&g!==i&&this.report("mismatched-close-tag","error",`Expected </${i}>, got </${g}>`,this.r.span(t))}else this.report("unclosed-tag","error",`Unclosed <${i}>`,this.r.span(t));let h=this.r.span(t);if(n)return{kind:"Component",tag:i,tagHole:null,attributes:r,children:c,selfClosing:a,loc:h};let d=this.svg||E.has(i)?"svg":"html";return{kind:"Element",tag:i,namespace:d,attributes:r,children:c,selfClosing:a,rawText:o,loc:h}}parseRawText(t){let i=[],n="</"+t.toLowerCase(),r="",s=this.r.pos(),o=()=>{r&&i.push({kind:"Text",value:r,raw:!0,loc:this.r.span(s)}),r=""};for(;!this.r.eof()&&!this.startsWithCloseFor(n);){if(this.r.atHole()){o();let l=this.r.takeHole();i.push({kind:"Expression",hole:l.index,loc:l.loc}),s=this.r.pos();continue}r||(s=this.r.pos()),r+=this.r.advance()}return o(),i}startsWithCloseFor(t){let i=0;for(;i<t.length;){let n=this.r.peek(i);if(n===""||n.toLowerCase()!==t[i])return!1;i++}return!0}parseAttributes(t){let i=[];for(;!this.r.eof()&&(this.r.skipWhitespace(),!(this.r.peek()===">"||this.r.startsWith("/>")));){if(this.r.atHole()){let a=this.r.takeHole();i.push({kind:"Spread",hole:a.index,loc:a.loc});continue}if(this.r.startsWith("...")){let a=this.r.pos();if(this.r.advance(),this.r.advance(),this.r.advance(),this.r.atHole()){let c=this.r.takeHole();i.push({kind:"Spread",hole:c.index,loc:this.r.span(a)})}else this.report("invalid-binding","error","Spread `...` must be followed by ${…}",this.r.span(a));continue}let n=this.r.pos(),r=this.readName();if(!r){this.r.advance();continue}let s=this.r.span(n);this.r.skipWhitespace();let o=null;this.r.peek()==="="&&(this.r.advance(),this.r.skipWhitespace(),o=this.parseAttrValue());let l={name:r,nameLoc:s,value:o,loc:this.r.span(n),report:(a,c)=>this.report(a,"error",c,this.r.span(n))};i.push(k(l,this.directives,{component:t}))}return i}parseAttrValue(){if(this.r.atHole())return{kind:"hole",hole:this.r.takeHole().index};let t=this.r.peek();return t==='"'||t==="'"?this.classifyParts(this.readQuotedParts(t)):{kind:"static",value:this.r.readWhile(n=>!/[\s>]/.test(n))}}readQuotedParts(t){this.r.advance();let i=[],n="";for(;!this.r.eof()&&this.r.peek()!==t;){if(this.r.atHole()){n&&(i.push({text:n}),n=""),i.push({hole:this.r.takeHole().index});continue}let r=this.r.advance();if(r==="")break;n+=r}return n&&i.push({text:n}),this.r.peek()===t&&this.r.advance(),i}classifyParts(t){let i=t.filter(n=>"hole"in n);return i.length===0?{kind:"static",value:t.map(n=>"text"in n?n.text:"").join("")}:t.length===1?{kind:"hole",hole:i[0].hole}:{kind:"mixed",parts:t}}foldEachKey(t,i){let n=null,r=0,s=0,o=0,l=0;for(let d of t)d.kind==="EachDirective"?(n=d,s++):d.kind==="IfDirective"?r++:d.kind==="ElseDirective"?o++:d.kind==="RefBinding"&&l++;let a=this.r.span(i);s>1&&this.report("duplicate-directive","error","Multiple `each` directives on one element",a),r>1&&this.report("duplicate-directive","error","Multiple `if` directives on one element",a),l>1&&this.report("duplicate-directive","error","Multiple `ref` bindings on one element",a),r>0&&s>0&&this.report("unsupported-combination","error","`if` and `each` cannot both apply to one element — wrap one in another element",a),r>0&&o>0&&this.report("invalid-directive","error","`if` and `else` cannot be on the same element",a);let c=t.findIndex(d=>d.kind==="Attribute"&&d.name==="key");if(!n){c!==-1&&this.report("invalid-directive","error","`key` requires an `each` directive on the same element",a);return}if(c===-1)return;let h=t[c];h.kind==="Attribute"&&h.value&&(h.value.kind==="static"?n.key={static:h.value.value}:h.value.kind==="hole"&&(n.key={hole:h.value.hole})),t.splice(c,1)}readName(){return this.r.readWhile(t=>V.test(t))}consumeCloseTag(){this.r.advance(),this.r.advance();let t=this.readName();return this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance(),t}report(t,i,n,r){this.diagnostics.push({code:t,severity:i,message:n,loc:r})}};function b(e,t={}){return new N(e,t).parse()}function I(e){let t=[],i=0;return e.forEach((n,r)=>{t.push({kind:"static",text:n,start:i}),i+=n.length,r<e.length-1&&t.push({kind:"hole",index:r,start:i,end:i})}),t}function Q(e,t={}){return b(I(e),t)}export{f as CORE_DIRECTIVES,m as Reader,R as childrenOf,Q as parse,b as parseTemplate,I as piecesFromStrings,k as resolveAttribute,x as setParents};
|
package/dist/parser.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var g=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var i in t)g(e,i,{get:t[i],enumerable:!0})},P=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of W(t))!w.call(e,r)&&r!==i&&g(e,r,{get:()=>t[r],enumerable:!(n=R(t,r))||n.enumerable});return e};var V=e=>P(g({},"__esModule",{value:!0}),e);var z={};H(z,{parseTemplate:()=>M});module.exports=V(z);function b(e){let t=(i,n)=>{i.parent=n;let r=L(i);for(let s of r)t(s,i)};return t(e,null),e}function L(e){switch(e.kind){case"Root":case"Element":case"Component":case"Fragment":return e.children;default:return[]}}var m=class{constructor(t){this.pieces=t;this.pi=0;this.oi=0;this.normalize()}normalize(){for(;this.pi<this.pieces.length;){let t=this.pieces[this.pi];if(t.kind==="static"&&this.oi>=t.text.length){this.pi++,this.oi=0;continue}break}}eof(){return this.pi>=this.pieces.length}pos(){if(this.eof()){let i=this.pieces[this.pieces.length-1];return i?i.kind==="static"?i.start+i.text.length:i.end:0}let t=this.pieces[this.pi];return t.kind==="static"?t.start+this.oi:t.start}atHole(){return!this.eof()&&this.pieces[this.pi].kind==="hole"}holeFollows(){if(this.eof())return!1;let t=this.pieces[this.pi];if(t.kind!=="static"||this.oi+1<t.text.length)return!1;let i=this.pieces[this.pi+1];return i!==void 0&&i.kind==="hole"}takeHole(){let t=this.pieces[this.pi];if(t.kind!=="hole")throw new Error("takeHole called off a hole");return this.pi++,this.oi=0,this.normalize(),{index:t.index,loc:{start:t.start,end:t.end}}}peek(t=0){if(this.eof())return"";let i=this.pieces[this.pi];return i.kind!=="static"?"":i.text[this.oi+t]??""}startsWith(t){if(this.eof())return!1;let i=this.pieces[this.pi];return i.kind!=="static"?!1:i.text.startsWith(t,this.oi)}advance(){if(this.eof())return"";let t=this.pieces[this.pi];if(t.kind!=="static")return"";let i=t.text[this.oi++]??"";return this.normalize(),i}readWhile(t){let i="";for(;!this.eof()&&!this.atHole();){let n=this.peek();if(n===""||!t(n))break;i+=n,this.oi++}return this.normalize(),i}skipWhitespace(){this.readWhile(t=>/\s/.test(t))}span(t){return{start:t,end:this.pos()}}};var x=new Set(["capture","once","passive","prevent","stop","self"]);function p(e,t){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${t} requires an expression value: ${e.name}=\${…}`),-1)}var y=(e,t)=>({kind:"Attribute",name:t?e.name.slice(1):e.name,value:e.value,boolean:t,loc:e.loc}),k=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let t,i;e.name[0]==="@"?(t="at",i=e.name.slice(1)):e.name.startsWith("on:")?(t="colon",i=e.name.slice(3)):(t="on",i=e.name.slice(2));let[n,...r]=i.split("."),s=n.toLowerCase();for(let o of r)x.has(o)||e.report("invalid-directive",`Unknown event modifier ".${o}" — expected one of ${[...x].join(", ")}`);return{kind:"EventBinding",name:s,syntax:t,modifiers:r,hole:p(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:p(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:p(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:p(e,"style directive"),loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:p(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:p(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:p(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:p(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>y(e,!0)}];function E(e,t=k,i={component:!1}){for(let n of t)if(!(n.elementOnly&&i.component)&&n.match(e.name))return n.build(e);return y(e,!1)}var D=new Set(["svg","path","circle","rect","line","polygon","polyline","ellipse","g","defs","clipPath","text"]),S=new Set(["script","style","textarea","title"]),C=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function T(e){return e.length>0&&(e[0]!==e[0].toLowerCase()||e.includes("."))}var I=new Set(["a","button","input","select","textarea","summary","details","option","label"]),F=new Set(["keydown","keyup","keypress"]);function u(e,t){return e.attributes.find(i=>"name"in i&&i.name===t)}function O(e){return e.attributes.some(t=>t.kind==="Spread")}function f(e,t){let i=u(e,t);if(!i||i.kind!=="Attribute"||!i.value)return;let n=i.value;return n.kind==="static"?n.value:void 0}function U(e){let t=f(e,"role");return t==="presentation"||t==="none"?!0:f(e,"aria-hidden")==="true"}function A(e,t){return e.attributes.some(i=>i.kind==="EventBinding"&&t(i.name))}function B(e){let t=[],i=(r,s,o)=>{t.push({code:s,message:o,severity:"warning",loc:r.loc})},n=r=>{for(let s of r){s.kind==="Element"&&_(s,i);let o="children"in s?s.children:void 0;o&&n(o)}};return n(e.children),t}function _(e,t){if(O(e))return;let i=e.tag.toLowerCase();i==="img"&&!u(e,"alt")&&!U(e)&&t(e,"a11y-img-alt",'An `img` needs an `alt`. Use `alt=""` when the image is decorative.'),i==="a"&&!u(e,"href")&&!u(e,"role")&&t(e,"a11y-anchor-href","An `a` without `href` is not a link. Use a `button` for an action."),i==="iframe"&&!u(e,"title")&&t(e,"a11y-iframe-title","An `iframe` needs a `title` describing its content.");let n=f(e,"tabindex")??f(e,"tabIndex");n!==void 0&&Number(n)>0&&t(e,"a11y-positive-tabindex","A positive `tabindex` reorders tab navigation for the entire page. Use `0`, or restructure the markup."),!I.has(i)&&A(e,r=>r==="click")&&!u(e,"role")&&!A(e,r=>F.has(r))&&t(e,"a11y-click-without-keyboard",`A click handler on \`${i}\` is unreachable by keyboard. Use a \`button\`, or add a \`role\` and a key handler.`)}var $=/[A-Za-z0-9\-_:@.?]/,N=class{constructor(t,i){this.diagnostics=[];this.r=new m(t),this.svg=i.svg??!1,this.directives=i.directives??k,this.accessibility=i.accessibility??!0}parse(){let t=this.r.pos(),i=[];for(;!this.r.eof()&&(i.push(...this.parseChildren()),!this.r.eof());){let r=this.r.pos();this.consumeCloseTag(),this.report("stray-close-tag","error","Close tag without a matching open tag",this.r.span(r))}let n={kind:"Root",children:i,loc:this.r.span(t)};return b(n),this.validateTree(n),this.accessibility&&this.diagnostics.push(...B(n)),{root:n,diagnostics:this.diagnostics}}validateTree(t){let i=n=>{let r=null;for(let s of n)s.kind==="Text"&&/^\s*$/.test(s.value)||(s.kind==="Element"||s.kind==="Component"?(s.attributes.some(l=>l.kind==="ElseDirective")&&(r!=null&&(r.kind==="Element"||r.kind==="Component")&&r.attributes.some(a=>a.kind==="IfDirective")||this.report("else-without-if","error","`else` must immediately follow an element with `if`",s.loc)),r=s):r=null,"children"in s&&s.children&&i(s.children))};i(t.children)}parseChildren(){let t=[];for(;!this.r.eof()&&!this.r.startsWith("</");){if(this.r.startsWith("<!--")){t.push(this.parseComment());continue}if(this.isFragmentStart()){t.push(this.parseFragment());continue}if(this.isDynamicTagStart()){t.push(this.parseDynamicComponent());continue}if(this.isTagStart()){t.push(this.parseElement());continue}if(this.r.atHole()){let n=this.r.takeHole(),r={kind:"Expression",hole:n.index,loc:n.loc};t.push(r);continue}let i=this.readText();i&&t.push(i)}return t}isTagStart(){return this.r.peek()==="<"&&/[A-Za-z]/.test(this.r.peek(1))}isFragmentStart(){return this.r.peek()==="<"&&this.r.peek(1)===">"}isDynamicTagStart(){return this.r.peek()==="<"&&this.r.holeFollows()}parseDynamicComponent(){let t=this.r.pos();this.r.advance();let i=this.r.takeHole().index,n=this.parseAttributes(!0);this.r.skipWhitespace();let r=!1,s=[];return this.r.startsWith("/>")?(this.r.advance(),this.r.advance(),r=!0):(this.r.peek()===">"&&this.r.advance(),s=this.parseChildren(),this.r.startsWith("</")?(this.r.advance(),this.r.advance(),this.r.atHole()?this.r.takeHole():this.readName(),this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance()):this.report("unclosed-tag","error","Unclosed dynamic component",this.r.span(t))),{kind:"Component",tag:"",tagHole:i,attributes:n,children:s,selfClosing:r,loc:this.r.span(t)}}readText(){let t=this.r.pos(),i="";for(;!this.r.eof()&&!this.r.atHole()&&!(this.r.startsWith("</")||this.r.startsWith("<!--")||this.isTagStart()||this.isFragmentStart()||this.isDynamicTagStart());)i+=this.r.advance();return i?{kind:"Text",value:i,raw:!1,loc:this.r.span(t)}:null}parseComment(){let t=this.r.pos();this.r.advance(),this.r.advance(),this.r.advance(),this.r.advance();let i="";for(;!this.r.eof()&&!this.r.startsWith("-->");){if(this.r.atHole()){this.r.takeHole(),i+="\0";continue}i+=this.r.advance()}return this.r.startsWith("-->")?(this.r.advance(),this.r.advance(),this.r.advance()):this.report("unclosed-comment","warning","Unterminated comment",this.r.span(t)),{kind:"Comment",value:i,loc:this.r.span(t)}}parseFragment(){let t=this.r.pos();this.r.advance(),this.r.advance();let i=this.parseChildren();if(this.r.startsWith("</")){let n=this.consumeCloseTag();n&&this.report("mismatched-close-tag","error",`Expected </> to close fragment, got </${n}>`,this.r.span(t))}else this.report("unclosed-tag","error","Unterminated fragment",this.r.span(t));return{kind:"Fragment",children:i,loc:this.r.span(t)}}parseElement(){let t=this.r.pos();this.r.advance();let i=this.readName(),n=T(i),r=this.parseAttributes(n);this.foldEachKey(r,t),this.r.skipWhitespace();let s=i.toLowerCase(),o=!n&&S.has(s),l=!n&&C.has(s),a=!1,c=[];if(this.r.startsWith("/>"))this.r.advance(),this.r.advance(),a=!0;else if(this.r.peek()===">"&&this.r.advance(),!l)if(c=o?this.parseRawText(i):this.parseChildren(),this.r.startsWith("</")){let v=this.consumeCloseTag();v&&v!==i&&this.report("mismatched-close-tag","error",`Expected </${i}>, got </${v}>`,this.r.span(t))}else this.report("unclosed-tag","error",`Unclosed <${i}>`,this.r.span(t));let h=this.r.span(t);if(n)return{kind:"Component",tag:i,tagHole:null,attributes:r,children:c,selfClosing:a,loc:h};let d=this.svg||D.has(i)?"svg":"html";return{kind:"Element",tag:i,namespace:d,attributes:r,children:c,selfClosing:a,rawText:o,loc:h}}parseRawText(t){let i=[],n="</"+t.toLowerCase(),r="",s=this.r.pos(),o=()=>{r&&i.push({kind:"Text",value:r,raw:!0,loc:this.r.span(s)}),r=""};for(;!this.r.eof()&&!this.startsWithCloseFor(n);){if(this.r.atHole()){o();let l=this.r.takeHole();i.push({kind:"Expression",hole:l.index,loc:l.loc}),s=this.r.pos();continue}r||(s=this.r.pos()),r+=this.r.advance()}return o(),i}startsWithCloseFor(t){let i=0;for(;i<t.length;){let n=this.r.peek(i);if(n===""||n.toLowerCase()!==t[i])return!1;i++}return!0}parseAttributes(t){let i=[];for(;!this.r.eof()&&(this.r.skipWhitespace(),!(this.r.peek()===">"||this.r.startsWith("/>")));){if(this.r.atHole()){let a=this.r.takeHole();i.push({kind:"Spread",hole:a.index,loc:a.loc});continue}if(this.r.startsWith("...")){let a=this.r.pos();if(this.r.advance(),this.r.advance(),this.r.advance(),this.r.atHole()){let c=this.r.takeHole();i.push({kind:"Spread",hole:c.index,loc:this.r.span(a)})}else this.report("invalid-binding","error","Spread `...` must be followed by ${…}",this.r.span(a));continue}let n=this.r.pos(),r=this.readName();if(!r){this.r.advance();continue}let s=this.r.span(n);this.r.skipWhitespace();let o=null;this.r.peek()==="="&&(this.r.advance(),this.r.skipWhitespace(),o=this.parseAttrValue());let l={name:r,nameLoc:s,value:o,loc:this.r.span(n),report:(a,c)=>this.report(a,"error",c,this.r.span(n))};i.push(E(l,this.directives,{component:t}))}return i}parseAttrValue(){if(this.r.atHole())return{kind:"hole",hole:this.r.takeHole().index};let t=this.r.peek();return t==='"'||t==="'"?this.classifyParts(this.readQuotedParts(t)):{kind:"static",value:this.r.readWhile(n=>!/[\s>]/.test(n))}}readQuotedParts(t){this.r.advance();let i=[],n="";for(;!this.r.eof()&&this.r.peek()!==t;){if(this.r.atHole()){n&&(i.push({text:n}),n=""),i.push({hole:this.r.takeHole().index});continue}let r=this.r.advance();if(r==="")break;n+=r}return n&&i.push({text:n}),this.r.peek()===t&&this.r.advance(),i}classifyParts(t){let i=t.filter(n=>"hole"in n);return i.length===0?{kind:"static",value:t.map(n=>"text"in n?n.text:"").join("")}:t.length===1?{kind:"hole",hole:i[0].hole}:{kind:"mixed",parts:t}}foldEachKey(t,i){let n=null,r=0,s=0,o=0,l=0;for(let d of t)d.kind==="EachDirective"?(n=d,s++):d.kind==="IfDirective"?r++:d.kind==="ElseDirective"?o++:d.kind==="RefBinding"&&l++;let a=this.r.span(i);s>1&&this.report("duplicate-directive","error","Multiple `each` directives on one element",a),r>1&&this.report("duplicate-directive","error","Multiple `if` directives on one element",a),l>1&&this.report("duplicate-directive","error","Multiple `ref` bindings on one element",a),r>0&&s>0&&this.report("unsupported-combination","error","`if` and `each` cannot both apply to one element — wrap one in another element",a),r>0&&o>0&&this.report("invalid-directive","error","`if` and `else` cannot be on the same element",a);let c=t.findIndex(d=>d.kind==="Attribute"&&d.name==="key");if(!n){c!==-1&&this.report("invalid-directive","error","`key` requires an `each` directive on the same element",a);return}if(c===-1)return;let h=t[c];h.kind==="Attribute"&&h.value&&(h.value.kind==="static"?n.key={static:h.value.value}:h.value.kind==="hole"&&(n.key={hole:h.value.hole})),t.splice(c,1)}readName(){return this.r.readWhile(t=>$.test(t))}consumeCloseTag(){this.r.advance(),this.r.advance();let t=this.readName();return this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance(),t}report(t,i,n,r){this.diagnostics.push({code:t,severity:i,message:n,loc:r})}};function M(e,t={}){return new N(e,t).parse()}
|
|
1
|
+
"use strict";var g=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var i in t)g(e,i,{get:t[i],enumerable:!0})},H=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of W(t))!w.call(e,r)&&r!==i&&g(e,r,{get:()=>t[r],enumerable:!(n=R(t,r))||n.enumerable});return e};var P=e=>H(g({},"__esModule",{value:!0}),e);var z={};L(z,{parseTemplate:()=>M});module.exports=P(z);function b(e){let t=(i,n)=>{i.parent=n;let r=V(i);for(let s of r)t(s,i)};return t(e,null),e}function V(e){switch(e.kind){case"Root":case"Element":case"Component":case"Fragment":return e.children;default:return[]}}var m=class{constructor(t){this.pieces=t;this.pi=0;this.oi=0;this.normalize()}normalize(){for(;this.pi<this.pieces.length;){let t=this.pieces[this.pi];if(t.kind==="static"&&this.oi>=t.text.length){this.pi++,this.oi=0;continue}break}}eof(){return this.pi>=this.pieces.length}pos(){if(this.eof()){let i=this.pieces[this.pieces.length-1];return i?i.kind==="static"?i.start+i.text.length:i.end:0}let t=this.pieces[this.pi];return t.kind==="static"?t.start+this.oi:t.start}atHole(){return!this.eof()&&this.pieces[this.pi].kind==="hole"}holeFollows(){if(this.eof())return!1;let t=this.pieces[this.pi];if(t.kind!=="static"||this.oi+1<t.text.length)return!1;let i=this.pieces[this.pi+1];return i!==void 0&&i.kind==="hole"}takeHole(){let t=this.pieces[this.pi];if(t.kind!=="hole")throw new Error("takeHole called off a hole");return this.pi++,this.oi=0,this.normalize(),{index:t.index,loc:{start:t.start,end:t.end}}}peek(t=0){if(this.eof())return"";let i=this.pieces[this.pi];return i.kind!=="static"?"":i.text[this.oi+t]??""}startsWith(t){if(this.eof())return!1;let i=this.pieces[this.pi];return i.kind!=="static"?!1:i.text.startsWith(t,this.oi)}advance(){if(this.eof())return"";let t=this.pieces[this.pi];if(t.kind!=="static")return"";let i=t.text[this.oi++]??"";return this.normalize(),i}readWhile(t){let i="";for(;!this.eof()&&!this.atHole();){let n=this.peek();if(n===""||!t(n))break;i+=n,this.oi++}return this.normalize(),i}skipWhitespace(){this.readWhile(t=>/\s/.test(t))}span(t){return{start:t,end:this.pos()}}};var x=new Set(["capture","once","passive","prevent","stop","self"]);function p(e,t){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${t} requires an expression value: ${e.name}=\${…}`),-1)}var y=(e,t)=>({kind:"Attribute",name:t?e.name.slice(1):e.name,value:e.value,boolean:t,loc:e.loc}),k=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let t,i;e.name[0]==="@"?(t="at",i=e.name.slice(1)):e.name.startsWith("on:")?(t="colon",i=e.name.slice(3)):(t="on",i=e.name.slice(2));let[n,...r]=i.split("."),s=n.toLowerCase();for(let o of r)x.has(o)||e.report("invalid-directive",`Unknown event modifier ".${o}" — expected one of ${[...x].join(", ")}`);return{kind:"EventBinding",name:s,syntax:t,modifiers:r,hole:p(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:p(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:p(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:p(e,"style directive"),loc:e.loc})},{id:"load",match:e=>e.startsWith("load:"),build:e=>({kind:"LoadDirective",strategy:e.name.slice(5),modifier:e.value&&e.value.kind==="static"?e.value.value:null,loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:p(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:p(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:p(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:p(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>y(e,!0)}];function D(e,t=k,i={component:!1}){for(let n of t)if(!(n.elementOnly&&i.component)&&n.match(e.name))return n.build(e);return y(e,!1)}var E=new Set(["svg","path","circle","rect","line","polygon","polyline","ellipse","g","defs","clipPath","text"]),S=new Set(["script","style","textarea","title"]),C=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function T(e){return e.length>0&&(e[0]!==e[0].toLowerCase()||e.includes("."))}var I=new Set(["a","button","input","select","textarea","summary","details","option","label"]),F=new Set(["keydown","keyup","keypress"]);function u(e,t){return e.attributes.find(i=>"name"in i&&i.name===t)}function O(e){return e.attributes.some(t=>t.kind==="Spread")}function f(e,t){let i=u(e,t);if(!i||i.kind!=="Attribute"||!i.value)return;let n=i.value;return n.kind==="static"?n.value:void 0}function U(e){let t=f(e,"role");return t==="presentation"||t==="none"?!0:f(e,"aria-hidden")==="true"}function A(e,t){return e.attributes.some(i=>i.kind==="EventBinding"&&t(i.name))}function B(e){let t=[],i=(r,s,o)=>{t.push({code:s,message:o,severity:"warning",loc:r.loc})},n=r=>{for(let s of r){s.kind==="Element"&&_(s,i);let o="children"in s?s.children:void 0;o&&n(o)}};return n(e.children),t}function _(e,t){if(O(e))return;let i=e.tag.toLowerCase();i==="img"&&!u(e,"alt")&&!U(e)&&t(e,"a11y-img-alt",'An `img` needs an `alt`. Use `alt=""` when the image is decorative.'),i==="a"&&!u(e,"href")&&!u(e,"role")&&t(e,"a11y-anchor-href","An `a` without `href` is not a link. Use a `button` for an action."),i==="iframe"&&!u(e,"title")&&t(e,"a11y-iframe-title","An `iframe` needs a `title` describing its content.");let n=f(e,"tabindex")??f(e,"tabIndex");n!==void 0&&Number(n)>0&&t(e,"a11y-positive-tabindex","A positive `tabindex` reorders tab navigation for the entire page. Use `0`, or restructure the markup."),!I.has(i)&&A(e,r=>r==="click")&&!u(e,"role")&&!A(e,r=>F.has(r))&&t(e,"a11y-click-without-keyboard",`A click handler on \`${i}\` is unreachable by keyboard. Use a \`button\`, or add a \`role\` and a key handler.`)}var $=/[A-Za-z0-9\-_:@.?]/,N=class{constructor(t,i){this.diagnostics=[];this.r=new m(t),this.svg=i.svg??!1,this.directives=i.directives??k,this.accessibility=i.accessibility??!0}parse(){let t=this.r.pos(),i=[];for(;!this.r.eof()&&(i.push(...this.parseChildren()),!this.r.eof());){let r=this.r.pos();this.consumeCloseTag(),this.report("stray-close-tag","error","Close tag without a matching open tag",this.r.span(r))}let n={kind:"Root",children:i,loc:this.r.span(t)};return b(n),this.validateTree(n),this.accessibility&&this.diagnostics.push(...B(n)),{root:n,diagnostics:this.diagnostics}}validateTree(t){let i=n=>{let r=null;for(let s of n)s.kind==="Text"&&/^\s*$/.test(s.value)||(s.kind==="Element"||s.kind==="Component"?(s.attributes.some(l=>l.kind==="ElseDirective")&&(r!=null&&(r.kind==="Element"||r.kind==="Component")&&r.attributes.some(a=>a.kind==="IfDirective")||this.report("else-without-if","error","`else` must immediately follow an element with `if`",s.loc)),r=s):r=null,"children"in s&&s.children&&i(s.children))};i(t.children)}parseChildren(){let t=[];for(;!this.r.eof()&&!this.r.startsWith("</");){if(this.r.startsWith("<!--")){t.push(this.parseComment());continue}if(this.isFragmentStart()){t.push(this.parseFragment());continue}if(this.isDynamicTagStart()){t.push(this.parseDynamicComponent());continue}if(this.isTagStart()){t.push(this.parseElement());continue}if(this.r.atHole()){let n=this.r.takeHole(),r={kind:"Expression",hole:n.index,loc:n.loc};t.push(r);continue}let i=this.readText();i&&t.push(i)}return t}isTagStart(){return this.r.peek()==="<"&&/[A-Za-z]/.test(this.r.peek(1))}isFragmentStart(){return this.r.peek()==="<"&&this.r.peek(1)===">"}isDynamicTagStart(){return this.r.peek()==="<"&&this.r.holeFollows()}parseDynamicComponent(){let t=this.r.pos();this.r.advance();let i=this.r.takeHole().index,n=this.parseAttributes(!0);this.r.skipWhitespace();let r=!1,s=[];return this.r.startsWith("/>")?(this.r.advance(),this.r.advance(),r=!0):(this.r.peek()===">"&&this.r.advance(),s=this.parseChildren(),this.r.startsWith("</")?(this.r.advance(),this.r.advance(),this.r.atHole()?this.r.takeHole():this.readName(),this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance()):this.report("unclosed-tag","error","Unclosed dynamic component",this.r.span(t))),{kind:"Component",tag:"",tagHole:i,attributes:n,children:s,selfClosing:r,loc:this.r.span(t)}}readText(){let t=this.r.pos(),i="";for(;!this.r.eof()&&!this.r.atHole()&&!(this.r.startsWith("</")||this.r.startsWith("<!--")||this.isTagStart()||this.isFragmentStart()||this.isDynamicTagStart());)i+=this.r.advance();return i?{kind:"Text",value:i,raw:!1,loc:this.r.span(t)}:null}parseComment(){let t=this.r.pos();this.r.advance(),this.r.advance(),this.r.advance(),this.r.advance();let i="";for(;!this.r.eof()&&!this.r.startsWith("-->");){if(this.r.atHole()){this.r.takeHole(),i+="\0";continue}i+=this.r.advance()}return this.r.startsWith("-->")?(this.r.advance(),this.r.advance(),this.r.advance()):this.report("unclosed-comment","warning","Unterminated comment",this.r.span(t)),{kind:"Comment",value:i,loc:this.r.span(t)}}parseFragment(){let t=this.r.pos();this.r.advance(),this.r.advance();let i=this.parseChildren();if(this.r.startsWith("</")){let n=this.consumeCloseTag();n&&this.report("mismatched-close-tag","error",`Expected </> to close fragment, got </${n}>`,this.r.span(t))}else this.report("unclosed-tag","error","Unterminated fragment",this.r.span(t));return{kind:"Fragment",children:i,loc:this.r.span(t)}}parseElement(){let t=this.r.pos();this.r.advance();let i=this.readName(),n=T(i),r=this.parseAttributes(n);this.foldEachKey(r,t),this.r.skipWhitespace();let s=i.toLowerCase(),o=!n&&S.has(s),l=!n&&C.has(s),a=!1,c=[];if(this.r.startsWith("/>"))this.r.advance(),this.r.advance(),a=!0;else if(this.r.peek()===">"&&this.r.advance(),!l)if(c=o?this.parseRawText(i):this.parseChildren(),this.r.startsWith("</")){let v=this.consumeCloseTag();v&&v!==i&&this.report("mismatched-close-tag","error",`Expected </${i}>, got </${v}>`,this.r.span(t))}else this.report("unclosed-tag","error",`Unclosed <${i}>`,this.r.span(t));let h=this.r.span(t);if(n)return{kind:"Component",tag:i,tagHole:null,attributes:r,children:c,selfClosing:a,loc:h};let d=this.svg||E.has(i)?"svg":"html";return{kind:"Element",tag:i,namespace:d,attributes:r,children:c,selfClosing:a,rawText:o,loc:h}}parseRawText(t){let i=[],n="</"+t.toLowerCase(),r="",s=this.r.pos(),o=()=>{r&&i.push({kind:"Text",value:r,raw:!0,loc:this.r.span(s)}),r=""};for(;!this.r.eof()&&!this.startsWithCloseFor(n);){if(this.r.atHole()){o();let l=this.r.takeHole();i.push({kind:"Expression",hole:l.index,loc:l.loc}),s=this.r.pos();continue}r||(s=this.r.pos()),r+=this.r.advance()}return o(),i}startsWithCloseFor(t){let i=0;for(;i<t.length;){let n=this.r.peek(i);if(n===""||n.toLowerCase()!==t[i])return!1;i++}return!0}parseAttributes(t){let i=[];for(;!this.r.eof()&&(this.r.skipWhitespace(),!(this.r.peek()===">"||this.r.startsWith("/>")));){if(this.r.atHole()){let a=this.r.takeHole();i.push({kind:"Spread",hole:a.index,loc:a.loc});continue}if(this.r.startsWith("...")){let a=this.r.pos();if(this.r.advance(),this.r.advance(),this.r.advance(),this.r.atHole()){let c=this.r.takeHole();i.push({kind:"Spread",hole:c.index,loc:this.r.span(a)})}else this.report("invalid-binding","error","Spread `...` must be followed by ${…}",this.r.span(a));continue}let n=this.r.pos(),r=this.readName();if(!r){this.r.advance();continue}let s=this.r.span(n);this.r.skipWhitespace();let o=null;this.r.peek()==="="&&(this.r.advance(),this.r.skipWhitespace(),o=this.parseAttrValue());let l={name:r,nameLoc:s,value:o,loc:this.r.span(n),report:(a,c)=>this.report(a,"error",c,this.r.span(n))};i.push(D(l,this.directives,{component:t}))}return i}parseAttrValue(){if(this.r.atHole())return{kind:"hole",hole:this.r.takeHole().index};let t=this.r.peek();return t==='"'||t==="'"?this.classifyParts(this.readQuotedParts(t)):{kind:"static",value:this.r.readWhile(n=>!/[\s>]/.test(n))}}readQuotedParts(t){this.r.advance();let i=[],n="";for(;!this.r.eof()&&this.r.peek()!==t;){if(this.r.atHole()){n&&(i.push({text:n}),n=""),i.push({hole:this.r.takeHole().index});continue}let r=this.r.advance();if(r==="")break;n+=r}return n&&i.push({text:n}),this.r.peek()===t&&this.r.advance(),i}classifyParts(t){let i=t.filter(n=>"hole"in n);return i.length===0?{kind:"static",value:t.map(n=>"text"in n?n.text:"").join("")}:t.length===1?{kind:"hole",hole:i[0].hole}:{kind:"mixed",parts:t}}foldEachKey(t,i){let n=null,r=0,s=0,o=0,l=0;for(let d of t)d.kind==="EachDirective"?(n=d,s++):d.kind==="IfDirective"?r++:d.kind==="ElseDirective"?o++:d.kind==="RefBinding"&&l++;let a=this.r.span(i);s>1&&this.report("duplicate-directive","error","Multiple `each` directives on one element",a),r>1&&this.report("duplicate-directive","error","Multiple `if` directives on one element",a),l>1&&this.report("duplicate-directive","error","Multiple `ref` bindings on one element",a),r>0&&s>0&&this.report("unsupported-combination","error","`if` and `each` cannot both apply to one element — wrap one in another element",a),r>0&&o>0&&this.report("invalid-directive","error","`if` and `else` cannot be on the same element",a);let c=t.findIndex(d=>d.kind==="Attribute"&&d.name==="key");if(!n){c!==-1&&this.report("invalid-directive","error","`key` requires an `each` directive on the same element",a);return}if(c===-1)return;let h=t[c];h.kind==="Attribute"&&h.value&&(h.value.kind==="static"?n.key={static:h.value.value}:h.value.kind==="hole"&&(n.key={hole:h.value.hole})),t.splice(c,1)}readName(){return this.r.readWhile(t=>$.test(t))}consumeCloseTag(){this.r.advance(),this.r.advance();let t=this.readName();return this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance(),t}report(t,i,n,r){this.diagnostics.push({code:t,severity:i,message:n,loc:r})}};function M(e,t={}){return new N(e,t).parse()}
|
package/dist/parser.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function N(e){let t=(i,n)=>{i.parent=n;let r=B(i);for(let s of r)t(s,i)};return t(e,null),e}function B(e){switch(e.kind){case"Root":case"Element":case"Component":case"Fragment":return e.children;default:return[]}}var m=class{constructor(t){this.pieces=t;this.pi=0;this.oi=0;this.normalize()}normalize(){for(;this.pi<this.pieces.length;){let t=this.pieces[this.pi];if(t.kind==="static"&&this.oi>=t.text.length){this.pi++,this.oi=0;continue}break}}eof(){return this.pi>=this.pieces.length}pos(){if(this.eof()){let i=this.pieces[this.pieces.length-1];return i?i.kind==="static"?i.start+i.text.length:i.end:0}let t=this.pieces[this.pi];return t.kind==="static"?t.start+this.oi:t.start}atHole(){return!this.eof()&&this.pieces[this.pi].kind==="hole"}holeFollows(){if(this.eof())return!1;let t=this.pieces[this.pi];if(t.kind!=="static"||this.oi+1<t.text.length)return!1;let i=this.pieces[this.pi+1];return i!==void 0&&i.kind==="hole"}takeHole(){let t=this.pieces[this.pi];if(t.kind!=="hole")throw new Error("takeHole called off a hole");return this.pi++,this.oi=0,this.normalize(),{index:t.index,loc:{start:t.start,end:t.end}}}peek(t=0){if(this.eof())return"";let i=this.pieces[this.pi];return i.kind!=="static"?"":i.text[this.oi+t]??""}startsWith(t){if(this.eof())return!1;let i=this.pieces[this.pi];return i.kind!=="static"?!1:i.text.startsWith(t,this.oi)}advance(){if(this.eof())return"";let t=this.pieces[this.pi];if(t.kind!=="static")return"";let i=t.text[this.oi++]??"";return this.normalize(),i}readWhile(t){let i="";for(;!this.eof()&&!this.atHole();){let n=this.peek();if(n===""||!t(n))break;i+=n,this.oi++}return this.normalize(),i}skipWhitespace(){this.readWhile(t=>/\s/.test(t))}span(t){return{start:t,end:this.pos()}}};var b=new Set(["capture","once","passive","prevent","stop","self"]);function p(e,t){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${t} requires an expression value: ${e.name}=\${…}`),-1)}var x=(e,t)=>({kind:"Attribute",name:t?e.name.slice(1):e.name,value:e.value,boolean:t,loc:e.loc}),g=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let t,i;e.name[0]==="@"?(t="at",i=e.name.slice(1)):e.name.startsWith("on:")?(t="colon",i=e.name.slice(3)):(t="on",i=e.name.slice(2));let[n,...r]=i.split("."),s=n.toLowerCase();for(let o of r)b.has(o)||e.report("invalid-directive",`Unknown event modifier ".${o}" — expected one of ${[...b].join(", ")}`);return{kind:"EventBinding",name:s,syntax:t,modifiers:r,hole:p(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:p(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:p(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:p(e,"style directive"),loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:p(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:p(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:p(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:p(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>x(e,!0)}];function y(e,t=g,i={component:!1}){for(let n of t)if(!(n.elementOnly&&i.component)&&n.match(e.name))return n.build(e);return x(e,!1)}var E=new Set(["svg","path","circle","rect","line","polygon","polyline","ellipse","g","defs","clipPath","text"]),D=new Set(["script","style","textarea","title"]),S=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function C(e){return e.length>0&&(e[0]!==e[0].toLowerCase()||e.includes("."))}var R=new Set(["a","button","input","select","textarea","summary","details","option","label"]),W=new Set(["keydown","keyup","keypress"]);function u(e,t){return e.attributes.find(i=>"name"in i&&i.name===t)}function w(e){return e.attributes.some(t=>t.kind==="Spread")}function f(e,t){let i=u(e,t);if(!i||i.kind!=="Attribute"||!i.value)return;let n=i.value;return n.kind==="static"?n.value:void 0}function H(e){let t=f(e,"role");return t==="presentation"||t==="none"?!0:f(e,"aria-hidden")==="true"}function T(e,t){return e.attributes.some(i=>i.kind==="EventBinding"&&t(i.name))}function A(e){let t=[],i=(r,s,o)=>{t.push({code:s,message:o,severity:"warning",loc:r.loc})},n=r=>{for(let s of r){s.kind==="Element"&&P(s,i);let o="children"in s?s.children:void 0;o&&n(o)}};return n(e.children),t}function P(e,t){if(w(e))return;let i=e.tag.toLowerCase();i==="img"&&!u(e,"alt")&&!H(e)&&t(e,"a11y-img-alt",'An `img` needs an `alt`. Use `alt=""` when the image is decorative.'),i==="a"&&!u(e,"href")&&!u(e,"role")&&t(e,"a11y-anchor-href","An `a` without `href` is not a link. Use a `button` for an action."),i==="iframe"&&!u(e,"title")&&t(e,"a11y-iframe-title","An `iframe` needs a `title` describing its content.");let n=f(e,"tabindex")??f(e,"tabIndex");n!==void 0&&Number(n)>0&&t(e,"a11y-positive-tabindex","A positive `tabindex` reorders tab navigation for the entire page. Use `0`, or restructure the markup."),!R.has(i)&&T(e,r=>r==="click")&&!u(e,"role")&&!T(e,r=>W.has(r))&&t(e,"a11y-click-without-keyboard",`A click handler on \`${i}\` is unreachable by keyboard. Use a \`button\`, or add a \`role\` and a key handler.`)}var V=/[A-Za-z0-9\-_:@.?]/,k=class{constructor(t,i){this.diagnostics=[];this.r=new m(t),this.svg=i.svg??!1,this.directives=i.directives??g,this.accessibility=i.accessibility??!0}parse(){let t=this.r.pos(),i=[];for(;!this.r.eof()&&(i.push(...this.parseChildren()),!this.r.eof());){let r=this.r.pos();this.consumeCloseTag(),this.report("stray-close-tag","error","Close tag without a matching open tag",this.r.span(r))}let n={kind:"Root",children:i,loc:this.r.span(t)};return N(n),this.validateTree(n),this.accessibility&&this.diagnostics.push(...A(n)),{root:n,diagnostics:this.diagnostics}}validateTree(t){let i=n=>{let r=null;for(let s of n)s.kind==="Text"&&/^\s*$/.test(s.value)||(s.kind==="Element"||s.kind==="Component"?(s.attributes.some(l=>l.kind==="ElseDirective")&&(r!=null&&(r.kind==="Element"||r.kind==="Component")&&r.attributes.some(a=>a.kind==="IfDirective")||this.report("else-without-if","error","`else` must immediately follow an element with `if`",s.loc)),r=s):r=null,"children"in s&&s.children&&i(s.children))};i(t.children)}parseChildren(){let t=[];for(;!this.r.eof()&&!this.r.startsWith("</");){if(this.r.startsWith("<!--")){t.push(this.parseComment());continue}if(this.isFragmentStart()){t.push(this.parseFragment());continue}if(this.isDynamicTagStart()){t.push(this.parseDynamicComponent());continue}if(this.isTagStart()){t.push(this.parseElement());continue}if(this.r.atHole()){let n=this.r.takeHole(),r={kind:"Expression",hole:n.index,loc:n.loc};t.push(r);continue}let i=this.readText();i&&t.push(i)}return t}isTagStart(){return this.r.peek()==="<"&&/[A-Za-z]/.test(this.r.peek(1))}isFragmentStart(){return this.r.peek()==="<"&&this.r.peek(1)===">"}isDynamicTagStart(){return this.r.peek()==="<"&&this.r.holeFollows()}parseDynamicComponent(){let t=this.r.pos();this.r.advance();let i=this.r.takeHole().index,n=this.parseAttributes(!0);this.r.skipWhitespace();let r=!1,s=[];return this.r.startsWith("/>")?(this.r.advance(),this.r.advance(),r=!0):(this.r.peek()===">"&&this.r.advance(),s=this.parseChildren(),this.r.startsWith("</")?(this.r.advance(),this.r.advance(),this.r.atHole()?this.r.takeHole():this.readName(),this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance()):this.report("unclosed-tag","error","Unclosed dynamic component",this.r.span(t))),{kind:"Component",tag:"",tagHole:i,attributes:n,children:s,selfClosing:r,loc:this.r.span(t)}}readText(){let t=this.r.pos(),i="";for(;!this.r.eof()&&!this.r.atHole()&&!(this.r.startsWith("</")||this.r.startsWith("<!--")||this.isTagStart()||this.isFragmentStart()||this.isDynamicTagStart());)i+=this.r.advance();return i?{kind:"Text",value:i,raw:!1,loc:this.r.span(t)}:null}parseComment(){let t=this.r.pos();this.r.advance(),this.r.advance(),this.r.advance(),this.r.advance();let i="";for(;!this.r.eof()&&!this.r.startsWith("-->");){if(this.r.atHole()){this.r.takeHole(),i+="\0";continue}i+=this.r.advance()}return this.r.startsWith("-->")?(this.r.advance(),this.r.advance(),this.r.advance()):this.report("unclosed-comment","warning","Unterminated comment",this.r.span(t)),{kind:"Comment",value:i,loc:this.r.span(t)}}parseFragment(){let t=this.r.pos();this.r.advance(),this.r.advance();let i=this.parseChildren();if(this.r.startsWith("</")){let n=this.consumeCloseTag();n&&this.report("mismatched-close-tag","error",`Expected </> to close fragment, got </${n}>`,this.r.span(t))}else this.report("unclosed-tag","error","Unterminated fragment",this.r.span(t));return{kind:"Fragment",children:i,loc:this.r.span(t)}}parseElement(){let t=this.r.pos();this.r.advance();let i=this.readName(),n=C(i),r=this.parseAttributes(n);this.foldEachKey(r,t),this.r.skipWhitespace();let s=i.toLowerCase(),o=!n&&D.has(s),l=!n&&S.has(s),a=!1,c=[];if(this.r.startsWith("/>"))this.r.advance(),this.r.advance(),a=!0;else if(this.r.peek()===">"&&this.r.advance(),!l)if(c=o?this.parseRawText(i):this.parseChildren(),this.r.startsWith("</")){let v=this.consumeCloseTag();v&&v!==i&&this.report("mismatched-close-tag","error",`Expected </${i}>, got </${v}>`,this.r.span(t))}else this.report("unclosed-tag","error",`Unclosed <${i}>`,this.r.span(t));let h=this.r.span(t);if(n)return{kind:"Component",tag:i,tagHole:null,attributes:r,children:c,selfClosing:a,loc:h};let d=this.svg||E.has(i)?"svg":"html";return{kind:"Element",tag:i,namespace:d,attributes:r,children:c,selfClosing:a,rawText:o,loc:h}}parseRawText(t){let i=[],n="</"+t.toLowerCase(),r="",s=this.r.pos(),o=()=>{r&&i.push({kind:"Text",value:r,raw:!0,loc:this.r.span(s)}),r=""};for(;!this.r.eof()&&!this.startsWithCloseFor(n);){if(this.r.atHole()){o();let l=this.r.takeHole();i.push({kind:"Expression",hole:l.index,loc:l.loc}),s=this.r.pos();continue}r||(s=this.r.pos()),r+=this.r.advance()}return o(),i}startsWithCloseFor(t){let i=0;for(;i<t.length;){let n=this.r.peek(i);if(n===""||n.toLowerCase()!==t[i])return!1;i++}return!0}parseAttributes(t){let i=[];for(;!this.r.eof()&&(this.r.skipWhitespace(),!(this.r.peek()===">"||this.r.startsWith("/>")));){if(this.r.atHole()){let a=this.r.takeHole();i.push({kind:"Spread",hole:a.index,loc:a.loc});continue}if(this.r.startsWith("...")){let a=this.r.pos();if(this.r.advance(),this.r.advance(),this.r.advance(),this.r.atHole()){let c=this.r.takeHole();i.push({kind:"Spread",hole:c.index,loc:this.r.span(a)})}else this.report("invalid-binding","error","Spread `...` must be followed by ${…}",this.r.span(a));continue}let n=this.r.pos(),r=this.readName();if(!r){this.r.advance();continue}let s=this.r.span(n);this.r.skipWhitespace();let o=null;this.r.peek()==="="&&(this.r.advance(),this.r.skipWhitespace(),o=this.parseAttrValue());let l={name:r,nameLoc:s,value:o,loc:this.r.span(n),report:(a,c)=>this.report(a,"error",c,this.r.span(n))};i.push(y(l,this.directives,{component:t}))}return i}parseAttrValue(){if(this.r.atHole())return{kind:"hole",hole:this.r.takeHole().index};let t=this.r.peek();return t==='"'||t==="'"?this.classifyParts(this.readQuotedParts(t)):{kind:"static",value:this.r.readWhile(n=>!/[\s>]/.test(n))}}readQuotedParts(t){this.r.advance();let i=[],n="";for(;!this.r.eof()&&this.r.peek()!==t;){if(this.r.atHole()){n&&(i.push({text:n}),n=""),i.push({hole:this.r.takeHole().index});continue}let r=this.r.advance();if(r==="")break;n+=r}return n&&i.push({text:n}),this.r.peek()===t&&this.r.advance(),i}classifyParts(t){let i=t.filter(n=>"hole"in n);return i.length===0?{kind:"static",value:t.map(n=>"text"in n?n.text:"").join("")}:t.length===1?{kind:"hole",hole:i[0].hole}:{kind:"mixed",parts:t}}foldEachKey(t,i){let n=null,r=0,s=0,o=0,l=0;for(let d of t)d.kind==="EachDirective"?(n=d,s++):d.kind==="IfDirective"?r++:d.kind==="ElseDirective"?o++:d.kind==="RefBinding"&&l++;let a=this.r.span(i);s>1&&this.report("duplicate-directive","error","Multiple `each` directives on one element",a),r>1&&this.report("duplicate-directive","error","Multiple `if` directives on one element",a),l>1&&this.report("duplicate-directive","error","Multiple `ref` bindings on one element",a),r>0&&s>0&&this.report("unsupported-combination","error","`if` and `each` cannot both apply to one element — wrap one in another element",a),r>0&&o>0&&this.report("invalid-directive","error","`if` and `else` cannot be on the same element",a);let c=t.findIndex(d=>d.kind==="Attribute"&&d.name==="key");if(!n){c!==-1&&this.report("invalid-directive","error","`key` requires an `each` directive on the same element",a);return}if(c===-1)return;let h=t[c];h.kind==="Attribute"&&h.value&&(h.value.kind==="static"?n.key={static:h.value.value}:h.value.kind==="hole"&&(n.key={hole:h.value.hole})),t.splice(c,1)}readName(){return this.r.readWhile(t=>V.test(t))}consumeCloseTag(){this.r.advance(),this.r.advance();let t=this.readName();return this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance(),t}report(t,i,n,r){this.diagnostics.push({code:t,severity:i,message:n,loc:r})}};function G(e,t={}){return new k(e,t).parse()}export{G as parseTemplate};
|
|
1
|
+
function N(e){let t=(i,n)=>{i.parent=n;let r=B(i);for(let s of r)t(s,i)};return t(e,null),e}function B(e){switch(e.kind){case"Root":case"Element":case"Component":case"Fragment":return e.children;default:return[]}}var m=class{constructor(t){this.pieces=t;this.pi=0;this.oi=0;this.normalize()}normalize(){for(;this.pi<this.pieces.length;){let t=this.pieces[this.pi];if(t.kind==="static"&&this.oi>=t.text.length){this.pi++,this.oi=0;continue}break}}eof(){return this.pi>=this.pieces.length}pos(){if(this.eof()){let i=this.pieces[this.pieces.length-1];return i?i.kind==="static"?i.start+i.text.length:i.end:0}let t=this.pieces[this.pi];return t.kind==="static"?t.start+this.oi:t.start}atHole(){return!this.eof()&&this.pieces[this.pi].kind==="hole"}holeFollows(){if(this.eof())return!1;let t=this.pieces[this.pi];if(t.kind!=="static"||this.oi+1<t.text.length)return!1;let i=this.pieces[this.pi+1];return i!==void 0&&i.kind==="hole"}takeHole(){let t=this.pieces[this.pi];if(t.kind!=="hole")throw new Error("takeHole called off a hole");return this.pi++,this.oi=0,this.normalize(),{index:t.index,loc:{start:t.start,end:t.end}}}peek(t=0){if(this.eof())return"";let i=this.pieces[this.pi];return i.kind!=="static"?"":i.text[this.oi+t]??""}startsWith(t){if(this.eof())return!1;let i=this.pieces[this.pi];return i.kind!=="static"?!1:i.text.startsWith(t,this.oi)}advance(){if(this.eof())return"";let t=this.pieces[this.pi];if(t.kind!=="static")return"";let i=t.text[this.oi++]??"";return this.normalize(),i}readWhile(t){let i="";for(;!this.eof()&&!this.atHole();){let n=this.peek();if(n===""||!t(n))break;i+=n,this.oi++}return this.normalize(),i}skipWhitespace(){this.readWhile(t=>/\s/.test(t))}span(t){return{start:t,end:this.pos()}}};var b=new Set(["capture","once","passive","prevent","stop","self"]);function p(e,t){return e.value&&e.value.kind==="hole"?e.value.hole:(e.report("invalid-binding",`${t} requires an expression value: ${e.name}=\${…}`),-1)}var x=(e,t)=>({kind:"Attribute",name:t?e.name.slice(1):e.name,value:e.value,boolean:t,loc:e.loc}),g=[{id:"event",match:e=>e[0]==="@"||e.startsWith("on:")||/^on[A-Z]/.test(e),build:e=>{let t,i;e.name[0]==="@"?(t="at",i=e.name.slice(1)):e.name.startsWith("on:")?(t="colon",i=e.name.slice(3)):(t="on",i=e.name.slice(2));let[n,...r]=i.split("."),s=n.toLowerCase();for(let o of r)b.has(o)||e.report("invalid-directive",`Unknown event modifier ".${o}" — expected one of ${[...b].join(", ")}`);return{kind:"EventBinding",name:s,syntax:t,modifiers:r,hole:p(e,"event binding"),loc:e.loc}}},{id:"bind",elementOnly:!0,match:e=>e.startsWith("bind:"),build:e=>({kind:"BindDirective",name:e.name.slice(5),hole:p(e,"two-way binding"),loc:e.loc})},{id:"class-directive",elementOnly:!0,match:e=>e.startsWith("class:"),build:e=>({kind:"ClassDirective",name:e.name.slice(6),hole:p(e,"class directive"),loc:e.loc})},{id:"style-directive",elementOnly:!0,match:e=>e.startsWith("style:"),build:e=>({kind:"StyleDirective",name:e.name.slice(6),hole:p(e,"style directive"),loc:e.loc})},{id:"load",match:e=>e.startsWith("load:"),build:e=>({kind:"LoadDirective",strategy:e.name.slice(5),modifier:e.value&&e.value.kind==="static"?e.value.value:null,loc:e.loc})},{id:"use",match:e=>e==="use"||e.startsWith("use:"),build:e=>({kind:"UseDirective",name:e.name.startsWith("use:")?e.name.slice(4):null,hole:e.value&&e.value.kind==="hole"?e.value.hole:null,loc:e.loc})},{id:"if",elementOnly:!0,match:e=>e==="if",build:e=>({kind:"IfDirective",hole:p(e,"if directive"),loc:e.loc})},{id:"each",elementOnly:!0,match:e=>e==="each",build:e=>({kind:"EachDirective",hole:p(e,"each directive"),key:null,loc:e.loc})},{id:"else",elementOnly:!0,match:e=>e==="else",build:e=>(e.value!==null&&e.report("invalid-directive","`else` takes no value"),{kind:"ElseDirective",loc:e.loc})},{id:"ref",match:e=>e==="ref",build:e=>({kind:"RefBinding",hole:p(e,"ref binding"),loc:e.loc})},{id:"property",match:e=>e[0]===".",build:e=>({kind:"PropertyBinding",name:e.name.slice(1),hole:p(e,"property binding"),loc:e.loc})},{id:"boolean",match:e=>e[0]==="?",build:e=>x(e,!0)}];function y(e,t=g,i={component:!1}){for(let n of t)if(!(n.elementOnly&&i.component)&&n.match(e.name))return n.build(e);return x(e,!1)}var D=new Set(["svg","path","circle","rect","line","polygon","polyline","ellipse","g","defs","clipPath","text"]),E=new Set(["script","style","textarea","title"]),S=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function C(e){return e.length>0&&(e[0]!==e[0].toLowerCase()||e.includes("."))}var R=new Set(["a","button","input","select","textarea","summary","details","option","label"]),W=new Set(["keydown","keyup","keypress"]);function u(e,t){return e.attributes.find(i=>"name"in i&&i.name===t)}function w(e){return e.attributes.some(t=>t.kind==="Spread")}function f(e,t){let i=u(e,t);if(!i||i.kind!=="Attribute"||!i.value)return;let n=i.value;return n.kind==="static"?n.value:void 0}function L(e){let t=f(e,"role");return t==="presentation"||t==="none"?!0:f(e,"aria-hidden")==="true"}function T(e,t){return e.attributes.some(i=>i.kind==="EventBinding"&&t(i.name))}function A(e){let t=[],i=(r,s,o)=>{t.push({code:s,message:o,severity:"warning",loc:r.loc})},n=r=>{for(let s of r){s.kind==="Element"&&H(s,i);let o="children"in s?s.children:void 0;o&&n(o)}};return n(e.children),t}function H(e,t){if(w(e))return;let i=e.tag.toLowerCase();i==="img"&&!u(e,"alt")&&!L(e)&&t(e,"a11y-img-alt",'An `img` needs an `alt`. Use `alt=""` when the image is decorative.'),i==="a"&&!u(e,"href")&&!u(e,"role")&&t(e,"a11y-anchor-href","An `a` without `href` is not a link. Use a `button` for an action."),i==="iframe"&&!u(e,"title")&&t(e,"a11y-iframe-title","An `iframe` needs a `title` describing its content.");let n=f(e,"tabindex")??f(e,"tabIndex");n!==void 0&&Number(n)>0&&t(e,"a11y-positive-tabindex","A positive `tabindex` reorders tab navigation for the entire page. Use `0`, or restructure the markup."),!R.has(i)&&T(e,r=>r==="click")&&!u(e,"role")&&!T(e,r=>W.has(r))&&t(e,"a11y-click-without-keyboard",`A click handler on \`${i}\` is unreachable by keyboard. Use a \`button\`, or add a \`role\` and a key handler.`)}var P=/[A-Za-z0-9\-_:@.?]/,k=class{constructor(t,i){this.diagnostics=[];this.r=new m(t),this.svg=i.svg??!1,this.directives=i.directives??g,this.accessibility=i.accessibility??!0}parse(){let t=this.r.pos(),i=[];for(;!this.r.eof()&&(i.push(...this.parseChildren()),!this.r.eof());){let r=this.r.pos();this.consumeCloseTag(),this.report("stray-close-tag","error","Close tag without a matching open tag",this.r.span(r))}let n={kind:"Root",children:i,loc:this.r.span(t)};return N(n),this.validateTree(n),this.accessibility&&this.diagnostics.push(...A(n)),{root:n,diagnostics:this.diagnostics}}validateTree(t){let i=n=>{let r=null;for(let s of n)s.kind==="Text"&&/^\s*$/.test(s.value)||(s.kind==="Element"||s.kind==="Component"?(s.attributes.some(l=>l.kind==="ElseDirective")&&(r!=null&&(r.kind==="Element"||r.kind==="Component")&&r.attributes.some(a=>a.kind==="IfDirective")||this.report("else-without-if","error","`else` must immediately follow an element with `if`",s.loc)),r=s):r=null,"children"in s&&s.children&&i(s.children))};i(t.children)}parseChildren(){let t=[];for(;!this.r.eof()&&!this.r.startsWith("</");){if(this.r.startsWith("<!--")){t.push(this.parseComment());continue}if(this.isFragmentStart()){t.push(this.parseFragment());continue}if(this.isDynamicTagStart()){t.push(this.parseDynamicComponent());continue}if(this.isTagStart()){t.push(this.parseElement());continue}if(this.r.atHole()){let n=this.r.takeHole(),r={kind:"Expression",hole:n.index,loc:n.loc};t.push(r);continue}let i=this.readText();i&&t.push(i)}return t}isTagStart(){return this.r.peek()==="<"&&/[A-Za-z]/.test(this.r.peek(1))}isFragmentStart(){return this.r.peek()==="<"&&this.r.peek(1)===">"}isDynamicTagStart(){return this.r.peek()==="<"&&this.r.holeFollows()}parseDynamicComponent(){let t=this.r.pos();this.r.advance();let i=this.r.takeHole().index,n=this.parseAttributes(!0);this.r.skipWhitespace();let r=!1,s=[];return this.r.startsWith("/>")?(this.r.advance(),this.r.advance(),r=!0):(this.r.peek()===">"&&this.r.advance(),s=this.parseChildren(),this.r.startsWith("</")?(this.r.advance(),this.r.advance(),this.r.atHole()?this.r.takeHole():this.readName(),this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance()):this.report("unclosed-tag","error","Unclosed dynamic component",this.r.span(t))),{kind:"Component",tag:"",tagHole:i,attributes:n,children:s,selfClosing:r,loc:this.r.span(t)}}readText(){let t=this.r.pos(),i="";for(;!this.r.eof()&&!this.r.atHole()&&!(this.r.startsWith("</")||this.r.startsWith("<!--")||this.isTagStart()||this.isFragmentStart()||this.isDynamicTagStart());)i+=this.r.advance();return i?{kind:"Text",value:i,raw:!1,loc:this.r.span(t)}:null}parseComment(){let t=this.r.pos();this.r.advance(),this.r.advance(),this.r.advance(),this.r.advance();let i="";for(;!this.r.eof()&&!this.r.startsWith("-->");){if(this.r.atHole()){this.r.takeHole(),i+="\0";continue}i+=this.r.advance()}return this.r.startsWith("-->")?(this.r.advance(),this.r.advance(),this.r.advance()):this.report("unclosed-comment","warning","Unterminated comment",this.r.span(t)),{kind:"Comment",value:i,loc:this.r.span(t)}}parseFragment(){let t=this.r.pos();this.r.advance(),this.r.advance();let i=this.parseChildren();if(this.r.startsWith("</")){let n=this.consumeCloseTag();n&&this.report("mismatched-close-tag","error",`Expected </> to close fragment, got </${n}>`,this.r.span(t))}else this.report("unclosed-tag","error","Unterminated fragment",this.r.span(t));return{kind:"Fragment",children:i,loc:this.r.span(t)}}parseElement(){let t=this.r.pos();this.r.advance();let i=this.readName(),n=C(i),r=this.parseAttributes(n);this.foldEachKey(r,t),this.r.skipWhitespace();let s=i.toLowerCase(),o=!n&&E.has(s),l=!n&&S.has(s),a=!1,c=[];if(this.r.startsWith("/>"))this.r.advance(),this.r.advance(),a=!0;else if(this.r.peek()===">"&&this.r.advance(),!l)if(c=o?this.parseRawText(i):this.parseChildren(),this.r.startsWith("</")){let v=this.consumeCloseTag();v&&v!==i&&this.report("mismatched-close-tag","error",`Expected </${i}>, got </${v}>`,this.r.span(t))}else this.report("unclosed-tag","error",`Unclosed <${i}>`,this.r.span(t));let h=this.r.span(t);if(n)return{kind:"Component",tag:i,tagHole:null,attributes:r,children:c,selfClosing:a,loc:h};let d=this.svg||D.has(i)?"svg":"html";return{kind:"Element",tag:i,namespace:d,attributes:r,children:c,selfClosing:a,rawText:o,loc:h}}parseRawText(t){let i=[],n="</"+t.toLowerCase(),r="",s=this.r.pos(),o=()=>{r&&i.push({kind:"Text",value:r,raw:!0,loc:this.r.span(s)}),r=""};for(;!this.r.eof()&&!this.startsWithCloseFor(n);){if(this.r.atHole()){o();let l=this.r.takeHole();i.push({kind:"Expression",hole:l.index,loc:l.loc}),s=this.r.pos();continue}r||(s=this.r.pos()),r+=this.r.advance()}return o(),i}startsWithCloseFor(t){let i=0;for(;i<t.length;){let n=this.r.peek(i);if(n===""||n.toLowerCase()!==t[i])return!1;i++}return!0}parseAttributes(t){let i=[];for(;!this.r.eof()&&(this.r.skipWhitespace(),!(this.r.peek()===">"||this.r.startsWith("/>")));){if(this.r.atHole()){let a=this.r.takeHole();i.push({kind:"Spread",hole:a.index,loc:a.loc});continue}if(this.r.startsWith("...")){let a=this.r.pos();if(this.r.advance(),this.r.advance(),this.r.advance(),this.r.atHole()){let c=this.r.takeHole();i.push({kind:"Spread",hole:c.index,loc:this.r.span(a)})}else this.report("invalid-binding","error","Spread `...` must be followed by ${…}",this.r.span(a));continue}let n=this.r.pos(),r=this.readName();if(!r){this.r.advance();continue}let s=this.r.span(n);this.r.skipWhitespace();let o=null;this.r.peek()==="="&&(this.r.advance(),this.r.skipWhitespace(),o=this.parseAttrValue());let l={name:r,nameLoc:s,value:o,loc:this.r.span(n),report:(a,c)=>this.report(a,"error",c,this.r.span(n))};i.push(y(l,this.directives,{component:t}))}return i}parseAttrValue(){if(this.r.atHole())return{kind:"hole",hole:this.r.takeHole().index};let t=this.r.peek();return t==='"'||t==="'"?this.classifyParts(this.readQuotedParts(t)):{kind:"static",value:this.r.readWhile(n=>!/[\s>]/.test(n))}}readQuotedParts(t){this.r.advance();let i=[],n="";for(;!this.r.eof()&&this.r.peek()!==t;){if(this.r.atHole()){n&&(i.push({text:n}),n=""),i.push({hole:this.r.takeHole().index});continue}let r=this.r.advance();if(r==="")break;n+=r}return n&&i.push({text:n}),this.r.peek()===t&&this.r.advance(),i}classifyParts(t){let i=t.filter(n=>"hole"in n);return i.length===0?{kind:"static",value:t.map(n=>"text"in n?n.text:"").join("")}:t.length===1?{kind:"hole",hole:i[0].hole}:{kind:"mixed",parts:t}}foldEachKey(t,i){let n=null,r=0,s=0,o=0,l=0;for(let d of t)d.kind==="EachDirective"?(n=d,s++):d.kind==="IfDirective"?r++:d.kind==="ElseDirective"?o++:d.kind==="RefBinding"&&l++;let a=this.r.span(i);s>1&&this.report("duplicate-directive","error","Multiple `each` directives on one element",a),r>1&&this.report("duplicate-directive","error","Multiple `if` directives on one element",a),l>1&&this.report("duplicate-directive","error","Multiple `ref` bindings on one element",a),r>0&&s>0&&this.report("unsupported-combination","error","`if` and `each` cannot both apply to one element — wrap one in another element",a),r>0&&o>0&&this.report("invalid-directive","error","`if` and `else` cannot be on the same element",a);let c=t.findIndex(d=>d.kind==="Attribute"&&d.name==="key");if(!n){c!==-1&&this.report("invalid-directive","error","`key` requires an `each` directive on the same element",a);return}if(c===-1)return;let h=t[c];h.kind==="Attribute"&&h.value&&(h.value.kind==="static"?n.key={static:h.value.value}:h.value.kind==="hole"&&(n.key={hole:h.value.hole})),t.splice(c,1)}readName(){return this.r.readWhile(t=>P.test(t))}consumeCloseTag(){this.r.advance(),this.r.advance();let t=this.readName();return this.r.skipWhitespace(),this.r.peek()===">"&&this.r.advance(),t}report(t,i,n,r){this.diagnostics.push({code:t,severity:i,message:n,loc:r})}};function G(e,t={}){return new k(e,t).parse()}export{G as parseTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts","../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.d.ts","../src/ast.ts","../src/a11y.ts","../src/directives.ts","../src/reader.ts","../src/tags.ts","../src/parser.ts","../src/index.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dom-events.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/globals.global.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/index.d.ts"],"fileIdsList":[[61,107],[64,107],[65,70,98,107],[66,77,78,85,95,106,107],[66,67,77,85,107],[68,107],[69,70,78,86,107],[70,95,103,107],[71,73,77,85,107],[72,107],[73,74,107],[77,107],[75,77,107],[77,78,79,95,106,107],[77,78,79,92,95,98,107],[107,111],[107],[73,77,80,85,95,106,107],[77,78,80,81,85,95,103,106,107],[80,82,95,103,106,107],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113],[77,83,107],[84,106,107],[73,77,85,95,107],[86,107],[87,107],[64,88,107],[89,105,107,111],[90,107],[91,107],[77,92,93,107],[92,94,107,109],[65,77,95,96,97,98,107],[65,95,97,107],[95,96,107],[98,107],[99,107],[77,101,102,107],[101,102,107],[70,85,95,103,107],[104,107],[85,105,107],[65,80,91,106,107],[70,107],[95,107,108],[107,109],[107,110],[65,70,77,79,88,95,106,107,109,111],[95,107,112],[52,107],[53,54,107],[53,107],[53,54,56,57,59,107],[53,54,55,56,57,58,107]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec","impliedFormat":1},{"version":"b8f34dd1757f68e03262b1ca3ddfa668a855b872f8bdd5224d6f993a7b37dc2c","impliedFormat":99},{"version":"5b3c80e4cce24cb3f83b4d4f4bb5d4305b2c15ba0b9df3f32e2e5277497e6e7e","signature":"ca5c2ce2e7ee58f4d934256c1ff07f72dccc31f6ff2c623f0c7af8bc229a6a07","impliedFormat":99},{"version":"4ceb59493ce9f9a001ad5165a0f68df7b777c153b4205361fcbadb6df1ffcdc4","signature":"a3b39dfbe89912e7d9514f9c67a9ceb943dda71fc93014229d5dc12fc965c858","impliedFormat":99},{"version":"0bb5df6213feee60968db4caa63087bb98eab22d1f6b0e027dfdbfbe92845f65","signature":"28b2c0f5b5edf8bb5376b7261a7b0e4be39c2b9c5873046e8c5faa61f22a6c68","impliedFormat":99},{"version":"b0d55b376d88cf6b33982abf3ae76ef0f9507b343cd930ff58836848232f6162","signature":"5f2c103a31a73eb51c02fdb720070596b04ca102ffee940cdceaf6406dcee0d6","impliedFormat":99},{"version":"79398fc78b9511ca426ae55622652128e935e4a5594e34b36aac2ad7cabe170a","signature":"562bd990982d3c9b5afe1461776568f2e33e90693f97d975e346c54cf94c6ed1","impliedFormat":99},{"version":"d001200221d6af8e0c840422191abd92d8fe389e5d8263d07e334bb713d611fa","signature":"2fef2e561e599a2b0cf4fec0383768c42e104997aef60f3441a661a073e237f4","impliedFormat":99},{"version":"739a75312a96b274e25258ea667210807206b1648ee7a15c0a40bea0374e2458","signature":"7b66e663ac54c9dfd176aab1ff7f2adaf4f6a2bcc61ae983dadfebec74eab286","impliedFormat":99},{"version":"7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","impliedFormat":1},{"version":"a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a","impliedFormat":1},{"version":"f749812878fecfa53cfc13b36e5d35086fb6377983a9df44175da83ccc23af1f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7d2e3fea24c712c99c03ad8f556abedbfe105f87f1be10b95dbd409d24bc05a3","impliedFormat":1},{"version":"211e3f15fbced4ab4be19f49ffa990b9ff20d749d33b65ff753be691e7616239","affectsGlobalScope":true,"impliedFormat":1},{"version":"3719525a8f6ab731e3dfd585d9f87df55ec7d50d461df84f74eb4d68bb165244","impliedFormat":1},{"version":"5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713","impliedFormat":1},{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true,"impliedFormat":1},{"version":"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","impliedFormat":1},{"version":"e596c9bb2f29a2699fdd4ae89139612652245192f67f45617c5a4b20832aaae9","impliedFormat":1},{"version":"bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","impliedFormat":1},{"version":"1cdcfc1f624d6c08aa12c73935f6e13f095919cd99edf95752951796eb225729","impliedFormat":1},{"version":"4eaff3d8e10676fd7913d8c108890e71c688e1e7d52f6d1d55c39514f493dc47","impliedFormat":1},{"version":"14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","impliedFormat":1},{"version":"5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea","impliedFormat":1},{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true,"impliedFormat":1},{"version":"00dee7cdca8b8420c47ea4a31a34b8e8294013ebc4f463fd941e867e7bf05029","affectsGlobalScope":true,"impliedFormat":1},{"version":"3256f3cccd578f9e7fe3a28096c505634bebcee8afb738ffa99368e536ca3a0b","impliedFormat":1},{"version":"1c84b46267610a34028edfd0d035509341751262bac1062857f3c8df7aff7153","impliedFormat":1},{"version":"7f138842074d0a40681775af008c8452093b68c383c94de31759e853c6d06b5c","impliedFormat":1},{"version":"a3d541d303ee505053f5dcbf9fafb65cac3d5631037501cd616195863a6c5740","impliedFormat":1},{"version":"8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","impliedFormat":1},{"version":"2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58","impliedFormat":1},{"version":"e630e5528e899219ae319e83bef54bf3bcb91b01d76861ecf881e8e614b167f0","affectsGlobalScope":true,"impliedFormat":1},{"version":"bcebb922784739bdb34c18ee51095d25a92b560c78ccd2eaacd6bd00f7443d83","impliedFormat":1},{"version":"7ee6ed878c4528215c82b664fe0cfe80e8b4da6c0d4cc80869367868774db8b1","impliedFormat":1},{"version":"b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30","impliedFormat":1},{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0715e4cd28ad471b2a93f3e552ff51a3ae423417a01a10aa1d3bc7c6b95059d6","affectsGlobalScope":true,"impliedFormat":1},{"version":"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","impliedFormat":1},{"version":"210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","impliedFormat":1},{"version":"36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","impliedFormat":1},{"version":"0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","impliedFormat":1},{"version":"25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","impliedFormat":1},{"version":"4f3fdeba4e28e21aa719c081b8dc8f91d47e12e773389b9d35679c08151c9d37","impliedFormat":1},{"version":"1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","impliedFormat":1},{"version":"69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","impliedFormat":1},{"version":"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","impliedFormat":1},{"version":"23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","impliedFormat":1},{"version":"f69ff39996a61a0dd10f4bce73272b52e8024a4d58b13ab32bf4712909d0a2b7","impliedFormat":1},{"version":"3c4ba1dd9b12ffa284b565063108f2f031d150ea15b8fafbdc17f5d2a07251f3","affectsGlobalScope":true,"impliedFormat":1},{"version":"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","impliedFormat":1},{"version":"1422cd9e705adcc09088fda85a900c2b70e3ad36ea85846f68bd1a884cdf4e2b","impliedFormat":1},{"version":"3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","impliedFormat":1},{"version":"5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2","impliedFormat":1},{"version":"a73ae8c0e62103bb9e21bb6538700881bf135b9a8b125b857ec68edfa0da4ed3","affectsGlobalScope":true,"impliedFormat":1},{"version":"e1c1b2fbe236bf7ee3e342eeae7e20efb8988a0ac7da1cbbfa2c1f66b76c3423","affectsGlobalScope":true,"impliedFormat":1},{"version":"868831cab82b65dfe1d68180e898af1f2101e89ba9b754d1db6fb8cc2fac1921","impliedFormat":1},{"version":"0fe8985a28f82c450a04a6edf1279d7181c0893f37da7d2a27f8efd4fd5edb03","impliedFormat":1},{"version":"e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa","impliedFormat":1},{"version":"52120bb7e4583612225bdf08e7c12559548170f11e660d33a33623bae9bbdbba","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6dd3dba8e665ac43d279e0fdf5219edda0eed69b5e9a5061f46cd6a65c4f7a1","impliedFormat":1}],"root":[[54,60]],"options":{"composite":true,"declarationMap":true,"emitDeclarationOnly":false,"importHelpers":true,"module":199,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":9,"tsBuildInfoFile":"./tsconfig.lib.tsbuildinfo"},"referencedMap":[[61,1],[62,1],[64,2],[65,3],[66,4],[67,5],[68,6],[69,7],[70,8],[71,9],[72,10],[73,11],[74,11],[76,12],[75,13],[77,12],[78,14],[79,15],[63,16],[113,17],[80,18],[81,19],[82,20],[114,21],[83,22],[84,23],[85,24],[86,25],[87,26],[88,27],[89,28],[90,29],[91,30],[92,31],[93,31],[94,32],[95,33],[97,34],[96,35],[98,36],[99,37],[100,17],[101,38],[102,39],[103,40],[104,41],[105,42],[106,43],[107,44],[108,45],[109,46],[110,47],[111,48],[112,49],[53,50],[52,17],[50,17],[51,17],[10,17],[9,17],[2,17],[11,17],[12,17],[13,17],[14,17],[15,17],[16,17],[17,17],[18,17],[3,17],[19,17],[20,17],[4,17],[21,17],[25,17],[22,17],[23,17],[24,17],[26,17],[27,17],[28,17],[5,17],[29,17],[30,17],[31,17],[32,17],[6,17],[36,17],[33,17],[34,17],[35,17],[37,17],[7,17],[38,17],[43,17],[44,17],[39,17],[40,17],[41,17],[42,17],[8,17],[48,17],[45,17],[46,17],[47,17],[1,17],[49,17],[55,51],[54,52],[56,51],[60,53],[59,54],[57,51],[58,52]],"latestChangedDtsFile":"./index.d.ts","version":"5.8.3"}
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts","../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.d.ts","../src/ast.ts","../src/a11y.ts","../src/directives.ts","../src/reader.ts","../src/tags.ts","../src/parser.ts","../src/index.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dom-events.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/globals.global.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/index.d.ts"],"fileIdsList":[[61,107],[64,107],[65,70,98,107],[66,77,78,85,95,106,107],[66,67,77,85,107],[68,107],[69,70,78,86,107],[70,95,103,107],[71,73,77,85,107],[72,107],[73,74,107],[77,107],[75,77,107],[77,78,79,95,106,107],[77,78,79,92,95,98,107],[107,111],[107],[73,77,80,85,95,106,107],[77,78,80,81,85,95,103,106,107],[80,82,95,103,106,107],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113],[77,83,107],[84,106,107],[73,77,85,95,107],[86,107],[87,107],[64,88,107],[89,105,107,111],[90,107],[91,107],[77,92,93,107],[92,94,107,109],[65,77,95,96,97,98,107],[65,95,97,107],[95,96,107],[98,107],[99,107],[77,101,102,107],[101,102,107],[70,85,95,103,107],[104,107],[85,105,107],[65,80,91,106,107],[70,107],[95,107,108],[107,109],[107,110],[65,70,77,79,88,95,106,107,109,111],[95,107,112],[52,107],[53,54,107],[53,107],[53,54,56,57,59,107],[53,54,55,56,57,58,107]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec","impliedFormat":1},{"version":"b8f34dd1757f68e03262b1ca3ddfa668a855b872f8bdd5224d6f993a7b37dc2c","impliedFormat":99},{"version":"7a6f026a13219fb9e127b87fbf04246fc27983ec5e41a0513a6612c2b392e9ac","signature":"a1d742d82223ed3ab102ab299e3eb6759e6be5b1572eaca01f0d67c3c4b0535a","impliedFormat":99},{"version":"4ceb59493ce9f9a001ad5165a0f68df7b777c153b4205361fcbadb6df1ffcdc4","signature":"a3b39dfbe89912e7d9514f9c67a9ceb943dda71fc93014229d5dc12fc965c858","impliedFormat":99},{"version":"77fe51eae62dccb579c2c138773395f09cb5e81ab7dc808c9f168490601e4b19","signature":"28b2c0f5b5edf8bb5376b7261a7b0e4be39c2b9c5873046e8c5faa61f22a6c68","impliedFormat":99},{"version":"b0d55b376d88cf6b33982abf3ae76ef0f9507b343cd930ff58836848232f6162","signature":"5f2c103a31a73eb51c02fdb720070596b04ca102ffee940cdceaf6406dcee0d6","impliedFormat":99},{"version":"79398fc78b9511ca426ae55622652128e935e4a5594e34b36aac2ad7cabe170a","signature":"562bd990982d3c9b5afe1461776568f2e33e90693f97d975e346c54cf94c6ed1","impliedFormat":99},{"version":"d001200221d6af8e0c840422191abd92d8fe389e5d8263d07e334bb713d611fa","signature":"2fef2e561e599a2b0cf4fec0383768c42e104997aef60f3441a661a073e237f4","impliedFormat":99},{"version":"739a75312a96b274e25258ea667210807206b1648ee7a15c0a40bea0374e2458","signature":"7b66e663ac54c9dfd176aab1ff7f2adaf4f6a2bcc61ae983dadfebec74eab286","impliedFormat":99},{"version":"7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","impliedFormat":1},{"version":"a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a","impliedFormat":1},{"version":"f749812878fecfa53cfc13b36e5d35086fb6377983a9df44175da83ccc23af1f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7d2e3fea24c712c99c03ad8f556abedbfe105f87f1be10b95dbd409d24bc05a3","impliedFormat":1},{"version":"211e3f15fbced4ab4be19f49ffa990b9ff20d749d33b65ff753be691e7616239","affectsGlobalScope":true,"impliedFormat":1},{"version":"3719525a8f6ab731e3dfd585d9f87df55ec7d50d461df84f74eb4d68bb165244","impliedFormat":1},{"version":"5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713","impliedFormat":1},{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true,"impliedFormat":1},{"version":"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","impliedFormat":1},{"version":"e596c9bb2f29a2699fdd4ae89139612652245192f67f45617c5a4b20832aaae9","impliedFormat":1},{"version":"bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","impliedFormat":1},{"version":"1cdcfc1f624d6c08aa12c73935f6e13f095919cd99edf95752951796eb225729","impliedFormat":1},{"version":"4eaff3d8e10676fd7913d8c108890e71c688e1e7d52f6d1d55c39514f493dc47","impliedFormat":1},{"version":"14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","impliedFormat":1},{"version":"5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea","impliedFormat":1},{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true,"impliedFormat":1},{"version":"00dee7cdca8b8420c47ea4a31a34b8e8294013ebc4f463fd941e867e7bf05029","affectsGlobalScope":true,"impliedFormat":1},{"version":"3256f3cccd578f9e7fe3a28096c505634bebcee8afb738ffa99368e536ca3a0b","impliedFormat":1},{"version":"1c84b46267610a34028edfd0d035509341751262bac1062857f3c8df7aff7153","impliedFormat":1},{"version":"7f138842074d0a40681775af008c8452093b68c383c94de31759e853c6d06b5c","impliedFormat":1},{"version":"a3d541d303ee505053f5dcbf9fafb65cac3d5631037501cd616195863a6c5740","impliedFormat":1},{"version":"8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","impliedFormat":1},{"version":"2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58","impliedFormat":1},{"version":"e630e5528e899219ae319e83bef54bf3bcb91b01d76861ecf881e8e614b167f0","affectsGlobalScope":true,"impliedFormat":1},{"version":"bcebb922784739bdb34c18ee51095d25a92b560c78ccd2eaacd6bd00f7443d83","impliedFormat":1},{"version":"7ee6ed878c4528215c82b664fe0cfe80e8b4da6c0d4cc80869367868774db8b1","impliedFormat":1},{"version":"b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30","impliedFormat":1},{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0715e4cd28ad471b2a93f3e552ff51a3ae423417a01a10aa1d3bc7c6b95059d6","affectsGlobalScope":true,"impliedFormat":1},{"version":"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","impliedFormat":1},{"version":"210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","impliedFormat":1},{"version":"36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","impliedFormat":1},{"version":"0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","impliedFormat":1},{"version":"25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","impliedFormat":1},{"version":"4f3fdeba4e28e21aa719c081b8dc8f91d47e12e773389b9d35679c08151c9d37","impliedFormat":1},{"version":"1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","impliedFormat":1},{"version":"69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","impliedFormat":1},{"version":"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","impliedFormat":1},{"version":"23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","impliedFormat":1},{"version":"f69ff39996a61a0dd10f4bce73272b52e8024a4d58b13ab32bf4712909d0a2b7","impliedFormat":1},{"version":"3c4ba1dd9b12ffa284b565063108f2f031d150ea15b8fafbdc17f5d2a07251f3","affectsGlobalScope":true,"impliedFormat":1},{"version":"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","impliedFormat":1},{"version":"1422cd9e705adcc09088fda85a900c2b70e3ad36ea85846f68bd1a884cdf4e2b","impliedFormat":1},{"version":"3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","impliedFormat":1},{"version":"5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2","impliedFormat":1},{"version":"a73ae8c0e62103bb9e21bb6538700881bf135b9a8b125b857ec68edfa0da4ed3","affectsGlobalScope":true,"impliedFormat":1},{"version":"e1c1b2fbe236bf7ee3e342eeae7e20efb8988a0ac7da1cbbfa2c1f66b76c3423","affectsGlobalScope":true,"impliedFormat":1},{"version":"868831cab82b65dfe1d68180e898af1f2101e89ba9b754d1db6fb8cc2fac1921","impliedFormat":1},{"version":"0fe8985a28f82c450a04a6edf1279d7181c0893f37da7d2a27f8efd4fd5edb03","impliedFormat":1},{"version":"e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa","impliedFormat":1},{"version":"52120bb7e4583612225bdf08e7c12559548170f11e660d33a33623bae9bbdbba","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6dd3dba8e665ac43d279e0fdf5219edda0eed69b5e9a5061f46cd6a65c4f7a1","impliedFormat":1}],"root":[[54,60]],"options":{"composite":true,"declarationMap":true,"emitDeclarationOnly":false,"importHelpers":true,"module":199,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":9,"tsBuildInfoFile":"./tsconfig.lib.tsbuildinfo"},"referencedMap":[[61,1],[62,1],[64,2],[65,3],[66,4],[67,5],[68,6],[69,7],[70,8],[71,9],[72,10],[73,11],[74,11],[76,12],[75,13],[77,12],[78,14],[79,15],[63,16],[113,17],[80,18],[81,19],[82,20],[114,21],[83,22],[84,23],[85,24],[86,25],[87,26],[88,27],[89,28],[90,29],[91,30],[92,31],[93,31],[94,32],[95,33],[97,34],[96,35],[98,36],[99,37],[100,17],[101,38],[102,39],[103,40],[104,41],[105,42],[106,43],[107,44],[108,45],[109,46],[110,47],[111,48],[112,49],[53,50],[52,17],[50,17],[51,17],[10,17],[9,17],[2,17],[11,17],[12,17],[13,17],[14,17],[15,17],[16,17],[17,17],[18,17],[3,17],[19,17],[20,17],[4,17],[21,17],[25,17],[22,17],[23,17],[24,17],[26,17],[27,17],[28,17],[5,17],[29,17],[30,17],[31,17],[32,17],[6,17],[36,17],[33,17],[34,17],[35,17],[37,17],[7,17],[38,17],[43,17],[44,17],[39,17],[40,17],[41,17],[42,17],[8,17],[48,17],[45,17],[46,17],[47,17],[1,17],[49,17],[55,51],[54,52],[56,51],[60,53],[59,54],[57,51],[58,52]],"latestChangedDtsFile":"./index.d.ts","version":"5.8.3"}
|