3 lines
83 KiB
JavaScript
Raw Normal View History

var $s=Object.defineProperty;var Xt=t=>{throw TypeError(t)};var Jt=(t,e)=>{for(var n in e)$s(t,n,{get:e[n],enumerable:!0})};var it=(t,e,n)=>e.has(t)||Xt("Cannot "+n);var L=(t,e,n)=>(it(t,e,"read from private field"),n?n.call(t):e.get(t)),V=(t,e,n)=>e.has(t)?Xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Q=(t,e,n,s)=>(it(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),c=(t,e,n)=>(it(t,e,"access private method"),n);var zt={};Jt(zt,{parsers:()=>jt});var jt={};Jt(jt,{__ng_action:()=>Ur,__ng_binding:()=>Wr,__ng_directive:()=>jr,__ng_interpolation:()=>qr});var Gr=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var Kt;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom"})(Kt||(Kt={}));var Yt;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default"})(Yt||(Yt={}));var Qt;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(Qt||(Qt={}));var B;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL"})(B||(B={}));var Zt;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Ignore=2]="Ignore"})(Zt||(Zt={}));var en;(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(en||(en={}));var tn;(function(t){t[t.None=0]="None",t[t.Const=1]="Const"})(tn||(tn={}));var nn;(function(t){t[t.Dynamic=0]="Dynamic",t[t.Bool=1]="Bool",t[t.String=2]="String",t[t.Int=3]="Int",t[t.Number=4]="Number",t[t.Function=5]="Function",t[t.Inferred=6]="Inferred",t[t.None=7]="None"})(nn||(nn={}));var Rs=void 0;var sn;(function(t){t[t.Minus=0]="Minus",t[t.Plus=1]="Plus"})(sn||(sn={}));var _;(function(t){t[t.Equals=0]="Equals",t[t.NotEquals=1]="NotEquals",t[t.Identical=2]="Identical",t[t.NotIdentical=3]="NotIdentical",t[t.Minus=4]="Minus",t[t.Plus=5]="Plus",t[t.Divide=6]="Divide",t[t.Multiply=7]="Multiply",t[t.Modulo=8]="Modulo",t[t.And=9]="And",t[t.Or=10]="Or",t[t.BitwiseOr=11]="BitwiseOr",t[t.BitwiseAnd=12]="BitwiseAnd",t[t.Lower=13]="Lower",t[t.LowerEquals=14]="LowerEquals",t[t.Bigger=15]="Bigger",t[t.BiggerEquals=16]="BiggerEquals",t[t.NullishCoalesce=17]="NullishCoalesce"})(_||(_={}));function Bs(t,e){return t==null||e==null?t==e:t.isEquivalent(e)}function Ds(t,e,n){let s=t.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(!n(t[r],e[r]))return!1;return!0}function tt(t,e){return Ds(t,e,(n,s)=>n.isEquivalent(s))}var k=class{type;sourceSpan;constructor(e,n){this.type=e||null,this.sourceSpan=n||null}prop(e,n){return new gt(this,e,null,n)}key(e,n,s){return new vt(this,e,n,s)}callFn(e,n,s){return new Xe(this,e,null,n,s)}instantiate(e,n,s){return new ft(this,e,n,s)}conditional(e,n=null,s){return new mt(this,e,n,null,s)}equals(e,n){return new C(_.Equals,this,e,null,n)}notEquals(e,n){return new C(_.NotEquals,this,e,null,n)}identical(e,n){return new C(_.Identical,this,e,null,n)}notIdentical(e,n){return new C(_.NotIdentical,this,e,null,n)}minus(e,n){return new C(_.Minus,this,e,null,n)}plus(e,n){return new C(_.Plus,this,e,null,n)}divide(e,n){return new C(_.Divide,this,e,null,n)}multiply(e,n){return new C(_.Multiply,this,e,null,n)}modulo(e,n){return new C(_.Modulo,this,e,null,n)}and(e,n){return new C(_.And,this,e,null,n)}bitwiseOr(e,n,s=!0){return new C(_.BitwiseOr,this,e,null,n,s)}bitwiseAnd(e,n,s=!0){return new C(_.BitwiseAnd,this,e,null,n,s)}or(e,n){return new C(_.Or,this,e,null,n)}lower(e,n){return new C(_.Lower,this,e,null,n)}lowerEquals(e,n){return new C(_.LowerEquals,this,e,null,n)}bigger(e,n){return new C(_.Bigger,this,e,null,n)}biggerEquals(e,n){return new C(_.BiggerEquals,this,e,null,n)}isBlank(e){return this.equals(TYPED_NULL_EXPR,e)}nullishCoalesce(e,n){return new C(_.NullishCoalesce,this,e,null,n)}toStmt(){return new xt(this,null)}},Ge=class t extends k{name;constructor(e,n,s){super(n,s),this.name=e}isEquivalent(e){return e instanceof t&&this.name===e.name}isConstant(){return!1}visitExpression(e,n){return e.visit
\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,hi=new RegExp(`[^${rs}]`),fi=new RegExp(`[${rs}]{2,}`,"g");var d;(function(t){t[t.Character=0]="Character",t[t.Identifier=1]="Identifier",t[t.PrivateIdentifier=2]="PrivateIdentifier",t[t.Keyword=3]="Keyword",t[t.String=4]="String",t[t.Operator=5]="Operator",t[t.Number=6]="Number",t[t.Error=7]="Error"})(d||(d={}));var Sr=["var","let","as","null","undefined","true","false","if","else","this","typeof"],De=class{tokenize(e){let n=new At(e),s=[],r=n.scanToken();for(;r!=null;)s.push(r),r=n.scanToken();return s}},M=class{index;end;type;numValue;strValue;constructor(e,n,s,r,o){this.index=e,this.end=n,this.type=s,this.numValue=r,this.strValue=o}isCharacter(e){return this.type==d.Character&&this.numValue==e}isNumber(){return this.type==d.Number}isString(){return this.type==d.String}isOperator(e){return this.type==d.Operator&&this.strValue==e}isIdentifier(){return this.type==d.Identifier}isPrivateIdentifier(){return this.type==d.PrivateIdentifier}isKeyword(){return this.type==d.Keyword}isKeywordLet(){return this.type==d.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==d.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==d.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==d.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==d.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==d.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==d.Keyword&&this.strValue=="this"}isKeywordTypeof(){return this.type===d.Keyword&&this.strValue==="typeof"}isError(){return this.type==d.Error}toNumber(){return this.type==d.Number?this.numValue:-1}toString(){switch(this.type){case d.Character:case d.Identifier:case d.Keyword:case d.Operator:case d.PrivateIdentifier:case d.String:case d.Error:return this.strValue;case d.Number:return this.numValue.toString();default:return null}}};function $n(t,e,n){return new M(t,e,d.Character,n,String.fromCharCode(n))}function Er(t,e,n){return new M(t,e,d.Identifier,0,n)}function yr(t,e,n){return new M(t,e,d.PrivateIdentifier,0,n)}function _r(t,e,n){return new M(t,e,d.Keyword,0,n)}function at(t,e,n){return new M(t,e,d.Operator,0,n)}function Cr(t,e,n){return new M(t,e,d.String,0,n)}function Tr(t,e,n){return new M(t,e,d.Number,n,"")}function kr(t,e,n){return new M(t,e,d.Error,0,n)}var lt=new M(-1,-1,d.Character,0,""),At=class{input;length;peek=0;index=-1;constructor(e){this.input=e,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?ot:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,n=this.length,s=this.peek,r=this.index;for(;s<=Wn;)if(++r>=n){s=ot;break}else s=e.charCodeAt(r);if(this.peek=s,this.index=r,r>=n)return null;if(Rn(s))return this.scanIdentifier();if(j(s))return this.scanNumber(r);let o=r;switch(s){case ee:return this.advance(),j(this.peek)?this.scanNumber(o):$n(o,this.index,ee);case je:case me:case Tt:case xe:case ze:case we:case ge:case te:case ve:return this.scanCharacter(o,s);case zn:case qn:return this.scanString();case zs:return this.scanPrivateIdentifier();case Gn:case Xn:case Xs:case Ct:case Gs:case tr:return this.scanOperator(o,String.fromCharCode(s));case hn:return this.scanQuestion(o);case Js:case Ks:return this.scanComplexOperator(o,String.fromCharCode(s),qe,"=");case js:case qe:return this.scanComplexOperator(o,String.fromCharCode(s),qe,"=",qe,"=");case pn:return this.scanComplexOperator(o,"&",pn,"&");case fn:return this.scanComplexOperator(o,"|",fn,"|");case Zn:for(;ur(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,n){return this.advance(),$n(e,this.index,n)}scanOperator(e,n){return this.advance(),at(e,this.index,n)}scanComplexOperator(e,n,s,r,o,a){this.advance();let l=n;return this.peek==s&&(this.advance(),l+=r),o!=null&&this.peek==o&&(this.advance(),l+=a),at(e,this.index,l)}scanIdentifier(){let e=this.index;for(this.advance();Bn(this.peek);)this.advance();let n=this.input.substring(e,this.in