prettier 3.0.0-alpha.1 → 3.0.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/LICENSE +35 -82
- package/doc.js +1 -6
- package/doc.mjs +1 -6
- package/index.cjs +2 -2
- package/index.mjs +4190 -5525
- package/internal/cli.mjs +281 -263
- package/internal/third-party.mjs +6 -0
- package/package.json +2 -2
- package/plugins/acorn-and-espree.js +1 -1
- package/plugins/acorn-and-espree.mjs +1 -1
- package/plugins/angular.js +2 -2
- package/plugins/angular.mjs +2 -2
- package/plugins/babel.js +1 -1
- package/plugins/babel.mjs +1 -1
- package/plugins/flow.js +1 -1
- package/plugins/flow.mjs +1 -1
- package/plugins/html.js +13 -14
- package/plugins/html.mjs +13 -14
- package/plugins/markdown.js +28 -28
- package/plugins/markdown.mjs +28 -28
- package/plugins/meriyah.js +1 -1
- package/plugins/meriyah.mjs +1 -1
- package/plugins/postcss.js +1 -1
- package/plugins/postcss.mjs +1 -1
- package/plugins/typescript.js +26 -32
- package/plugins/typescript.mjs +26 -32
- package/plugins/yaml.js +119 -119
- package/plugins/yaml.mjs +119 -119
- package/standalone.js +65 -66
- package/standalone.mjs +65 -66
package/internal/third-party.mjs
CHANGED
|
@@ -8831,6 +8831,12 @@ var require_vendors = __commonJS({
|
|
|
8831
8831
|
env: "DRONE",
|
|
8832
8832
|
pr: { DRONE_BUILD_EVENT: "pull_request" }
|
|
8833
8833
|
},
|
|
8834
|
+
{
|
|
8835
|
+
name: "Woodpecker",
|
|
8836
|
+
constant: "WOODPECKER",
|
|
8837
|
+
env: { CI: "woodpecker" },
|
|
8838
|
+
pr: { CI_BUILD_EVENT: "pull_request" }
|
|
8839
|
+
},
|
|
8834
8840
|
{
|
|
8835
8841
|
name: "dsari",
|
|
8836
8842
|
constant: "DSARI",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prettier",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.3",
|
|
4
4
|
"description": "Prettier is an opinionated code formatter",
|
|
5
5
|
"bin": "./bin/prettier.cjs",
|
|
6
6
|
"repository": "prettier/prettier",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"require": "./index.cjs",
|
|
17
17
|
"default": "./index.mjs"
|
|
18
18
|
},
|
|
19
|
-
"./*": "
|
|
19
|
+
"./*": "./*",
|
|
20
20
|
"./doc": {
|
|
21
21
|
"require": "./doc.js",
|
|
22
22
|
"default": "./doc.mjs"
|
|
@@ -10,4 +10,4 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
10
10
|
`):g=String.fromCharCode(x),this.options.locations&&(++this.curLine,this.lineStart=this.pos),g}jsx_readString(m){let x="",g=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let C=this.input.charCodeAt(this.pos);if(C===m)break;C===38?(x+=this.input.slice(g,this.pos),x+=this.jsx_readEntity(),g=this.pos):j(C)?(x+=this.input.slice(g,this.pos),x+=this.jsx_readNewLine(!1),g=this.pos):++this.pos}return x+=this.input.slice(g,this.pos++),this.finishToken(h.string,x)}jsx_readEntity(){let m="",x=0,g,C=this.input[this.pos];C!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let V=++this.pos;for(;this.pos<this.input.length&&x++<10;){if(C=this.input[this.pos++],C===";"){m[0]==="#"?m[1]==="x"?(m=m.substr(2),Fs.test(m)&&(g=String.fromCharCode(parseInt(m,16)))):(m=m.substr(1),Ds.test(m)&&(g=String.fromCharCode(parseInt(m,10)))):g=Rs[m];break}m+=C}return g||(this.pos=V,"&")}jsx_readWord(){let m,x=this.pos;do m=this.input.charCodeAt(++this.pos);while(U(m)||m===45);return this.finishToken(f.jsxName,this.input.slice(x,this.pos))}jsx_parseIdentifier(){let m=this.startNode();return this.type===f.jsxName?m.name=this.value:this.type.keyword?m.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(m,"JSXIdentifier")}jsx_parseNamespacedName(){let m=this.start,x=this.startLoc,g=this.jsx_parseIdentifier();if(!r.allowNamespaces||!this.eat(h.colon))return g;var C=this.startNodeAt(m,x);return C.namespace=g,C.name=this.jsx_parseIdentifier(),this.finishNode(C,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===f.jsxTagEnd)return"";let m=this.start,x=this.startLoc,g=this.jsx_parseNamespacedName();for(this.type===h.dot&&g.type==="JSXNamespacedName"&&!r.allowNamespacedObjects&&this.unexpected();this.eat(h.dot);){let C=this.startNodeAt(m,x);C.object=g,C.property=this.jsx_parseIdentifier(),g=this.finishNode(C,"JSXMemberExpression")}return g}jsx_parseAttributeValue(){switch(this.type){case h.braceL:let m=this.jsx_parseExpressionContainer();return m.expression.type==="JSXEmptyExpression"&&this.raise(m.start,"JSX attributes must only be assigned a non-empty expression"),m;case f.jsxTagStart:case h.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let m=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(m,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let m=this.startNode();return this.next(),m.expression=this.type===h.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(h.braceR),this.finishNode(m,"JSXExpressionContainer")}jsx_parseAttribute(){let m=this.startNode();return this.eat(h.braceL)?(this.expect(h.ellipsis),m.argument=this.parseMaybeAssign(),this.expect(h.braceR),this.finishNode(m,"JSXSpreadAttribute")):(m.name=this.jsx_parseNamespacedName(),m.value=this.eat(h.eq)?this.jsx_parseAttributeValue():null,this.finishNode(m,"JSXAttribute"))}jsx_parseOpeningElementAt(m,x){let g=this.startNodeAt(m,x);g.attributes=[];let C=this.jsx_parseElementName();for(C&&(g.name=C);this.type!==h.slash&&this.type!==f.jsxTagEnd;)g.attributes.push(this.jsx_parseAttribute());return g.selfClosing=this.eat(h.slash),this.expect(f.jsxTagEnd),this.finishNode(g,C?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(m,x){let g=this.startNodeAt(m,x),C=this.jsx_parseElementName();return C&&(g.name=C),this.expect(f.jsxTagEnd),this.finishNode(g,C?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(m,x){let g=this.startNodeAt(m,x),C=[],V=this.jsx_parseOpeningElementAt(m,x),H=null;if(!V.selfClosing){e:for(;;)switch(this.type){case f.jsxTagStart:if(m=this.start,x=this.startLoc,this.next(),this.eat(h.slash)){H=this.jsx_parseClosingElementAt(m,x);break e}C.push(this.jsx_parseElementAt(m,x));break;case f.jsxText:C.push(this.parseExprAtom());break;case h.braceL:C.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}Ie(H.name)!==Ie(V.name)&&this.raise(H.start,"Expected corresponding JSX closing tag for <"+Ie(V.name)+">")}let _=V.name?"Element":"Fragment";return g["opening"+_]=V,g["closing"+_]=H,g.children=C,this.type===h.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(g,"JSX"+_)}jsx_parseText(){let m=this.parseLiteral(this.value);return m.type="JSXText",m}jsx_parseElement(){let m=this.start,x=this.startLoc;return this.next(),this.jsx_parseElementAt(m,x)}parseExprAtom(m){return this.type===f.jsxText?this.jsx_parseText():this.type===f.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(m)}readToken(m){let x=this.curContext();if(x===N)return this.jsx_readToken();if(x===I||x===B){if(G(m))return this.jsx_readWord();if(m==62)return++this.pos,this.finishToken(f.jsxTagEnd);if((m===34||m===39)&&x==I)return this.jsx_readString(m)}return m===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(f.jsxTagStart)):super.readToken(m)}updateContext(m){if(this.type==h.braceL){var x=this.curContext();x==I?this.context.push(v.b_expr):x==N?this.context.push(v.b_tmpl):super.updateContext(m),this.exprAllowed=!0}else if(this.type===h.slash&&m===f.jsxTagStart)this.context.length-=2,this.context.push(B),this.exprAllowed=!1;else return super.updateContext(m)}}}});var Ti=Ee(Z=>{"use strict";b();Object.defineProperty(Z,"__esModule",{value:!0});var Js=Pe(),zs=ut(),Xs;function Gs(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}function bi(r){if(r&&r.__esModule)return r;var u=Object.create(null);return r&&Object.keys(r).forEach(function(p){if(p!=="default"){var o=Object.getOwnPropertyDescriptor(r,p);Object.defineProperty(u,p,o.get?o:{enumerable:!0,get:function(){return r[p]}})}}),u.default=r,Object.freeze(u)}var yi=bi(Js),Ws=Gs(zs),Hs=bi(Xs),M={Boolean:"Boolean",EOF:"<end>",Identifier:"Identifier",PrivateIdentifier:"PrivateIdentifier",Keyword:"Keyword",Null:"Null",Numeric:"Numeric",Punctuator:"Punctuator",String:"String",RegularExpression:"RegularExpression",Template:"Template",JSXIdentifier:"JSXIdentifier",JSXText:"JSXText"};function Qs(r,u){let p=r[0],o=r[r.length-1],h={type:M.Template,value:u.slice(p.start,o.end)};return p.loc&&(h.loc={start:p.loc.start,end:o.loc.end}),p.range&&(h.start=p.range[0],h.end=o.range[1],h.range=[h.start,h.end]),h}function pt(r,u){this._acornTokTypes=r,this._tokens=[],this._curlyBrace=null,this._code=u}pt.prototype={constructor:pt,translate(r,u){let p=r.type,o=this._acornTokTypes;if(p===o.name)r.type=M.Identifier,r.value==="static"&&(r.type=M.Keyword),u.ecmaVersion>5&&(r.value==="yield"||r.value==="let")&&(r.type=M.Keyword);else if(p===o.privateId)r.type=M.PrivateIdentifier;else if(p===o.semi||p===o.comma||p===o.parenL||p===o.parenR||p===o.braceL||p===o.braceR||p===o.dot||p===o.bracketL||p===o.colon||p===o.question||p===o.bracketR||p===o.ellipsis||p===o.arrow||p===o.jsxTagStart||p===o.incDec||p===o.starstar||p===o.jsxTagEnd||p===o.prefix||p===o.questionDot||p.binop&&!p.keyword||p.isAssign)r.type=M.Punctuator,r.value=this._code.slice(r.start,r.end);else if(p===o.jsxName)r.type=M.JSXIdentifier;else if(p.label==="jsxText"||p===o.jsxAttrValueToken)r.type=M.JSXText;else if(p.keyword)p.keyword==="true"||p.keyword==="false"?r.type=M.Boolean:p.keyword==="null"?r.type=M.Null:r.type=M.Keyword;else if(p===o.num)r.type=M.Numeric,r.value=this._code.slice(r.start,r.end);else if(p===o.string)u.jsxAttrValueToken?(u.jsxAttrValueToken=!1,r.type=M.JSXText):r.type=M.String,r.value=this._code.slice(r.start,r.end);else if(p===o.regexp){r.type=M.RegularExpression;let h=r.value;r.regex={flags:h.flags,pattern:h.pattern},r.value=`/${h.pattern}/${h.flags}`}return r},onToken(r,u){let p=this,o=this._acornTokTypes,h=u.tokens,f=this._tokens;function v(){h.push(Qs(p._tokens,p._code)),p._tokens=[]}if(r.type===o.eof){this._curlyBrace&&h.push(this.translate(this._curlyBrace,u));return}if(r.type===o.backQuote){this._curlyBrace&&(h.push(this.translate(this._curlyBrace,u)),this._curlyBrace=null),f.push(r),f.length>1&&v();return}if(r.type===o.dollarBraceL){f.push(r),v();return}if(r.type===o.braceR){this._curlyBrace&&h.push(this.translate(this._curlyBrace,u)),this._curlyBrace=r;return}if(r.type===o.template||r.type===o.invalidTemplate){this._curlyBrace&&(f.push(this._curlyBrace),this._curlyBrace=null),f.push(r);return}this._curlyBrace&&(h.push(this.translate(this._curlyBrace,u)),this._curlyBrace=null),h.push(this.translate(r,u))}};var Xe=[3,5,6,7,8,9,10,11,12,13,14];function vi(){return Xe[Xe.length-1]}function Ys(){return[...Xe]}function Zs(r=5){let u=r==="latest"?vi():r;if(typeof u!="number")throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof r} instead.`);if(u>=2015&&(u-=2009),!Xe.includes(u))throw new Error("Invalid ecmaVersion.");return u}function $s(r="script"){if(r==="script"||r==="module")return r;if(r==="commonjs")return"script";throw new Error("Invalid sourceType.")}function er(r){let u=Zs(r.ecmaVersion),p=$s(r.sourceType),o=r.range===!0,h=r.loc===!0;if(u!==3&&r.allowReserved)throw new Error("`allowReserved` is only supported when ecmaVersion is 3");if(typeof r.allowReserved<"u"&&typeof r.allowReserved!="boolean")throw new Error("`allowReserved`, when present, must be `true` or `false`");let f=u===3?r.allowReserved||"never":!1,v=r.ecmaFeatures||{},I=r.sourceType==="commonjs"||Boolean(v.globalReturn);if(p==="module"&&u<6)throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");return Object.assign({},r,{ecmaVersion:u,sourceType:p,ranges:o,locations:h,allowReserved:f,allowReturnOutsideFunction:I})}var ae=Symbol("espree's internal state"),ct=Symbol("espree's esprimaFinishNode");function tr(r,u,p,o,h,f,v){let I;r?I="Block":v.slice(p,p+2)==="#!"?I="Hashbang":I="Line";let B={type:I,value:u};return typeof p=="number"&&(B.start=p,B.end=o,B.range=[p,o]),typeof h=="object"&&(B.loc={start:h,end:f}),B}var gi=()=>r=>{let u=Object.assign({},r.acorn.tokTypes);return r.acornJsx&&Object.assign(u,r.acornJsx.tokTypes),class extends r{constructor(o,h){(typeof o!="object"||o===null)&&(o={}),typeof h!="string"&&!(h instanceof String)&&(h=String(h));let f=o.sourceType,v=er(o),I=v.ecmaFeatures||{},B=v.tokens===!0?new pt(u,h):null,N={originalSourceType:f||v.sourceType,tokens:B?[]:null,comments:v.comment===!0?[]:null,impliedStrict:I.impliedStrict===!0&&v.ecmaVersion>=5,ecmaVersion:v.ecmaVersion,jsxAttrValueToken:!1,lastToken:null,templateElements:[]};super({ecmaVersion:v.ecmaVersion,sourceType:v.sourceType,ranges:v.ranges,locations:v.locations,allowReserved:v.allowReserved,allowReturnOutsideFunction:v.allowReturnOutsideFunction,onToken:j=>{B&&B.onToken(j,N),j.type!==u.eof&&(N.lastToken=j)},onComment:(j,G,U,m,x,g)=>{if(N.comments){let C=tr(j,G,U,m,x,g,h);N.comments.push(C)}}},h),this[ae]=N}tokenize(){do this.next();while(this.type!==u.eof);this.next();let o=this[ae],h=o.tokens;return o.comments&&(h.comments=o.comments),h}finishNode(...o){let h=super.finishNode(...o);return this[ct](h)}finishNodeAt(...o){let h=super.finishNodeAt(...o);return this[ct](h)}parse(){let o=this[ae],h=super.parse();if(h.sourceType=o.originalSourceType,o.comments&&(h.comments=o.comments),o.tokens&&(h.tokens=o.tokens),h.body.length){let[f]=h.body;h.range&&(h.range[0]=f.range[0]),h.loc&&(h.loc.start=f.loc.start),h.start=f.start}return o.lastToken&&(h.range&&(h.range[1]=o.lastToken.range[1]),h.loc&&(h.loc.end=o.lastToken.loc.end),h.end=o.lastToken.end),this[ae].templateElements.forEach(f=>{let I=f.tail?1:2;f.start+=-1,f.end+=I,f.range&&(f.range[0]+=-1,f.range[1]+=I),f.loc&&(f.loc.start.column+=-1,f.loc.end.column+=I)}),h}parseTopLevel(o){return this[ae].impliedStrict&&(this.strict=!0),super.parseTopLevel(o)}raise(o,h){let f=r.acorn.getLineInfo(this.input,o),v=new SyntaxError(h);throw v.index=o,v.lineNumber=f.line,v.column=f.column+1,v}raiseRecoverable(o,h){this.raise(o,h)}unexpected(o){let h="Unexpected token";if(o!=null){if(this.pos=o,this.options.locations)for(;this.pos<this.lineStart;)this.lineStart=this.input.lastIndexOf(`
|
|
11
11
|
`,this.lineStart-2)+1,--this.curLine;this.nextToken()}this.end>this.start&&(h+=` ${this.input.slice(this.start,this.end)}`),this.raise(this.start,h)}jsx_readString(o){let h=super.jsx_readString(o);return this.type===u.string&&(this[ae].jsxAttrValueToken=!0),h}[ct](o){return o.type==="TemplateElement"&&this[ae].templateElements.push(o),o.type.includes("Function")&&!o.generator&&(o.generator=!1),o}}},ir="9.4.0",Si={_regular:null,_jsx:null,get regular(){return this._regular===null&&(this._regular=yi.Parser.extend(gi())),this._regular},get jsx(){return this._jsx===null&&(this._jsx=yi.Parser.extend(Ws.default(),gi())),this._jsx},get(r){return Boolean(r&&r.ecmaFeatures&&r.ecmaFeatures.jsx)?this.jsx:this.regular}};function sr(r,u){let p=Si.get(u);return(!u||u.tokens!==!0)&&(u=Object.assign({},u,{tokens:!0})),new p(u,r).tokenize()}function rr(r,u){let p=Si.get(u);return new p(u,r).parse()}var ar=ir,nr=function(){return Hs.KEYS}(),or=void 0,ur=vi(),hr=Ys();Z.Syntax=or;Z.VisitorKeys=nr;Z.latestEcmaVersion=ur;Z.parse=rr;Z.supportedEcmaVersions=hr;Z.tokenize=sr;Z.version=ar});var dr={};ss(dr,{default:()=>fr});b();b();b();function ns(r,u){let p=new SyntaxError(r+" ("+u.loc.start.line+":"+u.loc.start.column+")");return Object.assign(p,u)}var le=ns;b();function os(...r){let u;for(let[p,o]of r.entries())try{return{result:o()}}catch(h){p===0&&(u=h)}return{error:u}}var je=os;b();b();var fe=rs(ei(),1);b();b();function ys(r){if(!r.startsWith("#!"))return"";let u=r.indexOf(`
|
|
12
12
|
`);return u===-1?r:r.slice(0,u)}var ti=ys;function gs(r){let u=ti(r);u&&(r=r.slice(u.length+1));let p=(0,fe.extract)(r),{pragmas:o,comments:h}=(0,fe.parseWithComments)(p);return{shebang:u,text:r,pragmas:o,comments:h}}function ii(r){let u=Object.keys(gs(r).pragmas);return u.includes("prettier")||u.includes("format")}b();b();function bs(r){return Array.isArray(r)&&r.length>0}var de=bs;function D(r,u){let{ignoreDecorators:p}=u||{};if(!p){let o=r.declaration&&r.declaration.decorators||r.decorators;if(de(o))return D(o[0])}return r.range?r.range[0]:r.start}function K(r){return r.range?r.range[1]:r.end}function vs(r){return r=typeof r=="function"?{parse:r}:r,{astFormat:"estree",hasPragma:ii,locStart:D,locEnd:K,...r}}var Ue=vs;b();b();var Ss=(r,u,p,...o)=>{if(!(r&&u==null))return u.at?u.at(p,...o):u[p<0?u.length+p:p]},qe=Ss;b();function Ts({type:r}){return r.startsWith("TS")&&r.endsWith("Keyword")}var si=Ts;b();b();var Cs=new Set(["Block","CommentBlock","MultiLine"]),Es=r=>Cs.has(r==null?void 0:r.type),ke=Es;function ks(r){return ke(r)&&r.value[0]==="*"&&/@type\b/.test(r.value)}var ri=ks;b();function _s(r){let u=`*${r.value}*`.split(`
|
|
13
|
-
`);return u.length>1&&u.every(p=>p.trimStart()[0]==="*")}var st=_s;b();b();b();b();var _e=null;function we(r){if(_e!==null&&typeof _e.property){let u=_e;return _e=we.prototype=null,u}return _e=we.prototype=r==null?Object.create(null):r,new we}var ws=10;for(let r=0;r<=ws;r++)we();function rt(r){return we(r)}function As(r,u="type"){rt(r);function p(o){let h=o[u],f=r[h];if(!Array.isArray(f))throw Object.assign(new Error(`Missing visitor keys for '${h}'.`),{node:o});return f}return p}var ai=As;var ni={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body","interpreter"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ExportAllDeclaration:["source","exported","assertions"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","assertions"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","assertions"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],ClassPrivateProperty:["key","value","decorators","typeAnnotation","variance"],ClassPrivateMethod:["key","params","body","decorators","returnType","typeParameters"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","mixins","implements","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source"],DeclareExportAllDeclaration:["source"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","mixins","implements","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value","optional","static","method"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value","variance"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["id","qualification"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types"],TypeofTypeAnnotation:["argument"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],DecimalLiteral:[],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation","initializer"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","typeAnnotation","nameType"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters"],TSAsExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members","modifiers"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body","modifiers"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","parameter"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ImportExpression:["source","attributes"],Literal:[],MethodDefinition:["decorators","key","value","typeParameters"],PrivateIdentifier:[],Property:["key","value","decorators"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value","decorators"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],BigIntLiteralTypeAnnotation:[],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGQuotedExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],SpreadProperty:["argument"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],BigIntTypeAnnotation:[],QualifiedTypeofIdentifier:["id","qualification"]};var Is=ai(ni),oi=Is;function at(r,u){if(!(r!==null&&typeof r=="object"))return r;if(Array.isArray(r)){for(let o=0;o<r.length;o++)r[o]=at(r[o],u);return r}let p=oi(r);for(let o=0;o<p.length;o++)r[p[o]]=at(r[p[o]],u);return u(r)||r}var me=at;b();b();function Ns(r,u){let{start:p,end:o}=r.loc;throw le(u,{loc:{start:{line:p.line,column:p.column+1},end:{line:o.line,column:o.column+1}}})}var Ae=Ns;function Ls(r){for(;r&&r.kind!==305;)r=r.parent;return r}function Vs(r){let{illegalDecorators:u}=r;if(!de(u))return;let[{expression:p}]=u,o=Ls(p),[h,f]=[p.pos,p.end].map(v=>{let{line:I,character:B}=o.getLineAndCharacterOfPosition(v);return{line:I+1,column:B}});Ae({loc:{start:h,end:f}},"Decorators are not valid here.")}function Os(r,u){r.kind!==167||r.modifiers&&!r.modifiers.some(h=>h.kind===126)||r.initializer&&u.value===null&&Ae(u,"Abstract property cannot have an initializer")}function ui(r,u){let{esTreeNodeToTSNodeMap:p,tsNodeToESTreeNodeMap:o}=u.tsParseResult;me(r,h=>{let f=p.get(h);if(!f)return;let v=o.get(f);v===h&&(Vs(f),Os(f,v))})}function Bs(r,u){if(u.parser==="typescript"&&/@|abstract/.test(u.originalText)&&ui(r,u),u.parser!=="typescript"&&u.parser!=="flow"&&u.parser!=="acorn"&&u.parser!=="espree"&&u.parser!=="meriyah"){let o=new Set;r=me(r,h=>{h.leadingComments&&h.leadingComments.some(ri)&&o.add(D(h))}),r=me(r,h=>{if(h.type==="ParenthesizedExpression"){let{expression:f}=h;if(f.type==="TypeCastExpression")return f.range=h.range,f;let v=D(h);if(!o.has(v))return f.extra={...f.extra,parenthesized:!0},f}})}if(r=me(r,o=>{switch(o.type){case"ChainExpression":return Ke(o.expression);case"LogicalExpression":if(hi(o))return nt(o);break;case"VariableDeclaration":{let h=qe(!1,o.declarations,-1);h&&h.init&&p(o,h);break}case"TSParenthesizedType":return si(o.typeAnnotation)||o.typeAnnotation.type==="TSThisType"||(o.typeAnnotation.range=[D(o),K(o)]),o.typeAnnotation;case"TSTypeParameter":if(typeof o.name=="string"){let h=D(o);o.name={type:"Identifier",name:o.name,range:[h,h+o.name.length]}}break;case"ObjectExpression":if(u.parser==="typescript"){let h=o.properties.find(f=>f.type==="Property"&&f.value.type==="TSEmptyBodyFunctionExpression");h&&Ae(h.value,"Unexpected token.")}break;case"SequenceExpression":{let h=qe(!1,o.expressions,-1);o.range=[D(o),Math.min(K(h),K(o))];break}case"TopicReference":u.__isUsingHackPipeline=!0;break;case"ExportAllDeclaration":{let{exported:h}=o;if(u.parser==="meriyah"&&h&&h.type==="Identifier"){let f=u.originalText.slice(D(h),K(h));(f.startsWith('"')||f.startsWith("'"))&&(o.exported={...o.exported,type:"Literal",value:o.exported.name,raw:f})}break}}}),de(r.comments)){let o=qe(!1,r.comments,-1);for(let h=r.comments.length-2;h>=0;h--){let f=r.comments[h];K(f)===D(o)&&ke(f)&&ke(o)&&st(f)&&st(o)&&(r.comments.splice(h+1,1),f.value+="*//*"+o.value,f.range=[D(f),K(o)]),o=f}}return r;function p(o,h){u.originalText[K(h)]!==";"&&(o.range=[D(o),K(h)])}}function Ke(r){switch(r.type){case"CallExpression":r.type="OptionalCallExpression",r.callee=Ke(r.callee);break;case"MemberExpression":r.type="OptionalMemberExpression",r.object=Ke(r.object);break;case"TSNonNullExpression":r.expression=Ke(r.expression);break}return r}function hi(r){return r.type==="LogicalExpression"&&r.right.type==="LogicalExpression"&&r.operator===r.right.operator}function nt(r){return hi(r)?nt({type:"LogicalExpression",operator:r.operator,left:nt({type:"LogicalExpression",operator:r.operator,left:r.left,right:r.right.left,range:[D(r.left),K(r.right.left)]}),right:r.right.right,range:[D(r),K(r)]}):r}var Je=Bs;var js={ecmaVersion:"latest",sourceType:"module",allowReturnOutsideFunction:!0,allowImportExportEverywhere:!0,allowSuperOutsideMethod:!0,locations:!0,ranges:!0};function Us(r){let{message:u,loc:p}=r;if(!p)return r;let{line:o,column:h}=p;return le(u.replace(/ \(\d+:\d+\)$/,""),{loc:{start:{line:o,column:h+1}},cause:r})}var ht,qs=()=>{if(!ht){let{Parser:r}=Pe(),u=ut();ht=r.extend(u())}return ht};function mi(r,u){let p=qs(),o=[],h=[],f=p.parse(r,{...js,sourceType:u,onComment:o,onToken:h});return f.comments=o,f.tokens=h,f}function Ks(r,u={}){let{result:p,error:o}=je(()=>mi(r,"module"),()=>mi(r,"script"));if(!p)throw Us(o);return u.originalText=r,Je(p,u)}var xi=Ue(Ks);b();var Ci={ecmaVersion:"latest",range:!0,loc:!0,comment:!0,tokens:!0,sourceType:"module",ecmaFeatures:{jsx:!0,globalReturn:!0,impliedStrict:!1}};function cr(r){let{message:u,lineNumber:p,column:o}=r;return typeof p!="number"?r:le(u,{loc:{start:{line:p,column:o}},cause:r})}function pr(r,u={}){let{parse:p}=Ti(),{result:o,error:h}=je(()=>p(r,{...Ci,sourceType:"module"}),()=>p(r,{...Ci,sourceType:"script"}));if(!o)throw cr(h);return u.originalText=r,Je(o,u)}var Ei=Ue(pr);var lr={parsers:{acorn:xi,espree:Ei}},fr=lr;return as(dr);});
|
|
13
|
+
`);return u.length>1&&u.every(p=>p.trimStart()[0]==="*")}var st=_s;b();b();b();b();var _e=null;function we(r){if(_e!==null&&typeof _e.property){let u=_e;return _e=we.prototype=null,u}return _e=we.prototype=r==null?Object.create(null):r,new we}var ws=10;for(let r=0;r<=ws;r++)we();function rt(r){return we(r)}function As(r,u="type"){rt(r);function p(o){let h=o[u],f=r[h];if(!Array.isArray(f))throw Object.assign(new Error(`Missing visitor keys for '${h}'.`),{node:o});return f}return p}var ai=As;var ni={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body","interpreter"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ExportAllDeclaration:["source","exported","assertions"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","assertions"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","assertions"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],ClassPrivateProperty:["key","value","decorators","typeAnnotation","variance"],ClassPrivateMethod:["key","params","body","decorators","returnType","typeParameters"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","mixins","implements","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source"],DeclareExportAllDeclaration:["source"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","mixins","implements","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value","optional","static","method"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value","variance"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["id","qualification"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types"],TypeofTypeAnnotation:["argument"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],DecimalLiteral:[],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation","initializer"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","typeAnnotation","nameType"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters"],TSAsExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members","modifiers"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body","modifiers"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","parameter"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ImportExpression:["source","attributes"],Literal:[],MethodDefinition:["decorators","key","value","typeParameters"],PrivateIdentifier:[],Property:["key","value","decorators"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value","decorators"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],BigIntLiteralTypeAnnotation:[],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],SpreadProperty:["argument"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],BigIntTypeAnnotation:[],QualifiedTypeofIdentifier:["id","qualification"]};var Is=ai(ni),oi=Is;function at(r,u){if(!(r!==null&&typeof r=="object"))return r;if(Array.isArray(r)){for(let o=0;o<r.length;o++)r[o]=at(r[o],u);return r}let p=oi(r);for(let o=0;o<p.length;o++)r[p[o]]=at(r[p[o]],u);return u(r)||r}var me=at;b();b();function Ns(r,u){let{start:p,end:o}=r.loc;throw le(u,{loc:{start:{line:p.line,column:p.column+1},end:{line:o.line,column:o.column+1}}})}var Ae=Ns;function Ls(r){for(;r&&r.kind!==305;)r=r.parent;return r}function Vs(r){let{illegalDecorators:u}=r;if(!de(u))return;let[{expression:p}]=u,o=Ls(p),[h,f]=[p.pos,p.end].map(v=>{let{line:I,character:B}=o.getLineAndCharacterOfPosition(v);return{line:I+1,column:B}});Ae({loc:{start:h,end:f}},"Decorators are not valid here.")}function Os(r,u){r.kind!==167||r.modifiers&&!r.modifiers.some(h=>h.kind===126)||r.initializer&&u.value===null&&Ae(u,"Abstract property cannot have an initializer")}function ui(r,u){let{esTreeNodeToTSNodeMap:p,tsNodeToESTreeNodeMap:o}=u.tsParseResult;me(r,h=>{let f=p.get(h);if(!f)return;let v=o.get(f);v===h&&(Vs(f),Os(f,v))})}function Bs(r,u){if(u.parser==="typescript"&&/@|abstract/.test(u.originalText)&&ui(r,u),u.parser!=="typescript"&&u.parser!=="flow"&&u.parser!=="acorn"&&u.parser!=="espree"&&u.parser!=="meriyah"){let o=new Set;r=me(r,h=>{h.leadingComments&&h.leadingComments.some(ri)&&o.add(D(h))}),r=me(r,h=>{if(h.type==="ParenthesizedExpression"){let{expression:f}=h;if(f.type==="TypeCastExpression")return f.range=h.range,f;let v=D(h);if(!o.has(v))return f.extra={...f.extra,parenthesized:!0},f}})}if(r=me(r,o=>{switch(o.type){case"ChainExpression":return Ke(o.expression);case"LogicalExpression":if(hi(o))return nt(o);break;case"VariableDeclaration":{let h=qe(!1,o.declarations,-1);h&&h.init&&p(o,h);break}case"TSParenthesizedType":return si(o.typeAnnotation)||o.typeAnnotation.type==="TSThisType"||(o.typeAnnotation.range=[D(o),K(o)]),o.typeAnnotation;case"TSTypeParameter":if(typeof o.name=="string"){let h=D(o);o.name={type:"Identifier",name:o.name,range:[h,h+o.name.length]}}break;case"ObjectExpression":if(u.parser==="typescript"){let h=o.properties.find(f=>f.type==="Property"&&f.value.type==="TSEmptyBodyFunctionExpression");h&&Ae(h.value,"Unexpected token.")}break;case"SequenceExpression":{let h=qe(!1,o.expressions,-1);o.range=[D(o),Math.min(K(h),K(o))];break}case"TopicReference":u.__isUsingHackPipeline=!0;break;case"ExportAllDeclaration":{let{exported:h}=o;if(u.parser==="meriyah"&&h&&h.type==="Identifier"){let f=u.originalText.slice(D(h),K(h));(f.startsWith('"')||f.startsWith("'"))&&(o.exported={...o.exported,type:"Literal",value:o.exported.name,raw:f})}break}}}),de(r.comments)){let o=qe(!1,r.comments,-1);for(let h=r.comments.length-2;h>=0;h--){let f=r.comments[h];K(f)===D(o)&&ke(f)&&ke(o)&&st(f)&&st(o)&&(r.comments.splice(h+1,1),f.value+="*//*"+o.value,f.range=[D(f),K(o)]),o=f}}return r;function p(o,h){u.originalText[K(h)]!==";"&&(o.range=[D(o),K(h)])}}function Ke(r){switch(r.type){case"CallExpression":r.type="OptionalCallExpression",r.callee=Ke(r.callee);break;case"MemberExpression":r.type="OptionalMemberExpression",r.object=Ke(r.object);break;case"TSNonNullExpression":r.expression=Ke(r.expression);break}return r}function hi(r){return r.type==="LogicalExpression"&&r.right.type==="LogicalExpression"&&r.operator===r.right.operator}function nt(r){return hi(r)?nt({type:"LogicalExpression",operator:r.operator,left:nt({type:"LogicalExpression",operator:r.operator,left:r.left,right:r.right.left,range:[D(r.left),K(r.right.left)]}),right:r.right.right,range:[D(r),K(r)]}):r}var Je=Bs;var js={ecmaVersion:"latest",sourceType:"module",allowReturnOutsideFunction:!0,allowImportExportEverywhere:!0,allowSuperOutsideMethod:!0,locations:!0,ranges:!0};function Us(r){let{message:u,loc:p}=r;if(!p)return r;let{line:o,column:h}=p;return le(u.replace(/ \(\d+:\d+\)$/,""),{loc:{start:{line:o,column:h+1}},cause:r})}var ht,qs=()=>{if(!ht){let{Parser:r}=Pe(),u=ut();ht=r.extend(u())}return ht};function mi(r,u){let p=qs(),o=[],h=[],f=p.parse(r,{...js,sourceType:u,onComment:o,onToken:h});return f.comments=o,f.tokens=h,f}function Ks(r,u={}){let{result:p,error:o}=je(()=>mi(r,"module"),()=>mi(r,"script"));if(!p)throw Us(o);return u.originalText=r,Je(p,u)}var xi=Ue(Ks);b();var Ci={ecmaVersion:"latest",range:!0,loc:!0,comment:!0,tokens:!0,sourceType:"module",ecmaFeatures:{jsx:!0,globalReturn:!0,impliedStrict:!1}};function cr(r){let{message:u,lineNumber:p,column:o}=r;return typeof p!="number"?r:le(u,{loc:{start:{line:p,column:o}},cause:r})}function pr(r,u={}){let{parse:p}=Ti(),{result:o,error:h}=je(()=>p(r,{...Ci,sourceType:"module"}),()=>p(r,{...Ci,sourceType:"script"}));if(!o)throw cr(h);return u.originalText=r,Je(o,u)}var Ei=Ue(pr);var lr={parsers:{acorn:xi,espree:Ei}},fr=lr;return as(dr);});
|
|
@@ -10,4 +10,4 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
10
10
|
`):g=String.fromCharCode(x),this.options.locations&&(++this.curLine,this.lineStart=this.pos),g}jsx_readString(m){let x="",g=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let C=this.input.charCodeAt(this.pos);if(C===m)break;C===38?(x+=this.input.slice(g,this.pos),x+=this.jsx_readEntity(),g=this.pos):j(C)?(x+=this.input.slice(g,this.pos),x+=this.jsx_readNewLine(!1),g=this.pos):++this.pos}return x+=this.input.slice(g,this.pos++),this.finishToken(h.string,x)}jsx_readEntity(){let m="",x=0,g,C=this.input[this.pos];C!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let V=++this.pos;for(;this.pos<this.input.length&&x++<10;){if(C=this.input[this.pos++],C===";"){m[0]==="#"?m[1]==="x"?(m=m.substr(2),Bs.test(m)&&(g=String.fromCharCode(parseInt(m,16)))):(m=m.substr(1),Rs.test(m)&&(g=String.fromCharCode(parseInt(m,10)))):g=Os[m];break}m+=C}return g||(this.pos=V,"&")}jsx_readWord(){let m,x=this.pos;do m=this.input.charCodeAt(++this.pos);while(U(m)||m===45);return this.finishToken(f.jsxName,this.input.slice(x,this.pos))}jsx_parseIdentifier(){let m=this.startNode();return this.type===f.jsxName?m.name=this.value:this.type.keyword?m.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(m,"JSXIdentifier")}jsx_parseNamespacedName(){let m=this.start,x=this.startLoc,g=this.jsx_parseIdentifier();if(!r.allowNamespaces||!this.eat(h.colon))return g;var C=this.startNodeAt(m,x);return C.namespace=g,C.name=this.jsx_parseIdentifier(),this.finishNode(C,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===f.jsxTagEnd)return"";let m=this.start,x=this.startLoc,g=this.jsx_parseNamespacedName();for(this.type===h.dot&&g.type==="JSXNamespacedName"&&!r.allowNamespacedObjects&&this.unexpected();this.eat(h.dot);){let C=this.startNodeAt(m,x);C.object=g,C.property=this.jsx_parseIdentifier(),g=this.finishNode(C,"JSXMemberExpression")}return g}jsx_parseAttributeValue(){switch(this.type){case h.braceL:let m=this.jsx_parseExpressionContainer();return m.expression.type==="JSXEmptyExpression"&&this.raise(m.start,"JSX attributes must only be assigned a non-empty expression"),m;case f.jsxTagStart:case h.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let m=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(m,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let m=this.startNode();return this.next(),m.expression=this.type===h.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(h.braceR),this.finishNode(m,"JSXExpressionContainer")}jsx_parseAttribute(){let m=this.startNode();return this.eat(h.braceL)?(this.expect(h.ellipsis),m.argument=this.parseMaybeAssign(),this.expect(h.braceR),this.finishNode(m,"JSXSpreadAttribute")):(m.name=this.jsx_parseNamespacedName(),m.value=this.eat(h.eq)?this.jsx_parseAttributeValue():null,this.finishNode(m,"JSXAttribute"))}jsx_parseOpeningElementAt(m,x){let g=this.startNodeAt(m,x);g.attributes=[];let C=this.jsx_parseElementName();for(C&&(g.name=C);this.type!==h.slash&&this.type!==f.jsxTagEnd;)g.attributes.push(this.jsx_parseAttribute());return g.selfClosing=this.eat(h.slash),this.expect(f.jsxTagEnd),this.finishNode(g,C?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(m,x){let g=this.startNodeAt(m,x),C=this.jsx_parseElementName();return C&&(g.name=C),this.expect(f.jsxTagEnd),this.finishNode(g,C?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(m,x){let g=this.startNodeAt(m,x),C=[],V=this.jsx_parseOpeningElementAt(m,x),H=null;if(!V.selfClosing){e:for(;;)switch(this.type){case f.jsxTagStart:if(m=this.start,x=this.startLoc,this.next(),this.eat(h.slash)){H=this.jsx_parseClosingElementAt(m,x);break e}C.push(this.jsx_parseElementAt(m,x));break;case f.jsxText:C.push(this.parseExprAtom());break;case h.braceL:C.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}Ie(H.name)!==Ie(V.name)&&this.raise(H.start,"Expected corresponding JSX closing tag for <"+Ie(V.name)+">")}let _=V.name?"Element":"Fragment";return g["opening"+_]=V,g["closing"+_]=H,g.children=C,this.type===h.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(g,"JSX"+_)}jsx_parseText(){let m=this.parseLiteral(this.value);return m.type="JSXText",m}jsx_parseElement(){let m=this.start,x=this.startLoc;return this.next(),this.jsx_parseElementAt(m,x)}parseExprAtom(m){return this.type===f.jsxText?this.jsx_parseText():this.type===f.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(m)}readToken(m){let x=this.curContext();if(x===N)return this.jsx_readToken();if(x===I||x===B){if(G(m))return this.jsx_readWord();if(m==62)return++this.pos,this.finishToken(f.jsxTagEnd);if((m===34||m===39)&&x==I)return this.jsx_readString(m)}return m===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(f.jsxTagStart)):super.readToken(m)}updateContext(m){if(this.type==h.braceL){var x=this.curContext();x==I?this.context.push(v.b_expr):x==N?this.context.push(v.b_tmpl):super.updateContext(m),this.exprAllowed=!0}else if(this.type===h.slash&&m===f.jsxTagStart)this.context.length-=2,this.context.push(B),this.exprAllowed=!1;else return super.updateContext(m)}}}});var Si=Ee(Z=>{"use strict";b();Object.defineProperty(Z,"__esModule",{value:!0});var qs=Pe(),Ks=ot(),Js;function zs(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}function gi(r){if(r&&r.__esModule)return r;var u=Object.create(null);return r&&Object.keys(r).forEach(function(p){if(p!=="default"){var o=Object.getOwnPropertyDescriptor(r,p);Object.defineProperty(u,p,o.get?o:{enumerable:!0,get:function(){return r[p]}})}}),u.default=r,Object.freeze(u)}var xi=gi(qs),Xs=zs(Ks),Gs=gi(Js),M={Boolean:"Boolean",EOF:"<end>",Identifier:"Identifier",PrivateIdentifier:"PrivateIdentifier",Keyword:"Keyword",Null:"Null",Numeric:"Numeric",Punctuator:"Punctuator",String:"String",RegularExpression:"RegularExpression",Template:"Template",JSXIdentifier:"JSXIdentifier",JSXText:"JSXText"};function Ws(r,u){let p=r[0],o=r[r.length-1],h={type:M.Template,value:u.slice(p.start,o.end)};return p.loc&&(h.loc={start:p.loc.start,end:o.loc.end}),p.range&&(h.start=p.range[0],h.end=o.range[1],h.range=[h.start,h.end]),h}function ct(r,u){this._acornTokTypes=r,this._tokens=[],this._curlyBrace=null,this._code=u}ct.prototype={constructor:ct,translate(r,u){let p=r.type,o=this._acornTokTypes;if(p===o.name)r.type=M.Identifier,r.value==="static"&&(r.type=M.Keyword),u.ecmaVersion>5&&(r.value==="yield"||r.value==="let")&&(r.type=M.Keyword);else if(p===o.privateId)r.type=M.PrivateIdentifier;else if(p===o.semi||p===o.comma||p===o.parenL||p===o.parenR||p===o.braceL||p===o.braceR||p===o.dot||p===o.bracketL||p===o.colon||p===o.question||p===o.bracketR||p===o.ellipsis||p===o.arrow||p===o.jsxTagStart||p===o.incDec||p===o.starstar||p===o.jsxTagEnd||p===o.prefix||p===o.questionDot||p.binop&&!p.keyword||p.isAssign)r.type=M.Punctuator,r.value=this._code.slice(r.start,r.end);else if(p===o.jsxName)r.type=M.JSXIdentifier;else if(p.label==="jsxText"||p===o.jsxAttrValueToken)r.type=M.JSXText;else if(p.keyword)p.keyword==="true"||p.keyword==="false"?r.type=M.Boolean:p.keyword==="null"?r.type=M.Null:r.type=M.Keyword;else if(p===o.num)r.type=M.Numeric,r.value=this._code.slice(r.start,r.end);else if(p===o.string)u.jsxAttrValueToken?(u.jsxAttrValueToken=!1,r.type=M.JSXText):r.type=M.String,r.value=this._code.slice(r.start,r.end);else if(p===o.regexp){r.type=M.RegularExpression;let h=r.value;r.regex={flags:h.flags,pattern:h.pattern},r.value=`/${h.pattern}/${h.flags}`}return r},onToken(r,u){let p=this,o=this._acornTokTypes,h=u.tokens,f=this._tokens;function v(){h.push(Ws(p._tokens,p._code)),p._tokens=[]}if(r.type===o.eof){this._curlyBrace&&h.push(this.translate(this._curlyBrace,u));return}if(r.type===o.backQuote){this._curlyBrace&&(h.push(this.translate(this._curlyBrace,u)),this._curlyBrace=null),f.push(r),f.length>1&&v();return}if(r.type===o.dollarBraceL){f.push(r),v();return}if(r.type===o.braceR){this._curlyBrace&&h.push(this.translate(this._curlyBrace,u)),this._curlyBrace=r;return}if(r.type===o.template||r.type===o.invalidTemplate){this._curlyBrace&&(f.push(this._curlyBrace),this._curlyBrace=null),f.push(r);return}this._curlyBrace&&(h.push(this.translate(this._curlyBrace,u)),this._curlyBrace=null),h.push(this.translate(r,u))}};var ze=[3,5,6,7,8,9,10,11,12,13,14];function bi(){return ze[ze.length-1]}function Hs(){return[...ze]}function Qs(r=5){let u=r==="latest"?bi():r;if(typeof u!="number")throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof r} instead.`);if(u>=2015&&(u-=2009),!ze.includes(u))throw new Error("Invalid ecmaVersion.");return u}function Ys(r="script"){if(r==="script"||r==="module")return r;if(r==="commonjs")return"script";throw new Error("Invalid sourceType.")}function Zs(r){let u=Qs(r.ecmaVersion),p=Ys(r.sourceType),o=r.range===!0,h=r.loc===!0;if(u!==3&&r.allowReserved)throw new Error("`allowReserved` is only supported when ecmaVersion is 3");if(typeof r.allowReserved<"u"&&typeof r.allowReserved!="boolean")throw new Error("`allowReserved`, when present, must be `true` or `false`");let f=u===3?r.allowReserved||"never":!1,v=r.ecmaFeatures||{},I=r.sourceType==="commonjs"||Boolean(v.globalReturn);if(p==="module"&&u<6)throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");return Object.assign({},r,{ecmaVersion:u,sourceType:p,ranges:o,locations:h,allowReserved:f,allowReturnOutsideFunction:I})}var ae=Symbol("espree's internal state"),ht=Symbol("espree's esprimaFinishNode");function $s(r,u,p,o,h,f,v){let I;r?I="Block":v.slice(p,p+2)==="#!"?I="Hashbang":I="Line";let B={type:I,value:u};return typeof p=="number"&&(B.start=p,B.end=o,B.range=[p,o]),typeof h=="object"&&(B.loc={start:h,end:f}),B}var yi=()=>r=>{let u=Object.assign({},r.acorn.tokTypes);return r.acornJsx&&Object.assign(u,r.acornJsx.tokTypes),class extends r{constructor(o,h){(typeof o!="object"||o===null)&&(o={}),typeof h!="string"&&!(h instanceof String)&&(h=String(h));let f=o.sourceType,v=Zs(o),I=v.ecmaFeatures||{},B=v.tokens===!0?new ct(u,h):null,N={originalSourceType:f||v.sourceType,tokens:B?[]:null,comments:v.comment===!0?[]:null,impliedStrict:I.impliedStrict===!0&&v.ecmaVersion>=5,ecmaVersion:v.ecmaVersion,jsxAttrValueToken:!1,lastToken:null,templateElements:[]};super({ecmaVersion:v.ecmaVersion,sourceType:v.sourceType,ranges:v.ranges,locations:v.locations,allowReserved:v.allowReserved,allowReturnOutsideFunction:v.allowReturnOutsideFunction,onToken:j=>{B&&B.onToken(j,N),j.type!==u.eof&&(N.lastToken=j)},onComment:(j,G,U,m,x,g)=>{if(N.comments){let C=$s(j,G,U,m,x,g,h);N.comments.push(C)}}},h),this[ae]=N}tokenize(){do this.next();while(this.type!==u.eof);this.next();let o=this[ae],h=o.tokens;return o.comments&&(h.comments=o.comments),h}finishNode(...o){let h=super.finishNode(...o);return this[ht](h)}finishNodeAt(...o){let h=super.finishNodeAt(...o);return this[ht](h)}parse(){let o=this[ae],h=super.parse();if(h.sourceType=o.originalSourceType,o.comments&&(h.comments=o.comments),o.tokens&&(h.tokens=o.tokens),h.body.length){let[f]=h.body;h.range&&(h.range[0]=f.range[0]),h.loc&&(h.loc.start=f.loc.start),h.start=f.start}return o.lastToken&&(h.range&&(h.range[1]=o.lastToken.range[1]),h.loc&&(h.loc.end=o.lastToken.loc.end),h.end=o.lastToken.end),this[ae].templateElements.forEach(f=>{let I=f.tail?1:2;f.start+=-1,f.end+=I,f.range&&(f.range[0]+=-1,f.range[1]+=I),f.loc&&(f.loc.start.column+=-1,f.loc.end.column+=I)}),h}parseTopLevel(o){return this[ae].impliedStrict&&(this.strict=!0),super.parseTopLevel(o)}raise(o,h){let f=r.acorn.getLineInfo(this.input,o),v=new SyntaxError(h);throw v.index=o,v.lineNumber=f.line,v.column=f.column+1,v}raiseRecoverable(o,h){this.raise(o,h)}unexpected(o){let h="Unexpected token";if(o!=null){if(this.pos=o,this.options.locations)for(;this.pos<this.lineStart;)this.lineStart=this.input.lastIndexOf(`
|
|
11
11
|
`,this.lineStart-2)+1,--this.curLine;this.nextToken()}this.end>this.start&&(h+=` ${this.input.slice(this.start,this.end)}`),this.raise(this.start,h)}jsx_readString(o){let h=super.jsx_readString(o);return this.type===u.string&&(this[ae].jsxAttrValueToken=!0),h}[ht](o){return o.type==="TemplateElement"&&this[ae].templateElements.push(o),o.type.includes("Function")&&!o.generator&&(o.generator=!1),o}}},er="9.4.0",vi={_regular:null,_jsx:null,get regular(){return this._regular===null&&(this._regular=xi.Parser.extend(yi())),this._regular},get jsx(){return this._jsx===null&&(this._jsx=xi.Parser.extend(Xs.default(),yi())),this._jsx},get(r){return Boolean(r&&r.ecmaFeatures&&r.ecmaFeatures.jsx)?this.jsx:this.regular}};function tr(r,u){let p=vi.get(u);return(!u||u.tokens!==!0)&&(u=Object.assign({},u,{tokens:!0})),new p(u,r).tokenize()}function ir(r,u){let p=vi.get(u);return new p(u,r).parse()}var sr=er,rr=function(){return Gs.KEYS}(),ar=void 0,nr=bi(),or=Hs();Z.Syntax=ar;Z.VisitorKeys=rr;Z.latestEcmaVersion=nr;Z.parse=ir;Z.supportedEcmaVersions=or;Z.tokenize=tr;Z.version=sr});b();b();b();function rs(r,u){let p=new SyntaxError(r+" ("+u.loc.start.line+":"+u.loc.start.column+")");return Object.assign(p,u)}var le=rs;b();function as(...r){let u;for(let[p,o]of r.entries())try{return{result:o()}}catch(h){p===0&&(u=h)}return{error:u}}var Me=as;b();b();var fe=ss($t(),1);b();b();function ms(r){if(!r.startsWith("#!"))return"";let u=r.indexOf(`
|
|
12
12
|
`);return u===-1?r:r.slice(0,u)}var ei=ms;function xs(r){let u=ei(r);u&&(r=r.slice(u.length+1));let p=(0,fe.extract)(r),{pragmas:o,comments:h}=(0,fe.parseWithComments)(p);return{shebang:u,text:r,pragmas:o,comments:h}}function ti(r){let u=Object.keys(xs(r).pragmas);return u.includes("prettier")||u.includes("format")}b();b();function ys(r){return Array.isArray(r)&&r.length>0}var de=ys;function D(r,u){let{ignoreDecorators:p}=u||{};if(!p){let o=r.declaration&&r.declaration.decorators||r.decorators;if(de(o))return D(o[0])}return r.range?r.range[0]:r.start}function K(r){return r.range?r.range[1]:r.end}function gs(r){return r=typeof r=="function"?{parse:r}:r,{astFormat:"estree",hasPragma:ti,locStart:D,locEnd:K,...r}}var je=gs;b();b();var bs=(r,u,p,...o)=>{if(!(r&&u==null))return u.at?u.at(p,...o):u[p<0?u.length+p:p]},Ue=bs;b();function vs({type:r}){return r.startsWith("TS")&&r.endsWith("Keyword")}var ii=vs;b();b();var Ss=new Set(["Block","CommentBlock","MultiLine"]),Ts=r=>Ss.has(r==null?void 0:r.type),ke=Ts;function Cs(r){return ke(r)&&r.value[0]==="*"&&/@type\b/.test(r.value)}var si=Cs;b();function Es(r){let u=`*${r.value}*`.split(`
|
|
13
|
-
`);return u.length>1&&u.every(p=>p.trimStart()[0]==="*")}var it=Es;b();b();b();b();var _e=null;function we(r){if(_e!==null&&typeof _e.property){let u=_e;return _e=we.prototype=null,u}return _e=we.prototype=r==null?Object.create(null):r,new we}var ks=10;for(let r=0;r<=ks;r++)we();function st(r){return we(r)}function _s(r,u="type"){st(r);function p(o){let h=o[u],f=r[h];if(!Array.isArray(f))throw Object.assign(new Error(`Missing visitor keys for '${h}'.`),{node:o});return f}return p}var ri=_s;var ai={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body","interpreter"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ExportAllDeclaration:["source","exported","assertions"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","assertions"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","assertions"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],ClassPrivateProperty:["key","value","decorators","typeAnnotation","variance"],ClassPrivateMethod:["key","params","body","decorators","returnType","typeParameters"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","mixins","implements","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source"],DeclareExportAllDeclaration:["source"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","mixins","implements","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value","optional","static","method"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value","variance"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["id","qualification"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types"],TypeofTypeAnnotation:["argument"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],DecimalLiteral:[],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation","initializer"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","typeAnnotation","nameType"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters"],TSAsExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members","modifiers"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body","modifiers"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","parameter"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ImportExpression:["source","attributes"],Literal:[],MethodDefinition:["decorators","key","value","typeParameters"],PrivateIdentifier:[],Property:["key","value","decorators"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value","decorators"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],BigIntLiteralTypeAnnotation:[],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGQuotedExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],SpreadProperty:["argument"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],BigIntTypeAnnotation:[],QualifiedTypeofIdentifier:["id","qualification"]};var As=ri(ai),ni=As;function rt(r,u){if(!(r!==null&&typeof r=="object"))return r;if(Array.isArray(r)){for(let o=0;o<r.length;o++)r[o]=rt(r[o],u);return r}let p=ni(r);for(let o=0;o<p.length;o++)r[p[o]]=rt(r[p[o]],u);return u(r)||r}var me=rt;b();b();function Ps(r,u){let{start:p,end:o}=r.loc;throw le(u,{loc:{start:{line:p.line,column:p.column+1},end:{line:o.line,column:o.column+1}}})}var Ae=Ps;function Is(r){for(;r&&r.kind!==305;)r=r.parent;return r}function Ns(r){let{illegalDecorators:u}=r;if(!de(u))return;let[{expression:p}]=u,o=Is(p),[h,f]=[p.pos,p.end].map(v=>{let{line:I,character:B}=o.getLineAndCharacterOfPosition(v);return{line:I+1,column:B}});Ae({loc:{start:h,end:f}},"Decorators are not valid here.")}function Ls(r,u){r.kind!==167||r.modifiers&&!r.modifiers.some(h=>h.kind===126)||r.initializer&&u.value===null&&Ae(u,"Abstract property cannot have an initializer")}function oi(r,u){let{esTreeNodeToTSNodeMap:p,tsNodeToESTreeNodeMap:o}=u.tsParseResult;me(r,h=>{let f=p.get(h);if(!f)return;let v=o.get(f);v===h&&(Ns(f),Ls(f,v))})}function Vs(r,u){if(u.parser==="typescript"&&/@|abstract/.test(u.originalText)&&oi(r,u),u.parser!=="typescript"&&u.parser!=="flow"&&u.parser!=="acorn"&&u.parser!=="espree"&&u.parser!=="meriyah"){let o=new Set;r=me(r,h=>{h.leadingComments&&h.leadingComments.some(si)&&o.add(D(h))}),r=me(r,h=>{if(h.type==="ParenthesizedExpression"){let{expression:f}=h;if(f.type==="TypeCastExpression")return f.range=h.range,f;let v=D(h);if(!o.has(v))return f.extra={...f.extra,parenthesized:!0},f}})}if(r=me(r,o=>{switch(o.type){case"ChainExpression":return qe(o.expression);case"LogicalExpression":if(ui(o))return at(o);break;case"VariableDeclaration":{let h=Ue(!1,o.declarations,-1);h&&h.init&&p(o,h);break}case"TSParenthesizedType":return ii(o.typeAnnotation)||o.typeAnnotation.type==="TSThisType"||(o.typeAnnotation.range=[D(o),K(o)]),o.typeAnnotation;case"TSTypeParameter":if(typeof o.name=="string"){let h=D(o);o.name={type:"Identifier",name:o.name,range:[h,h+o.name.length]}}break;case"ObjectExpression":if(u.parser==="typescript"){let h=o.properties.find(f=>f.type==="Property"&&f.value.type==="TSEmptyBodyFunctionExpression");h&&Ae(h.value,"Unexpected token.")}break;case"SequenceExpression":{let h=Ue(!1,o.expressions,-1);o.range=[D(o),Math.min(K(h),K(o))];break}case"TopicReference":u.__isUsingHackPipeline=!0;break;case"ExportAllDeclaration":{let{exported:h}=o;if(u.parser==="meriyah"&&h&&h.type==="Identifier"){let f=u.originalText.slice(D(h),K(h));(f.startsWith('"')||f.startsWith("'"))&&(o.exported={...o.exported,type:"Literal",value:o.exported.name,raw:f})}break}}}),de(r.comments)){let o=Ue(!1,r.comments,-1);for(let h=r.comments.length-2;h>=0;h--){let f=r.comments[h];K(f)===D(o)&&ke(f)&&ke(o)&&it(f)&&it(o)&&(r.comments.splice(h+1,1),f.value+="*//*"+o.value,f.range=[D(f),K(o)]),o=f}}return r;function p(o,h){u.originalText[K(h)]!==";"&&(o.range=[D(o),K(h)])}}function qe(r){switch(r.type){case"CallExpression":r.type="OptionalCallExpression",r.callee=qe(r.callee);break;case"MemberExpression":r.type="OptionalMemberExpression",r.object=qe(r.object);break;case"TSNonNullExpression":r.expression=qe(r.expression);break}return r}function ui(r){return r.type==="LogicalExpression"&&r.right.type==="LogicalExpression"&&r.operator===r.right.operator}function at(r){return ui(r)?at({type:"LogicalExpression",operator:r.operator,left:at({type:"LogicalExpression",operator:r.operator,left:r.left,right:r.right.left,range:[D(r.left),K(r.right.left)]}),right:r.right.right,range:[D(r),K(r)]}):r}var Ke=Vs;var Ds={ecmaVersion:"latest",sourceType:"module",allowReturnOutsideFunction:!0,allowImportExportEverywhere:!0,allowSuperOutsideMethod:!0,locations:!0,ranges:!0};function Ms(r){let{message:u,loc:p}=r;if(!p)return r;let{line:o,column:h}=p;return le(u.replace(/ \(\d+:\d+\)$/,""),{loc:{start:{line:o,column:h+1}},cause:r})}var ut,js=()=>{if(!ut){let{Parser:r}=Pe(),u=ot();ut=r.extend(u())}return ut};function di(r,u){let p=js(),o=[],h=[],f=p.parse(r,{...Ds,sourceType:u,onComment:o,onToken:h});return f.comments=o,f.tokens=h,f}function Us(r,u={}){let{result:p,error:o}=Me(()=>di(r,"module"),()=>di(r,"script"));if(!p)throw Ms(o);return u.originalText=r,Ke(p,u)}var mi=je(Us);b();var Ti={ecmaVersion:"latest",range:!0,loc:!0,comment:!0,tokens:!0,sourceType:"module",ecmaFeatures:{jsx:!0,globalReturn:!0,impliedStrict:!1}};function ur(r){let{message:u,lineNumber:p,column:o}=r;return typeof p!="number"?r:le(u,{loc:{start:{line:p,column:o}},cause:r})}function hr(r,u={}){let{parse:p}=Si(),{result:o,error:h}=Me(()=>p(r,{...Ti,sourceType:"module"}),()=>p(r,{...Ti,sourceType:"script"}));if(!o)throw ur(h);return u.originalText=r,Ke(o,u)}var Ci=je(hr);var cr={parsers:{acorn:mi,espree:Ci}},Ya=cr;export{Ya as default};
|
|
13
|
+
`);return u.length>1&&u.every(p=>p.trimStart()[0]==="*")}var it=Es;b();b();b();b();var _e=null;function we(r){if(_e!==null&&typeof _e.property){let u=_e;return _e=we.prototype=null,u}return _e=we.prototype=r==null?Object.create(null):r,new we}var ks=10;for(let r=0;r<=ks;r++)we();function st(r){return we(r)}function _s(r,u="type"){st(r);function p(o){let h=o[u],f=r[h];if(!Array.isArray(f))throw Object.assign(new Error(`Missing visitor keys for '${h}'.`),{node:o});return f}return p}var ri=_s;var ai={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body","interpreter"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ExportAllDeclaration:["source","exported","assertions"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","assertions"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","assertions"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],ClassPrivateProperty:["key","value","decorators","typeAnnotation","variance"],ClassPrivateMethod:["key","params","body","decorators","returnType","typeParameters"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","mixins","implements","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source"],DeclareExportAllDeclaration:["source"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","mixins","implements","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value","optional","static","method"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value","variance"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["id","qualification"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types"],TypeofTypeAnnotation:["argument"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],DecimalLiteral:[],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation","initializer"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","typeAnnotation","nameType"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters"],TSAsExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members","modifiers"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body","modifiers"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","parameter"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ImportExpression:["source","attributes"],Literal:[],MethodDefinition:["decorators","key","value","typeParameters"],PrivateIdentifier:[],Property:["key","value","decorators"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value","decorators"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],BigIntLiteralTypeAnnotation:[],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],SpreadProperty:["argument"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],BigIntTypeAnnotation:[],QualifiedTypeofIdentifier:["id","qualification"]};var As=ri(ai),ni=As;function rt(r,u){if(!(r!==null&&typeof r=="object"))return r;if(Array.isArray(r)){for(let o=0;o<r.length;o++)r[o]=rt(r[o],u);return r}let p=ni(r);for(let o=0;o<p.length;o++)r[p[o]]=rt(r[p[o]],u);return u(r)||r}var me=rt;b();b();function Ps(r,u){let{start:p,end:o}=r.loc;throw le(u,{loc:{start:{line:p.line,column:p.column+1},end:{line:o.line,column:o.column+1}}})}var Ae=Ps;function Is(r){for(;r&&r.kind!==305;)r=r.parent;return r}function Ns(r){let{illegalDecorators:u}=r;if(!de(u))return;let[{expression:p}]=u,o=Is(p),[h,f]=[p.pos,p.end].map(v=>{let{line:I,character:B}=o.getLineAndCharacterOfPosition(v);return{line:I+1,column:B}});Ae({loc:{start:h,end:f}},"Decorators are not valid here.")}function Ls(r,u){r.kind!==167||r.modifiers&&!r.modifiers.some(h=>h.kind===126)||r.initializer&&u.value===null&&Ae(u,"Abstract property cannot have an initializer")}function oi(r,u){let{esTreeNodeToTSNodeMap:p,tsNodeToESTreeNodeMap:o}=u.tsParseResult;me(r,h=>{let f=p.get(h);if(!f)return;let v=o.get(f);v===h&&(Ns(f),Ls(f,v))})}function Vs(r,u){if(u.parser==="typescript"&&/@|abstract/.test(u.originalText)&&oi(r,u),u.parser!=="typescript"&&u.parser!=="flow"&&u.parser!=="acorn"&&u.parser!=="espree"&&u.parser!=="meriyah"){let o=new Set;r=me(r,h=>{h.leadingComments&&h.leadingComments.some(si)&&o.add(D(h))}),r=me(r,h=>{if(h.type==="ParenthesizedExpression"){let{expression:f}=h;if(f.type==="TypeCastExpression")return f.range=h.range,f;let v=D(h);if(!o.has(v))return f.extra={...f.extra,parenthesized:!0},f}})}if(r=me(r,o=>{switch(o.type){case"ChainExpression":return qe(o.expression);case"LogicalExpression":if(ui(o))return at(o);break;case"VariableDeclaration":{let h=Ue(!1,o.declarations,-1);h&&h.init&&p(o,h);break}case"TSParenthesizedType":return ii(o.typeAnnotation)||o.typeAnnotation.type==="TSThisType"||(o.typeAnnotation.range=[D(o),K(o)]),o.typeAnnotation;case"TSTypeParameter":if(typeof o.name=="string"){let h=D(o);o.name={type:"Identifier",name:o.name,range:[h,h+o.name.length]}}break;case"ObjectExpression":if(u.parser==="typescript"){let h=o.properties.find(f=>f.type==="Property"&&f.value.type==="TSEmptyBodyFunctionExpression");h&&Ae(h.value,"Unexpected token.")}break;case"SequenceExpression":{let h=Ue(!1,o.expressions,-1);o.range=[D(o),Math.min(K(h),K(o))];break}case"TopicReference":u.__isUsingHackPipeline=!0;break;case"ExportAllDeclaration":{let{exported:h}=o;if(u.parser==="meriyah"&&h&&h.type==="Identifier"){let f=u.originalText.slice(D(h),K(h));(f.startsWith('"')||f.startsWith("'"))&&(o.exported={...o.exported,type:"Literal",value:o.exported.name,raw:f})}break}}}),de(r.comments)){let o=Ue(!1,r.comments,-1);for(let h=r.comments.length-2;h>=0;h--){let f=r.comments[h];K(f)===D(o)&&ke(f)&&ke(o)&&it(f)&&it(o)&&(r.comments.splice(h+1,1),f.value+="*//*"+o.value,f.range=[D(f),K(o)]),o=f}}return r;function p(o,h){u.originalText[K(h)]!==";"&&(o.range=[D(o),K(h)])}}function qe(r){switch(r.type){case"CallExpression":r.type="OptionalCallExpression",r.callee=qe(r.callee);break;case"MemberExpression":r.type="OptionalMemberExpression",r.object=qe(r.object);break;case"TSNonNullExpression":r.expression=qe(r.expression);break}return r}function ui(r){return r.type==="LogicalExpression"&&r.right.type==="LogicalExpression"&&r.operator===r.right.operator}function at(r){return ui(r)?at({type:"LogicalExpression",operator:r.operator,left:at({type:"LogicalExpression",operator:r.operator,left:r.left,right:r.right.left,range:[D(r.left),K(r.right.left)]}),right:r.right.right,range:[D(r),K(r)]}):r}var Ke=Vs;var Ds={ecmaVersion:"latest",sourceType:"module",allowReturnOutsideFunction:!0,allowImportExportEverywhere:!0,allowSuperOutsideMethod:!0,locations:!0,ranges:!0};function Ms(r){let{message:u,loc:p}=r;if(!p)return r;let{line:o,column:h}=p;return le(u.replace(/ \(\d+:\d+\)$/,""),{loc:{start:{line:o,column:h+1}},cause:r})}var ut,js=()=>{if(!ut){let{Parser:r}=Pe(),u=ot();ut=r.extend(u())}return ut};function di(r,u){let p=js(),o=[],h=[],f=p.parse(r,{...Ds,sourceType:u,onComment:o,onToken:h});return f.comments=o,f.tokens=h,f}function Us(r,u={}){let{result:p,error:o}=Me(()=>di(r,"module"),()=>di(r,"script"));if(!p)throw Ms(o);return u.originalText=r,Ke(p,u)}var mi=je(Us);b();var Ti={ecmaVersion:"latest",range:!0,loc:!0,comment:!0,tokens:!0,sourceType:"module",ecmaFeatures:{jsx:!0,globalReturn:!0,impliedStrict:!1}};function ur(r){let{message:u,lineNumber:p,column:o}=r;return typeof p!="number"?r:le(u,{loc:{start:{line:p,column:o}},cause:r})}function hr(r,u={}){let{parse:p}=Si(),{result:o,error:h}=Me(()=>p(r,{...Ti,sourceType:"module"}),()=>p(r,{...Ti,sourceType:"script"}));if(!o)throw ur(h);return u.originalText=r,Ke(o,u)}var Ci=je(hr);var cr={parsers:{acorn:mi,espree:Ci}},Ya=cr;export{Ya as default};
|
package/plugins/angular.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e){function n(i){var l=i();return l.default}if(typeof exports=="object"&&typeof module=="object")module.exports=n(e);else if(typeof define=="function"&&define.amd)define(function(){return n(e)});else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.angular=n(e)}})(function(){"use strict";var
|
|
2
|
-
`,Lt="\r",_t=function(){function r(e){this.string=e;for(var t=[0],s=0;s<e.length;)switch(e[s]){case Te:s+=Te.length,t.push(s);break;case Lt:s+=Lt.length,e[s]===Te&&(s+=Te.length),t.push(s);break;default:s++;break}this.offsets=t}return r.prototype.locationForIndex=function(e){if(e<0||e>this.string.length)return null;for(var t=0,s=this.offsets;s[t+1]<=e;)t++;var n=e-s[t];return{line:t,column:n}},r.prototype.indexForLocation=function(e){var t=e.line,s=e.column;return t<0||t>=this.offsets.length||s<0||s>this.lengthOfLine(t)?null:this.offsets[t]+s},r.prototype.lengthOfLine=function(e){var t=this.offsets[e],s=e===this.offsets.length-1?this.string.length:this.offsets[e+1];return s-t},r}();ye.LinesAndColumns=_t;ye.default=_t});var Bt=le(Ke=>{"use strict";m();Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Context=void 0;var fs=bt(),Ye=class{constructor(e){this.text=e,this.locator=new et(this.text)}};Ke.Context=Ye;var et=class{constructor(e){this._lineAndColumn=new fs.default(e)}locationForIndex(e){let{line:t,column:s}=this._lineAndColumn.locationForIndex(e);return{line:t+1,column:s}}}});var ot={};Be(ot,{AST:()=>E,ASTWithName:()=>M,ASTWithSource:()=>K,AbsoluteSourceSpan:()=>B,AstMemoryEfficientTransformer:()=>st,AstTransformer:()=>tt,Binary:()=>I,BindingPipe:()=>Y,BoundElementProperty:()=>at,Chain:()=>V,Conditional:()=>q,EmptyExpr:()=>R,ExpressionBinding:()=>Ae,FunctionCall:()=>oe,ImplicitReceiver:()=>W,Interpolation:()=>se,KeyedRead:()=>X,KeyedWrite:()=>J,LiteralArray:()=>ee,LiteralMap:()=>te,LiteralPrimitive:()=>P,MethodCall:()=>ie,NonNullAssert:()=>ne,ParseSpan:()=>T,ParsedEvent:()=>nt,ParsedProperty:()=>rt,ParsedPropertyType:()=>$e,ParsedVariable:()=>it,ParserError:()=>Q,PrefixNot:()=>re,PropertyRead:()=>F,PropertyWrite:()=>H,Quote:()=>de,RecursiveAstVisitor:()=>Ce,SafeKeyedRead:()=>Z,SafeMethodCall:()=>ae,SafePropertyRead:()=>z,ThisReceiver:()=>Ee,Unary:()=>L,VariableBinding:()=>xe});var Q,T,E,M,de,R,W,Ee,V,q,F,H,z,X,Z,J,Y,P,ee,te,se,I,L,re,ne,ie,ae,oe,B,K,xe,Ae,Ce,tt,st,rt,$e,nt,it,at,Me=j(()=>{m();Q=class{constructor(e,t,s,n){this.input=t,this.errLocation=s,this.ctxLocation=n,this.message=`Parser Error: ${e} ${s} [${t}] in ${n}`}},T=class{constructor(e,t){this.start=e,this.end=t}toAbsolute(e){return new B(e+this.start,e+this.end)}},E=class{constructor(e,t){this.span=e,this.sourceSpan=t}toString(){return"AST"}},M=class extends E{constructor(e,t,s){super(e,t),this.nameSpan=s}},de=class extends E{constructor(e,t,s,n,i){super(e,t),this.prefix=s,this.uninterpretedExpression=n,this.location=i}visit(e,t=null){return e.visitQuote(this,t)}toString(){return"Quote"}},R=class extends E{visit(e,t=null){}},W=class extends E{visit(e,t=null){return e.visitImplicitReceiver(this,t)}},Ee=class extends W{visit(e,t=null){var s;return(s=e.visitThisReceiver)===null||s===void 0?void 0:s.call(e,this,t)}},V=class extends E{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitChain(this,t)}},q=class extends E{constructor(e,t,s,n,i){super(e,t),this.condition=s,this.trueExp=n,this.falseExp=i}visit(e,t=null){return e.visitConditional(this,t)}},F=class extends M{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitPropertyRead(this,t)}},H=class extends M{constructor(e,t,s,n,i,a){super(e,t,s),this.receiver=n,this.name=i,this.value=a}visit(e,t=null){return e.visitPropertyWrite(this,t)}},z=class extends M{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitSafePropertyRead(this,t)}},X=class extends E{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitKeyedRead(this,t)}},Z=class extends E{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitSafeKeyedRead(this,t)}},J=class extends E{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.key=n,this.value=i}visit(e,t=null){return e.visitKeyedWrite(this,t)}},Y=class extends M{constructor(e,t,s,n,i,a){super(e,t,a),this.exp=s,this.name=n,this.args=i}visit(e,t=null){return e.visitPipe(this,t)}},P=class extends E{constructor(e,t,s){super(e,t),this.value=s}visit(e,t=null){return e.visitLiteralPrimitive(this,t)}},ee=class extends E{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitLiteralArray(this,t)}},te=class extends E{constructor(e,t,s,n){super(e,t),this.keys=s,this.values=n}visit(e,t=null){return e.visitLiteralMap(this,t)}},se=class extends E{constructor(e,t,s,n){super(e,t),this.strings=s,this.expressions=n}visit(e,t=null){return e.visitInterpolation(this,t)}},I=class extends E{constructor(e,t,s,n,i){super(e,t),this.operation=s,this.left=n,this.right=i}visit(e,t=null){return e.visitBinary(this,t)}},L=class extends I{constructor(e,t,s,n,i,a,h){super(e,t,i,a,h),this.operator=s,this.expr=n}static createMinus(e,t,s){return new L(e,t,"-",s,"-",new P(e,t,0),s)}static createPlus(e,t,s){return new L(e,t,"+",s,"-",s,new P(e,t,0))}visit(e,t=null){return e.visitUnary!==void 0?e.visitUnary(this,t):e.visitBinary(this,t)}},re=class extends E{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitPrefixNot(this,t)}},ne=class extends E{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitNonNullAssert(this,t)}},ie=class extends M{constructor(e,t,s,n,i,a,h){super(e,t,s),this.receiver=n,this.name=i,this.args=a,this.argumentSpan=h}visit(e,t=null){return e.visitMethodCall(this,t)}},ae=class extends M{constructor(e,t,s,n,i,a,h){super(e,t,s),this.receiver=n,this.name=i,this.args=a,this.argumentSpan=h}visit(e,t=null){return e.visitSafeMethodCall(this,t)}},oe=class extends E{constructor(e,t,s,n){super(e,t),this.target=s,this.args=n}visit(e,t=null){return e.visitFunctionCall(this,t)}},B=class{constructor(e,t){this.start=e,this.end=t}},K=class extends E{constructor(e,t,s,n,i){super(new T(0,t===null?0:t.length),new B(n,t===null?n:n+t.length)),this.ast=e,this.source=t,this.location=s,this.errors=i}visit(e,t=null){return e.visitASTWithSource?e.visitASTWithSource(this,t):this.ast.visit(e,t)}toString(){return`${this.source} in ${this.location}`}},xe=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},Ae=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},Ce=class{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitFunctionCall(e,t){e.target&&this.visit(e.target,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.receiver,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitMethodCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitPrefixNot(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeMethodCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitSafeKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitQuote(e,t){}visitAll(e,t){for(let s of e)this.visit(s,t)}},tt=class{visitImplicitReceiver(e,t){return e}visitThisReceiver(e,t){return e}visitInterpolation(e,t){return new se(e.span,e.sourceSpan,e.strings,this.visitAll(e.expressions))}visitLiteralPrimitive(e,t){return new P(e.span,e.sourceSpan,e.value)}visitPropertyRead(e,t){return new F(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name)}visitPropertyWrite(e,t){return new H(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name,e.value.visit(this))}visitSafePropertyRead(e,t){return new z(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name)}visitMethodCall(e,t){return new ie(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name,this.visitAll(e.args),e.argumentSpan)}visitSafeMethodCall(e,t){return new ae(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name,this.visitAll(e.args),e.argumentSpan)}visitFunctionCall(e,t){return new oe(e.span,e.sourceSpan,e.target.visit(this),this.visitAll(e.args))}visitLiteralArray(e,t){return new ee(e.span,e.sourceSpan,this.visitAll(e.expressions))}visitLiteralMap(e,t){return new te(e.span,e.sourceSpan,e.keys,this.visitAll(e.values))}visitUnary(e,t){switch(e.operator){case"+":return L.createPlus(e.span,e.sourceSpan,e.expr.visit(this));case"-":return L.createMinus(e.span,e.sourceSpan,e.expr.visit(this));default:throw new Error(`Unknown unary operator ${e.operator}`)}}visitBinary(e,t){return new I(e.span,e.sourceSpan,e.operation,e.left.visit(this),e.right.visit(this))}visitPrefixNot(e,t){return new re(e.span,e.sourceSpan,e.expression.visit(this))}visitNonNullAssert(e,t){return new ne(e.span,e.sourceSpan,e.expression.visit(this))}visitConditional(e,t){return new q(e.span,e.sourceSpan,e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this))}visitPipe(e,t){return new Y(e.span,e.sourceSpan,e.exp.visit(this),e.name,this.visitAll(e.args),e.nameSpan)}visitKeyedRead(e,t){return new X(e.span,e.sourceSpan,e.receiver.visit(this),e.key.visit(this))}visitKeyedWrite(e,t){return new J(e.span,e.sourceSpan,e.receiver.visit(this),e.key.visit(this),e.value.visit(this))}visitAll(e){let t=[];for(let s=0;s<e.length;++s)t[s]=e[s].visit(this);return t}visitChain(e,t){return new V(e.span,e.sourceSpan,this.visitAll(e.expressions))}visitQuote(e,t){return new de(e.span,e.sourceSpan,e.prefix,e.uninterpretedExpression,e.location)}visitSafeKeyedRead(e,t){return new Z(e.span,e.sourceSpan,e.receiver.visit(this),e.key.visit(this))}},st=class{visitImplicitReceiver(e,t){return e}visitThisReceiver(e,t){return e}visitInterpolation(e,t){let s=this.visitAll(e.expressions);return s!==e.expressions?new se(e.span,e.sourceSpan,e.strings,s):e}visitLiteralPrimitive(e,t){return e}visitPropertyRead(e,t){let s=e.receiver.visit(this);return s!==e.receiver?new F(e.span,e.sourceSpan,e.nameSpan,s,e.name):e}visitPropertyWrite(e,t){let s=e.receiver.visit(this),n=e.value.visit(this);return s!==e.receiver||n!==e.value?new H(e.span,e.sourceSpan,e.nameSpan,s,e.name,n):e}visitSafePropertyRead(e,t){let s=e.receiver.visit(this);return s!==e.receiver?new z(e.span,e.sourceSpan,e.nameSpan,s,e.name):e}visitMethodCall(e,t){let s=e.receiver.visit(this),n=this.visitAll(e.args);return s!==e.receiver||n!==e.args?new ie(e.span,e.sourceSpan,e.nameSpan,s,e.name,n,e.argumentSpan):e}visitSafeMethodCall(e,t){let s=e.receiver.visit(this),n=this.visitAll(e.args);return s!==e.receiver||n!==e.args?new ae(e.span,e.sourceSpan,e.nameSpan,s,e.name,n,e.argumentSpan):e}visitFunctionCall(e,t){let s=e.target&&e.target.visit(this),n=this.visitAll(e.args);return s!==e.target||n!==e.args?new oe(e.span,e.sourceSpan,s,n):e}visitLiteralArray(e,t){let s=this.visitAll(e.expressions);return s!==e.expressions?new ee(e.span,e.sourceSpan,s):e}visitLiteralMap(e,t){let s=this.visitAll(e.values);return s!==e.values?new te(e.span,e.sourceSpan,e.keys,s):e}visitUnary(e,t){let s=e.expr.visit(this);if(s!==e.expr)switch(e.operator){case"+":return L.createPlus(e.span,e.sourceSpan,s);case"-":return L.createMinus(e.span,e.sourceSpan,s);default:throw new Error(`Unknown unary operator ${e.operator}`)}return e}visitBinary(e,t){let s=e.left.visit(this),n=e.right.visit(this);return s!==e.left||n!==e.right?new I(e.span,e.sourceSpan,e.operation,s,n):e}visitPrefixNot(e,t){let s=e.expression.visit(this);return s!==e.expression?new re(e.span,e.sourceSpan,s):e}visitNonNullAssert(e,t){let s=e.expression.visit(this);return s!==e.expression?new ne(e.span,e.sourceSpan,s):e}visitConditional(e,t){let s=e.condition.visit(this),n=e.trueExp.visit(this),i=e.falseExp.visit(this);return s!==e.condition||n!==e.trueExp||i!==e.falseExp?new q(e.span,e.sourceSpan,s,n,i):e}visitPipe(e,t){let s=e.exp.visit(this),n=this.visitAll(e.args);return s!==e.exp||n!==e.args?new Y(e.span,e.sourceSpan,s,e.name,n,e.nameSpan):e}visitKeyedRead(e,t){let s=e.receiver.visit(this),n=e.key.visit(this);return s!==e.receiver||n!==e.key?new X(e.span,e.sourceSpan,s,n):e}visitKeyedWrite(e,t){let s=e.receiver.visit(this),n=e.key.visit(this),i=e.value.visit(this);return s!==e.receiver||n!==e.key||i!==e.value?new J(e.span,e.sourceSpan,s,n,i):e}visitAll(e){let t=[],s=!1;for(let n=0;n<e.length;++n){let i=e[n],a=i.visit(this);t[n]=a,s=s||a!==i}return s?t:e}visitChain(e,t){let s=this.visitAll(e.expressions);return s!==e.expressions?new V(e.span,e.sourceSpan,s):e}visitQuote(e,t){return e}visitSafeKeyedRead(e,t){let s=e.receiver.visit(this),n=e.key.visit(this);return s!==e.receiver||n!==e.key?new Z(e.span,e.sourceSpan,s,n):e}},rt=class{constructor(e,t,s,n,i,a){this.name=e,this.expression=t,this.type=s,this.sourceSpan=n,this.keySpan=i,this.valueSpan=a,this.isLiteral=this.type===$e.LITERAL_ATTR,this.isAnimation=this.type===$e.ANIMATION}};(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.LITERAL_ATTR=1]="LITERAL_ATTR",r[r.ANIMATION=2]="ANIMATION"})($e||($e={}));nt=class{constructor(e,t,s,n,i,a,h){this.name=e,this.targetOrPhase=t,this.type=s,this.handler=n,this.sourceSpan=i,this.handlerSpan=a,this.keySpan=h}},it=class{constructor(e,t,s,n,i){this.name=e,this.value=t,this.sourceSpan=s,this.keySpan=n,this.valueSpan=i}},at=class{constructor(e,t,s,n,i,a,h,x){this.name=e,this.type=t,this.securityContext=s,this.value=n,this.unit=i,this.sourceSpan=a,this.keySpan=h,this.valueSpan=x}}});function Tt(r){return r>=9&&r<=32||r==160}function U(r){return 48<=r&&r<=57}function Kt(r){return r>=97&&r<=122||r>=65&&r<=90}function ct(r){return r===39||r===34||r===96}var ht=j(()=>{m();});var Vt={};Be(Vt,{EOF:()=>Pe,Lexer:()=>ut,Token:()=>_,TokenType:()=>f,isIdentifier:()=>ft});function Dt(r,e,t){return new _(r,e,f.Character,t,String.fromCharCode(t))}function Vs(r,e,t){return new _(r,e,f.Identifier,0,t)}function qs(r,e,t){return new _(r,e,f.PrivateIdentifier,0,t)}function Hs(r,e,t){return new _(r,e,f.Keyword,0,t)}function pt(r,e,t){return new _(r,e,f.Operator,0,t)}function zs(r,e,t){return new _(r,e,f.String,0,t)}function Xs(r,e,t){return new _(r,e,f.Number,t,"")}function Zs(r,e,t){return new _(r,e,f.Error,0,t)}function lt(r){return 97<=r&&r<=122||65<=r&&r<=90||r==95||r==36}function ft(r){if(r.length==0)return!1;let e=new Ge(r);if(!lt(e.peek))return!1;for(e.advance();e.peek!==0;){if(!dt(e.peek))return!1;e.advance()}return!0}function dt(r){return Kt(r)||U(r)||r==95||r==36}function Js(r){return r==101||r==69}function Ys(r){return r==45||r==43}function er(r){switch(r){case 110:return 10;case 102:return 12;case 114:return 13;case 116:return 9;case 118:return 11;default:return r}}function tr(r){let e=parseInt(r);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+r);return e}var f,Ws,ut,_,Pe,Ge,vt=j(()=>{m();ht();(function(r){r[r.Character=0]="Character",r[r.Identifier=1]="Identifier",r[r.PrivateIdentifier=2]="PrivateIdentifier",r[r.Keyword=3]="Keyword",r[r.String=4]="String",r[r.Operator=5]="Operator",r[r.Number=6]="Number",r[r.Error=7]="Error"})(f||(f={}));Ws=["var","let","as","null","undefined","true","false","if","else","this"],ut=class{tokenize(e){let t=new Ge(e),s=[],n=t.scanToken();for(;n!=null;)s.push(n),n=t.scanToken();return s}},_=class{constructor(e,t,s,n,i){this.index=e,this.end=t,this.type=s,this.numValue=n,this.strValue=i}isCharacter(e){return this.type==f.Character&&this.numValue==e}isNumber(){return this.type==f.Number}isString(){return this.type==f.String}isOperator(e){return this.type==f.Operator&&this.strValue==e}isIdentifier(){return this.type==f.Identifier}isPrivateIdentifier(){return this.type==f.PrivateIdentifier}isKeyword(){return this.type==f.Keyword}isKeywordLet(){return this.type==f.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==f.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==f.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==f.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==f.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==f.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==f.Keyword&&this.strValue=="this"}isError(){return this.type==f.Error}toNumber(){return this.type==f.Number?this.numValue:-1}toString(){switch(this.type){case f.Character:case f.Identifier:case f.Keyword:case f.Operator:case f.PrivateIdentifier:case f.String:case f.Error:return this.strValue;case f.Number:return this.numValue.toString();default:return null}}};Pe=new _(-1,-1,f.Character,0,""),Ge=class{constructor(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?0:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,t=this.length,s=this.peek,n=this.index;for(;s<=32;)if(++n>=t){s=0;break}else s=e.charCodeAt(n);if(this.peek=s,this.index=n,n>=t)return null;if(lt(s))return this.scanIdentifier();if(U(s))return this.scanNumber(n);let i=n;switch(s){case 46:return this.advance(),U(this.peek)?this.scanNumber(i):Dt(i,this.index,46);case 40:case 41:case 123:case 125:case 91:case 93:case 44:case 58:case 59:return this.scanCharacter(i,s);case 39:case 34:return this.scanString();case 35:return this.scanPrivateIdentifier();case 43:case 45:case 42:case 47:case 37:case 94:return this.scanOperator(i,String.fromCharCode(s));case 63:return this.scanQuestion(i);case 60:case 62:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=");case 33:case 61:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=",61,"=");case 38:return this.scanComplexOperator(i,"&",38,"&");case 124:return this.scanComplexOperator(i,"|",124,"|");case 160:for(;Tt(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,t){return this.advance(),Dt(e,this.index,t)}scanOperator(e,t){return this.advance(),pt(e,this.index,t)}scanComplexOperator(e,t,s,n,i,a){this.advance();let h=t;return this.peek==s&&(this.advance(),h+=n),i!=null&&this.peek==i&&(this.advance(),h+=a),pt(e,this.index,h)}scanIdentifier(){let e=this.index;for(this.advance();dt(this.peek);)this.advance();let t=this.input.substring(e,this.index);return Ws.indexOf(t)>-1?Hs(e,this.index,t):Vs(e,this.index,t)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!lt(this.peek))return this.error("Invalid character [#]",-1);for(;dt(this.peek);)this.advance();let t=this.input.substring(e,this.index);return qs(e,this.index,t)}scanNumber(e){let t=this.index===e,s=!1;for(this.advance();;){if(!U(this.peek))if(this.peek===95){if(!U(this.input.charCodeAt(this.index-1))||!U(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===46)t=!1;else if(Js(this.peek)){if(this.advance(),Ys(this.peek)&&this.advance(),!U(this.peek))return this.error("Invalid exponent",-1);t=!1}else break;this.advance()}let n=this.input.substring(e,this.index);s&&(n=n.replace(/_/g,""));let i=t?tr(n):parseFloat(n);return Xs(e,this.index,i)}scanString(){let e=this.index,t=this.peek;this.advance();let s="",n=this.index,i=this.input;for(;this.peek!=t;)if(this.peek==92){s+=i.substring(n,this.index),this.advance();let h;if(this.peek=this.peek,this.peek==117){let x=i.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(x))h=parseInt(x,16);else return this.error(`Invalid unicode escape [\\u${x}]`,0);for(let v=0;v<5;v++)this.advance()}else h=er(this.peek),this.advance();s+=String.fromCharCode(h),n=this.index}else{if(this.peek==0)return this.error("Unterminated quote",0);this.advance()}let a=i.substring(n,this.index);return this.advance(),zs(e,this.index,s+a)}scanQuestion(e){this.advance();let t="?";return(this.peek===63||this.peek===46)&&(t+=this.peek===46?".":"?",this.advance()),pt(e,this.index,t)}error(e,t){let s=this.index+t;return Zs(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}}});function qt(r,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${r}' to be an array, [start, end].`);if(e!=null){let t=e[0],s=e[1];sr.forEach(n=>{if(n.test(t)||n.test(s))throw new Error(`['${t}', '${s}'] contains unusable interpolation symbol.`)})}}var sr,Ht=j(()=>{m();sr=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//]});var Ie,ue,zt=j(()=>{m();Ht();Ie=class{constructor(e,t){this.start=e,this.end=t}static fromArray(e){return e?(qt("interpolation",e),new Ie(e[0],e[1])):ue}},ue=new Ie("{{","}}")});var Xt={};Be(Xt,{IvyParser:()=>gt,Parser:()=>Ve,SplitInterpolation:()=>Qe,TemplateBindingParseResult:()=>We,_ParseAST:()=>G});var Qe,We,Ve,gt,me,G,mt,St,Zt=j(()=>{m();ht();zt();Me();vt();Qe=class{constructor(e,t,s){this.strings=e,this.expressions=t,this.offsets=s}},We=class{constructor(e,t,s){this.templateBindings=e,this.warnings=t,this.errors=s}},Ve=class{constructor(e){this._lexer=e,this.errors=[],this.simpleExpressionChecker=mt}parseAction(e,t,s,n=ue){this._checkNoInterpolation(e,t,n);let i=this._stripComments(e),a=this._lexer.tokenize(this._stripComments(e)),h=new G(e,t,s,a,i.length,!0,this.errors,e.length-i.length).parseChain();return new K(h,e,t,s,this.errors)}parseBinding(e,t,s,n=ue){let i=this._parseBindingAst(e,t,s,n);return new K(i,e,t,s,this.errors)}checkSimpleExpression(e){let t=new this.simpleExpressionChecker;return e.visit(t),t.errors}parseSimpleBinding(e,t,s,n=ue){let i=this._parseBindingAst(e,t,s,n),a=this.checkSimpleExpression(i);return a.length>0&&this._reportError(`Host binding expression cannot contain ${a.join(" ")}`,e,t),new K(i,e,t,s,this.errors)}_reportError(e,t,s,n){this.errors.push(new Q(e,t,s,n))}_parseBindingAst(e,t,s,n){let i=this._parseQuote(e,t,s);if(i!=null)return i;this._checkNoInterpolation(e,t,n);let a=this._stripComments(e),h=this._lexer.tokenize(a);return new G(e,t,s,h,a.length,!1,this.errors,e.length-a.length).parseChain()}_parseQuote(e,t,s){if(e==null)return null;let n=e.indexOf(":");if(n==-1)return null;let i=e.substring(0,n).trim();if(!ft(i))return null;let a=e.substring(n+1),h=new T(0,e.length);return new de(h,h.toAbsolute(s),i,a,t)}parseTemplateBindings(e,t,s,n,i){let a=this._lexer.tokenize(t);return new G(t,s,i,a,t.length,!1,this.errors,0).parseTemplateBindings({source:e,span:new B(n,n+e.length)})}parseInterpolation(e,t,s,n=ue){let{strings:i,expressions:a,offsets:h}=this.splitInterpolation(e,t,n);if(a.length===0)return null;let x=[];for(let v=0;v<a.length;++v){let A=a[v].text,N=this._stripComments(A),O=this._lexer.tokenize(N),w=new G(e,t,s,O,N.length,!1,this.errors,h[v]+(A.length-N.length)).parseChain();x.push(w)}return this.createInterpolationAst(i.map(v=>v.text),x,e,t,s)}parseInterpolationExpression(e,t,s){let n=this._stripComments(e),i=this._lexer.tokenize(n),a=new G(e,t,s,i,n.length,!1,this.errors,0).parseChain(),h=["",""];return this.createInterpolationAst(h,[a],e,t,s)}createInterpolationAst(e,t,s,n,i){let a=new T(0,s.length),h=new se(a,a.toAbsolute(i),e,t);return new K(h,s,n,i,this.errors)}splitInterpolation(e,t,s=ue){let n=[],i=[],a=[],h=0,x=!1,v=!1,{start:A,end:N}=s;for(;h<e.length;)if(x){let O=h,w=O+A.length,C=this._getInterpolationEndIndex(e,N,w);if(C===-1){x=!1,v=!0;break}let c=C+N.length,o=e.substring(w,C);o.trim().length===0&&this._reportError("Blank expressions are not allowed in interpolated strings",e,`at column ${h} in`,t),i.push({text:o,start:O,end:c}),a.push(w),h=c,x=!1}else{let O=h;h=e.indexOf(A,h),h===-1&&(h=e.length);let w=e.substring(O,h);n.push({text:w,start:O,end:h}),x=!0}if(!x)if(v){let O=n[n.length-1];O.text+=e.substring(h),O.end=e.length}else n.push({text:e.substring(h),start:h,end:e.length});return new Qe(n,i,a)}wrapLiteralPrimitive(e,t,s){let n=new T(0,e==null?0:e.length);return new K(new P(n,n.toAbsolute(s),e),e,t,s,this.errors)}_stripComments(e){let t=this._commentStart(e);return t!=null?e.substring(0,t).trim():e}_commentStart(e){let t=null;for(let s=0;s<e.length-1;s++){let n=e.charCodeAt(s),i=e.charCodeAt(s+1);if(n===47&&i==47&&t==null)return s;t===n?t=null:t==null&&ct(n)&&(t=n)}return null}_checkNoInterpolation(e,t,{start:s,end:n}){let i=-1,a=-1;for(let h of this._forEachUnquotedChar(e,0))if(i===-1)e.startsWith(s)&&(i=h);else if(a=this._getInterpolationEndIndex(e,n,h),a>-1)break;i>-1&&a>-1&&this._reportError(`Got interpolation (${s}${n}) where expression was expected`,e,`at column ${i} in`,t)}_getInterpolationEndIndex(e,t,s){for(let n of this._forEachUnquotedChar(e,s)){if(e.startsWith(t,n))return n;if(e.startsWith("//",n))return e.indexOf(t,n)}return-1}*_forEachUnquotedChar(e,t){let s=null,n=0;for(let i=t;i<e.length;i++){let a=e[i];ct(e.charCodeAt(i))&&(s===null||s===a)&&n%2===0?s=s===null?a:null:s===null&&(yield i),n=a==="\\"?n+1:0}}},gt=class extends Ve{constructor(){super(...arguments),this.simpleExpressionChecker=St}};(function(r){r[r.None=0]="None",r[r.Writable=1]="Writable"})(me||(me={}));G=class{constructor(e,t,s,n,i,a,h,x){this.input=e,this.location=t,this.absoluteOffset=s,this.tokens=n,this.inputLength=i,this.parseAction=a,this.errors=h,this.offset=x,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.context=me.None,this.sourceSpanCache=new Map,this.index=0}peek(e){let t=this.index+e;return t<this.tokens.length?this.tokens[t]:Pe}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.inputLength+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let s=this.currentEndIndex;if(t!==void 0&&t>this.currentEndIndex&&(s=t),e>s){let n=s;s=e,e=n}return new T(e,s)}sourceSpan(e,t){let s=`${e}@${this.inputIndex}:${t}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,t){this.context|=e;let s=t();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===Pe?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],t=this.inputIndex;for(;this.index<this.tokens.length;){let s=this.parsePipe();if(e.push(s),this.consumeOptionalCharacter(59))for(this.parseAction||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(59););else this.index<this.tokens.length&&this.error(`Unexpected token '${this.next}'`)}if(e.length==0){let s=this.offset,n=this.offset+this.inputLength;return new R(this.span(s,n),this.sourceSpan(s,n))}return e.length==1?e[0]:new V(this.span(t),this.sourceSpan(t),e)}parsePipe(){let e=this.inputIndex,t=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseAction&&this.error("Cannot have a pipe in an action expression");do{let s=this.inputIndex,n=this.expectIdentifierOrKeyword(),i,a;n!==null?i=this.sourceSpan(s):(n="",a=this.next.index!==-1?this.next.index:this.inputLength+this.offset,i=new T(a,a).toAbsolute(this.absoluteOffset));let h=[];for(;this.consumeOptionalCharacter(58);)h.push(this.parseExpression());t=new Y(this.span(e),this.sourceSpan(e,a),t,n,h,i)}while(this.consumeOptionalOperator("|"))}return t}parseExpression(){return this.parseConditional()}parseConditional(){let e=this.inputIndex,t=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){let s=this.parsePipe(),n;if(this.consumeOptionalCharacter(58))n=this.parsePipe();else{let i=this.inputIndex,a=this.input.substring(e,i);this.error(`Conditional expression ${a} requires all 3 expressions`),n=new R(this.span(e),this.sourceSpan(e))}return new q(this.span(e),this.sourceSpan(e),t,s,n)}else return t}parseLogicalOr(){let e=this.inputIndex,t=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){let s=this.parseLogicalAnd();t=new I(this.span(e),this.sourceSpan(e),"||",t,s)}return t}parseLogicalAnd(){let e=this.inputIndex,t=this.parseNullishCoalescing();for(;this.consumeOptionalOperator("&&");){let s=this.parseNullishCoalescing();t=new I(this.span(e),this.sourceSpan(e),"&&",t,s)}return t}parseNullishCoalescing(){let e=this.inputIndex,t=this.parseEquality();for(;this.consumeOptionalOperator("??");){let s=this.parseEquality();t=new I(this.span(e),this.sourceSpan(e),"??",t,s)}return t}parseEquality(){let e=this.inputIndex,t=this.parseRelational();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"==":case"===":case"!=":case"!==":this.advance();let n=this.parseRelational();t=new I(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseRelational(){let e=this.inputIndex,t=this.parseAdditive();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"<":case">":case"<=":case">=":this.advance();let n=this.parseAdditive();t=new I(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseAdditive(){let e=this.inputIndex,t=this.parseMultiplicative();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let n=this.parseMultiplicative();t=new I(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseMultiplicative(){let e=this.inputIndex,t=this.parsePrefix();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let n=this.parsePrefix();t=new I(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parsePrefix(){if(this.next.type==f.Operator){let e=this.inputIndex,t=this.next.strValue,s;switch(t){case"+":return this.advance(),s=this.parsePrefix(),L.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),L.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new re(this.span(e),this.sourceSpan(e),s)}}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(46))t=this.parseAccessMemberOrMethodCall(t,e,!1);else if(this.consumeOptionalOperator("?."))t=this.consumeOptionalCharacter(91)?this.parseKeyedReadOrWrite(t,e,!0):this.parseAccessMemberOrMethodCall(t,e,!0);else if(this.consumeOptionalCharacter(91))t=this.parseKeyedReadOrWrite(t,e,!1);else if(this.consumeOptionalCharacter(40)){this.rparensExpected++;let s=this.parseCallArguments();this.rparensExpected--,this.expectCharacter(41),t=new oe(this.span(e),this.sourceSpan(e),t,s)}else if(this.consumeOptionalOperator("!"))t=new ne(this.span(e),this.sourceSpan(e),t);else return t}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;let t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),t}else{if(this.next.isKeywordNull())return this.advance(),new P(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new P(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new P(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new P(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new Ee(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;let t=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new ee(this.span(e),this.sourceSpan(e),t)}else{if(this.next.isCharacter(123))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(new W(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let t=this.next.toNumber();return this.advance(),new P(this.span(e),this.sourceSpan(e),t)}else if(this.next.isString()){let t=this.next.toString();return this.advance(),new P(this.span(e),this.sourceSpan(e),t)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new R(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new R(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new R(this.span(e),this.sourceSpan(e)))}}}parseExpressionList(e){let t=[];do if(!this.next.isCharacter(e))t.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(44));return t}parseLiteralMap(){let e=[],t=[],s=this.inputIndex;if(this.expectCharacter(123),!this.consumeOptionalCharacter(125)){this.rbracesExpected++;do{let n=this.inputIndex,i=this.next.isString(),a=this.expectIdentifierOrKeywordOrString();if(e.push({key:a,quoted:i}),i)this.expectCharacter(58),t.push(this.parsePipe());else if(this.consumeOptionalCharacter(58))t.push(this.parsePipe());else{let h=this.span(n),x=this.sourceSpan(n);t.push(new F(h,x,x,new W(h,x),a))}}while(this.consumeOptionalCharacter(44));this.rbracesExpected--,this.expectCharacter(125)}return new te(this.span(s),this.sourceSpan(s),e,t)}parseAccessMemberOrMethodCall(e,t,s){let n=this.inputIndex,i=this.withContext(me.Writable,()=>{var h;let x=(h=this.expectIdentifierOrKeyword())!==null&&h!==void 0?h:"";return x.length===0&&this.error("Expected identifier for property access",e.span.end),x}),a=this.sourceSpan(n);if(this.consumeOptionalCharacter(40)){let h=this.inputIndex;this.rparensExpected++;let x=this.parseCallArguments(),v=this.span(h,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(41),this.rparensExpected--;let A=this.span(t),N=this.sourceSpan(t);return s?new ae(A,N,a,e,i,x,v):new ie(A,N,a,e,i,x,v)}else{if(s)return this.consumeOptionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),new R(this.span(t),this.sourceSpan(t))):new z(this.span(t),this.sourceSpan(t),a,e,i);if(this.consumeOptionalOperator("=")){if(!this.parseAction)return this.error("Bindings cannot contain assignments"),new R(this.span(t),this.sourceSpan(t));let h=this.parseConditional();return new H(this.span(t),this.sourceSpan(t),a,e,i,h)}else return new F(this.span(t),this.sourceSpan(t),a,e,i)}}parseCallArguments(){if(this.next.isCharacter(41))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(44));return e}expectTemplateBindingKey(){let e="",t=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-");while(t);return{source:e,span:new B(s,s+e.length)}}parseTemplateBindings(e){let t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index<this.tokens.length;){let s=this.parseLetBinding();if(s)t.push(s);else{let n=this.expectTemplateBindingKey(),i=this.parseAsBinding(n);i?t.push(i):(n.source=e.source+n.source.charAt(0).toUpperCase()+n.source.substring(1),t.push(...this.parseDirectiveKeywordBindings(n)))}this.consumeStatementTerminator()}return new We(t,[],this.errors)}parseKeyedReadOrWrite(e,t,s){return this.withContext(me.Writable,()=>{this.rbracketsExpected++;let n=this.parsePipe();if(n instanceof R&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(93),this.consumeOptionalOperator("="))if(s)this.error("The '?.' operator cannot be used in the assignment");else{let i=this.parseConditional();return new J(this.span(t),this.sourceSpan(t),e,n,i)}else return s?new Z(this.span(t),this.sourceSpan(t),e,n):new X(this.span(t),this.sourceSpan(t),e,n);return new R(this.span(t),this.sourceSpan(t))})}parseDirectiveKeywordBindings(e){let t=[];this.consumeOptionalCharacter(58);let s=this.getDirectiveBoundTarget(),n=this.currentAbsoluteOffset,i=this.parseAsBinding(e);i||(this.consumeStatementTerminator(),n=this.currentAbsoluteOffset);let a=new B(e.span.start,n);return t.push(new Ae(a,e,s)),i&&t.push(i),t}getDirectiveBoundTarget(){if(this.next===Pe||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:t,end:s}=e.span,n=this.input.substring(t,s);return new K(e,n,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let t=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new B(e.span.start,this.currentAbsoluteOffset);return new xe(s,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let t=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let n=new B(e,this.currentAbsoluteOffset);return new xe(n,t,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(59)||this.consumeOptionalCharacter(44)}error(e,t=null){this.errors.push(new Q(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),e<this.tokens.length?`at column ${this.tokens[e].index+1} in`:"at the end of the expression"}_reportErrorForPrivateIdentifier(e,t){let s=`Private identifiers are not supported. Unexpected private identifier: ${e}`;t!==null&&(s+=`, ${t}`),this.error(s)}skip(){let e=this.next;for(;this.index<this.tokens.length&&!e.isCharacter(59)&&!e.isOperator("|")&&(this.rparensExpected<=0||!e.isCharacter(41))&&(this.rbracesExpected<=0||!e.isCharacter(125))&&(this.rbracketsExpected<=0||!e.isCharacter(93))&&(!(this.context&me.Writable)||!e.isOperator("="));)this.next.isError()&&this.errors.push(new Q(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),e=this.next}},mt=class{constructor(){this.errors=[]}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){}visitLiteralPrimitive(e,t){}visitPropertyRead(e,t){}visitPropertyWrite(e,t){}visitSafePropertyRead(e,t){}visitMethodCall(e,t){}visitSafeMethodCall(e,t){}visitFunctionCall(e,t){}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitUnary(e,t){}visitBinary(e,t){}visitPrefixNot(e,t){}visitNonNullAssert(e,t){}visitConditional(e,t){}visitPipe(e,t){this.errors.push("pipes")}visitKeyedRead(e,t){}visitKeyedWrite(e,t){}visitAll(e,t){return e.map(s=>s.visit(this,t))}visitChain(e,t){}visitQuote(e,t){}visitSafeKeyedRead(e,t){}},St=class extends Ce{constructor(){super(...arguments),this.errors=[]}visitPipe(){this.errors.push("pipes")}}});var He=le(S=>{"use strict";m();Object.defineProperty(S,"__esModule",{value:!0});S.getLast=S.toLowerCamelCase=S.findBackChar=S.findFrontChar=S.fitSpans=S.getNgType=S.parseNgInterpolation=S.parseNgTemplateBindings=S.parseNgAction=S.parseNgSimpleBinding=S.parseNgBinding=S.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX=void 0;var y=(Me(),we(ot)),rr=(vt(),we(Vt)),nr=(Zt(),we(Xt)),Yt="angular-estree-parser";S.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX="NgEstreeParser";var wt=0,qe=[Yt,wt];function Et(){return new nr.Parser(new rr.Lexer)}function At(r,e){let t=Et(),{astInput:s,comments:n}=es(r,t),{ast:i,errors:a}=e(s,t);return Ct(a),{ast:i,comments:n}}function ir(r){return At(r,(e,t)=>t.parseBinding(e,...qe))}S.parseNgBinding=ir;function ar(r){return At(r,(e,t)=>t.parseSimpleBinding(e,...qe))}S.parseNgSimpleBinding=ar;function or(r){return At(r,(e,t)=>t.parseAction(e,...qe))}S.parseNgAction=or;function cr(r){let e=Et(),{templateBindings:t,errors:s}=e.parseTemplateBindings(S.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX,r,Yt,wt,wt);return Ct(s),t}S.parseNgTemplateBindings=cr;function hr(r){let e=Et(),{astInput:t,comments:s}=es(r,e),n="{{",i="}}",{ast:a,errors:h}=e.parseInterpolation(n+t+i,...qe);Ct(h);let x=a.expressions[0],v=new Set;return yt(x,A=>{v.has(A)||(A.start-=n.length,A.end-=n.length,v.add(A))}),{ast:x,comments:s}}S.parseNgInterpolation=hr;function yt(r,e){if(!(!r||typeof r!="object")){if(Array.isArray(r))return r.forEach(t=>yt(t,e));for(let t of Object.keys(r)){let s=r[t];t==="span"?e(s):yt(s,e)}}}function Ct(r){if(r.length!==0){let[{message:e}]=r;throw new SyntaxError(e.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}}function es(r,e){let t=e._commentStart(r);return t===null?{astInput:r,comments:[]}:{astInput:r.slice(0,t),comments:[{type:"Comment",value:r.slice(t+2),span:{start:t,end:r.length}}]}}function pr(r){return y.Unary&&r instanceof y.Unary?"Unary":r instanceof y.Binary?"Binary":r instanceof y.BindingPipe?"BindingPipe":r instanceof y.Chain?"Chain":r instanceof y.Conditional?"Conditional":r instanceof y.EmptyExpr?"EmptyExpr":r instanceof y.FunctionCall?"FunctionCall":r instanceof y.ImplicitReceiver?"ImplicitReceiver":r instanceof y.KeyedRead?"KeyedRead":r instanceof y.KeyedWrite?"KeyedWrite":r instanceof y.LiteralArray?"LiteralArray":r instanceof y.LiteralMap?"LiteralMap":r instanceof y.LiteralPrimitive?"LiteralPrimitive":r instanceof y.MethodCall?"MethodCall":r instanceof y.NonNullAssert?"NonNullAssert":r instanceof y.PrefixNot?"PrefixNot":r instanceof y.PropertyRead?"PropertyRead":r instanceof y.PropertyWrite?"PropertyWrite":r instanceof y.Quote?"Quote":r instanceof y.SafeMethodCall?"SafeMethodCall":r instanceof y.SafePropertyRead?"SafePropertyRead":r.type}S.getNgType=pr;function Jt({start:r,end:e},t){let s=r,n=e;for(;n!==s&&/\s/.test(t[n-1]);)n--;for(;s!==n&&/\s/.test(t[s]);)s++;return{start:s,end:n}}function ur({start:r,end:e},t){let s=r,n=e;for(;n!==t.length&&/\s/.test(t[n]);)n++;for(;s!==0&&/\s/.test(t[s-1]);)s--;return{start:s,end:n}}function lr(r,e){return e[r.start-1]==="("&&e[r.end]===")"?{start:r.start-1,end:r.end+1}:r}function dr(r,e,t){let s=0,n={start:r.start,end:r.end};for(;;){let i=ur(n,e),a=lr(i,e);if(i.start===a.start&&i.end===a.end)break;n.start=a.start,n.end=a.end,s++}return{hasParens:(t?s-1:s)!==0,outerSpan:Jt(t?{start:n.start+1,end:n.end-1}:n,e),innerSpan:Jt(r,e)}}S.fitSpans=dr;function xr(r,e,t){let s=e;for(;!r.test(t[s]);)if(--s<0)throw new Error(`Cannot find front char ${r} from index ${e} in ${JSON.stringify(t)}`);return s}S.findFrontChar=xr;function fr(r,e,t){let s=e;for(;!r.test(t[s]);)if(++s>=t.length)throw new Error(`Cannot find back char ${r} from index ${e} in ${JSON.stringify(t)}`);return s}S.findBackChar=fr;function vr(r){return r.slice(0,1).toLowerCase()+r.slice(1)}S.toLowerCamelCase=vr;function gr(r){return r.length===0?void 0:r[r.length-1]}S.getLast=gr});var $t=le(D=>{"use strict";m();Object.defineProperty(D,"__esModule",{value:!0});D.transformSpan=D.transform=void 0;var Re=He(),mr=(r,e,t=!1)=>{let s=Re.getNgType(r);switch(s){case"Unary":{let{operator:c,expr:o}=r,u=n(o);return a("UnaryExpression",{prefix:!0,argument:u,operator:c},r.span,{hasParentParens:t})}case"Binary":{let{left:c,operation:o,right:u}=r,p=u.span.start===u.span.end,d=c.span.start===c.span.end;if(p||d){let $=c.span.start===c.span.end?n(u):n(c);return a("UnaryExpression",{prefix:!0,argument:$,operator:p?"+":"-"},{start:r.span.start,end:C($)},{hasParentParens:t})}let g=n(c),l=n(u);return a(o==="&&"||o==="||"?"LogicalExpression":"BinaryExpression",{left:g,right:l,operator:o},{start:w(g),end:C(l)},{hasParentParens:t})}case"BindingPipe":{let{exp:c,name:o,args:u}=r,p=n(c),d=v(/\S/,v(/\|/,C(p))+1),g=a("Identifier",{name:o},{start:d,end:d+o.length}),l=u.map(n);return a("NGPipeExpression",{left:p,right:g,arguments:l},{start:w(p),end:C(l.length===0?g:Re.getLast(l))},{hasParentParens:t})}case"Chain":{let{expressions:c}=r;return a("NGChainedExpression",{expressions:c.map(n)},r.span,{hasParentParens:t})}case"Comment":{let{value:c}=r;return a("CommentLine",{value:c},r.span,{processSpan:!1})}case"Conditional":{let{condition:c,trueExp:o,falseExp:u}=r,p=n(c),d=n(o),g=n(u);return a("ConditionalExpression",{test:p,consequent:d,alternate:g},{start:w(p),end:C(g)},{hasParentParens:t})}case"EmptyExpr":return a("NGEmptyExpression",{},r.span,{hasParentParens:t});case"FunctionCall":{let{target:c,args:o}=r,u=o.length===1?[i(o[0])]:o.map(n),p=n(c);return a("CallExpression",{callee:p,arguments:u},{start:w(p),end:r.span.end},{hasParentParens:t})}case"ImplicitReceiver":return a("ThisExpression",{},r.span,{hasParentParens:t});case"KeyedRead":{let{key:c}=r,o=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,u=n(c);return h(o,u,{computed:!0,optional:!1},{end:r.span.end,hasParentParens:t})}case"LiteralArray":{let{expressions:c}=r;return a("ArrayExpression",{elements:c.map(n)},r.span,{hasParentParens:t})}case"LiteralMap":{let{keys:c,values:o}=r,u=o.map(d=>n(d)),p=c.map(({key:d,quoted:g},l)=>{let $=u[l],Se=v(/\S/,l===0?r.span.start+1:v(/,/,C(u[l-1]))+1),as=x(/\S/,x(/:/,w($)-1)-1)+1,kt={start:Se,end:as},_e=g?a("StringLiteral",{value:d},kt):a("Identifier",{name:d},kt),os=_e.end<_e.start;return a("ObjectProperty",{key:_e,value:$,method:!1,shorthand:os,computed:!1},{start:w(_e),end:C($)})});return a("ObjectExpression",{properties:p},r.span,{hasParentParens:t})}case"LiteralPrimitive":{let{value:c}=r;switch(typeof c){case"boolean":return a("BooleanLiteral",{value:c},r.span,{hasParentParens:t});case"number":return a("NumericLiteral",{value:c},r.span,{hasParentParens:t});case"object":return a("NullLiteral",{},r.span,{hasParentParens:t});case"string":return a("StringLiteral",{value:c},r.span,{hasParentParens:t});case"undefined":return a("Identifier",{name:"undefined"},r.span,{hasParentParens:t});default:throw new Error(`Unexpected LiteralPrimitive value type ${typeof c}`)}}case"MethodCall":case"SafeMethodCall":{let c=s==="SafeMethodCall",{receiver:o,name:u,args:p}=r,d=p.length===1?[i(p[0])]:p.map(n),g=x(/\S/,x(/\(/,(d.length===0?x(/\)/,r.span.end-1):w(d[0]))-1)-1)+1,l=a("Identifier",{name:u},{start:g-u.length,end:g}),$=h(o,l,{computed:!1,optional:c}),Se=N($);return a(c||Se?"OptionalCallExpression":"CallExpression",{callee:$,arguments:d},{start:w($),end:r.span.end},{hasParentParens:t})}case"NonNullAssert":{let{expression:c}=r,o=n(c);return a("TSNonNullExpression",{expression:o},{start:w(o),end:r.span.end},{hasParentParens:t})}case"PrefixNot":{let{expression:c}=r,o=n(c);return a("UnaryExpression",{prefix:!0,operator:"!",argument:o},{start:r.span.start,end:C(o)},{hasParentParens:t})}case"PropertyRead":case"SafePropertyRead":{let c=s==="SafePropertyRead",{receiver:o,name:u}=r,p=x(/\S/,r.span.end-1)+1,d=a("Identifier",{name:u},{start:p-u.length,end:p},A(o)?{hasParentParens:t}:{});return h(o,d,{computed:!1,optional:c},{hasParentParens:t})}case"KeyedWrite":{let{key:c,value:o}=r,u=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,p=n(c),d=n(o),g=h(u,p,{computed:!0,optional:!1},{end:v(/\]/,C(p))+1});return a("AssignmentExpression",{left:g,operator:"=",right:d},{start:w(g),end:C(d)},{hasParentParens:t})}case"PropertyWrite":{let{receiver:c,name:o,value:u}=r,p=n(u),d=x(/\S/,x(/=/,w(p)-1)-1)+1,g=a("Identifier",{name:o},{start:d-o.length,end:d}),l=h(c,g,{computed:!1,optional:!1});return a("AssignmentExpression",{left:l,operator:"=",right:p},{start:w(l),end:C(p)},{hasParentParens:t})}case"Quote":{let{prefix:c,uninterpretedExpression:o}=r;return a("NGQuotedExpression",{prefix:c,value:o},r.span,{hasParentParens:t})}default:throw new Error(`Unexpected node ${s}`)}function n(c){return D.transform(c,e)}function i(c){return D.transform(c,e,!0)}function a(c,o,u,{processSpan:p=!0,hasParentParens:d=!1}={}){let g=Object.assign(Object.assign({type:c},ts(u,e,p,d)),o);switch(c){case"Identifier":{let l=g;l.loc.identifierName=l.name;break}case"NumericLiteral":{let l=g;l.extra=Object.assign(Object.assign({},l.extra),{raw:e.text.slice(l.start,l.end),rawValue:l.value});break}case"StringLiteral":{let l=g;l.extra=Object.assign(Object.assign({},l.extra),{raw:e.text.slice(l.start,l.end),rawValue:l.value});break}}return g}function h(c,o,u,{end:p=C(o),hasParentParens:d=!1}={}){if(A(c)||c.span.start===o.start)return o;let g=n(c),l=N(g);return a(u.optional||l?"OptionalMemberExpression":"MemberExpression",Object.assign({object:g,property:o,computed:u.computed},u.optional?{optional:!0}:l?{optional:!1}:null),{start:w(g),end:p},{hasParentParens:d})}function x(c,o){return Re.findFrontChar(c,o,e.text)}function v(c,o){return Re.findBackChar(c,o,e.text)}function A(c){return c.span.start>=c.span.end||/^\s+$/.test(e.text.slice(c.span.start,c.span.end))}function N(c){return(c.type==="OptionalCallExpression"||c.type==="OptionalMemberExpression")&&!O(c)}function O(c){return c.extra&&c.extra.parenthesized}function w(c){return O(c)?c.extra.parenStart:c.start}function C(c){return O(c)?c.extra.parenEnd:c.end}};D.transform=mr;function ts(r,e,t=!1,s=!1){if(!t){let{start:h,end:x}=r;return{start:h,end:x,loc:{start:e.locator.locationForIndex(h),end:e.locator.locationForIndex(x)}}}let{outerSpan:n,innerSpan:i,hasParens:a}=Re.fitSpans(r,e.text,s);return Object.assign({start:i.start,end:i.end,loc:{start:e.locator.locationForIndex(i.start),end:e.locator.locationForIndex(i.end)}},a&&{extra:{parenthesized:!0,parenStart:n.start,parenEnd:n.end}})}D.transformSpan=ts});var rs=le(ze=>{"use strict";m();Object.defineProperty(ze,"__esModule",{value:!0});ze.transformTemplateBindings=void 0;var ss=(Me(),we(ot)),Ot=$t(),Nt=He();function Sr(r,e){r.forEach(w);let[t]=r,{key:s}=t,n=e.text.slice(t.sourceSpan.start,t.sourceSpan.end).trim().length===0?r.slice(1):r,i=[],a=null;for(let o=0;o<n.length;o++){let u=n[o];if(a&&N(a)&&O(u)&&u.value&&u.value.source===a.key.source){let p=v("NGMicrosyntaxKey",{name:u.key.source},u.key.span),d=($,Se)=>Object.assign(Object.assign({},$),Ot.transformSpan({start:$.start,end:Se},e)),g=$=>Object.assign(Object.assign({},d($,p.end)),{alias:p}),l=i.pop();if(l.type==="NGMicrosyntaxExpression")i.push(g(l));else if(l.type==="NGMicrosyntaxKeyedExpression"){let $=g(l.expression);i.push(d(Object.assign(Object.assign({},l),{expression:$}),$.end))}else throw new Error(`Unexpected type ${l.type}`)}else i.push(h(u,o));a=u}return v("NGMicrosyntax",{body:i},i.length===0?r[0].sourceSpan:{start:i[0].start,end:i[i.length-1].end});function h(o,u){if(N(o)){let{key:p,value:d}=o;return d?u===0?v("NGMicrosyntaxExpression",{expression:x(d.ast),alias:null},d.sourceSpan):v("NGMicrosyntaxKeyedExpression",{key:v("NGMicrosyntaxKey",{name:A(p.source)},p.span),expression:v("NGMicrosyntaxExpression",{expression:x(d.ast),alias:null},d.sourceSpan)},{start:p.span.start,end:d.sourceSpan.end}):v("NGMicrosyntaxKey",{name:A(p.source)},p.span)}else{let{key:p,sourceSpan:d}=o;if(/^let\s$/.test(e.text.slice(d.start,d.start+4))){let{value:l}=o;return v("NGMicrosyntaxLet",{key:v("NGMicrosyntaxKey",{name:p.source},p.span),value:l?v("NGMicrosyntaxKey",{name:l.source},l.span):null},{start:d.start,end:l?l.span.end:p.span.end})}else{let l=c(o);return v("NGMicrosyntaxAs",{key:v("NGMicrosyntaxKey",{name:l.source},l.span),alias:v("NGMicrosyntaxKey",{name:p.source},p.span)},{start:l.span.start,end:p.span.end})}}}function x(o){return Ot.transform(o,e)}function v(o,u,p,d=!0){return Object.assign(Object.assign({type:o},Ot.transformSpan(p,e,d)),u)}function A(o){return Nt.toLowerCamelCase(o.slice(s.source.length))}function N(o){return o instanceof ss.ExpressionBinding}function O(o){return o instanceof ss.VariableBinding}function w(o){C(o.key.span),O(o)&&o.value&&C(o.value.span)}function C(o){if(e.text[o.start]!=='"'&&e.text[o.start]!=="'")return;let u=e.text[o.start],p=!1;for(let d=o.start+1;d<e.text.length;d++)switch(e.text[d]){case u:if(!p){o.end=d+1;return}default:p=!1;break;case"\\":p=!p;break}}function c(o){if(!o.value||o.value.source!==Nt.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX)return o.value;let u=Nt.findBackChar(/\S/,o.sourceSpan.start,e.text);return{source:"$implicit",span:{start:u,end:u}}}}ze.transformTemplateBindings=Sr});var is=le(b=>{"use strict";m();Object.defineProperty(b,"__esModule",{value:!0});b.parseTemplateBindings=b.parseAction=b.parseInterpolation=b.parseSimpleBinding=b.parseBinding=void 0;var ns=Bt(),wr=$t(),yr=rs(),Le=He();function Xe(r,e){let{ast:t,comments:s}=e(r),n=new ns.Context(r),i=h=>wr.transform(h,n),a=i(t);return a.comments=s.map(i),a}function Er(r){return Xe(r,Le.parseNgBinding)}b.parseBinding=Er;function Ar(r){return Xe(r,Le.parseNgSimpleBinding)}b.parseSimpleBinding=Ar;function Cr(r){return Xe(r,Le.parseNgInterpolation)}b.parseInterpolation=Cr;function $r(r){return Xe(r,Le.parseNgAction)}b.parseAction=$r;function Or(r){return yr.transformTemplateBindings(Le.parseNgTemplateBindings(r),new ns.Context(r))}b.parseTemplateBindings=Or});var Pr={};Be(Pr,{default:()=>kr});m();m();m();function xs(r){return Array.isArray(r)&&r.length>0}var It=xs;function Je(r,e){let{ignoreDecorators:t}=e||{};if(!t){let s=r.declaration&&r.declaration.decorators||r.decorators;if(It(s))return Je(s[0])}return r.range?r.range[0]:r.start}function Rt(r){return r.range?r.range[1]:r.end}function Ze(r){return{astFormat:"estree",parse:async(t,s)=>{let n=await Promise.resolve().then(()=>ds(is(),1)),i=r(t,n);return{type:"NGRoot",node:s.parser==="__ng_action"&&i.type!=="NGChainedExpression"?{...i,type:"NGChainedExpression",expressions:[i]}:i}},locStart:Je,locEnd:Rt}}var Nr={parsers:{__ng_action:Ze((r,e)=>e.parseAction(r)),__ng_binding:Ze((r,e)=>e.parseBinding(r)),__ng_interpolation:Ze((r,e)=>e.parseInterpolation(r)),__ng_directive:Ze((r,e)=>e.parseTemplateBindings(r))}},kr=Nr;return we(Pr);});
|
|
1
|
+
(function(e){function n(i){var l=i();return l.default}if(typeof exports=="object"&&typeof module=="object")module.exports=n(e);else if(typeof define=="function"&&define.amd)define(function(){return n(e)});else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.angular=n(e)}})(function(){"use strict";var ye=Object.defineProperty;var Zt=Object.getOwnPropertyDescriptor;var Jt=Object.getOwnPropertyNames;var Yt=Object.prototype.hasOwnProperty;var er=(r,e,t)=>e in r?ye(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var $=(r,e)=>()=>(r&&(e=r(r=0)),e);var ct=(r,e)=>{for(var t in e)ye(r,t,{get:e[t],enumerable:!0})},tr=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Jt(e))!Yt.call(r,n)&&n!==t&&ye(r,n,{get:()=>e[n],enumerable:!(s=Zt(e,n))||s.enumerable});return r};var rr=r=>tr(ye({},"__esModule",{value:!0}),r);var Ee=(r,e,t)=>(er(r,typeof e!="symbol"?e+"":e,t),t);var g=$(()=>{});var Ae,ut,lt,xt=$(()=>{g();Ae=`
|
|
2
|
+
`,ut="\r",lt=function(){function r(e){this.length=e.length;for(var t=[0],s=0;s<e.length;)switch(e[s]){case Ae:s+=Ae.length,t.push(s);break;case ut:s+=ut.length,e[s]===Ae&&(s+=Ae.length),t.push(s);break;default:s++;break}this.offsets=t}return r.prototype.locationForIndex=function(e){if(e<0||e>this.length)return null;for(var t=0,s=this.offsets;s[t+1]<=e;)t++;var n=e-s[t];return{line:t,column:n}},r.prototype.indexForLocation=function(e){var t=e.line,s=e.column;return t<0||t>=this.offsets.length||s<0||s>this.lengthOfLine(t)?null:this.offsets[t]+s},r.prototype.lengthOfLine=function(e){var t=this.offsets[e],s=e===this.offsets.length-1?this.length:this.offsets[e+1];return s-t},r}()});var xe,De,ft=$(()=>{g();xt();xe=class{constructor(e){Ee(this,"text");Ee(this,"locator");this.text=e,this.locator=new De(this.text)}},De=class{constructor(e){Ee(this,"_linesAndColumns");this._linesAndColumns=new lt(e)}locationForIndex(e){let{line:t,column:s}=this._linesAndColumns.locationForIndex(e);return{line:t+1,column:s,index:e}}}});var W,K,w,Q,C,T,$e,j,H,M,z,q,X,Ce,Z,J,O,Y,ee,Oe,N,L,te,re,se,ne,b,B,F,ie,Ne,dt,Ge=$(()=>{g();W=class{constructor(e,t,s,n){this.input=t,this.errLocation=s,this.ctxLocation=n,this.message=`Parser Error: ${e} ${s} [${t}] in ${n}`}},K=class{constructor(e,t){this.start=e,this.end=t}toAbsolute(e){return new b(e+this.start,e+this.end)}},w=class{constructor(e,t){this.span=e,this.sourceSpan=t}toString(){return"AST"}},Q=class extends w{constructor(e,t,s){super(e,t),this.nameSpan=s}},C=class extends w{visit(e,t=null){}},T=class extends w{visit(e,t=null){return e.visitImplicitReceiver(this,t)}},$e=class extends T{visit(e,t=null){var s;return(s=e.visitThisReceiver)==null?void 0:s.call(e,this,t)}},j=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitChain(this,t)}},H=class extends w{constructor(e,t,s,n,i){super(e,t),this.condition=s,this.trueExp=n,this.falseExp=i}visit(e,t=null){return e.visitConditional(this,t)}},M=class extends Q{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitPropertyRead(this,t)}},z=class extends Q{constructor(e,t,s,n,i,a){super(e,t,s),this.receiver=n,this.name=i,this.value=a}visit(e,t=null){return e.visitPropertyWrite(this,t)}},q=class extends Q{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitSafePropertyRead(this,t)}},X=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitKeyedRead(this,t)}},Ce=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitSafeKeyedRead(this,t)}},Z=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.key=n,this.value=i}visit(e,t=null){return e.visitKeyedWrite(this,t)}},J=class extends Q{constructor(e,t,s,n,i,a){super(e,t,a),this.exp=s,this.name=n,this.args=i}visit(e,t=null){return e.visitPipe(this,t)}},O=class extends w{constructor(e,t,s){super(e,t),this.value=s}visit(e,t=null){return e.visitLiteralPrimitive(this,t)}},Y=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitLiteralArray(this,t)}},ee=class extends w{constructor(e,t,s,n){super(e,t),this.keys=s,this.values=n}visit(e,t=null){return e.visitLiteralMap(this,t)}},Oe=class extends w{constructor(e,t,s,n){super(e,t),this.strings=s,this.expressions=n}visit(e,t=null){return e.visitInterpolation(this,t)}},N=class extends w{constructor(e,t,s,n,i){super(e,t),this.operation=s,this.left=n,this.right=i}visit(e,t=null){return e.visitBinary(this,t)}},L=class extends N{constructor(e,t,s,n,i,a,h){super(e,t,i,a,h),this.operator=s,this.expr=n,this.left=null,this.right=null,this.operation=null}static createMinus(e,t,s){return new L(e,t,"-",s,"-",new O(e,t,0),s)}static createPlus(e,t,s){return new L(e,t,"+",s,"-",s,new O(e,t,0))}visit(e,t=null){return e.visitUnary!==void 0?e.visitUnary(this,t):e.visitBinary(this,t)}},te=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitPrefixNot(this,t)}},re=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitNonNullAssert(this,t)}},se=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitCall(this,t)}},ne=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitSafeCall(this,t)}},b=class{constructor(e,t){this.start=e,this.end=t}},B=class extends w{constructor(e,t,s,n,i){super(new K(0,t===null?0:t.length),new b(n,t===null?n:n+t.length)),this.ast=e,this.source=t,this.location=s,this.errors=i}visit(e,t=null){return e.visitASTWithSource?e.visitASTWithSource(this,t):this.ast.visit(e,t)}toString(){return`${this.source} in ${this.location}`}},F=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},ie=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},Ne=class{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.receiver,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitPrefixNot(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitSafeCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitAll(e,t){for(let s of e)this.visit(s,t)}};(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.LITERAL_ATTR=1]="LITERAL_ATTR",r[r.ANIMATION=2]="ANIMATION"})(dt||(dt={}))});function vt(r){return r>=9&&r<=32||r==160}function _(r){return 48<=r&&r<=57}function gt(r){return r>=97&&r<=122||r>=65&&r<=90}function Ve(r){return r===39||r===34||r===96}var We=$(()=>{g();});function Et(r,e,t){return new P(r,e,v.Character,t,String.fromCharCode(t))}function Br(r,e,t){return new P(r,e,v.Identifier,0,t)}function Kr(r,e,t){return new P(r,e,v.PrivateIdentifier,0,t)}function Tr(r,e,t){return new P(r,e,v.Keyword,0,t)}function je(r,e,t){return new P(r,e,v.Operator,0,t)}function _r(r,e,t){return new P(r,e,v.String,0,t)}function Mr(r,e,t){return new P(r,e,v.Number,t,"")}function Fr(r,e,t){return new P(r,e,v.Error,0,t)}function At(r){return 97<=r&&r<=122||65<=r&&r<=90||r==95||r==36}function $t(r){return gt(r)||_(r)||r==95||r==36}function Ur(r){return r==101||r==69}function Dr(r){return r==45||r==43}function Gr(r){switch(r){case 110:return 10;case 102:return 12;case 114:return 13;case 116:return 9;case 118:return 11;default:return r}}function Vr(r){let e=parseInt(r);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+r);return e}var v,br,fe,P,Re,He,qe=$(()=>{g();We();(function(r){r[r.Character=0]="Character",r[r.Identifier=1]="Identifier",r[r.PrivateIdentifier=2]="PrivateIdentifier",r[r.Keyword=3]="Keyword",r[r.String=4]="String",r[r.Operator=5]="Operator",r[r.Number=6]="Number",r[r.Error=7]="Error"})(v||(v={}));br=["var","let","as","null","undefined","true","false","if","else","this"],fe=class{tokenize(e){let t=new He(e),s=[],n=t.scanToken();for(;n!=null;)s.push(n),n=t.scanToken();return s}},P=class{constructor(e,t,s,n,i){this.index=e,this.end=t,this.type=s,this.numValue=n,this.strValue=i}isCharacter(e){return this.type==v.Character&&this.numValue==e}isNumber(){return this.type==v.Number}isString(){return this.type==v.String}isOperator(e){return this.type==v.Operator&&this.strValue==e}isIdentifier(){return this.type==v.Identifier}isPrivateIdentifier(){return this.type==v.PrivateIdentifier}isKeyword(){return this.type==v.Keyword}isKeywordLet(){return this.type==v.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==v.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==v.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==v.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==v.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==v.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==v.Keyword&&this.strValue=="this"}isError(){return this.type==v.Error}toNumber(){return this.type==v.Number?this.numValue:-1}toString(){switch(this.type){case v.Character:case v.Identifier:case v.Keyword:case v.Operator:case v.PrivateIdentifier:case v.String:case v.Error:return this.strValue;case v.Number:return this.numValue.toString();default:return null}}};Re=new P(-1,-1,v.Character,0,""),He=class{constructor(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?0:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,t=this.length,s=this.peek,n=this.index;for(;s<=32;)if(++n>=t){s=0;break}else s=e.charCodeAt(n);if(this.peek=s,this.index=n,n>=t)return null;if(At(s))return this.scanIdentifier();if(_(s))return this.scanNumber(n);let i=n;switch(s){case 46:return this.advance(),_(this.peek)?this.scanNumber(i):Et(i,this.index,46);case 40:case 41:case 123:case 125:case 91:case 93:case 44:case 58:case 59:return this.scanCharacter(i,s);case 39:case 34:return this.scanString();case 35:return this.scanPrivateIdentifier();case 43:case 45:case 42:case 47:case 37:case 94:return this.scanOperator(i,String.fromCharCode(s));case 63:return this.scanQuestion(i);case 60:case 62:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=");case 33:case 61:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=",61,"=");case 38:return this.scanComplexOperator(i,"&",38,"&");case 124:return this.scanComplexOperator(i,"|",124,"|");case 160:for(;vt(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,t){return this.advance(),Et(e,this.index,t)}scanOperator(e,t){return this.advance(),je(e,this.index,t)}scanComplexOperator(e,t,s,n,i,a){this.advance();let h=t;return this.peek==s&&(this.advance(),h+=n),i!=null&&this.peek==i&&(this.advance(),h+=a),je(e,this.index,h)}scanIdentifier(){let e=this.index;for(this.advance();$t(this.peek);)this.advance();let t=this.input.substring(e,this.index);return br.indexOf(t)>-1?Tr(e,this.index,t):Br(e,this.index,t)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!At(this.peek))return this.error("Invalid character [#]",-1);for(;$t(this.peek);)this.advance();let t=this.input.substring(e,this.index);return Kr(e,this.index,t)}scanNumber(e){let t=this.index===e,s=!1;for(this.advance();;){if(!_(this.peek))if(this.peek===95){if(!_(this.input.charCodeAt(this.index-1))||!_(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===46)t=!1;else if(Ur(this.peek)){if(this.advance(),Dr(this.peek)&&this.advance(),!_(this.peek))return this.error("Invalid exponent",-1);t=!1}else break;this.advance()}let n=this.input.substring(e,this.index);s&&(n=n.replace(/_/g,""));let i=t?Vr(n):parseFloat(n);return Mr(e,this.index,i)}scanString(){let e=this.index,t=this.peek;this.advance();let s="",n=this.index,i=this.input;for(;this.peek!=t;)if(this.peek==92){s+=i.substring(n,this.index),this.advance();let h;if(this.peek=this.peek,this.peek==117){let d=i.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(d))h=parseInt(d,16);else return this.error(`Invalid unicode escape [\\u${d}]`,0);for(let f=0;f<5;f++)this.advance()}else h=Gr(this.peek),this.advance();s+=String.fromCharCode(h),n=this.index}else{if(this.peek==0)return this.error("Unterminated quote",0);this.advance()}let a=i.substring(n,this.index);return this.advance(),_r(e,this.index,s+a)}scanQuestion(e){this.advance();let t="?";return(this.peek===63||this.peek===46)&&(t+=this.peek===46?".":"?",this.advance()),je(e,this.index,t)}error(e,t){let s=this.index+t;return Fr(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}}});function kt(r,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${r}' to be an array, [start, end].`);if(e!=null){let t=e[0],s=e[1];Wr.forEach(n=>{if(n.test(t)||n.test(s))throw new Error(`['${t}', '${s}'] contains unusable interpolation symbol.`)})}}var Wr,It=$(()=>{g();Wr=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//]});var me,G,Pt=$(()=>{g();It();me=class{constructor(e,t){this.start=e,this.end=t}static fromArray(e){return e?(kt("interpolation",e),new me(e[0],e[1])):G}},G=new me("{{","}}")});function Qr(r){let e=new Map,t=0,s=0,n=0;for(;n<r.length;){let i=r[n];if(i.type===9){let[a,h]=i.parts;t+=h.length,s+=a.length}else{let a=i.parts.reduce((h,d)=>h+d.length,0);s+=a,t+=a}e.set(s,t),n++}return e}var Xe,Ze,Se,pe,V,Je,Rt=$(()=>{g();We();Pt();Ge();qe();Xe=class{constructor(e,t,s){this.strings=e,this.expressions=t,this.offsets=s}},Ze=class{constructor(e,t,s){this.templateBindings=e,this.warnings=t,this.errors=s}},Se=class{constructor(e){this._lexer=e,this.errors=[]}parseAction(e,t,s,n,i=G){this._checkNoInterpolation(e,s,i);let a=this._stripComments(e),h=this._lexer.tokenize(a),d=1;t&&(d|=2);let f=new V(e,s,n,h,d,this.errors,0).parseChain();return new B(f,e,s,n,this.errors)}parseBinding(e,t,s,n=G){let i=this._parseBindingAst(e,t,s,n);return new B(i,e,t,s,this.errors)}checkSimpleExpression(e){let t=new Je;return e.visit(t),t.errors}parseSimpleBinding(e,t,s,n=G){let i=this._parseBindingAst(e,t,s,n),a=this.checkSimpleExpression(i);return a.length>0&&this._reportError(`Host binding expression cannot contain ${a.join(" ")}`,e,t),new B(i,e,t,s,this.errors)}_reportError(e,t,s,n){this.errors.push(new W(e,t,s,n))}_parseBindingAst(e,t,s,n){this._checkNoInterpolation(e,t,n);let i=this._stripComments(e),a=this._lexer.tokenize(i);return new V(e,t,s,a,0,this.errors,0).parseChain()}parseTemplateBindings(e,t,s,n,i){let a=this._lexer.tokenize(t);return new V(t,s,i,a,0,this.errors,0).parseTemplateBindings({source:e,span:new b(n,n+e.length)})}parseInterpolation(e,t,s,n,i=G){let{strings:a,expressions:h,offsets:d}=this.splitInterpolation(e,t,n,i);if(h.length===0)return null;let f=[];for(let S=0;S<h.length;++S){let R=h[S].text,k=this._stripComments(R),E=this._lexer.tokenize(k),y=new V(e,t,s,E,0,this.errors,d[S]).parseChain();f.push(y)}return this.createInterpolationAst(a.map(S=>S.text),f,e,t,s)}parseInterpolationExpression(e,t,s){let n=this._stripComments(e),i=this._lexer.tokenize(n),a=new V(e,t,s,i,0,this.errors,0).parseChain(),h=["",""];return this.createInterpolationAst(h,[a],e,t,s)}createInterpolationAst(e,t,s,n,i){let a=new K(0,s.length),h=new Oe(a,a.toAbsolute(i),e,t);return new B(h,s,n,i,this.errors)}splitInterpolation(e,t,s,n=G){var y;let i=[],a=[],h=[],d=s?Qr(s):null,f=0,S=!1,R=!1,{start:k,end:E}=n;for(;f<e.length;)if(S){let o=f,c=o+k.length,x=this._getInterpolationEndIndex(e,E,c);if(x===-1){S=!1,R=!0;break}let u=x+E.length,l=e.substring(c,x);l.trim().length===0&&this._reportError("Blank expressions are not allowed in interpolated strings",e,`at column ${f} in`,t),a.push({text:l,start:o,end:u});let p=((y=d==null?void 0:d.get(o))!=null?y:o)+k.length;h.push(p),f=u,S=!1}else{let o=f;f=e.indexOf(k,f),f===-1&&(f=e.length);let c=e.substring(o,f);i.push({text:c,start:o,end:f}),S=!0}if(!S)if(R){let o=i[i.length-1];o.text+=e.substring(f),o.end=e.length}else i.push({text:e.substring(f),start:f,end:e.length});return new Xe(i,a,h)}wrapLiteralPrimitive(e,t,s){let n=new K(0,e==null?0:e.length);return new B(new O(n,n.toAbsolute(s),e),e,t,s,this.errors)}_stripComments(e){let t=this._commentStart(e);return t!=null?e.substring(0,t):e}_commentStart(e){let t=null;for(let s=0;s<e.length-1;s++){let n=e.charCodeAt(s),i=e.charCodeAt(s+1);if(n===47&&i==47&&t==null)return s;t===n?t=null:t==null&&Ve(n)&&(t=n)}return null}_checkNoInterpolation(e,t,{start:s,end:n}){let i=-1,a=-1;for(let h of this._forEachUnquotedChar(e,0))if(i===-1)e.startsWith(s)&&(i=h);else if(a=this._getInterpolationEndIndex(e,n,h),a>-1)break;i>-1&&a>-1&&this._reportError(`Got interpolation (${s}${n}) where expression was expected`,e,`at column ${i} in`,t)}_getInterpolationEndIndex(e,t,s){for(let n of this._forEachUnquotedChar(e,s)){if(e.startsWith(t,n))return n;if(e.startsWith("//",n))return e.indexOf(t,n)}return-1}*_forEachUnquotedChar(e,t){let s=null,n=0;for(let i=t;i<e.length;i++){let a=e[i];Ve(e.charCodeAt(i))&&(s===null||s===a)&&n%2===0?s=s===null?a:null:s===null&&(yield i),n=a==="\\"?n+1:0}}};(function(r){r[r.None=0]="None",r[r.Writable=1]="Writable"})(pe||(pe={}));V=class{constructor(e,t,s,n,i,a,h){this.input=e,this.location=t,this.absoluteOffset=s,this.tokens=n,this.parseFlags=i,this.errors=a,this.offset=h,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.context=pe.None,this.sourceSpanCache=new Map,this.index=0}peek(e){let t=this.index+e;return t<this.tokens.length?this.tokens[t]:Re}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let s=this.currentEndIndex;if(t!==void 0&&t>this.currentEndIndex&&(s=t),e>s){let n=s;s=e,e=n}return new K(e,s)}sourceSpan(e,t){let s=`${e}@${this.inputIndex}:${t}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,t){this.context|=e;let s=t();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===Re?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],t=this.inputIndex;for(;this.index<this.tokens.length;){let s=this.parsePipe();if(e.push(s),this.consumeOptionalCharacter(59))for(this.parseFlags&1||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(59););else if(this.index<this.tokens.length){let n=this.index;if(this.error(`Unexpected token '${this.next}'`),this.index===n)break}}if(e.length===0){let s=this.offset,n=this.offset+this.input.length;return new C(this.span(s,n),this.sourceSpan(s,n))}return e.length==1?e[0]:new j(this.span(t),this.sourceSpan(t),e)}parsePipe(){let e=this.inputIndex,t=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseFlags&1&&this.error("Cannot have a pipe in an action expression");do{let s=this.inputIndex,n=this.expectIdentifierOrKeyword(),i,a;n!==null?i=this.sourceSpan(s):(n="",a=this.next.index!==-1?this.next.index:this.input.length+this.offset,i=new K(a,a).toAbsolute(this.absoluteOffset));let h=[];for(;this.consumeOptionalCharacter(58);)h.push(this.parseExpression());t=new J(this.span(e),this.sourceSpan(e,a),t,n,h,i)}while(this.consumeOptionalOperator("|"))}return t}parseExpression(){return this.parseConditional()}parseConditional(){let e=this.inputIndex,t=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){let s=this.parsePipe(),n;if(this.consumeOptionalCharacter(58))n=this.parsePipe();else{let i=this.inputIndex,a=this.input.substring(e,i);this.error(`Conditional expression ${a} requires all 3 expressions`),n=new C(this.span(e),this.sourceSpan(e))}return new H(this.span(e),this.sourceSpan(e),t,s,n)}else return t}parseLogicalOr(){let e=this.inputIndex,t=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){let s=this.parseLogicalAnd();t=new N(this.span(e),this.sourceSpan(e),"||",t,s)}return t}parseLogicalAnd(){let e=this.inputIndex,t=this.parseNullishCoalescing();for(;this.consumeOptionalOperator("&&");){let s=this.parseNullishCoalescing();t=new N(this.span(e),this.sourceSpan(e),"&&",t,s)}return t}parseNullishCoalescing(){let e=this.inputIndex,t=this.parseEquality();for(;this.consumeOptionalOperator("??");){let s=this.parseEquality();t=new N(this.span(e),this.sourceSpan(e),"??",t,s)}return t}parseEquality(){let e=this.inputIndex,t=this.parseRelational();for(;this.next.type==v.Operator;){let s=this.next.strValue;switch(s){case"==":case"===":case"!=":case"!==":this.advance();let n=this.parseRelational();t=new N(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseRelational(){let e=this.inputIndex,t=this.parseAdditive();for(;this.next.type==v.Operator;){let s=this.next.strValue;switch(s){case"<":case">":case"<=":case">=":this.advance();let n=this.parseAdditive();t=new N(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseAdditive(){let e=this.inputIndex,t=this.parseMultiplicative();for(;this.next.type==v.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let n=this.parseMultiplicative();t=new N(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseMultiplicative(){let e=this.inputIndex,t=this.parsePrefix();for(;this.next.type==v.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let n=this.parsePrefix();t=new N(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parsePrefix(){if(this.next.type==v.Operator){let e=this.inputIndex,t=this.next.strValue,s;switch(t){case"+":return this.advance(),s=this.parsePrefix(),L.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),L.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new te(this.span(e),this.sourceSpan(e),s)}}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(46))t=this.parseAccessMember(t,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(40)?t=this.parseCall(t,e,!0):t=this.consumeOptionalCharacter(91)?this.parseKeyedReadOrWrite(t,e,!0):this.parseAccessMember(t,e,!0);else if(this.consumeOptionalCharacter(91))t=this.parseKeyedReadOrWrite(t,e,!1);else if(this.consumeOptionalCharacter(40))t=this.parseCall(t,e,!1);else if(this.consumeOptionalOperator("!"))t=new re(this.span(e),this.sourceSpan(e),t);else return t}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;let t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),t}else{if(this.next.isKeywordNull())return this.advance(),new O(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new O(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new O(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new O(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new $e(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;let t=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new Y(this.span(e),this.sourceSpan(e),t)}else{if(this.next.isCharacter(123))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new T(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let t=this.next.toNumber();return this.advance(),new O(this.span(e),this.sourceSpan(e),t)}else if(this.next.isString()){let t=this.next.toString();return this.advance(),new O(this.span(e),this.sourceSpan(e),t)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new C(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new C(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new C(this.span(e),this.sourceSpan(e)))}}}parseExpressionList(e){let t=[];do if(!this.next.isCharacter(e))t.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(44));return t}parseLiteralMap(){let e=[],t=[],s=this.inputIndex;if(this.expectCharacter(123),!this.consumeOptionalCharacter(125)){this.rbracesExpected++;do{let n=this.inputIndex,i=this.next.isString(),a=this.expectIdentifierOrKeywordOrString();if(e.push({key:a,quoted:i}),i)this.expectCharacter(58),t.push(this.parsePipe());else if(this.consumeOptionalCharacter(58))t.push(this.parsePipe());else{let h=this.span(n),d=this.sourceSpan(n);t.push(new M(h,d,d,new T(h,d),a))}}while(this.consumeOptionalCharacter(44));this.rbracesExpected--,this.expectCharacter(125)}return new ee(this.span(s),this.sourceSpan(s),e,t)}parseAccessMember(e,t,s){let n=this.inputIndex,i=this.withContext(pe.Writable,()=>{var f;let d=(f=this.expectIdentifierOrKeyword())!=null?f:"";return d.length===0&&this.error("Expected identifier for property access",e.span.end),d}),a=this.sourceSpan(n),h;if(s)this.consumeOptionalAssignment()?(this.error("The '?.' operator cannot be used in the assignment"),h=new C(this.span(t),this.sourceSpan(t))):h=new q(this.span(t),this.sourceSpan(t),a,e,i);else if(this.consumeOptionalAssignment()){if(!(this.parseFlags&1))return this.error("Bindings cannot contain assignments"),new C(this.span(t),this.sourceSpan(t));let d=this.parseConditional();h=new z(this.span(t),this.sourceSpan(t),a,e,i,d)}else h=new M(this.span(t),this.sourceSpan(t),a,e,i);return h}parseCall(e,t,s){let n=this.inputIndex;this.rparensExpected++;let i=this.parseCallArguments(),a=this.span(n,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(41),this.rparensExpected--;let h=this.span(t),d=this.sourceSpan(t);return s?new ne(h,d,e,i,a):new se(h,d,e,i,a)}consumeOptionalAssignment(){return this.parseFlags&2&&this.next.isOperator("!")&&this.peek(1).isOperator("=")?(this.advance(),this.advance(),!0):this.consumeOptionalOperator("=")}parseCallArguments(){if(this.next.isCharacter(41))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(44));return e}expectTemplateBindingKey(){let e="",t=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-");while(t);return{source:e,span:new b(s,s+e.length)}}parseTemplateBindings(e){let t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index<this.tokens.length;){let s=this.parseLetBinding();if(s)t.push(s);else{let n=this.expectTemplateBindingKey(),i=this.parseAsBinding(n);i?t.push(i):(n.source=e.source+n.source.charAt(0).toUpperCase()+n.source.substring(1),t.push(...this.parseDirectiveKeywordBindings(n)))}this.consumeStatementTerminator()}return new Ze(t,[],this.errors)}parseKeyedReadOrWrite(e,t,s){return this.withContext(pe.Writable,()=>{this.rbracketsExpected++;let n=this.parsePipe();if(n instanceof C&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(93),this.consumeOptionalOperator("="))if(s)this.error("The '?.' operator cannot be used in the assignment");else{let i=this.parseConditional();return new Z(this.span(t),this.sourceSpan(t),e,n,i)}else return s?new Ce(this.span(t),this.sourceSpan(t),e,n):new X(this.span(t),this.sourceSpan(t),e,n);return new C(this.span(t),this.sourceSpan(t))})}parseDirectiveKeywordBindings(e){let t=[];this.consumeOptionalCharacter(58);let s=this.getDirectiveBoundTarget(),n=this.currentAbsoluteOffset,i=this.parseAsBinding(e);i||(this.consumeStatementTerminator(),n=this.currentAbsoluteOffset);let a=new b(e.span.start,n);return t.push(new ie(a,e,s)),i&&t.push(i),t}getDirectiveBoundTarget(){if(this.next===Re||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:t,end:s}=e.span,n=this.input.substring(t,s);return new B(e,n,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let t=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new b(e.span.start,this.currentAbsoluteOffset);return new F(s,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let t=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let n=new b(e,this.currentAbsoluteOffset);return new F(n,t,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(59)||this.consumeOptionalCharacter(44)}error(e,t=null){this.errors.push(new W(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),e<this.tokens.length?`at column ${this.tokens[e].index+1} in`:"at the end of the expression"}_reportErrorForPrivateIdentifier(e,t){let s=`Private identifiers are not supported. Unexpected private identifier: ${e}`;t!==null&&(s+=`, ${t}`),this.error(s)}skip(){let e=this.next;for(;this.index<this.tokens.length&&!e.isCharacter(59)&&!e.isOperator("|")&&(this.rparensExpected<=0||!e.isCharacter(41))&&(this.rbracesExpected<=0||!e.isCharacter(125))&&(this.rbracketsExpected<=0||!e.isCharacter(93))&&(!(this.context&pe.Writable)||!e.isOperator("="));)this.next.isError()&&this.errors.push(new W(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),e=this.next}},Je=class extends Ne{constructor(){super(...arguments),this.errors=[]}visitPipe(){this.errors.push("pipes")}}});var Le=$(()=>{g();Ge();qe();Rt()});function rt(){return new Se(new fe)}function st(r,e){let t=rt(),{astInput:s,comments:n}=Ft(r,t),{ast:i,errors:a}=e(s,t);return nt(a),{ast:i,comments:n}}function Bt(r){return st(r,(e,t)=>t.parseBinding(e,...be))}function Kt(r){return st(r,(e,t)=>t.parseSimpleBinding(e,...be))}function Tt(r){return st(r,(e,t)=>t.parseAction(e,!1,...be))}function _t(r){let e=rt(),{templateBindings:t,errors:s}=e.parseTemplateBindings(tt,r,bt,Ye,Ye);return nt(s),t}function Mt(r){let e=rt(),{astInput:t,comments:s}=Ft(r,e),n="{{",i="}}",{ast:a,errors:h}=e.parseInterpolation(n+t+i,...be,null);nt(h);let d=a.expressions[0],f=new Set;return et(d,S=>{f.has(S)||(S.start-=n.length,S.end-=n.length,f.add(S))}),{ast:d,comments:s}}function et(r,e){if(!(!r||typeof r!="object")){if(Array.isArray(r))return r.forEach(t=>et(t,e));for(let t of Object.keys(r)){let s=r[t];t==="span"?e(s):et(s,e)}}}function nt(r){if(r.length!==0){let[{message:e}]=r;throw new SyntaxError(e.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}}function Ft(r,e){let t=e._commentStart(r);return t===null?{astInput:r,comments:[]}:{astInput:r.slice(0,t),comments:[{type:"Comment",value:r.slice(t+2),span:{start:t,end:r.length}}]}}function Ut(r){return r instanceof L?"Unary":r instanceof N?"Binary":r instanceof J?"BindingPipe":r instanceof se?"Call":r instanceof j?"Chain":r instanceof H?"Conditional":r instanceof C?"EmptyExpr":r instanceof T?"ImplicitReceiver":r instanceof X?"KeyedRead":r instanceof Z?"KeyedWrite":r instanceof Y?"LiteralArray":r instanceof ee?"LiteralMap":r instanceof O?"LiteralPrimitive":r instanceof re?"NonNullAssert":r instanceof te?"PrefixNot":r instanceof M?"PropertyRead":r instanceof z?"PropertyWrite":r instanceof ne?"SafeCall":r instanceof q?"SafePropertyRead":r.type}function Lt({start:r,end:e},t){let s=r,n=e;for(;n!==s&&/\s/.test(t[n-1]);)n--;for(;s!==n&&/\s/.test(t[s]);)s++;return{start:s,end:n}}function Hr({start:r,end:e},t){let s=r,n=e;for(;n!==t.length&&/\s/.test(t[n]);)n++;for(;s!==0&&/\s/.test(t[s-1]);)s--;return{start:s,end:n}}function zr(r,e){return e[r.start-1]==="("&&e[r.end]===")"?{start:r.start-1,end:r.end+1}:r}function Dt(r,e,t){let s=0,n={start:r.start,end:r.end};for(;;){let i=Hr(n,e),a=zr(i,e);if(i.start===a.start&&i.end===a.end)break;n.start=a.start,n.end=a.end,s++}return{hasParens:(t?s-1:s)!==0,outerSpan:Lt(t?{start:n.start+1,end:n.end-1}:n,e),innerSpan:Lt(r,e)}}function Gt(r,e,t){let s=e;for(;!r.test(t[s]);)if(--s<0)throw new Error(`Cannot find front char ${r} from index ${e} in ${JSON.stringify(t)}`);return s}function Be(r,e,t){let s=e;for(;!r.test(t[s]);)if(++s>=t.length)throw new Error(`Cannot find back char ${r} from index ${e} in ${JSON.stringify(t)}`);return s}function Vt(r){return r.slice(0,1).toLowerCase()+r.slice(1)}function Wt(r){return r.length===0?void 0:r[r.length-1]}var bt,tt,Ye,be,Ke=$(()=>{g();Le();Le();bt="angular-estree-parser",tt="NgEstreeParser",Ye=0,be=[bt,Ye]});function Te(r,e,t=!1,s=!1){if(!t){let{start:h,end:d}=r;return{start:h,end:d,loc:{start:e.locator.locationForIndex(h),end:e.locator.locationForIndex(d)}}}let{outerSpan:n,innerSpan:i,hasParens:a}=Dt(r,e.text,s);return{start:i.start,end:i.end,loc:{start:e.locator.locationForIndex(i.start),end:e.locator.locationForIndex(i.end)},...a&&{extra:{parenthesized:!0,parenStart:n.start,parenEnd:n.end}}}}var ue,it=$(()=>{g();Ke();ue=(r,e,t=!1)=>{let s=Ut(r);switch(s){case"Unary":{let{operator:o,expr:c}=r,x=n(c);return a("UnaryExpression",{prefix:!0,argument:x,operator:o},r.span,{hasParentParens:t})}case"Binary":{let{left:o,operation:c,right:x}=r,u=n(o),l=n(x);return a(c==="&&"||c==="||"?"LogicalExpression":"BinaryExpression",{left:u,right:l,operator:c},{start:E(u),end:y(l)},{hasParentParens:t})}case"BindingPipe":{let{exp:o,name:c,args:x}=r,u=n(o),l=f(/\S/,f(/\|/,y(u))+1),m=a("Identifier",{name:c},{start:l,end:l+c.length}),p=x.map(n);return a("NGPipeExpression",{left:u,right:m,arguments:p},{start:E(u),end:y(p.length===0?m:Wt(p))},{hasParentParens:t})}case"Chain":{let{expressions:o}=r;return a("NGChainedExpression",{expressions:o.map(n)},r.span,{hasParentParens:t})}case"Comment":{let{value:o}=r;return a("CommentLine",{value:o},r.span,{processSpan:!1})}case"Conditional":{let{condition:o,trueExp:c,falseExp:x}=r,u=n(o),l=n(c),m=n(x);return a("ConditionalExpression",{test:u,consequent:l,alternate:m},{start:E(u),end:y(m)},{hasParentParens:t})}case"EmptyExpr":return a("NGEmptyExpression",{},r.span,{hasParentParens:t});case"ImplicitReceiver":return a("ThisExpression",{},r.span,{hasParentParens:t});case"KeyedRead":{let{key:o}=r,c=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,x=n(o);return h(c,x,{computed:!0,optional:!1},{end:r.span.end,hasParentParens:t})}case"LiteralArray":{let{expressions:o}=r;return a("ArrayExpression",{elements:o.map(n)},r.span,{hasParentParens:t})}case"LiteralMap":{let{keys:o,values:c}=r,x=c.map(l=>n(l)),u=o.map(({key:l,quoted:m},p)=>{let I=x[p],le=E(I),at=y(I),Fe=f(/\S/,p===0?r.span.start+1:f(/,/,y(x[p-1]))+1),qt=le===Fe?at:d(/\S/,d(/:/,le-1)-1)+1,ot={start:Fe,end:qt},we=m?a("StringLiteral",{value:l},ot):a("Identifier",{name:l},ot),Xt=we.end<we.start||Fe===le;return a("ObjectProperty",{key:we,value:I,method:!1,shorthand:Xt,computed:!1},{start:E(we),end:at})});return a("ObjectExpression",{properties:u},r.span,{hasParentParens:t})}case"LiteralPrimitive":{let{value:o}=r;switch(typeof o){case"boolean":return a("BooleanLiteral",{value:o},r.span,{hasParentParens:t});case"number":return a("NumericLiteral",{value:o},r.span,{hasParentParens:t});case"object":return a("NullLiteral",{},r.span,{hasParentParens:t});case"string":return a("StringLiteral",{value:o},r.span,{hasParentParens:t});case"undefined":return a("Identifier",{name:"undefined"},r.span,{hasParentParens:t});default:throw new Error(`Unexpected LiteralPrimitive value type ${typeof o}`)}}case"Call":case"SafeCall":{let o=s==="SafeCall",{receiver:c,args:x}=r,u=x.length===1?[i(x[0])]:x.map(n),l=n(c),m=R(l),p=o||m?"OptionalCallExpression":"CallExpression";return a(p,{callee:l,arguments:u,optional:p==="OptionalCallExpression"?o:void 0},{start:E(l),end:r.span.end},{hasParentParens:t})}case"NonNullAssert":{let{expression:o}=r,c=n(o);return a("TSNonNullExpression",{expression:c},{start:E(c),end:r.span.end},{hasParentParens:t})}case"PrefixNot":{let{expression:o}=r,c=n(o);return a("UnaryExpression",{prefix:!0,operator:"!",argument:c},{start:r.span.start,end:y(c)},{hasParentParens:t})}case"PropertyRead":case"SafePropertyRead":{let o=s==="SafePropertyRead",{receiver:c,name:x}=r,u=d(/\S/,r.span.end-1)+1,l=a("Identifier",{name:x},{start:u-x.length,end:u},S(c)?{hasParentParens:t}:{});return h(c,l,{computed:!1,optional:o},{hasParentParens:t})}case"KeyedWrite":{let{key:o,value:c}=r,x=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,u=n(o),l=n(c),m=h(x,u,{computed:!0,optional:!1},{end:f(/\]/,y(u))+1});return a("AssignmentExpression",{left:m,operator:"=",right:l},{start:E(m),end:y(l)},{hasParentParens:t})}case"PropertyWrite":{let{receiver:o,name:c,value:x}=r,u=n(x),l=d(/\S/,d(/=/,E(u)-1)-1)+1,m=a("Identifier",{name:c},{start:l-c.length,end:l}),p=h(o,m,{computed:!1,optional:!1});return a("AssignmentExpression",{left:p,operator:"=",right:u},{start:E(p),end:y(u)},{hasParentParens:t})}default:throw new Error(`Unexpected node ${s}`)}function n(o){return ue(o,e)}function i(o){return ue(o,e,!0)}function a(o,c,x,{processSpan:u=!0,hasParentParens:l=!1}={}){let m={type:o,...Te(x,e,u,l),...c};switch(o){case"Identifier":{let p=m;p.loc.identifierName=p.name;break}case"NumericLiteral":{let p=m;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"StringLiteral":{let p=m;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"ObjectProperty":{let p=m;p.shorthand&&(p.extra={...p.extra,shorthand:p.shorthand});break}}return m}function h(o,c,x,{end:u=y(c),hasParentParens:l=!1}={}){if(S(o)||o.span.start===c.start)return c;let m=n(o),p=R(m);return a(x.optional||p?"OptionalMemberExpression":"MemberExpression",{object:m,property:c,computed:x.computed,...x.optional?{optional:!0}:p?{optional:!1}:null},{start:E(m),end:u},{hasParentParens:l})}function d(o,c){return Gt(o,c,e.text)}function f(o,c){return Be(o,c,e.text)}function S(o){return o.span.start>=o.span.end||/^\s+$/.test(e.text.slice(o.span.start,o.span.end))}function R(o){return(o.type==="OptionalCallExpression"||o.type==="OptionalMemberExpression")&&!k(o)}function k(o){return o.extra&&o.extra.parenthesized}function E(o){return k(o)?o.extra.parenStart:o.start}function y(o){return k(o)?o.extra.parenEnd:o.end}}});function Qt(r,e){r.forEach(E);let[t]=r,{key:s}=t,n=e.text.slice(t.sourceSpan.start,t.sourceSpan.end).trim().length===0?r.slice(1):r,i=[],a=null;for(let c=0;c<n.length;c++){let x=n[c];if(a&&R(a)&&k(x)&&x.value&&x.value.source===a.key.source){let u=f("NGMicrosyntaxKey",{name:x.key.source},x.key.span),l=(I,le)=>({...I,...Te({start:I.start,end:le},e)}),m=I=>({...l(I,u.end),alias:u}),p=i.pop();if(p.type==="NGMicrosyntaxExpression")i.push(m(p));else if(p.type==="NGMicrosyntaxKeyedExpression"){let I=m(p.expression);i.push(l({...p,expression:I},I.end))}else throw new Error(`Unexpected type ${p.type}`)}else i.push(h(x,c));a=x}return f("NGMicrosyntax",{body:i},i.length===0?r[0].sourceSpan:{start:i[0].start,end:i[i.length-1].end});function h(c,x){if(R(c)){let{key:u,value:l}=c;return l?x===0?f("NGMicrosyntaxExpression",{expression:d(l.ast),alias:null},l.sourceSpan):f("NGMicrosyntaxKeyedExpression",{key:f("NGMicrosyntaxKey",{name:S(u.source)},u.span),expression:f("NGMicrosyntaxExpression",{expression:d(l.ast),alias:null},l.sourceSpan)},{start:u.span.start,end:l.sourceSpan.end}):f("NGMicrosyntaxKey",{name:S(u.source)},u.span)}else{let{key:u,sourceSpan:l}=c;if(/^let\s$/.test(e.text.slice(l.start,l.start+4))){let{value:p}=c;return f("NGMicrosyntaxLet",{key:f("NGMicrosyntaxKey",{name:u.source},u.span),value:p?f("NGMicrosyntaxKey",{name:p.source},p.span):null},{start:l.start,end:p?p.span.end:u.span.end})}else{let p=o(c);return f("NGMicrosyntaxAs",{key:f("NGMicrosyntaxKey",{name:p.source},p.span),alias:f("NGMicrosyntaxKey",{name:u.source},u.span)},{start:p.span.start,end:u.span.end})}}}function d(c){return ue(c,e)}function f(c,x,u,l=!0){return{type:c,...Te(u,e,l),...x}}function S(c){return Vt(c.slice(s.source.length))}function R(c){return c instanceof ie}function k(c){return c instanceof F}function E(c){y(c.key.span),k(c)&&c.value&&y(c.value.span)}function y(c){if(e.text[c.start]!=='"'&&e.text[c.start]!=="'")return;let x=e.text[c.start],u=!1;for(let l=c.start+1;l<e.text.length;l++)switch(e.text[l]){case x:if(!u){c.end=l+1;return}default:u=!1;break;case"\\":u=!u;break}}function o(c){if(!c.value||c.value.source!==tt)return c.value;let x=Be(/\S/,c.sourceSpan.start,e.text);return{source:"$implicit",span:{start:x,end:x}}}}var jt=$(()=>{g();Le();it();Ke()});var Ht={};ct(Ht,{parseAction:()=>Jr,parseBinding:()=>qr,parseInterpolation:()=>Zr,parseSimpleBinding:()=>Xr,parseTemplateBindings:()=>Yr});function _e(r,e){let{ast:t,comments:s}=e(r),n=new xe(r),i=h=>ue(h,n),a=i(t);return a.comments=s.map(h=>i(h)),a}function qr(r){return _e(r,Bt)}function Xr(r){return _e(r,Kt)}function Zr(r){return _e(r,Mt)}function Jr(r){return _e(r,Tt)}function Yr(r){return Qt(_t(r),new xe(r))}var zt=$(()=>{g();ft();it();jt();Ke()});var rs={};ct(rs,{default:()=>ts});g();g();g();function sr(r){return Array.isArray(r)&&r.length>0}var ht=sr;function Ue(r,e){let{ignoreDecorators:t}=e||{};if(!t){let s=r.declaration&&r.declaration.decorators||r.decorators;if(ht(s))return Ue(s[0])}return r.range?r.range[0]:r.start}function pt(r){return r.range?r.range[1]:r.end}function Me(r){return{astFormat:"estree",parse:async(t,s)=>{let n=await Promise.resolve().then(()=>(zt(),Ht)),i=r(t,n);return{type:"NGRoot",node:s.parser==="__ng_action"&&i.type!=="NGChainedExpression"?{...i,type:"NGChainedExpression",expressions:[i]}:i}},locStart:Ue,locEnd:pt}}var es={parsers:{__ng_action:Me((r,e)=>e.parseAction(r)),__ng_binding:Me((r,e)=>e.parseBinding(r)),__ng_interpolation:Me((r,e)=>e.parseInterpolation(r)),__ng_directive:Me((r,e)=>e.parseTemplateBindings(r))}},ts=es;return rr(rs);});
|