@vuebro/runtime 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,7 +115,7 @@ function Wl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"d
115
115
  }
116
116
  `};class Mt{__init(){this.helperNames={}}__init2(){this.createRequireName=null}constructor(n){this.nameManager=n,Mt.prototype.__init.call(this),Mt.prototype.__init2.call(this)}getHelperName(n){let s=this.helperNames[n];return s||(s=this.nameManager.claimFreeName(`_${n}`),this.helperNames[n]=s,s)}emitHelpers(){let n="";this.helperNames.optionalChainDelete&&this.getHelperName("optionalChain"),this.helperNames.asyncOptionalChainDelete&&this.getHelperName("asyncOptionalChain");for(const[s,o]of Object.entries(Qo)){const i=this.helperNames[s];let c=o;s==="optionalChainDelete"?c=c.replace("OPTIONAL_CHAIN_NAME",this.helperNames.optionalChain):s==="asyncOptionalChainDelete"?c=c.replace("ASYNC_OPTIONAL_CHAIN_NAME",this.helperNames.asyncOptionalChain):s==="require"&&(this.createRequireName===null&&(this.createRequireName=this.nameManager.claimFreeName("_createRequire")),c=c.replace(/CREATE_REQUIRE_NAME/g,this.createRequireName)),i&&(n+=" ",n+=c.replace(s,i).replace(/\s+/g," ").trim())}return n}}function Qs(e,n,s){Yo(e,s)&&Zo(e,n,s)}function Yo(e,n){for(const s of e.tokens)if(s.type===t.name&&!s.isType&&no(s)&&n.has(e.identifierNameForToken(s)))return!0;return!1}function Zo(e,n,s){const o=[];let i=n.length-1;for(let c=e.tokens.length-1;;c--){for(;o.length>0&&o[o.length-1].startTokenIndex===c+1;)o.pop();for(;i>=0&&n[i].endTokenIndex===c+1;)o.push(n[i]),i--;if(c<0)break;const h=e.tokens[c],m=e.identifierNameForToken(h);if(o.length>1&&!h.isType&&h.type===t.name&&s.has(m)){if(so(h))Ys(o[o.length-1],e,m);else if(ro(h)){let g=o.length-1;for(;g>0&&!o[g].isFunctionScope;)g--;if(g<0)throw new Error("Did not find parent function scope.");Ys(o[g],e,m)}}}if(o.length>0)throw new Error("Expected empty scope stack after processing file.")}function Ys(e,n,s){for(let o=e.startTokenIndex;o<e.endTokenIndex;o++){const i=n.tokens[o];(i.type===t.name||i.type===t.jsxName)&&n.identifierNameForToken(i)===s&&(i.shadowsGlobal=!0)}}function Ko(e,n){const s=[];for(const o of n)o.type===t.name&&s.push(e.slice(o.start,o.end));return s}class ds{__init(){this.usedNames=new Set}constructor(n,s){ds.prototype.__init.call(this),this.usedNames=new Set(Ko(n,s))}claimFreeName(n){const s=this.findFreeName(n);return this.usedNames.add(s),s}findFreeName(n){if(!this.usedNames.has(n))return n;let s=2;for(;this.usedNames.has(n+String(s));)s++;return n+String(s)}}var mt={},dt={},we={},Zs;function ns(){if(Zs)return we;Zs=1;var e=we&&we.__extends||function(){var c=function(h,m){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,f){g.__proto__=f}||function(g,f){for(var y in f)f.hasOwnProperty(y)&&(g[y]=f[y])},c(h,m)};return function(h,m){c(h,m);function g(){this.constructor=h}h.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}}();Object.defineProperty(we,"__esModule",{value:!0}),we.DetailContext=we.NoopContext=we.VError=void 0;var n=function(c){e(h,c);function h(m,g){var f=c.call(this,g)||this;return f.path=m,Object.setPrototypeOf(f,h.prototype),f}return h}(Error);we.VError=n;var s=function(){function c(){}return c.prototype.fail=function(h,m,g){return!1},c.prototype.unionResolver=function(){return this},c.prototype.createContext=function(){return this},c.prototype.resolveUnion=function(h){},c}();we.NoopContext=s;var o=function(){function c(){this._propNames=[""],this._messages=[null],this._score=0}return c.prototype.fail=function(h,m,g){return this._propNames.push(h),this._messages.push(m),this._score+=g,!1},c.prototype.unionResolver=function(){return new i},c.prototype.resolveUnion=function(h){for(var m,g,f=h,y=null,T=0,S=f.contexts;T<S.length;T++){var C=S[T];(!y||C._score>=y._score)&&(y=C)}y&&y._score>0&&((m=this._propNames).push.apply(m,y._propNames),(g=this._messages).push.apply(g,y._messages))},c.prototype.getError=function(h){for(var m=[],g=this._propNames.length-1;g>=0;g--){var f=this._propNames[g];h+=typeof f=="number"?"["+f+"]":f?"."+f:"";var y=this._messages[g];y&&m.push(h+" "+y)}return new n(h,m.join("; "))},c.prototype.getErrorDetail=function(h){for(var m=[],g=this._propNames.length-1;g>=0;g--){var f=this._propNames[g];h+=typeof f=="number"?"["+f+"]":f?"."+f:"";var y=this._messages[g];y&&m.push({path:h,message:y})}for(var T=null,g=m.length-1;g>=0;g--)T&&(m[g].nested=[T]),T=m[g];return T},c}();we.DetailContext=o;var i=function(){function c(){this.contexts=[]}return c.prototype.createContext=function(){var h=new o;return this.contexts.push(h),h},c}();return we}var Ks;function e1(){return Ks||(Ks=1,function(e){var n=dt&&dt.__extends||function(){var _=function(x,I){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,A){w.__proto__=A}||function(w,A){for(var L in A)A.hasOwnProperty(L)&&(w[L]=A[L])},_(x,I)};return function(x,I){_(x,I);function w(){this.constructor=x}x.prototype=I===null?Object.create(I):(w.prototype=I.prototype,new w)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.basicTypes=e.BasicType=e.TParamList=e.TParam=e.param=e.TFunc=e.func=e.TProp=e.TOptional=e.opt=e.TIface=e.iface=e.TEnumLiteral=e.enumlit=e.TEnumType=e.enumtype=e.TIntersection=e.intersection=e.TUnion=e.union=e.TTuple=e.tuple=e.TArray=e.array=e.TLiteral=e.lit=e.TName=e.name=e.TType=void 0;var s=ns(),o=function(){function _(){}return _}();e.TType=o;function i(_){return typeof _=="string"?h(_):_}function c(_,x){var I=_[x];if(!I)throw new Error("Unknown type "+x);return I}function h(_){return new m(_)}e.name=h;var m=function(_){n(x,_);function x(I){var w=_.call(this)||this;return w.name=I,w._failMsg="is not a "+I,w}return x.prototype.getChecker=function(I,w,A){var L=this,D=c(I,this.name),U=D.getChecker(I,w,A);return D instanceof ee||D instanceof x?U:function(Q,z){return U(Q,z)?!0:z.fail(null,L._failMsg,0)}},x}(o);e.TName=m;function g(_){return new f(_)}e.lit=g;var f=function(_){n(x,_);function x(I){var w=_.call(this)||this;return w.value=I,w.name=JSON.stringify(I),w._failMsg="is not "+w.name,w}return x.prototype.getChecker=function(I,w){var A=this;return function(L,D){return L===A.value?!0:D.fail(null,A._failMsg,-1)}},x}(o);e.TLiteral=f;function y(_){return new T(i(_))}e.array=y;var T=function(_){n(x,_);function x(I){var w=_.call(this)||this;return w.ttype=I,w}return x.prototype.getChecker=function(I,w){var A=this.ttype.getChecker(I,w);return function(L,D){if(!Array.isArray(L))return D.fail(null,"is not an array",0);for(var U=0;U<L.length;U++){var Q=A(L[U],D);if(!Q)return D.fail(U,null,1)}return!0}},x}(o);e.TArray=T;function S(){for(var _=[],x=0;x<arguments.length;x++)_[x]=arguments[x];return new C(_.map(function(I){return i(I)}))}e.tuple=S;var C=function(_){n(x,_);function x(I){var w=_.call(this)||this;return w.ttypes=I,w}return x.prototype.getChecker=function(I,w){var A=this.ttypes.map(function(D){return D.getChecker(I,w)}),L=function(D,U){if(!Array.isArray(D))return U.fail(null,"is not an array",0);for(var Q=0;Q<A.length;Q++){var z=A[Q](D[Q],U);if(!z)return U.fail(Q,null,1)}return!0};return w?function(D,U){return L(D,U)?D.length<=A.length?!0:U.fail(A.length,"is extraneous",2):!1}:L},x}(o);e.TTuple=C;function $(){for(var _=[],x=0;x<arguments.length;x++)_[x]=arguments[x];return new V(_.map(function(I){return i(I)}))}e.union=$;var V=function(_){n(x,_);function x(I){var w=_.call(this)||this;w.ttypes=I;var A=I.map(function(D){return D instanceof m||D instanceof f?D.name:null}).filter(function(D){return D}),L=I.length-A.length;return A.length?(L>0&&A.push(L+" more"),w._failMsg="is none of "+A.join(", ")):w._failMsg="is none of "+L+" types",w}return x.prototype.getChecker=function(I,w){var A=this,L=this.ttypes.map(function(D){return D.getChecker(I,w)});return function(D,U){for(var Q=U.unionResolver(),z=0;z<L.length;z++){var ce=L[z](D,Q.createContext());if(ce)return!0}return U.resolveUnion(Q),U.fail(null,A._failMsg,0)}},x}(o);e.TUnion=V;function re(){for(var _=[],x=0;x<arguments.length;x++)_[x]=arguments[x];return new ie(_.map(function(I){return i(I)}))}e.intersection=re;var ie=function(_){n(x,_);function x(I){var w=_.call(this)||this;return w.ttypes=I,w}return x.prototype.getChecker=function(I,w){var A=new Set,L=this.ttypes.map(function(D){return D.getChecker(I,w,A)});return function(D,U){var Q=L.every(function(z){return z(D,U)});return Q?!0:U.fail(null,null,0)}},x}(o);e.TIntersection=ie;function N(_){return new O(_)}e.enumtype=N;var O=function(_){n(x,_);function x(I){var w=_.call(this)||this;return w.members=I,w.validValues=new Set,w._failMsg="is not a valid enum value",w.validValues=new Set(Object.keys(I).map(function(A){return I[A]})),w}return x.prototype.getChecker=function(I,w){var A=this;return function(L,D){return A.validValues.has(L)?!0:D.fail(null,A._failMsg,0)}},x}(o);e.TEnumType=O;function R(_,x){return new Y(_,x)}e.enumlit=R;var Y=function(_){n(x,_);function x(I,w){var A=_.call(this)||this;return A.enumName=I,A.prop=w,A._failMsg="is not "+I+"."+w,A}return x.prototype.getChecker=function(I,w){var A=this,L=c(I,this.enumName);if(!(L instanceof O))throw new Error("Type "+this.enumName+" used in enumlit is not an enum type");var D=L.members[this.prop];if(!L.members.hasOwnProperty(this.prop))throw new Error("Unknown value "+this.enumName+"."+this.prop+" used in enumlit");return function(U,Q){return U===D?!0:Q.fail(null,A._failMsg,-1)}},x}(o);e.TEnumLiteral=Y;function te(_){return Object.keys(_).map(function(x){return X(x,_[x])})}function X(_,x){return x instanceof pe?new ve(_,x.ttype,!0):new ve(_,i(x),!1)}function ae(_,x){return new de(_,te(x))}e.iface=ae;var de=function(_){n(x,_);function x(I,w){var A=_.call(this)||this;return A.bases=I,A.props=w,A.propSet=new Set(w.map(function(L){return L.name})),A}return x.prototype.getChecker=function(I,w,A){var L=this,D=this.bases.map(function(ne){return c(I,ne).getChecker(I,w)}),U=this.props.map(function(ne){return ne.ttype.getChecker(I,w)}),Q=new s.NoopContext,z=this.props.map(function(ne,fe){return!ne.isOpt&&!U[fe](void 0,Q)}),ce=function(ne,fe){if(typeof ne!="object"||ne===null)return fe.fail(null,"is not an object",0);for(var me=0;me<D.length;me++)if(!D[me](ne,fe))return!1;for(var me=0;me<U.length;me++){var Qe=L.props[me].name,ot=ne[Qe];if(ot===void 0){if(z[me])return fe.fail(Qe,"is missing",1)}else{var pt=U[me](ot,fe);if(!pt)return fe.fail(Qe,null,1)}}return!0};if(!w)return ce;var _e=this.propSet;return A&&(this.propSet.forEach(function(ne){return A.add(ne)}),_e=A),function(ne,fe){if(!ce(ne,fe))return!1;for(var me in ne)if(!_e.has(me))return fe.fail(me,"is extraneous",2);return!0}},x}(o);e.TIface=de;function he(_){return new pe(i(_))}e.opt=he;var pe=function(_){n(x,_);function x(I){var w=_.call(this)||this;return w.ttype=I,w}return x.prototype.getChecker=function(I,w){var A=this.ttype.getChecker(I,w);return function(L,D){return L===void 0||A(L,D)}},x}(o);e.TOptional=pe;var ve=function(){function _(x,I,w){this.name=x,this.ttype=I,this.isOpt=w}return _}();e.TProp=ve;function Be(_){for(var x=[],I=1;I<arguments.length;I++)x[I-1]=arguments[I];return new De(new Fe(x),i(_))}e.func=Be;var De=function(_){n(x,_);function x(I,w){var A=_.call(this)||this;return A.paramList=I,A.result=w,A}return x.prototype.getChecker=function(I,w){return function(A,L){return typeof A=="function"?!0:L.fail(null,"is not a function",0)}},x}(o);e.TFunc=De;function $e(_,x,I){return new Oe(_,i(x),!!I)}e.param=$e;var Oe=function(){function _(x,I,w){this.name=x,this.ttype=I,this.isOpt=w}return _}();e.TParam=Oe;var Fe=function(_){n(x,_);function x(I){var w=_.call(this)||this;return w.params=I,w}return x.prototype.getChecker=function(I,w){var A=this,L=this.params.map(function(z){return z.ttype.getChecker(I,w)}),D=new s.NoopContext,U=this.params.map(function(z,ce){return!z.isOpt&&!L[ce](void 0,D)}),Q=function(z,ce){if(!Array.isArray(z))return ce.fail(null,"is not an array",0);for(var _e=0;_e<L.length;_e++){var ne=A.params[_e];if(z[_e]===void 0){if(U[_e])return ce.fail(ne.name,"is missing",1)}else{var fe=L[_e](z[_e],ce);if(!fe)return ce.fail(ne.name,null,1)}}return!0};return w?function(z,ce){return Q(z,ce)?z.length<=L.length?!0:ce.fail(L.length,"is extraneous",2):!1}:Q},x}(o);e.TParamList=Fe;var ee=function(_){n(x,_);function x(I,w){var A=_.call(this)||this;return A.validator=I,A.message=w,A}return x.prototype.getChecker=function(I,w){var A=this;return function(L,D){return A.validator(L)?!0:D.fail(null,A.message,0)}},x}(o);e.BasicType=ee,e.basicTypes={any:new ee(function(_){return!0},"is invalid"),number:new ee(function(_){return typeof _=="number"},"is not a number"),object:new ee(function(_){return typeof _=="object"&&_},"is not an object"),boolean:new ee(function(_){return typeof _=="boolean"},"is not a boolean"),string:new ee(function(_){return typeof _=="string"},"is not a string"),symbol:new ee(function(_){return typeof _=="symbol"},"is not a symbol"),void:new ee(function(_){return _==null},"is not void"),undefined:new ee(function(_){return _===void 0},"is not undefined"),null:new ee(function(_){return _===null},"is not null"),never:new ee(function(_){return!1},"is unexpected"),Date:new ee(je("[object Date]"),"is not a Date"),RegExp:new ee(je("[object RegExp]"),"is not a RegExp")};var Ue=Object.prototype.toString;function je(_){return function(x){return typeof x=="object"&&x&&Ue.call(x)===_}}typeof Buffer<"u"&&(e.basicTypes.Buffer=new ee(function(_){return Buffer.isBuffer(_)},"is not a Buffer"));for(var He=function(_){e.basicTypes[_.name]=new ee(function(x){return x instanceof _},"is not a "+_.name)},Ne=0,qe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,ArrayBuffer];Ne<qe.length;Ne++){var Ve=qe[Ne];He(Ve)}}(dt)),dt}var t1;function ei(){return t1||(t1=1,function(e){var n=mt&&mt.__spreadArrays||function(){for(var g=0,f=0,y=arguments.length;f<y;f++)g+=arguments[f].length;for(var T=Array(g),S=0,f=0;f<y;f++)for(var C=arguments[f],$=0,V=C.length;$<V;$++,S++)T[S]=C[$];return T};Object.defineProperty(e,"__esModule",{value:!0}),e.Checker=e.createCheckers=void 0;var s=e1(),o=ns(),i=e1();Object.defineProperty(e,"TArray",{enumerable:!0,get:function(){return i.TArray}}),Object.defineProperty(e,"TEnumType",{enumerable:!0,get:function(){return i.TEnumType}}),Object.defineProperty(e,"TEnumLiteral",{enumerable:!0,get:function(){return i.TEnumLiteral}}),Object.defineProperty(e,"TFunc",{enumerable:!0,get:function(){return i.TFunc}}),Object.defineProperty(e,"TIface",{enumerable:!0,get:function(){return i.TIface}}),Object.defineProperty(e,"TLiteral",{enumerable:!0,get:function(){return i.TLiteral}}),Object.defineProperty(e,"TName",{enumerable:!0,get:function(){return i.TName}}),Object.defineProperty(e,"TOptional",{enumerable:!0,get:function(){return i.TOptional}}),Object.defineProperty(e,"TParam",{enumerable:!0,get:function(){return i.TParam}}),Object.defineProperty(e,"TParamList",{enumerable:!0,get:function(){return i.TParamList}}),Object.defineProperty(e,"TProp",{enumerable:!0,get:function(){return i.TProp}}),Object.defineProperty(e,"TTuple",{enumerable:!0,get:function(){return i.TTuple}}),Object.defineProperty(e,"TType",{enumerable:!0,get:function(){return i.TType}}),Object.defineProperty(e,"TUnion",{enumerable:!0,get:function(){return i.TUnion}}),Object.defineProperty(e,"TIntersection",{enumerable:!0,get:function(){return i.TIntersection}}),Object.defineProperty(e,"array",{enumerable:!0,get:function(){return i.array}}),Object.defineProperty(e,"enumlit",{enumerable:!0,get:function(){return i.enumlit}}),Object.defineProperty(e,"enumtype",{enumerable:!0,get:function(){return i.enumtype}}),Object.defineProperty(e,"func",{enumerable:!0,get:function(){return i.func}}),Object.defineProperty(e,"iface",{enumerable:!0,get:function(){return i.iface}}),Object.defineProperty(e,"lit",{enumerable:!0,get:function(){return i.lit}}),Object.defineProperty(e,"name",{enumerable:!0,get:function(){return i.name}}),Object.defineProperty(e,"opt",{enumerable:!0,get:function(){return i.opt}}),Object.defineProperty(e,"param",{enumerable:!0,get:function(){return i.param}}),Object.defineProperty(e,"tuple",{enumerable:!0,get:function(){return i.tuple}}),Object.defineProperty(e,"union",{enumerable:!0,get:function(){return i.union}}),Object.defineProperty(e,"intersection",{enumerable:!0,get:function(){return i.intersection}}),Object.defineProperty(e,"BasicType",{enumerable:!0,get:function(){return i.BasicType}});var c=ns();Object.defineProperty(e,"VError",{enumerable:!0,get:function(){return c.VError}});function h(){for(var g=[],f=0;f<arguments.length;f++)g[f]=arguments[f];for(var y=Object.assign.apply(Object,n([{},s.basicTypes],g)),T={},S=0,C=g;S<C.length;S++)for(var $=C[S],V=0,re=Object.keys($);V<re.length;V++){var ie=re[V];T[ie]=new m(y,$[ie])}return T}e.createCheckers=h;var m=function(){function g(f,y,T){if(T===void 0&&(T="value"),this.suite=f,this.ttype=y,this._path=T,this.props=new Map,y instanceof s.TIface)for(var S=0,C=y.props;S<C.length;S++){var $=C[S];this.props.set($.name,$.ttype)}this.checkerPlain=this.ttype.getChecker(f,!1),this.checkerStrict=this.ttype.getChecker(f,!0)}return g.prototype.setReportedPath=function(f){this._path=f},g.prototype.check=function(f){return this._doCheck(this.checkerPlain,f)},g.prototype.test=function(f){return this.checkerPlain(f,new o.NoopContext)},g.prototype.validate=function(f){return this._doValidate(this.checkerPlain,f)},g.prototype.strictCheck=function(f){return this._doCheck(this.checkerStrict,f)},g.prototype.strictTest=function(f){return this.checkerStrict(f,new o.NoopContext)},g.prototype.strictValidate=function(f){return this._doValidate(this.checkerStrict,f)},g.prototype.getProp=function(f){var y=this.props.get(f);if(!y)throw new Error("Type has no property "+f);return new g(this.suite,y,this._path+"."+f)},g.prototype.methodArgs=function(f){var y=this._getMethod(f);return new g(this.suite,y.paramList)},g.prototype.methodResult=function(f){var y=this._getMethod(f);return new g(this.suite,y.result)},g.prototype.getArgs=function(){if(!(this.ttype instanceof s.TFunc))throw new Error("getArgs() applied to non-function");return new g(this.suite,this.ttype.paramList)},g.prototype.getResult=function(){if(!(this.ttype instanceof s.TFunc))throw new Error("getResult() applied to non-function");return new g(this.suite,this.ttype.result)},g.prototype.getType=function(){return this.ttype},g.prototype._doCheck=function(f,y){var T=new o.NoopContext;if(!f(y,T)){var S=new o.DetailContext;throw f(y,S),S.getError(this._path)}},g.prototype._doValidate=function(f,y){var T=new o.NoopContext;if(f(y,T))return null;var S=new o.DetailContext;return f(y,S),S.getErrorDetail(this._path)},g.prototype._getMethod=function(f){var y=this.props.get(f);if(!y)throw new Error("Type has no property "+f);if(!(y instanceof s.TFunc))throw new Error("Property "+f+" is not a method");return y},g}();e.Checker=m}(mt)),mt}var G=ei();const ti=G.union(G.lit("jsx"),G.lit("typescript"),G.lit("flow"),G.lit("imports"),G.lit("react-hot-loader"),G.lit("jest")),ni=G.iface([],{compiledFilename:"string"}),si=G.iface([],{transforms:G.array("Transform"),disableESTransforms:G.opt("boolean"),jsxRuntime:G.opt(G.union(G.lit("classic"),G.lit("automatic"),G.lit("preserve"))),production:G.opt("boolean"),jsxImportSource:G.opt("string"),jsxPragma:G.opt("string"),jsxFragmentPragma:G.opt("string"),keepUnusedImports:G.opt("boolean"),preserveDynamicImport:G.opt("boolean"),injectCreateRequireForImportRequire:G.opt("boolean"),enableLegacyTypeScriptModuleInterop:G.opt("boolean"),enableLegacyBabel5ModuleInterop:G.opt("boolean"),sourceMapOptions:G.opt("SourceMapOptions"),filePath:G.opt("string")}),ri={Transform:ti,SourceMapOptions:ni,Options:si},{Options:oi}=G.createCheckers(ri);function ii(e){oi.strictCheck(e)}function q1(){k(),ue(!1)}function M1(e){k(),Qt(e)}function Je(e){P(),ks(e)}function Bt(){P(),r.tokens[r.tokens.length-1].identifierRole=v.ImportDeclaration}function ks(e){let n;r.scopeDepth===0?n=v.TopLevelDeclaration:e?n=v.BlockScopedDeclaration:n=v.FunctionScopedDeclaration,r.tokens[r.tokens.length-1].identifierRole=n}function Qt(e){switch(r.type){case t._this:{const n=M(0);k(),q(n);return}case t._yield:case t.name:{r.type=t.name,Je(e);return}case t.bracketL:{k(),gs(t.bracketR,e,!0);return}case t.braceL:vs(!0,e);return;default:j()}}function gs(e,n,s=!1,o=!1,i=0){let c=!0,h=!1;const m=r.tokens.length;for(;!p(e)&&!r.error;)if(c?c=!1:(d(t.comma),r.tokens[r.tokens.length-1].contextId=i,!h&&r.tokens[m].isType&&(r.tokens[r.tokens.length-1].isType=!0,h=!0)),!(s&&a(t.comma))){if(p(e))break;if(a(t.ellipsis)){M1(n),B1(),p(t.comma),d(e);break}else ai(o,n)}}function ai(e,n){e&&_s([l._public,l._protected,l._private,l._readonly,l._override]),$t(n),B1(),$t(n,!0)}function B1(){H?Ac():B&&da()}function $t(e,n=!1){if(n||Qt(e),!p(t.eq))return;const s=r.tokens.length-1;ue(),r.tokens[s].rhsEndIndex=r.tokens.length}function ss(){return a(t.name)}function ci(){return a(t.name)||!!(r.type&t.IS_KEYWORD)||a(t.string)||a(t.num)||a(t.bigint)||a(t.decimal)}function $1(){const e=r.snapshot();return k(),(a(t.bracketL)||a(t.braceL)||a(t.star)||a(t.ellipsis)||a(t.hash)||ci())&&!ge()?!0:(r.restoreFromSnapshot(e),!1)}function _s(e){for(;U1(e)!==null;);}function U1(e){if(!a(t.name))return null;const n=r.contextualKeyword;if(e.indexOf(n)!==-1&&$1()){switch(n){case l._readonly:r.tokens[r.tokens.length-1].type=t._readonly;break;case l._abstract:r.tokens[r.tokens.length-1].type=t._abstract;break;case l._static:r.tokens[r.tokens.length-1].type=t._static;break;case l._public:r.tokens[r.tokens.length-1].type=t._public;break;case l._private:r.tokens[r.tokens.length-1].type=t._private;break;case l._protected:r.tokens[r.tokens.length-1].type=t._protected;break;case l._override:r.tokens[r.tokens.length-1].type=t._override;break;case l._declare:r.tokens[r.tokens.length-1].type=t._declare;break}return n}return null}function vt(){for(P();p(t.dot);)P()}function li(){vt(),!ge()&&a(t.lessThan)&&ut()}function ui(){k(),Nt()}function hi(){k()}function pi(){d(t._typeof),a(t._import)?H1():vt(),!ge()&&a(t.lessThan)&&ut()}function H1(){d(t._import),d(t.parenL),d(t.string),d(t.parenR),p(t.dot)&&vt(),a(t.lessThan)&&ut()}function fi(){p(t._const);const e=p(t._in),n=oe(l._out);p(t._const),(e||n)&&!a(t.name)?r.tokens[r.tokens.length-1].type=t.name:P(),p(t._extends)&&K(),p(t.eq)&&K()}function st(){a(t.lessThan)&&Yt()}function Yt(){const e=M(0);for(a(t.lessThan)||a(t.typeParameterStart)?k():j();!p(t.greaterThan)&&!r.error;)fi(),p(t.comma);q(e)}function xs(e){const n=e===t.arrow;st(),d(t.parenL),r.scopeDepth++,mi(!1),r.scopeDepth--,(n||a(e))&&bt(e)}function mi(e){gs(t.parenR,e)}function Ut(){p(t.comma)||J()}function n1(){xs(t.colon),Ut()}function di(){const e=r.snapshot();k();const n=p(t.name)&&a(t.colon);return r.restoreFromSnapshot(e),n}function V1(){if(!(a(t.bracketL)&&di()))return!1;const e=M(0);return d(t.bracketL),P(),Nt(),d(t.bracketR),lt(),Ut(),q(e),!0}function s1(e){p(t.question),!e&&(a(t.parenL)||a(t.lessThan))?(xs(t.colon),Ut()):(lt(),Ut())}function ki(){if(a(t.parenL)||a(t.lessThan)){n1();return}if(a(t._new)){k(),a(t.parenL)||a(t.lessThan)?n1():s1(!1);return}const e=!!U1([l._readonly]);V1()||((E(l._get)||E(l._set))&&$1(),wt(-1),s1(e))}function gi(){W1()}function W1(){for(d(t.braceL);!p(t.braceR)&&!r.error;)ki()}function _i(){const e=r.snapshot(),n=xi();return r.restoreFromSnapshot(e),n}function xi(){return k(),p(t.plus)||p(t.minus)?E(l._readonly):(E(l._readonly)&&k(),!a(t.bracketL)||(k(),!ss())?!1:(k(),a(t._in)))}function yi(){P(),d(t._in),K()}function Ii(){d(t.braceL),a(t.plus)||a(t.minus)?(k(),se(l._readonly)):oe(l._readonly),d(t.bracketL),yi(),oe(l._as)&&K(),d(t.bracketR),a(t.plus)||a(t.minus)?(k(),d(t.question)):p(t.question),Oi(),J(),d(t.braceR)}function bi(){for(d(t.bracketL);!p(t.bracketR)&&!r.error;)wi(),p(t.comma)}function wi(){p(t.ellipsis)?K():(K(),p(t.question)),p(t.colon)&&K()}function Ti(){d(t.parenL),K(),d(t.parenR)}function Ai(){for(We(),We();!a(t.backQuote)&&!r.error;)d(t.dollarBraceL),K(),We(),We();k()}var Xe;(function(e){e[e.TSFunctionType=0]="TSFunctionType";const s=1;e[e.TSConstructorType=s]="TSConstructorType";const o=s+1;e[e.TSAbstractConstructorType=o]="TSAbstractConstructorType"})(Xe||(Xe={}));function Zn(e){e===Xe.TSAbstractConstructorType&&se(l._abstract),(e===Xe.TSConstructorType||e===Xe.TSAbstractConstructorType)&&d(t._new);const n=r.inDisallowConditionalTypesContext;r.inDisallowConditionalTypesContext=!1,xs(t.arrow),r.inDisallowConditionalTypesContext=n}function Ei(){switch(r.type){case t.name:li();return;case t._void:case t._null:k();return;case t.string:case t.num:case t.bigint:case t.decimal:case t._true:case t._false:ct();return;case t.minus:k(),ct();return;case t._this:{hi(),E(l._is)&&!ge()&&ui();return}case t._typeof:pi();return;case t._import:H1();return;case t.braceL:_i()?Ii():gi();return;case t.bracketL:bi();return;case t.parenL:Ti();return;case t.backQuote:Ai();return;default:if(r.type&t.IS_KEYWORD){k(),r.tokens[r.tokens.length-1].type=t.name;return}break}j()}function Si(){for(Ei();!ge()&&p(t.bracketL);)p(t.bracketR)||(K(),d(t.bracketR))}function vi(){if(se(l._infer),P(),a(t._extends)){const e=r.snapshot();d(t._extends);const n=r.inDisallowConditionalTypesContext;r.inDisallowConditionalTypesContext=!0,K(),r.inDisallowConditionalTypesContext=n,(r.error||!r.inDisallowConditionalTypesContext&&a(t.question))&&r.restoreFromSnapshot(e)}}function rs(){if(E(l._keyof)||E(l._unique)||E(l._readonly))k(),rs();else if(E(l._infer))vi();else{const e=r.inDisallowConditionalTypesContext;r.inDisallowConditionalTypesContext=!1,Si(),r.inDisallowConditionalTypesContext=e}}function r1(){if(p(t.bitwiseAND),rs(),a(t.bitwiseAND))for(;p(t.bitwiseAND);)rs()}function Ni(){if(p(t.bitwiseOR),r1(),a(t.bitwiseOR))for(;p(t.bitwiseOR);)r1()}function Ci(){return a(t.lessThan)?!0:a(t.parenL)&&Ri()}function Pi(){if(a(t.name)||a(t._this))return k(),!0;if(a(t.braceL)||a(t.bracketL)){let e=1;for(k();e>0&&!r.error;)a(t.braceL)||a(t.bracketL)?e++:(a(t.braceR)||a(t.bracketR))&&e--,k();return!0}return!1}function Ri(){const e=r.snapshot(),n=Li();return r.restoreFromSnapshot(e),n}function Li(){return k(),!!(a(t.parenR)||a(t.ellipsis)||Pi()&&(a(t.colon)||a(t.comma)||a(t.question)||a(t.eq)||a(t.parenR)&&(k(),a(t.arrow))))}function bt(e){const n=M(0);d(e),Fi()||K(),q(n)}function Di(){a(t.colon)&&bt(t.colon)}function lt(){a(t.colon)&&Nt()}function Oi(){p(t.colon)&&K()}function Fi(){const e=r.snapshot();return E(l._asserts)?(k(),oe(l._is)?(K(),!0):ss()||a(t._this)?(k(),oe(l._is)&&K(),!0):(r.restoreFromSnapshot(e),!1)):ss()||a(t._this)?(k(),E(l._is)&&!ge()?(k(),K(),!0):(r.restoreFromSnapshot(e),!1)):!1}function Nt(){const e=M(0);d(t.colon),K(),q(e)}function K(){if(o1(),r.inDisallowConditionalTypesContext||ge()||!p(t._extends))return;const e=r.inDisallowConditionalTypesContext;r.inDisallowConditionalTypesContext=!0,o1(),r.inDisallowConditionalTypesContext=e,d(t.question),K(),d(t.colon),K()}function ji(){return E(l._abstract)&&Z()===t._new}function o1(){if(Ci()){Zn(Xe.TSFunctionType);return}if(a(t._new)){Zn(Xe.TSConstructorType);return}else if(ji()){Zn(Xe.TSAbstractConstructorType);return}Ni()}function qi(){const e=M(1);K(),d(t.greaterThan),q(e),Ct()}function Mi(){if(p(t.jsxTagStart)){r.tokens[r.tokens.length-1].type=t.typeParameterStart;const e=M(1);for(;!a(t.greaterThan)&&!r.error;)K(),p(t.comma);be(),q(e)}}function X1(){for(;!a(t.braceL)&&!r.error;)Bi(),p(t.comma)}function Bi(){vt(),a(t.lessThan)&&ut()}function $i(){Je(!1),st(),p(t._extends)&&X1(),W1()}function Ui(){Je(!1),st(),d(t.eq),K(),J()}function Hi(){if(a(t.string)?ct():P(),p(t.eq)){const e=r.tokens.length-1;ue(),r.tokens[e].rhsEndIndex=r.tokens.length}}function ys(){for(Je(!1),d(t.braceL);!p(t.braceR)&&!r.error;)Hi(),p(t.comma)}function Is(){d(t.braceL),tn(t.braceR)}function os(){Je(!1),p(t.dot)?os():Is()}function G1(){E(l._global)?P():a(t.string)?Me():j(),a(t.braceL)?Is():J()}function is(){Bt(),d(t.eq),Wi(),J()}function Vi(){return E(l._require)&&Z()===t.parenL}function Wi(){Vi()?Xi():vt()}function Xi(){se(l._require),d(t.parenL),a(t.string)||j(),ct(),d(t.parenR)}function Gi(){if(Ce())return!1;switch(r.type){case t._function:{const e=M(1);k();const n=r.start;return tt(n,!0),q(e),!0}case t._class:{const e=M(1);return nt(!0,!1),q(e),!0}case t._const:if(a(t._const)&&fs(l._enum)){const e=M(1);return d(t._const),se(l._enum),r.tokens[r.tokens.length-1].type=t._enum,ys(),q(e),!0}case t._var:case t._let:{const e=M(1);return jt(r.type!==t._var),q(e),!0}case t.name:{const e=M(1),n=r.contextualKeyword;let s=!1;return n===l._global?(G1(),s=!0):s=Zt(n,!0),q(e),s}default:return!1}}function i1(){return Zt(r.contextualKeyword,!0)}function zi(e){switch(e){case l._declare:{const n=r.tokens.length-1;if(Gi())return r.tokens[n].type=t._declare,!0;break}case l._global:if(a(t.braceL))return Is(),!0;break;default:return Zt(e,!1)}return!1}function Zt(e,n){switch(e){case l._abstract:if(it(n)&&a(t._class))return r.tokens[r.tokens.length-1].type=t._abstract,nt(!0,!1),!0;break;case l._enum:if(it(n)&&a(t.name))return r.tokens[r.tokens.length-1].type=t._enum,ys(),!0;break;case l._interface:if(it(n)&&a(t.name)){const s=M(n?2:1);return $i(),q(s),!0}break;case l._module:if(it(n)){if(a(t.string)){const s=M(n?2:1);return G1(),q(s),!0}else if(a(t.name)){const s=M(n?2:1);return os(),q(s),!0}}break;case l._namespace:if(it(n)&&a(t.name)){const s=M(n?2:1);return os(),q(s),!0}break;case l._type:if(it(n)&&a(t.name)){const s=M(n?2:1);return Ui(),q(s),!0}break}return!1}function it(e){return e?(k(),!0):!Ce()}function Ji(){const e=r.snapshot();return Yt(),ht(),Di(),d(t.arrow),r.error?(r.restoreFromSnapshot(e),!1):(Pt(!0),!0)}function bs(){r.type===t.bitShiftL&&(r.pos-=1,F(t.lessThan)),ut()}function ut(){const e=M(0);for(d(t.lessThan);!a(t.greaterThan)&&!r.error;)K(),p(t.comma);e?(d(t.greaterThan),q(e)):(q(e),C1(),d(t.greaterThan),r.tokens[r.tokens.length-1].isType=!0)}function z1(){if(a(t.name))switch(r.contextualKeyword){case l._abstract:case l._declare:case l._enum:case l._interface:case l._module:case l._namespace:case l._type:return!0}return!1}function Qi(e,n){if(a(t.colon)&&bt(t.colon),!a(t.braceL)&&Ce()){let s=r.tokens.length-1;for(;s>=0&&(r.tokens[s].start>=e||r.tokens[s].type===t._default||r.tokens[s].type===t._export);)r.tokens[s].isType=!0,s--;return}Pt(!1,n)}function Yi(e,n,s){if(!ge()&&p(t.bang)){r.tokens[r.tokens.length-1].type=t.nonNullAssertion;return}if(a(t.lessThan)||a(t.bitShiftL)){const o=r.snapshot();if(!n&&nr()&&Ji())return;if(bs(),!n&&p(t.parenL)?(r.tokens[r.tokens.length-1].subscriptStartIndex=e,Ge()):a(t.backQuote)?Ss():(r.type===t.greaterThan||r.type!==t.parenL&&r.type&t.IS_EXPRESSION_START&&!ge())&&j(),r.error)r.restoreFromSnapshot(o);else return}else!n&&a(t.questionDot)&&Z()===t.lessThan&&(k(),r.tokens[e].isOptionalChainStart=!0,r.tokens[r.tokens.length-1].subscriptStartIndex=e,ut(),d(t.parenL),Ge());Ts(e,n,s)}function Zi(){if(p(t._import))return E(l._type)&&Z()!==t.eq&&se(l._type),is(),!0;if(p(t.eq))return le(),J(),!0;if(oe(l._as))return se(l._namespace),P(),J(),!0;if(E(l._type)){const e=Z();(e===t.braceL||e===t.star)&&k()}return!1}function Ki(){if(P(),a(t.comma)||a(t.braceR)){r.tokens[r.tokens.length-1].identifierRole=v.ImportDeclaration;return}if(P(),a(t.comma)||a(t.braceR)){r.tokens[r.tokens.length-1].identifierRole=v.ImportDeclaration,r.tokens[r.tokens.length-2].isType=!0,r.tokens[r.tokens.length-1].isType=!0;return}if(P(),a(t.comma)||a(t.braceR)){r.tokens[r.tokens.length-3].identifierRole=v.ImportAccess,r.tokens[r.tokens.length-1].identifierRole=v.ImportDeclaration;return}P(),r.tokens[r.tokens.length-3].identifierRole=v.ImportAccess,r.tokens[r.tokens.length-1].identifierRole=v.ImportDeclaration,r.tokens[r.tokens.length-4].isType=!0,r.tokens[r.tokens.length-3].isType=!0,r.tokens[r.tokens.length-2].isType=!0,r.tokens[r.tokens.length-1].isType=!0}function ea(){if(P(),a(t.comma)||a(t.braceR)){r.tokens[r.tokens.length-1].identifierRole=v.ExportAccess;return}if(P(),a(t.comma)||a(t.braceR)){r.tokens[r.tokens.length-1].identifierRole=v.ExportAccess,r.tokens[r.tokens.length-2].isType=!0,r.tokens[r.tokens.length-1].isType=!0;return}if(P(),a(t.comma)||a(t.braceR)){r.tokens[r.tokens.length-3].identifierRole=v.ExportAccess;return}P(),r.tokens[r.tokens.length-3].identifierRole=v.ExportAccess,r.tokens[r.tokens.length-4].isType=!0,r.tokens[r.tokens.length-3].isType=!0,r.tokens[r.tokens.length-2].isType=!0,r.tokens[r.tokens.length-1].isType=!0}function ta(){if(E(l._abstract)&&Z()===t._class)return r.type=t._abstract,k(),nt(!0,!0),!0;if(E(l._interface)){const e=M(2);return Zt(l._interface,!0),q(e),!0}return!1}function na(){if(r.type===t._const){const e=St();if(e.type===t.name&&e.contextualKeyword===l._enum)return d(t._const),se(l._enum),r.tokens[r.tokens.length-1].type=t._enum,ys(),!0}return!1}function sa(e){const n=r.tokens.length;_s([l._abstract,l._readonly,l._declare,l._static,l._override]);const s=r.tokens.length;if(V1()){const i=e?n-1:n;for(let c=i;c<s;c++)r.tokens[c].isType=!0;return!0}return!1}function ra(e){zi(e)||J()}function oa(){const e=oe(l._declare);e&&(r.tokens[r.tokens.length-1].type=t._declare);let n=!1;if(a(t.name))if(e){const s=M(2);n=i1(),q(s)}else n=i1();if(!n)if(e){const s=M(2);Ie(!0),q(s)}else Ie(!0)}function ia(e){if(e&&(a(t.lessThan)||a(t.bitShiftL))&&bs(),oe(l._implements)){r.tokens[r.tokens.length-1].type=t._implements;const n=M(1);X1(),q(n)}}function aa(){st()}function ca(){st()}function la(){const e=M(0);ge()||p(t.bang),lt(),q(e)}function ua(){a(t.colon)&&Nt()}function ha(e,n){return zt?pa(e,n):fa(e,n)}function pa(e,n){if(!a(t.lessThan))return Pe(e,n);const s=r.snapshot();let o=Pe(e,n);if(r.error)r.restoreFromSnapshot(s);else return o;return r.type=t.typeParameterStart,Yt(),o=Pe(e,n),o||j(),o}function fa(e,n){if(!a(t.lessThan))return Pe(e,n);const s=r.snapshot();Yt();const o=Pe(e,n);if(o||j(),r.error)r.restoreFromSnapshot(s);else return o;return Pe(e,n)}function ma(){if(a(t.colon)){const e=r.snapshot();bt(t.colon),ye()&&j(),a(t.arrow)||j(),r.error&&r.restoreFromSnapshot(e)}return p(t.arrow)}function da(){const e=M(0);p(t.question),lt(),q(e)}function ka(){(a(t.lessThan)||a(t.bitShiftL))&&bs(),mr()}function ga(){let e=!1,n=!1;for(;;){if(r.pos>=b.length){j("Unterminated JSX contents");return}const s=b.charCodeAt(r.pos);if(s===u.lessThan||s===u.leftCurlyBrace){if(r.pos===r.start){if(s===u.lessThan){r.pos++,F(t.jsxTagStart);return}P1(s);return}F(e&&!n?t.jsxEmptyText:t.jsxText);return}s===u.lineFeed?e=!0:s!==u.space&&s!==u.carriageReturn&&s!==u.tab&&(n=!0),r.pos++}}function _a(e){for(r.pos++;;){if(r.pos>=b.length){j("Unterminated string constant");return}if(b.charCodeAt(r.pos)===e){r.pos++;break}r.pos++}F(t.string)}function xa(){let e;do{if(r.pos>b.length){j("Unexpectedly reached the end of input.");return}e=b.charCodeAt(++r.pos)}while(Ae[e]||e===u.dash);F(t.jsxName)}function as(){be()}function J1(e){if(as(),!p(t.colon)){r.tokens[r.tokens.length-1].identifierRole=e;return}as()}function Q1(){const e=r.tokens.length;J1(v.Access);let n=!1;for(;a(t.dot);)n=!0,be(),as();if(!n){const s=r.tokens[e],o=b.charCodeAt(s.start);o>=u.lowercaseA&&o<=u.lowercaseZ&&(s.identifierRole=null)}}function ya(){switch(r.type){case t.braceL:k(),le(),be();return;case t.jsxTagStart:Z1(),be();return;case t.string:be();return;default:j("JSX value should be either an expression or a quoted JSX text")}}function Ia(){d(t.ellipsis),le()}function ba(e){if(a(t.jsxTagEnd))return!1;Q1(),B&&Mi();let n=!1;for(;!a(t.slash)&&!a(t.jsxTagEnd)&&!r.error;){if(p(t.braceL)){n=!0,d(t.ellipsis),ue(),be();continue}n&&r.end-r.start===3&&b.charCodeAt(r.start)===u.lowercaseK&&b.charCodeAt(r.start+1)===u.lowercaseE&&b.charCodeAt(r.start+2)===u.lowercaseY&&(r.tokens[e].jsxRole=Te.KeyAfterPropSpread),J1(v.ObjectKey),a(t.eq)&&(be(),ya())}const s=a(t.slash);return s&&be(),s}function wa(){a(t.jsxTagEnd)||Q1()}function Y1(){const e=r.tokens.length-1;r.tokens[e].jsxRole=Te.NoChildren;let n=0;if(!ba(e))for(at();;)switch(r.type){case t.jsxTagStart:if(be(),a(t.slash)){be(),wa(),r.tokens[e].jsxRole!==Te.KeyAfterPropSpread&&(n===1?r.tokens[e].jsxRole=Te.OneChild:n>1&&(r.tokens[e].jsxRole=Te.StaticChildren));return}n++,Y1(),at();break;case t.jsxText:n++,at();break;case t.jsxEmptyText:at();break;case t.braceL:k(),a(t.ellipsis)?(Ia(),at(),n+=2):(a(t.braceR)||(n++,le()),at());break;default:j();return}}function Z1(){be(),Y1()}function be(){r.tokens.push(new Jt),v1(),r.start=r.pos;const e=b.charCodeAt(r.pos);if(Et[e])xa();else if(e===u.quotationMark||e===u.apostrophe)_a(e);else switch(++r.pos,e){case u.greaterThan:F(t.jsxTagEnd);break;case u.lessThan:F(t.jsxTagStart);break;case u.slash:F(t.slash);break;case u.equalsTo:F(t.eq);break;case u.leftCurlyBrace:F(t.braceL);break;case u.dot:F(t.dot);break;case u.colon:F(t.colon);break;default:j()}}function at(){r.tokens.push(new Jt),r.start=r.pos,ga()}function Ta(e){if(a(t.question)){const n=Z();if(n===t.colon||n===t.comma||n===t.parenR)return}K1(e)}function Aa(){w1(t.question),a(t.colon)&&(B?Nt():H&&rt())}class Ea{constructor(n){this.stop=n}}function le(e=!1){if(ue(e),a(t.comma))for(;p(t.comma);)ue(e)}function ue(e=!1,n=!1){return B?ha(e,n):H?Pc(e,n):Pe(e,n)}function Pe(e,n){if(a(t._yield))return Ua(),!1;(a(t.parenL)||a(t.name)||a(t._yield))&&(r.potentialArrowAt=r.start);const s=Sa(e);return n&&Es(),r.type&t.IS_ASSIGN?(k(),ue(e),!1):s}function Sa(e){return Na(e)?!0:(va(e),!1)}function va(e){B||H?Ta(e):K1(e)}function K1(e){p(t.question)&&(ue(),d(t.colon),ue(e))}function Na(e){const n=r.tokens.length;return Ct()?!0:(Ot(n,-1,e),!1)}function Ot(e,n,s){if(B&&(t._in&t.PRECEDENCE_MASK)>n&&!ge()&&(oe(l._as)||oe(l._satisfies))){const i=M(1);K(),q(i),C1(),Ot(e,n,s);return}const o=r.type&t.PRECEDENCE_MASK;if(o>0&&(!s||!a(t._in))&&o>n){const i=r.type;k(),i===t.nullishCoalescing&&(r.tokens[r.tokens.length-1].nullishStartIndex=e);const c=r.tokens.length;Ct(),Ot(c,i&t.IS_RIGHT_ASSOCIATIVE?o-1:o,s),i===t.nullishCoalescing&&(r.tokens[e].numNullishCoalesceStarts++,r.tokens[r.tokens.length-1].numNullishCoalesceEnds++),Ot(e,n,s)}}function Ct(){if(B&&!zt&&p(t.lessThan))return qi(),!1;if(E(l._module)&&A1()===u.leftCurlyBrace&&!_1())return Ha(),!1;if(r.type&t.IS_PREFIX)return k(),Ct(),!1;if(er())return!0;for(;r.type&t.IS_POSTFIX&&!ye();)r.type===t.preIncDec&&(r.type=t.postIncDec),k();return!1}function er(){const e=r.tokens.length;return Me()?!0:(ws(e),r.tokens.length>e&&r.tokens[e].isOptionalChainStart&&(r.tokens[r.tokens.length-1].isOptionalChainEnd=!0),!1)}function ws(e,n=!1){H?Lc(e,n):tr(e,n)}function tr(e,n=!1){const s=new Ea(!1);do Ca(e,n,s);while(!s.stop&&!r.error)}function Ca(e,n,s){B?Yi(e,n,s):H?fc(e,n,s):Ts(e,n,s)}function Ts(e,n,s){if(!n&&p(t.doubleColon))As(),s.stop=!0,ws(e,n);else if(a(t.questionDot)){if(r.tokens[e].isOptionalChainStart=!0,n&&Z()===t.parenL){s.stop=!0;return}k(),r.tokens[r.tokens.length-1].subscriptStartIndex=e,p(t.bracketL)?(le(),d(t.bracketR)):p(t.parenL)?Ge():Ht()}else if(p(t.dot))r.tokens[r.tokens.length-1].subscriptStartIndex=e,Ht();else if(p(t.bracketL))r.tokens[r.tokens.length-1].subscriptStartIndex=e,le(),d(t.bracketR);else if(!n&&a(t.parenL))if(nr()){const o=r.snapshot(),i=r.tokens.length;k(),r.tokens[r.tokens.length-1].subscriptStartIndex=e;const c=yt();r.tokens[r.tokens.length-1].contextId=c,Ge(),r.tokens[r.tokens.length-1].contextId=c,Pa()&&(r.restoreFromSnapshot(o),s.stop=!0,r.scopeDepth++,ht(),Ra(i))}else{k(),r.tokens[r.tokens.length-1].subscriptStartIndex=e;const o=yt();r.tokens[r.tokens.length-1].contextId=o,Ge(),r.tokens[r.tokens.length-1].contextId=o}else a(t.backQuote)?Ss():s.stop=!0}function nr(){return r.tokens[r.tokens.length-1].contextualKeyword===l._async&&!ye()}function Ge(){let e=!0;for(;!p(t.parenR)&&!r.error;){if(e)e=!1;else if(d(t.comma),p(t.parenR))break;ir(!1)}}function Pa(){return a(t.colon)||a(t.arrow)}function Ra(e){B?ua():H&&Cc(),d(t.arrow),Tt(e)}function As(){const e=r.tokens.length;Me(),ws(e,!0)}function Me(){if(p(t.modulo))return P(),!1;if(a(t.jsxText)||a(t.jsxEmptyText))return ct(),!1;if(a(t.lessThan)&&zt)return r.type=t.jsxTagStart,Z1(),k(),!1;const e=r.potentialArrowAt===r.start;switch(r.type){case t.slash:case t.assign:io();case t._super:case t._this:case t.regexp:case t.num:case t.bigint:case t.decimal:case t.string:case t._null:case t._true:case t._false:return k(),!1;case t._import:return k(),a(t.dot)&&(r.tokens[r.tokens.length-1].type=t.name,k(),P()),!1;case t.name:{const n=r.tokens.length,s=r.start,o=r.contextualKeyword;return P(),o===l._await?($a(),!1):o===l._async&&a(t._function)&&!ye()?(k(),tt(s,!1),!1):e&&o===l._async&&!ye()&&a(t.name)?(r.scopeDepth++,Je(!1),d(t.arrow),Tt(n),!0):a(t._do)&&!ye()?(k(),ze(),!1):e&&!ye()&&a(t.arrow)?(r.scopeDepth++,ks(!1),d(t.arrow),Tt(n),!0):(r.tokens[r.tokens.length-1].identifierRole=v.Access,!1)}case t._do:return k(),ze(),!1;case t.parenL:return sr(e);case t.bracketL:return k(),or(t.bracketR,!0),!1;case t.braceL:return vs(!1,!1),!1;case t._function:return La(),!1;case t.at:js();case t._class:return nt(!1),!1;case t._new:return Oa(),!1;case t.backQuote:return Ss(),!1;case t.doubleColon:return k(),As(),!1;case t.hash:{const n=A1();return Et[n]||n===u.backslash?Ht():k(),!1}default:return j(),!1}}function Ht(){p(t.hash),P()}function La(){const e=r.start;P(),p(t.dot)&&P(),tt(e,!1)}function ct(){k()}function Kt(){d(t.parenL),le(),d(t.parenR)}function sr(e){const n=r.snapshot(),s=r.tokens.length;d(t.parenL);let o=!0;for(;!a(t.parenR)&&!r.error;){if(o)o=!1;else if(d(t.comma),a(t.parenR))break;if(a(t.ellipsis)){M1(!1),Es();break}else ue(!1,!0)}return d(t.parenR),e&&Da()&&cs()?(r.restoreFromSnapshot(n),r.scopeDepth++,ht(),cs(),Tt(s),r.error?(r.restoreFromSnapshot(n),sr(!1),!1):!0):!1}function Da(){return a(t.colon)||!ye()}function cs(){return B?ma():H?Rc():p(t.arrow)}function Es(){(B||H)&&Aa()}function Oa(){if(d(t._new),p(t.dot)){P();return}Fa(),H&&mc(),p(t.parenL)&&or(t.parenR)}function Fa(){As(),p(t.questionDot)}function Ss(){for(We(),We();!a(t.backQuote)&&!r.error;)d(t.dollarBraceL),le(),We(),We();k()}function vs(e,n){const s=yt();let o=!0;for(k(),r.tokens[r.tokens.length-1].contextId=s;!p(t.braceR)&&!r.error;){if(o)o=!1;else if(d(t.comma),p(t.braceR))break;let i=!1;if(a(t.ellipsis)){const c=r.tokens.length;if(q1(),e&&(r.tokens.length===c+2&&ks(n),p(t.braceR)))break;continue}e||(i=p(t.star)),!e&&E(l._async)?(i&&j(),P(),a(t.colon)||a(t.parenL)||a(t.braceR)||a(t.eq)||a(t.comma)||(a(t.star)&&(k(),i=!0),wt(s))):wt(s),Ba(e,n,s)}r.tokens[r.tokens.length-1].contextId=s}function ja(e){return!e&&(a(t.string)||a(t.num)||a(t.bracketL)||a(t.name)||!!(r.type&t.IS_KEYWORD))}function qa(e,n){const s=r.start;return a(t.parenL)?(e&&j(),ls(s,!1),!0):ja(e)?(wt(n),ls(s,!1),!0):!1}function Ma(e,n){if(p(t.colon)){e?$t(n):ue(!1);return}let s;e?r.scopeDepth===0?s=v.ObjectShorthandTopLevelDeclaration:n?s=v.ObjectShorthandBlockScopedDeclaration:s=v.ObjectShorthandFunctionScopedDeclaration:s=v.ObjectShorthand,r.tokens[r.tokens.length-1].identifierRole=s,$t(n,!0)}function Ba(e,n,s){B?aa():H&&Tc(),qa(e,s)||Ma(e,n)}function wt(e){H&&Fs(),p(t.bracketL)?(r.tokens[r.tokens.length-1].contextId=e,ue(),d(t.bracketR),r.tokens[r.tokens.length-1].contextId=e):(a(t.num)||a(t.string)||a(t.bigint)||a(t.decimal)?Me():Ht(),r.tokens[r.tokens.length-1].identifierRole=v.ObjectKey,r.tokens[r.tokens.length-1].contextId=e)}function ls(e,n){const s=yt();r.scopeDepth++;const o=r.tokens.length;ht(n,s),rr(e,s);const c=r.tokens.length;r.scopes.push(new Re(o,c,!0)),r.scopeDepth--}function Tt(e){Pt(!0);const n=r.tokens.length;r.scopes.push(new Re(e,n,!0)),r.scopeDepth--}function rr(e,n=0){B?Qi(e,n):H?pc(n):Pt(!1,n)}function Pt(e,n=0){e&&!a(t.braceL)?ue():ze(!0,n)}function or(e,n=!1){let s=!0;for(;!p(e)&&!r.error;){if(s)s=!1;else if(d(t.comma),p(e))break;ir(n)}}function ir(e){e&&a(t.comma)||(a(t.ellipsis)?(q1(),Es()):a(t.question)?k():ue(!1,!0))}function P(){k(),r.tokens[r.tokens.length-1].type=t.name}function $a(){Ct()}function Ua(){k(),!a(t.semi)&&!ye()&&(p(t.star),ue())}function Ha(){se(l._module),d(t.braceL),tn(t.braceR)}function Va(e){return(e.type===t.name||!!(e.type&t.IS_KEYWORD))&&e.contextualKeyword!==l._from}function Le(e){const n=M(0);d(e||t.colon),xe(),q(n)}function a1(){d(t.modulo),se(l._checks),p(t.parenL)&&(le(),d(t.parenR))}function Ns(){const e=M(0);d(t.colon),a(t.modulo)?a1():(xe(),a(t.modulo)&&a1()),q(e)}function Wa(){k(),Cs(!0)}function Xa(){k(),P(),a(t.lessThan)&&Se(),d(t.parenL),hs(),d(t.parenR),Ns(),J()}function us(){a(t._class)?Wa():a(t._function)?Xa():a(t._var)?Ga():oe(l._module)?p(t.dot)?Qa():za():E(l._type)?Ya():E(l._opaque)?Za():E(l._interface)?Ka():a(t._export)?Ja():j()}function Ga(){k(),ur(),J()}function za(){for(a(t.string)?Me():P(),d(t.braceL);!a(t.braceR)&&!r.error;)a(t._import)?(k(),yr()):j();d(t.braceR)}function Ja(){d(t._export),p(t._default)?a(t._function)||a(t._class)?us():(xe(),J()):a(t._var)||a(t._function)||a(t._class)||E(l._opaque)?us():a(t.star)||a(t.braceL)||E(l._interface)||E(l._type)||E(l._opaque)?_r():j()}function Qa(){se(l._exports),rt(),J()}function Ya(){k(),Rs()}function Za(){k(),Ls(!0)}function Ka(){k(),Cs()}function Cs(e=!1){if(en(),a(t.lessThan)&&Se(),p(t._extends))do Ft();while(!e&&p(t.comma));if(E(l._mixins)){k();do Ft();while(p(t.comma))}if(E(l._implements)){k();do Ft();while(p(t.comma))}Vt(e,!1,e)}function Ft(){ar(!1),a(t.lessThan)&&et()}function Ps(){Cs()}function en(){P()}function Rs(){en(),a(t.lessThan)&&Se(),Le(t.eq),J()}function Ls(e){se(l._type),en(),a(t.lessThan)&&Se(),a(t.colon)&&Le(t.colon),e||Le(t.eq),J()}function ec(){Fs(),ur(),p(t.eq)&&xe()}function Se(){const e=M(0);a(t.lessThan)||a(t.typeParameterStart)?k():j();do ec(),a(t.greaterThan)||d(t.comma);while(!a(t.greaterThan)&&!r.error);d(t.greaterThan),q(e)}function et(){const e=M(0);for(d(t.lessThan);!a(t.greaterThan)&&!r.error;)xe(),a(t.greaterThan)||d(t.comma);d(t.greaterThan),q(e)}function tc(){if(se(l._interface),p(t._extends))do Ft();while(p(t.comma));Vt(!1,!1,!1)}function Ds(){a(t.num)||a(t.string)?Me():P()}function nc(){Z()===t.colon?(Ds(),Le()):xe(),d(t.bracketR),Le()}function sc(){Ds(),d(t.bracketR),d(t.bracketR),a(t.lessThan)||a(t.parenL)?Os():(p(t.question),Le())}function Os(){for(a(t.lessThan)&&Se(),d(t.parenL);!a(t.parenR)&&!a(t.ellipsis)&&!r.error;)Wt(),a(t.parenR)||d(t.comma);p(t.ellipsis)&&Wt(),d(t.parenR),Le()}function rc(){Os()}function Vt(e,n,s){let o;for(n&&a(t.braceBarL)?(d(t.braceBarL),o=t.braceBarR):(d(t.braceL),o=t.braceR);!a(o)&&!r.error;){if(s&&E(l._proto)){const i=Z();i!==t.colon&&i!==t.question&&(k(),e=!1)}if(e&&E(l._static)){const i=Z();i!==t.colon&&i!==t.question&&k()}if(Fs(),p(t.bracketL))p(t.bracketL)?sc():nc();else if(a(t.parenL)||a(t.lessThan))rc();else{if(E(l._get)||E(l._set)){const i=Z();(i===t.name||i===t.string||i===t.num)&&k()}oc()}ic()}d(o)}function oc(){if(a(t.ellipsis)){if(d(t.ellipsis),p(t.comma)||p(t.semi),a(t.braceR))return;xe()}else Ds(),a(t.lessThan)||a(t.parenL)?Os():(p(t.question),Le())}function ic(){!p(t.semi)&&!p(t.comma)&&!a(t.braceR)&&!a(t.braceBarR)&&j()}function ar(e){for(e||P();p(t.dot);)P()}function ac(){ar(!0),a(t.lessThan)&&et()}function cc(){d(t._typeof),cr()}function lc(){for(d(t.bracketL);r.pos<b.length&&!a(t.bracketR)&&(xe(),!a(t.bracketR));)d(t.comma);d(t.bracketR)}function Wt(){const e=Z();e===t.colon||e===t.question?(P(),p(t.question),Le()):xe()}function hs(){for(;!a(t.parenR)&&!a(t.ellipsis)&&!r.error;)Wt(),a(t.parenR)||d(t.comma);p(t.ellipsis)&&Wt()}function cr(){let e=!1;const n=r.noAnonFunctionType;switch(r.type){case t.name:{if(E(l._interface)){tc();return}P(),ac();return}case t.braceL:Vt(!1,!1,!1);return;case t.braceBarL:Vt(!1,!0,!1);return;case t.bracketL:lc();return;case t.lessThan:Se(),d(t.parenL),hs(),d(t.parenR),d(t.arrow),xe();return;case t.parenL:if(k(),!a(t.parenR)&&!a(t.ellipsis))if(a(t.name)){const s=Z();e=s!==t.question&&s!==t.colon}else e=!0;if(e)if(r.noAnonFunctionType=!1,xe(),r.noAnonFunctionType=n,r.noAnonFunctionType||!(a(t.comma)||a(t.parenR)&&Z()===t.arrow)){d(t.parenR);return}else p(t.comma);hs(),d(t.parenR),d(t.arrow),xe();return;case t.minus:k(),ct();return;case t.string:case t.num:case t._true:case t._false:case t._null:case t._this:case t._void:case t.star:k();return;default:if(r.type===t._typeof){cc();return}else if(r.type&t.IS_KEYWORD){k(),r.tokens[r.tokens.length-1].type=t.name;return}}j()}function uc(){for(cr();!ye()&&(a(t.bracketL)||a(t.questionDot));)p(t.questionDot),d(t.bracketL),p(t.bracketR)||(xe(),d(t.bracketR))}function lr(){p(t.question)?lr():uc()}function c1(){lr(),!r.noAnonFunctionType&&p(t.arrow)&&xe()}function l1(){for(p(t.bitwiseAND),c1();p(t.bitwiseAND);)c1()}function hc(){for(p(t.bitwiseOR),l1();p(t.bitwiseOR);)l1()}function xe(){hc()}function rt(){Le()}function ur(){P(),a(t.colon)&&rt()}function Fs(){(a(t.plus)||a(t.minus))&&(k(),r.tokens[r.tokens.length-1].isType=!0)}function pc(e){a(t.colon)&&Ns(),Pt(!1,e)}function fc(e,n,s){if(a(t.questionDot)&&Z()===t.lessThan){if(n){s.stop=!0;return}k(),et(),d(t.parenL),Ge();return}else if(!n&&a(t.lessThan)){const o=r.snapshot();if(et(),d(t.parenL),Ge(),r.error)r.restoreFromSnapshot(o);else return}Ts(e,n,s)}function mc(){if(a(t.lessThan)){const e=r.snapshot();et(),r.error&&r.restoreFromSnapshot(e)}}function dc(){if(a(t.name)&&r.contextualKeyword===l._interface){const e=M(0);return k(),Ps(),q(e),!0}else if(E(l._enum))return hr(),!0;return!1}function kc(){return E(l._enum)?(hr(),!0):!1}function gc(e){if(e===l._declare){if(a(t._class)||a(t.name)||a(t._function)||a(t._var)||a(t._export)){const n=M(1);us(),q(n)}}else if(a(t.name)){if(e===l._interface){const n=M(1);Ps(),q(n)}else if(e===l._type){const n=M(1);Rs(),q(n)}else if(e===l._opaque){const n=M(1);Ls(!1),q(n)}}J()}function _c(){return E(l._type)||E(l._interface)||E(l._opaque)||E(l._enum)}function xc(){return a(t.name)&&(r.contextualKeyword===l._type||r.contextualKeyword===l._interface||r.contextualKeyword===l._opaque||r.contextualKeyword===l._enum)}function yc(){if(E(l._type)){const e=M(1);k(),a(t.braceL)?(qs(),At()):Rs(),q(e)}else if(E(l._opaque)){const e=M(1);k(),Ls(!1),q(e)}else if(E(l._interface)){const e=M(1);k(),Ps(),q(e)}else Ie(!0)}function Ic(){return a(t.star)||E(l._type)&&Z()===t.star}function bc(){if(oe(l._type)){const e=M(2);ps(),q(e)}else ps()}function wc(e){if(e&&a(t.lessThan)&&et(),E(l._implements)){const n=M(0);k(),r.tokens[r.tokens.length-1].type=t._implements;do en(),a(t.lessThan)&&et();while(p(t.comma));q(n)}}function Tc(){a(t.lessThan)&&(Se(),a(t.parenL)||j())}function Ac(){const e=M(0);p(t.question),a(t.colon)&&rt(),q(e)}function Ec(){if(a(t._typeof)||E(l._type)){const e=St();(Va(e)||e.type===t.braceL||e.type===t.star)&&k()}}function Sc(){const e=r.contextualKeyword===l._type||r.type===t._typeof;e?k():P(),E(l._as)&&!fs(l._as)?(P(),e&&!a(t.name)&&!(r.type&t.IS_KEYWORD)||P()):(e&&(a(t.name)||r.type&t.IS_KEYWORD)&&P(),oe(l._as)&&P())}function vc(){if(a(t.lessThan)){const e=M(0);Se(),q(e)}}function Nc(){a(t.colon)&&rt()}function Cc(){if(a(t.colon)){const e=r.noAnonFunctionType;r.noAnonFunctionType=!0,rt(),r.noAnonFunctionType=e}}function Pc(e,n){if(a(t.lessThan)){const s=r.snapshot();let o=Pe(e,n);if(r.error)r.restoreFromSnapshot(s),r.type=t.typeParameterStart;else return o;const i=M(0);if(Se(),q(i),o=Pe(e,n),o)return!0;j()}return Pe(e,n)}function Rc(){if(a(t.colon)){const e=M(0),n=r.snapshot(),s=r.noAnonFunctionType;r.noAnonFunctionType=!0,Ns(),r.noAnonFunctionType=s,ye()&&j(),a(t.arrow)||j(),r.error&&r.restoreFromSnapshot(n),q(e)}return p(t.arrow)}function Lc(e,n=!1){if(r.tokens[r.tokens.length-1].contextualKeyword===l._async&&a(t.lessThan)){const s=r.snapshot();if(Dc()&&!r.error)return;r.restoreFromSnapshot(s)}tr(e,n)}function Dc(){r.scopeDepth++;const e=r.tokens.length;return ht(),cs()?(Tt(e),!0):!1}function hr(){se(l._enum),r.tokens[r.tokens.length-1].type=t._enum,P(),Oc()}function Oc(){oe(l._of)&&k(),d(t.braceL),Fc(),d(t.braceR)}function Fc(){for(;!a(t.braceR)&&!r.error&&!p(t.ellipsis);)jc(),a(t.braceR)||d(t.comma)}function jc(){P(),p(t.eq)&&k()}function qc(){if(tn(t.eof),r.scopes.push(new Re(0,r.tokens.length,!0)),r.scopeDepth!==0)throw new Error(`Invalid scope depth at end of file: ${r.scopeDepth}`);return new Tl(r.tokens,r.scopes)}function Ie(e){H&&dc()||(a(t.at)&&js(),Mc(e))}function Mc(e){if(B&&na())return;const n=r.type;switch(n){case t._break:case t._continue:$c();return;case t._debugger:Uc();return;case t._do:Hc();return;case t._for:Vc();return;case t._function:if(Z()===t.dot)break;e||j(),Gc();return;case t._class:e||j(),nt(!0);return;case t._if:zc();return;case t._return:Jc();return;case t._switch:Qc();return;case t._throw:Yc();return;case t._try:Kc();return;case t._let:case t._const:e||j();case t._var:jt(n!==t._var);return;case t._while:el();return;case t.braceL:ze();return;case t.semi:tl();return;case t._export:case t._import:{const i=Z();if(i===t.parenL||i===t.dot)break;k(),n===t._import?yr():_r();return}case t.name:if(r.contextualKeyword===l._async){const i=r.start,c=r.snapshot();if(k(),a(t._function)&&!ye()){d(t._function),tt(i,!0);return}else r.restoreFromSnapshot(c)}else if(r.contextualKeyword===l._using&&!_1()&&Z()===t.name){jt(!0);return}else if(pr()){se(l._await),jt(!0);return}}const s=r.tokens.length;le();let o=null;if(r.tokens.length===s+1){const i=r.tokens[r.tokens.length-1];i.type===t.name&&(o=i.contextualKeyword)}if(o==null){J();return}p(t.colon)?nl():sl(o)}function pr(){if(!E(l._await))return!1;const e=r.snapshot();return k(),!E(l._using)||ge()||(k(),!a(t.name)||ge())?(r.restoreFromSnapshot(e),!1):(r.restoreFromSnapshot(e),!0)}function js(){for(;a(t.at);)fr()}function fr(){if(k(),p(t.parenL))le(),d(t.parenR);else{for(P();p(t.dot);)P();Bc()}}function Bc(){B?ka():mr()}function mr(){p(t.parenL)&&Ge()}function $c(){k(),Ce()||(P(),J())}function Uc(){k(),J()}function Hc(){k(),Ie(!1),d(t._while),Kt(),p(t.semi)}function Vc(){r.scopeDepth++;const e=r.tokens.length;Xc();const n=r.tokens.length;r.scopes.push(new Re(e,n,!1)),r.scopeDepth--}function Wc(){return!(!E(l._using)||fs(l._of))}function Xc(){k();let e=!1;if(E(l._await)&&(e=!0,k()),d(t.parenL),a(t.semi)){e&&j(),Kn();return}const n=pr();if(n||a(t._var)||a(t._let)||a(t._const)||Wc()){if(n&&se(l._await),k(),dr(!0,r.type!==t._var),a(t._in)||E(l._of)){u1(e);return}Kn();return}if(le(!0),a(t._in)||E(l._of)){u1(e);return}e&&j(),Kn()}function Gc(){const e=r.start;k(),tt(e,!0)}function zc(){k(),Kt(),Ie(!1),p(t._else)&&Ie(!1)}function Jc(){k(),Ce()||(le(),J())}function Qc(){k(),Kt(),r.scopeDepth++;const e=r.tokens.length;for(d(t.braceL);!a(t.braceR)&&!r.error;)if(a(t._case)||a(t._default)){const s=a(t._case);k(),s&&le(),d(t.colon)}else Ie(!0);k();const n=r.tokens.length;r.scopes.push(new Re(e,n,!1)),r.scopeDepth--}function Yc(){k(),le(),J()}function Zc(){Qt(!0),B&&lt()}function Kc(){if(k(),ze(),a(t._catch)){k();let e=null;if(a(t.parenL)&&(r.scopeDepth++,e=r.tokens.length,d(t.parenL),Zc(),d(t.parenR)),ze(),e!=null){const n=r.tokens.length;r.scopes.push(new Re(e,n,!1)),r.scopeDepth--}}p(t._finally)&&ze()}function jt(e){k(),dr(!1,e),J()}function el(){k(),Kt(),Ie(!1)}function tl(){k()}function nl(){Ie(!0)}function sl(e){B?ra(e):H?gc(e):J()}function ze(e=!1,n=0){const s=r.tokens.length;r.scopeDepth++,d(t.braceL),n&&(r.tokens[r.tokens.length-1].contextId=n),tn(t.braceR),n&&(r.tokens[r.tokens.length-1].contextId=n);const o=r.tokens.length;r.scopes.push(new Re(s,o,e)),r.scopeDepth--}function tn(e){for(;!p(e)&&!r.error;)Ie(!0)}function Kn(){d(t.semi),a(t.semi)||le(),d(t.semi),a(t.parenR)||le(),d(t.parenR),Ie(!1)}function u1(e){e?oe(l._of):k(),le(),d(t.parenR),Ie(!1)}function dr(e,n){for(;;){if(rl(n),p(t.eq)){const s=r.tokens.length-1;ue(e),r.tokens[s].rhsEndIndex=r.tokens.length}if(!p(t.comma))break}}function rl(e){Qt(e),B?la():H&&Nc()}function tt(e,n,s=!1){a(t.star)&&k(),n&&!s&&!a(t.name)&&!a(t._yield)&&j();let o=null;a(t.name)&&(n||(o=r.tokens.length,r.scopeDepth++),Je(!1));const i=r.tokens.length;r.scopeDepth++,ht(),rr(e);const c=r.tokens.length;r.scopes.push(new Re(i,c,!0)),r.scopeDepth--,o!==null&&(r.scopes.push(new Re(o,c,!0)),r.scopeDepth--)}function ht(e=!1,n=0){B?ca():H&&vc(),d(t.parenL),n&&(r.tokens[r.tokens.length-1].contextId=n),gs(t.parenR,!1,!1,e,n),n&&(r.tokens[r.tokens.length-1].contextId=n)}function nt(e,n=!1){const s=yt();k(),r.tokens[r.tokens.length-1].contextId=s,r.tokens[r.tokens.length-1].isExpression=!e;let o=null;e||(o=r.tokens.length,r.scopeDepth++),cl(e,n),ll();const i=r.tokens.length;if(ol(s),!r.error&&(r.tokens[i].contextId=s,r.tokens[r.tokens.length-1].contextId=s,o!==null)){const c=r.tokens.length;r.scopes.push(new Re(o,c,!1)),r.scopeDepth--}}function kr(){return a(t.eq)||a(t.semi)||a(t.braceR)||a(t.bang)||a(t.colon)}function gr(){return a(t.parenL)||a(t.lessThan)}function ol(e){for(d(t.braceL);!p(t.braceR)&&!r.error;){if(p(t.semi))continue;if(a(t.at)){fr();continue}const n=r.start;il(n,e)}}function il(e,n){B&&_s([l._declare,l._public,l._protected,l._private,l._override]);let s=!1;if(a(t.name)&&r.contextualKeyword===l._static){if(P(),gr()){gt(e,!1);return}else if(kr()){qt();return}if(r.tokens[r.tokens.length-1].type=t._static,s=!0,a(t.braceL)){r.tokens[r.tokens.length-1].contextId=n,ze();return}}al(e,s,n)}function al(e,n,s){if(B&&sa(n))return;if(p(t.star)){kt(s),gt(e,!1);return}kt(s);let o=!1;const i=r.tokens[r.tokens.length-1];i.contextualKeyword===l._constructor&&(o=!0),h1(),gr()?gt(e,o):kr()?qt():i.contextualKeyword===l._async&&!Ce()?(r.tokens[r.tokens.length-1].type=t._async,a(t.star)&&k(),kt(s),h1(),gt(e,!1)):(i.contextualKeyword===l._get||i.contextualKeyword===l._set)&&!(Ce()&&a(t.star))?(i.contextualKeyword===l._get?r.tokens[r.tokens.length-1].type=t._get:r.tokens[r.tokens.length-1].type=t._set,kt(s),gt(e,!1)):i.contextualKeyword===l._accessor&&!Ce()?(kt(s),qt()):Ce()?qt():j()}function gt(e,n){B?st():H&&a(t.lessThan)&&Se(),ls(e,n)}function kt(e){wt(e)}function h1(){if(B){const e=M(0);p(t.question),q(e)}}function qt(){if(B?(w1(t.bang),lt()):H&&a(t.colon)&&rt(),a(t.eq)){const e=r.tokens.length;k(),ue(),r.tokens[e].rhsEndIndex=r.tokens.length}J()}function cl(e,n=!1){B&&(!e||n)&&E(l._implements)||(a(t.name)&&Je(!0),B?st():H&&a(t.lessThan)&&Se())}function ll(){let e=!1;p(t._extends)?(er(),e=!0):e=!1,B?ia(e):H&&wc(e)}function _r(){const e=r.tokens.length-1;B&&Zi()||(fl()?ml():pl()?(P(),a(t.comma)&&Z()===t.star?(d(t.comma),d(t.star),se(l._as),P()):xr(),At()):p(t._default)?ul():kl()?hl():(qs(),At()),r.tokens[e].rhsEndIndex=r.tokens.length)}function ul(){if(B&&ta()||H&&kc())return;const e=r.start;p(t._function)?tt(e,!0,!0):E(l._async)&&Z()===t._function?(oe(l._async),p(t._function),tt(e,!0,!0)):a(t._class)?nt(!0,!0):a(t.at)?(js(),nt(!0,!0)):(ue(),J())}function hl(){B?oa():H?yc():Ie(!0)}function pl(){if(B&&z1())return!1;if(H&&xc())return!1;if(a(t.name))return r.contextualKeyword!==l._async;if(!a(t._default))return!1;const e=ms(),n=St(),s=n.type===t.name&&n.contextualKeyword===l._from;if(n.type===t.comma)return!0;if(s){const o=b.charCodeAt(T1(e+4));return o===u.quotationMark||o===u.apostrophe}return!1}function xr(){p(t.comma)&&qs()}function At(){oe(l._from)&&(Me(),Ir()),J()}function fl(){return H?Ic():a(t.star)}function ml(){H?bc():ps()}function ps(){d(t.star),E(l._as)?dl():At()}function dl(){k(),r.tokens[r.tokens.length-1].type=t._as,P(),xr(),At()}function kl(){return B&&z1()||H&&_c()||r.type===t._var||r.type===t._const||r.type===t._let||r.type===t._function||r.type===t._class||E(l._async)||a(t.at)}function qs(){let e=!0;for(d(t.braceL);!p(t.braceR)&&!r.error;){if(e)e=!1;else if(d(t.comma),p(t.braceR))break;gl()}}function gl(){if(B){ea();return}P(),r.tokens[r.tokens.length-1].identifierRole=v.ExportAccess,oe(l._as)&&P()}function _l(){const e=r.snapshot();return se(l._module),oe(l._from)?E(l._from)?(r.restoreFromSnapshot(e),!0):(r.restoreFromSnapshot(e),!1):a(t.comma)?(r.restoreFromSnapshot(e),!1):(r.restoreFromSnapshot(e),!0)}function xl(){E(l._module)&&_l()&&k()}function yr(){if(B&&a(t.name)&&Z()===t.eq){is();return}if(B&&E(l._type)){const e=St();if(e.type===t.name&&e.contextualKeyword!==l._from){if(se(l._type),Z()===t.eq){is();return}}else(e.type===t.star||e.type===t.braceL)&&se(l._type)}a(t.string)||(xl(),Il(),se(l._from)),Me(),Ir(),J()}function yl(){return a(t.name)}function p1(){Bt()}function Il(){H&&Ec();let e=!0;if(!(yl()&&(p1(),!p(t.comma)))){if(a(t.star)){k(),se(l._as),p1();return}for(d(t.braceL);!p(t.braceR)&&!r.error;){if(e)e=!1;else if(p(t.colon)&&j("ES2015 named imports do not destructure. Use another statement for destructuring after the import."),d(t.comma),p(t.braceR))break;bl()}}}function bl(){if(B){Ki();return}if(H){Sc();return}Bt(),E(l._as)&&(r.tokens[r.tokens.length-1].identifierRole=v.ImportAccess,k(),Bt())}function Ir(){(a(t._with)||E(l._assert)&&!ge())&&(k(),vs(!1,!1))}function wl(){return r.pos===0&&b.charCodeAt(0)===u.numberSign&&b.charCodeAt(1)===u.exclamationMark&&S1(2),E1(),qc()}class Tl{constructor(n,s){this.tokens=n,this.scopes=s}}function Al(e,n,s,o){if(o&&s)throw new Error("Cannot combine flow and typescript plugins.");Kr(e,n,s,o);const i=wl();if(r.error)throw Qr(r.error);return i}function El(e){let n=e.currentIndex(),s=0;const o=e.currentToken();do{const i=e.tokens[n];if(i.isOptionalChainStart&&s++,i.isOptionalChainEnd&&s--,s+=i.numNullishCoalesceStarts,s-=i.numNullishCoalesceEnds,i.contextualKeyword===l._await&&i.identifierRole==null&&i.scopeDepth===o.scopeDepth)return!0;n+=1}while(s>0&&n<e.tokens.length);return!1}class _t{__init(){this.resultCode=""}__init2(){this.resultMappings=new Array(this.tokens.length)}__init3(){this.tokenIndex=0}constructor(n,s,o,i,c){this.code=n,this.tokens=s,this.isFlowEnabled=o,this.disableESTransforms=i,this.helperManager=c,_t.prototype.__init.call(this),_t.prototype.__init2.call(this),_t.prototype.__init3.call(this)}snapshot(){return{resultCode:this.resultCode,tokenIndex:this.tokenIndex}}restoreToSnapshot(n){this.resultCode=n.resultCode,this.tokenIndex=n.tokenIndex}dangerouslyGetAndRemoveCodeSinceSnapshot(n){const s=this.resultCode.slice(n.resultCode.length);return this.resultCode=n.resultCode,s}reset(){this.resultCode="",this.resultMappings=new Array(this.tokens.length),this.tokenIndex=0}matchesContextualAtIndex(n,s){return this.matches1AtIndex(n,t.name)&&this.tokens[n].contextualKeyword===s}identifierNameAtIndex(n){return this.identifierNameForToken(this.tokens[n])}identifierNameAtRelativeIndex(n){return this.identifierNameForToken(this.tokenAtRelativeIndex(n))}identifierName(){return this.identifierNameForToken(this.currentToken())}identifierNameForToken(n){return this.code.slice(n.start,n.end)}rawCodeForToken(n){return this.code.slice(n.start,n.end)}stringValueAtIndex(n){return this.stringValueForToken(this.tokens[n])}stringValue(){return this.stringValueForToken(this.currentToken())}stringValueForToken(n){return this.code.slice(n.start+1,n.end-1)}matches1AtIndex(n,s){return this.tokens[n].type===s}matches2AtIndex(n,s,o){return this.tokens[n].type===s&&this.tokens[n+1].type===o}matches3AtIndex(n,s,o,i){return this.tokens[n].type===s&&this.tokens[n+1].type===o&&this.tokens[n+2].type===i}matches1(n){return this.tokens[this.tokenIndex].type===n}matches2(n,s){return this.tokens[this.tokenIndex].type===n&&this.tokens[this.tokenIndex+1].type===s}matches3(n,s,o){return this.tokens[this.tokenIndex].type===n&&this.tokens[this.tokenIndex+1].type===s&&this.tokens[this.tokenIndex+2].type===o}matches4(n,s,o,i){return this.tokens[this.tokenIndex].type===n&&this.tokens[this.tokenIndex+1].type===s&&this.tokens[this.tokenIndex+2].type===o&&this.tokens[this.tokenIndex+3].type===i}matches5(n,s,o,i,c){return this.tokens[this.tokenIndex].type===n&&this.tokens[this.tokenIndex+1].type===s&&this.tokens[this.tokenIndex+2].type===o&&this.tokens[this.tokenIndex+3].type===i&&this.tokens[this.tokenIndex+4].type===c}matchesContextual(n){return this.matchesContextualAtIndex(this.tokenIndex,n)}matchesContextIdAndLabel(n,s){return this.matches1(n)&&this.currentToken().contextId===s}previousWhitespaceAndComments(){let n=this.code.slice(this.tokenIndex>0?this.tokens[this.tokenIndex-1].end:0,this.tokenIndex<this.tokens.length?this.tokens[this.tokenIndex].start:this.code.length);return this.isFlowEnabled&&(n=n.replace(/@flow/g,"")),n}replaceToken(n){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=n,this.appendTokenSuffix(),this.tokenIndex++}replaceTokenTrimmingLeftWhitespace(n){this.resultCode+=this.previousWhitespaceAndComments().replace(/[^\r\n]/g,""),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=n,this.appendTokenSuffix(),this.tokenIndex++}removeInitialToken(){this.replaceToken("")}removeToken(){this.replaceTokenTrimmingLeftWhitespace("")}removeBalancedCode(){let n=0;for(;!this.isAtEnd();){if(this.matches1(t.braceL))n++;else if(this.matches1(t.braceR)){if(n===0)return;n--}this.removeToken()}}copyExpectedToken(n){if(this.tokens[this.tokenIndex].type!==n)throw new Error(`Expected token ${n}`);this.copyToken()}copyToken(){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=this.code.slice(this.tokens[this.tokenIndex].start,this.tokens[this.tokenIndex].end),this.appendTokenSuffix(),this.tokenIndex++}copyTokenWithPrefix(n){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultCode+=n,this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=this.code.slice(this.tokens[this.tokenIndex].start,this.tokens[this.tokenIndex].end),this.appendTokenSuffix(),this.tokenIndex++}appendTokenPrefix(){const n=this.currentToken();if((n.numNullishCoalesceStarts||n.isOptionalChainStart)&&(n.isAsyncOperation=El(this)),!this.disableESTransforms){if(n.numNullishCoalesceStarts)for(let s=0;s<n.numNullishCoalesceStarts;s++)n.isAsyncOperation?(this.resultCode+="await ",this.resultCode+=this.helperManager.getHelperName("asyncNullishCoalesce")):this.resultCode+=this.helperManager.getHelperName("nullishCoalesce"),this.resultCode+="(";n.isOptionalChainStart&&(n.isAsyncOperation&&(this.resultCode+="await "),this.tokenIndex>0&&this.tokenAtRelativeIndex(-1).type===t._delete?n.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName("asyncOptionalChainDelete"):this.resultCode+=this.helperManager.getHelperName("optionalChainDelete"):n.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName("asyncOptionalChain"):this.resultCode+=this.helperManager.getHelperName("optionalChain"),this.resultCode+="([")}}appendTokenSuffix(){const n=this.currentToken();if(n.isOptionalChainEnd&&!this.disableESTransforms&&(this.resultCode+="])"),n.numNullishCoalesceEnds&&!this.disableESTransforms)for(let s=0;s<n.numNullishCoalesceEnds;s++)this.resultCode+="))"}appendCode(n){this.resultCode+=n}currentToken(){return this.tokens[this.tokenIndex]}currentTokenCode(){const n=this.currentToken();return this.code.slice(n.start,n.end)}tokenAtRelativeIndex(n){return this.tokens[this.tokenIndex+n]}currentIndex(){return this.tokenIndex}nextToken(){if(this.tokenIndex===this.tokens.length)throw new Error("Unexpectedly reached end of input.");this.tokenIndex++}previousToken(){this.tokenIndex--}finish(){if(this.tokenIndex!==this.tokens.length)throw new Error("Tried to finish processing tokens before reaching the end.");return this.resultCode+=this.previousWhitespaceAndComments(),{code:this.resultCode,mappings:this.resultMappings}}isAtEnd(){return this.tokenIndex===this.tokens.length}}function Sl(e,n,s,o){const i=n.snapshot(),c=vl(n);let h=[];const m=[],g=[];let f=null;const y=[],T=[],S=n.currentToken().contextId;if(S==null)throw new Error("Expected non-null class context ID on class open-brace.");for(n.nextToken();!n.matchesContextIdAndLabel(t.braceR,S);)if(n.matchesContextual(l._constructor)&&!n.currentToken().isType)({constructorInitializerStatements:h,constructorInsertPos:f}=f1(n));else if(n.matches1(t.semi))o||T.push({start:n.currentIndex(),end:n.currentIndex()+1}),n.nextToken();else if(n.currentToken().isType)n.nextToken();else{const C=n.currentIndex();let $=!1,V=!1,re=!1;for(;Xt(n.currentToken());)n.matches1(t._static)&&($=!0),n.matches1(t.hash)&&(V=!0),(n.matches1(t._declare)||n.matches1(t._abstract))&&(re=!0),n.nextToken();if($&&n.matches1(t.braceL)){es(n,S);continue}if(V){es(n,S);continue}if(n.matchesContextual(l._constructor)&&!n.currentToken().isType){({constructorInitializerStatements:h,constructorInsertPos:f}=f1(n));continue}const ie=n.currentIndex();if(Nl(n),n.matches1(t.lessThan)||n.matches1(t.parenL)){es(n,S);continue}for(;n.currentToken().isType;)n.nextToken();if(n.matches1(t.eq)){const N=n.currentIndex(),O=n.currentToken().rhsEndIndex;if(O==null)throw new Error("Expected rhsEndIndex on class field assignment.");for(n.nextToken();n.currentIndex()<O;)e.processToken();let R;$?(R=s.claimFreeName("__initStatic"),g.push(R)):(R=s.claimFreeName("__init"),m.push(R)),y.push({initializerName:R,equalsIndex:N,start:ie,end:n.currentIndex()})}else(!o||re)&&T.push({start:C,end:n.currentIndex()})}return n.restoreToSnapshot(i),o?{headerInfo:c,constructorInitializerStatements:h,instanceInitializerNames:[],staticInitializerNames:[],constructorInsertPos:f,fields:[],rangesToRemove:T}:{headerInfo:c,constructorInitializerStatements:h,instanceInitializerNames:m,staticInitializerNames:g,constructorInsertPos:f,fields:y,rangesToRemove:T}}function es(e,n){for(e.nextToken();e.currentToken().contextId!==n;)e.nextToken();for(;Xt(e.tokenAtRelativeIndex(-1));)e.previousToken()}function vl(e){const n=e.currentToken(),s=n.contextId;if(s==null)throw new Error("Expected context ID on class token.");const o=n.isExpression;if(o==null)throw new Error("Expected isExpression on class token.");let i=null,c=!1;for(e.nextToken(),e.matches1(t.name)&&(i=e.identifierName());!e.matchesContextIdAndLabel(t.braceL,s);)e.matches1(t._extends)&&!e.currentToken().isType&&(c=!0),e.nextToken();return{isExpression:o,className:i,hasSuperclass:c}}function f1(e){const n=[];e.nextToken();const s=e.currentToken().contextId;if(s==null)throw new Error("Expected context ID on open-paren starting constructor params.");for(;!e.matchesContextIdAndLabel(t.parenR,s);)if(e.currentToken().contextId===s){if(e.nextToken(),Xt(e.currentToken())){for(e.nextToken();Xt(e.currentToken());)e.nextToken();const c=e.currentToken();if(c.type!==t.name)throw new Error("Expected identifier after access modifiers in constructor arg.");const h=e.identifierNameForToken(c);n.push(`this.${h} = ${h}`)}}else e.nextToken();for(e.nextToken();e.currentToken().isType;)e.nextToken();let o=e.currentIndex(),i=!1;for(;!e.matchesContextIdAndLabel(t.braceR,s);){if(!i&&e.matches2(t._super,t.parenL)){e.nextToken();const c=e.currentToken().contextId;if(c==null)throw new Error("Expected a context ID on the super call");for(;!e.matchesContextIdAndLabel(t.parenR,c);)e.nextToken();o=e.currentIndex(),i=!0}e.nextToken()}return e.nextToken(),{constructorInitializerStatements:n,constructorInsertPos:o}}function Xt(e){return[t._async,t._get,t._set,t.plus,t.minus,t._readonly,t._static,t._public,t._private,t._protected,t._override,t._abstract,t.star,t._declare,t.hash].includes(e.type)}function Nl(e){if(e.matches1(t.bracketL)){const s=e.currentToken().contextId;if(s==null)throw new Error("Expected class context ID on computed name open bracket.");for(;!e.matchesContextIdAndLabel(t.bracketR,s);)e.nextToken();e.nextToken()}else e.nextToken()}function br(e){if(e.removeInitialToken(),e.removeToken(),e.removeToken(),e.removeToken(),e.matches1(t.parenL))e.removeToken(),e.removeToken(),e.removeToken();else for(;e.matches1(t.dot);)e.removeToken(),e.removeToken()}const wr={typeDeclarations:new Set,valueDeclarations:new Set};function Tr(e){const n=new Set,s=new Set;for(let o=0;o<e.tokens.length;o++){const i=e.tokens[o];i.type===t.name&&b1(i)&&(i.isType?n.add(e.identifierNameForToken(i)):s.add(e.identifierNameForToken(i)))}return{typeDeclarations:n,valueDeclarations:s}}function Ar(e){let n=e.currentIndex();for(;!e.matches1AtIndex(n,t.braceR);)n++;return e.matchesContextualAtIndex(n+1,l._from)&&e.matches1AtIndex(n+2,t.string)}function Ke(e){(e.matches2(t._with,t.braceL)||e.matches2(t.name,t.braceL)&&e.matchesContextual(l._assert))&&(e.removeToken(),e.removeToken(),e.removeBalancedCode(),e.removeToken())}function Er(e,n,s,o){if(!e||n)return!1;const i=s.currentToken();if(i.rhsEndIndex==null)throw new Error("Expected non-null rhsEndIndex on export token.");const c=i.rhsEndIndex-s.currentIndex();if(c!==3&&!(c===4&&s.matches1AtIndex(i.rhsEndIndex-1,t.semi)))return!1;const h=s.tokenAtRelativeIndex(2);if(h.type!==t.name)return!1;const m=s.identifierNameForToken(h);return o.typeDeclarations.has(m)&&!o.valueDeclarations.has(m)}class xt extends Ee{__init(){this.hadExport=!1}__init2(){this.hadNamedExport=!1}__init3(){this.hadDefaultExport=!1}constructor(n,s,o,i,c,h,m,g,f,y,T,S){super(),this.rootTransformer=n,this.tokens=s,this.importProcessor=o,this.nameManager=i,this.helperManager=c,this.reactHotLoaderTransformer=h,this.enableLegacyBabel5ModuleInterop=m,this.enableLegacyTypeScriptModuleInterop=g,this.isTypeScriptTransformEnabled=f,this.isFlowTransformEnabled=y,this.preserveDynamicImport=T,this.keepUnusedImports=S,xt.prototype.__init.call(this),xt.prototype.__init2.call(this),xt.prototype.__init3.call(this),this.declarationInfo=f?Tr(s):wr}getPrefixCode(){let n="";return this.hadExport&&(n+='Object.defineProperty(exports, "__esModule", {value: true});'),n}getSuffixCode(){return this.enableLegacyBabel5ModuleInterop&&this.hadDefaultExport&&!this.hadNamedExport?`
117
117
  module.exports = exports.default;
118
- `:""}process(){return this.tokens.matches3(t._import,t.name,t.eq)?this.processImportEquals():this.tokens.matches1(t._import)?(this.processImport(),!0):this.tokens.matches2(t._export,t.eq)?(this.tokens.replaceToken("module.exports"),!0):this.tokens.matches1(t._export)&&!this.tokens.currentToken().isType?(this.hadExport=!0,this.processExport()):this.tokens.matches2(t.name,t.postIncDec)&&this.processPostIncDec()?!0:this.tokens.matches1(t.name)||this.tokens.matches1(t.jsxName)?this.processIdentifier():this.tokens.matches1(t.eq)?this.processAssignment():this.tokens.matches1(t.assign)?this.processComplexAssignment():this.tokens.matches1(t.preIncDec)?this.processPreIncDec():!1}processImportEquals(){const n=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.importProcessor.shouldAutomaticallyElideImportedName(n)?br(this.tokens):this.tokens.replaceToken("const"),!0}processImport(){if(this.tokens.matches2(t._import,t.parenL)){if(this.preserveDynamicImport){this.tokens.copyToken();return}const s=this.enableLegacyTypeScriptModuleInterop?"":`${this.helperManager.getHelperName("interopRequireWildcard")}(`;this.tokens.replaceToken(`Promise.resolve().then(() => ${s}require`);const o=this.tokens.currentToken().contextId;if(o==null)throw new Error("Expected context ID on dynamic import invocation.");for(this.tokens.copyToken();!this.tokens.matchesContextIdAndLabel(t.parenR,o);)this.rootTransformer.processToken();this.tokens.replaceToken(s?")))":"))");return}if(this.removeImportAndDetectIfShouldElide())this.tokens.removeToken();else{const s=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(s)),this.tokens.appendCode(this.importProcessor.claimImportCode(s))}Ke(this.tokens),this.tokens.matches1(t.semi)&&this.tokens.removeToken()}removeImportAndDetectIfShouldElide(){if(this.tokens.removeInitialToken(),this.tokens.matchesContextual(l._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,t.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._from))return this.removeRemainingImport(),!0;if(this.tokens.matches1(t.name)||this.tokens.matches1(t.star))return this.removeRemainingImport(),!1;if(this.tokens.matches1(t.string))return!1;let n=!1,s=!1;for(;!this.tokens.matches1(t.string);)(!n&&this.tokens.matches1(t.braceL)||this.tokens.matches1(t.comma))&&(this.tokens.removeToken(),this.tokens.matches1(t.braceR)||(s=!0),(this.tokens.matches2(t.name,t.comma)||this.tokens.matches2(t.name,t.braceR)||this.tokens.matches4(t.name,t.name,t.name,t.comma)||this.tokens.matches4(t.name,t.name,t.name,t.braceR))&&(n=!0)),this.tokens.removeToken();return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!n:this.isFlowTransformEnabled?s&&!n:!1}removeRemainingImport(){for(;!this.tokens.matches1(t.string);)this.tokens.removeToken()}processIdentifier(){const n=this.tokens.currentToken();if(n.shadowsGlobal)return!1;if(n.identifierRole===v.ObjectShorthand)return this.processObjectShorthand();if(n.identifierRole!==v.Access)return!1;const s=this.importProcessor.getIdentifierReplacement(this.tokens.identifierNameForToken(n));if(!s)return!1;let o=this.tokens.currentIndex()+1;for(;o<this.tokens.tokens.length&&this.tokens.tokens[o].type===t.parenR;)o++;return this.tokens.tokens[o].type===t.parenL?this.tokens.tokenAtRelativeIndex(1).type===t.parenL&&this.tokens.tokenAtRelativeIndex(-1).type!==t._new?(this.tokens.replaceToken(`${s}.call(void 0, `),this.tokens.removeToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR)):this.tokens.replaceToken(`(0, ${s})`):this.tokens.replaceToken(s),!0}processObjectShorthand(){const n=this.tokens.identifierName(),s=this.importProcessor.getIdentifierReplacement(n);return s?(this.tokens.replaceToken(`${n}: ${s}`),!0):!1}processExport(){if(this.tokens.matches2(t._export,t._enum)||this.tokens.matches3(t._export,t._const,t._enum))return this.hadNamedExport=!0,!1;if(this.tokens.matches2(t._export,t._default))return this.tokens.matches3(t._export,t._default,t._enum)?(this.hadDefaultExport=!0,!1):(this.processExportDefault(),!0);if(this.tokens.matches2(t._export,t.braceL))return this.processExportBindings(),!0;if(this.tokens.matches2(t._export,t.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(t.braceL)){for(;!this.tokens.matches1(t.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(t._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(l._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,t.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),Ke(this.tokens)),!0}if(this.hadNamedExport=!0,this.tokens.matches2(t._export,t._var)||this.tokens.matches2(t._export,t._let)||this.tokens.matches2(t._export,t._const))return this.processExportVar(),!0;if(this.tokens.matches2(t._export,t._function)||this.tokens.matches3(t._export,t.name,t._function))return this.processExportFunction(),!0;if(this.tokens.matches2(t._export,t._class)||this.tokens.matches3(t._export,t._abstract,t._class)||this.tokens.matches2(t._export,t.at))return this.processExportClass(),!0;if(this.tokens.matches2(t._export,t.star))return this.processExportStar(),!0;throw new Error("Unrecognized export syntax.")}processAssignment(){const n=this.tokens.currentIndex(),s=this.tokens.tokens[n-1];if(s.isType||s.type!==t.name||s.shadowsGlobal||n>=2&&this.tokens.matches1AtIndex(n-2,t.dot)||n>=2&&[t._var,t._let,t._const].includes(this.tokens.tokens[n-2].type))return!1;const o=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(s));return o?(this.tokens.copyToken(),this.tokens.appendCode(` ${o} =`),!0):!1}processComplexAssignment(){const n=this.tokens.currentIndex(),s=this.tokens.tokens[n-1];if(s.type!==t.name||s.shadowsGlobal||n>=2&&this.tokens.matches1AtIndex(n-2,t.dot))return!1;const o=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(s));return o?(this.tokens.appendCode(` = ${o}`),this.tokens.copyToken(),!0):!1}processPreIncDec(){const n=this.tokens.currentIndex(),s=this.tokens.tokens[n+1];if(s.type!==t.name||s.shadowsGlobal||n+2<this.tokens.tokens.length&&(this.tokens.matches1AtIndex(n+2,t.dot)||this.tokens.matches1AtIndex(n+2,t.bracketL)||this.tokens.matches1AtIndex(n+2,t.parenL)))return!1;const o=this.tokens.identifierNameForToken(s),i=this.importProcessor.resolveExportBinding(o);return i?(this.tokens.appendCode(`${i} = `),this.tokens.copyToken(),!0):!1}processPostIncDec(){const n=this.tokens.currentIndex(),s=this.tokens.tokens[n],o=this.tokens.tokens[n+1];if(s.type!==t.name||s.shadowsGlobal||n>=1&&this.tokens.matches1AtIndex(n-1,t.dot))return!1;const i=this.tokens.identifierNameForToken(s),c=this.importProcessor.resolveExportBinding(i);if(!c)return!1;const h=this.tokens.rawCodeForToken(o),m=this.importProcessor.getIdentifierReplacement(i)||i;if(h==="++")this.tokens.replaceToken(`(${m} = ${c} = ${m} + 1, ${m} - 1)`);else if(h==="--")this.tokens.replaceToken(`(${m} = ${c} = ${m} - 1, ${m} + 1)`);else throw new Error(`Unexpected operator: ${h}`);return this.tokens.removeToken(),!0}processExportDefault(){let n=!0;if(this.tokens.matches4(t._export,t._default,t._function,t.name)||this.tokens.matches5(t._export,t._default,t.name,t._function,t.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._async)){this.tokens.removeInitialToken(),this.tokens.removeToken();const s=this.processNamedFunction();this.tokens.appendCode(` exports.default = ${s};`)}else if(this.tokens.matches4(t._export,t._default,t._class,t.name)||this.tokens.matches5(t._export,t._default,t._abstract,t._class,t.name)||this.tokens.matches3(t._export,t._default,t.at)){this.tokens.removeInitialToken(),this.tokens.removeToken(),this.copyDecorators(),this.tokens.matches1(t._abstract)&&this.tokens.removeToken();const s=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.default = ${s};`)}else if(Er(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))n=!1,this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken();else if(this.reactHotLoaderTransformer){const s=this.nameManager.claimFreeName("_default");this.tokens.replaceToken(`let ${s}; exports.`),this.tokens.copyToken(),this.tokens.appendCode(` = ${s} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(s)}else this.tokens.replaceToken("exports."),this.tokens.copyToken(),this.tokens.appendCode(" =");n&&(this.hadDefaultExport=!0)}copyDecorators(){for(;this.tokens.matches1(t.at);)if(this.tokens.copyToken(),this.tokens.matches1(t.parenL))this.tokens.copyExpectedToken(t.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR);else{for(this.tokens.copyExpectedToken(t.name);this.tokens.matches1(t.dot);)this.tokens.copyExpectedToken(t.dot),this.tokens.copyExpectedToken(t.name);this.tokens.matches1(t.parenL)&&(this.tokens.copyExpectedToken(t.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR))}}processExportVar(){this.isSimpleExportVar()?this.processSimpleExportVar():this.processComplexExportVar()}isSimpleExportVar(){let n=this.tokens.currentIndex();if(n++,n++,!this.tokens.matches1AtIndex(n,t.name))return!1;for(n++;n<this.tokens.tokens.length&&this.tokens.tokens[n].isType;)n++;return!!this.tokens.matches1AtIndex(n,t.eq)}processSimpleExportVar(){this.tokens.removeInitialToken(),this.tokens.copyToken();const n=this.tokens.identifierName();for(;!this.tokens.matches1(t.eq);)this.rootTransformer.processToken();const s=this.tokens.currentToken().rhsEndIndex;if(s==null)throw new Error("Expected = token with an end index.");for(;this.tokens.currentIndex()<s;)this.rootTransformer.processToken();this.tokens.appendCode(`; exports.${n} = ${n}`)}processComplexExportVar(){this.tokens.removeInitialToken(),this.tokens.removeToken();const n=this.tokens.matches1(t.braceL);n&&this.tokens.appendCode("(");let s=0;for(;;)if(this.tokens.matches1(t.braceL)||this.tokens.matches1(t.dollarBraceL)||this.tokens.matches1(t.bracketL))s++,this.tokens.copyToken();else if(this.tokens.matches1(t.braceR)||this.tokens.matches1(t.bracketR))s--,this.tokens.copyToken();else{if(s===0&&!this.tokens.matches1(t.name)&&!this.tokens.currentToken().isType)break;if(this.tokens.matches1(t.eq)){const o=this.tokens.currentToken().rhsEndIndex;if(o==null)throw new Error("Expected = token with an end index.");for(;this.tokens.currentIndex()<o;)this.rootTransformer.processToken()}else{const o=this.tokens.currentToken();if(I1(o)){const i=this.tokens.identifierName();let c=this.importProcessor.getIdentifierReplacement(i);if(c===null)throw new Error(`Expected a replacement for ${i} in \`export var\` syntax.`);oo(o)&&(c=`${i}: ${c}`),this.tokens.replaceToken(c)}else this.rootTransformer.processToken()}}if(n){const o=this.tokens.currentToken().rhsEndIndex;if(o==null)throw new Error("Expected = token with an end index.");for(;this.tokens.currentIndex()<o;)this.rootTransformer.processToken();this.tokens.appendCode(")")}}processExportFunction(){this.tokens.replaceToken("");const n=this.processNamedFunction();this.tokens.appendCode(` exports.${n} = ${n};`)}processNamedFunction(){if(this.tokens.matches1(t._function))this.tokens.copyToken();else if(this.tokens.matches2(t.name,t._function)){if(!this.tokens.matchesContextual(l._async))throw new Error("Expected async keyword in function export.");this.tokens.copyToken(),this.tokens.copyToken()}if(this.tokens.matches1(t.star)&&this.tokens.copyToken(),!this.tokens.matches1(t.name))throw new Error("Expected identifier for exported function name.");const n=this.tokens.identifierName();if(this.tokens.copyToken(),this.tokens.currentToken().isType)for(this.tokens.removeInitialToken();this.tokens.currentToken().isType;)this.tokens.removeToken();return this.tokens.copyExpectedToken(t.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR),this.rootTransformer.processPossibleTypeRange(),this.tokens.copyExpectedToken(t.braceL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.braceR),n}processExportClass(){this.tokens.removeInitialToken(),this.copyDecorators(),this.tokens.matches1(t._abstract)&&this.tokens.removeToken();const n=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.${n} = ${n};`)}processExportBindings(){this.tokens.removeInitialToken(),this.tokens.removeToken();const n=Ar(this.tokens),s=[];for(;;){if(this.tokens.matches1(t.braceR)){this.tokens.removeToken();break}const o=It(this.tokens);for(;this.tokens.currentIndex()<o.endIndex;)this.tokens.removeToken();if(!(o.isType||!n&&this.shouldElideExportedIdentifier(o.leftName))){const c=o.rightName;c==="default"?this.hadDefaultExport=!0:this.hadNamedExport=!0;const h=o.leftName,m=this.importProcessor.getIdentifierReplacement(h);s.push(`exports.${c} = ${m||h};`)}if(this.tokens.matches1(t.braceR)){this.tokens.removeToken();break}if(this.tokens.matches2(t.comma,t.braceR)){this.tokens.removeToken(),this.tokens.removeToken();break}else if(this.tokens.matches1(t.comma))this.tokens.removeToken();else throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`)}if(this.tokens.matchesContextual(l._from)){this.tokens.removeToken();const o=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(o)),Ke(this.tokens)}else this.tokens.appendCode(s.join(" "));this.tokens.matches1(t.semi)&&this.tokens.removeToken()}processExportStar(){for(this.tokens.removeInitialToken();!this.tokens.matches1(t.string);)this.tokens.removeToken();const n=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(n)),Ke(this.tokens),this.tokens.matches1(t.semi)&&this.tokens.removeToken()}shouldElideExportedIdentifier(n){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.declarationInfo.valueDeclarations.has(n)}}class Cl extends Ee{constructor(n,s,o,i,c,h,m,g){super(),this.tokens=n,this.nameManager=s,this.helperManager=o,this.reactHotLoaderTransformer=i,this.isTypeScriptTransformEnabled=c,this.isFlowTransformEnabled=h,this.keepUnusedImports=m,this.nonTypeIdentifiers=c&&!m?F1(n,g):new Set,this.declarationInfo=c&&!m?Tr(n):wr,this.injectCreateRequireForImportRequire=!!g.injectCreateRequireForImportRequire}process(){if(this.tokens.matches3(t._import,t.name,t.eq))return this.processImportEquals();if(this.tokens.matches4(t._import,t.name,t.name,t.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._type)){this.tokens.removeInitialToken();for(let n=0;n<7;n++)this.tokens.removeToken();return!0}if(this.tokens.matches2(t._export,t.eq))return this.tokens.replaceToken("module.exports"),!0;if(this.tokens.matches5(t._export,t._import,t.name,t.name,t.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._type)){this.tokens.removeInitialToken();for(let n=0;n<8;n++)this.tokens.removeToken();return!0}if(this.tokens.matches1(t._import))return this.processImport();if(this.tokens.matches2(t._export,t._default))return this.processExportDefault();if(this.tokens.matches2(t._export,t.braceL))return this.processNamedExports();if(this.tokens.matches2(t._export,t.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(t.braceL)){for(;!this.tokens.matches1(t.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(t._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(l._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,t.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),Ke(this.tokens)),!0}return!1}processImportEquals(){const n=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.shouldAutomaticallyElideImportedName(n)?br(this.tokens):this.injectCreateRequireForImportRequire?(this.tokens.replaceToken("const"),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.replaceToken(this.helperManager.getHelperName("require"))):this.tokens.replaceToken("const"),!0}processImport(){if(this.tokens.matches2(t._import,t.parenL))return!1;const n=this.tokens.snapshot();if(this.removeImportTypeBindings()){for(this.tokens.restoreToSnapshot(n);!this.tokens.matches1(t.string);)this.tokens.removeToken();this.tokens.removeToken(),Ke(this.tokens),this.tokens.matches1(t.semi)&&this.tokens.removeToken()}return!0}removeImportTypeBindings(){if(this.tokens.copyExpectedToken(t._import),this.tokens.matchesContextual(l._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,t.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._from))return!0;if(this.tokens.matches1(t.string))return this.tokens.copyToken(),!1;this.tokens.matchesContextual(l._module)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._from)&&this.tokens.copyToken();let n=!1,s=!1,o=!1;if(this.tokens.matches1(t.name)&&(this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())?(this.tokens.removeToken(),this.tokens.matches1(t.comma)&&this.tokens.removeToken()):(n=!0,this.tokens.copyToken(),this.tokens.matches1(t.comma)&&(o=!0,this.tokens.removeToken()))),this.tokens.matches1(t.star))this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))?(this.tokens.removeToken(),this.tokens.removeToken(),this.tokens.removeToken()):(o&&this.tokens.appendCode(","),n=!0,this.tokens.copyExpectedToken(t.star),this.tokens.copyExpectedToken(t.name),this.tokens.copyExpectedToken(t.name));else if(this.tokens.matches1(t.braceL)){for(o&&this.tokens.appendCode(","),this.tokens.copyToken();!this.tokens.matches1(t.braceR);){s=!0;const i=It(this.tokens);if(i.isType||this.shouldAutomaticallyElideImportedName(i.rightName)){for(;this.tokens.currentIndex()<i.endIndex;)this.tokens.removeToken();this.tokens.matches1(t.comma)&&this.tokens.removeToken()}else{for(n=!0;this.tokens.currentIndex()<i.endIndex;)this.tokens.copyToken();this.tokens.matches1(t.comma)&&this.tokens.copyToken()}}this.tokens.copyExpectedToken(t.braceR)}return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!n:this.isFlowTransformEnabled?s&&!n:!1}shouldAutomaticallyElideImportedName(n){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.nonTypeIdentifiers.has(n)}processExportDefault(){if(Er(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))return this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken(),!0;if(!(this.tokens.matches4(t._export,t._default,t._function,t.name)||this.tokens.matches5(t._export,t._default,t.name,t._function,t.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._async)||this.tokens.matches4(t._export,t._default,t._class,t.name)||this.tokens.matches5(t._export,t._default,t._abstract,t._class,t.name))&&this.reactHotLoaderTransformer){const s=this.nameManager.claimFreeName("_default");return this.tokens.replaceToken(`let ${s}; export`),this.tokens.copyToken(),this.tokens.appendCode(` ${s} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(s),!0}return!1}processNamedExports(){if(!this.isTypeScriptTransformEnabled)return!1;this.tokens.copyExpectedToken(t._export),this.tokens.copyExpectedToken(t.braceL);const n=Ar(this.tokens);let s=!1;for(;!this.tokens.matches1(t.braceR);){const o=It(this.tokens);if(o.isType||!n&&this.shouldElideExportedName(o.leftName)){for(;this.tokens.currentIndex()<o.endIndex;)this.tokens.removeToken();this.tokens.matches1(t.comma)&&this.tokens.removeToken()}else{for(s=!0;this.tokens.currentIndex()<o.endIndex;)this.tokens.copyToken();this.tokens.matches1(t.comma)&&this.tokens.copyToken()}}return this.tokens.copyExpectedToken(t.braceR),!this.keepUnusedImports&&n&&!s&&(this.tokens.removeToken(),this.tokens.removeToken(),Ke(this.tokens)),!0}shouldElideExportedName(n){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&this.declarationInfo.typeDeclarations.has(n)&&!this.declarationInfo.valueDeclarations.has(n)}}class Pl extends Ee{constructor(n,s,o){super(),this.rootTransformer=n,this.tokens=s,this.isImportsTransformEnabled=o}process(){return this.rootTransformer.processPossibleArrowParamEnd()||this.rootTransformer.processPossibleAsyncArrowWithTypeParams()||this.rootTransformer.processPossibleTypeRange()?!0:this.tokens.matches1(t._enum)?(this.processEnum(),!0):this.tokens.matches2(t._export,t._enum)?(this.processNamedExportEnum(),!0):this.tokens.matches3(t._export,t._default,t._enum)?(this.processDefaultExportEnum(),!0):!1}processNamedExportEnum(){if(this.isImportsTransformEnabled){this.tokens.removeInitialToken();const n=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.tokens.appendCode(` exports.${n} = ${n};`)}else this.tokens.copyToken(),this.processEnum()}processDefaultExportEnum(){this.tokens.removeInitialToken(),this.tokens.removeToken();const n=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.isImportsTransformEnabled?this.tokens.appendCode(` exports.default = ${n};`):this.tokens.appendCode(` export default ${n};`)}processEnum(){this.tokens.replaceToken("const"),this.tokens.copyExpectedToken(t.name);let n=!1;this.tokens.matchesContextual(l._of)&&(this.tokens.removeToken(),n=this.tokens.matchesContextual(l._symbol),this.tokens.removeToken());const s=this.tokens.matches3(t.braceL,t.name,t.eq);this.tokens.appendCode(' = require("flow-enums-runtime")');const o=!n&&!s;for(this.tokens.replaceTokenTrimmingLeftWhitespace(o?".Mirrored([":"({");!this.tokens.matches1(t.braceR);){if(this.tokens.matches1(t.ellipsis)){this.tokens.removeToken();break}this.processEnumElement(n,s),this.tokens.matches1(t.comma)&&this.tokens.copyToken()}this.tokens.replaceToken(o?"]);":"});")}processEnumElement(n,s){if(n){const o=this.tokens.identifierName();this.tokens.copyToken(),this.tokens.appendCode(`: Symbol("${o}")`)}else s?(this.tokens.copyToken(),this.tokens.replaceTokenTrimmingLeftWhitespace(":"),this.tokens.copyToken()):this.tokens.replaceToken(`"${this.tokens.identifierName()}"`)}}function Rl(e){let n,s=e[0],o=1;for(;o<e.length;){const i=e[o],c=e[o+1];if(o+=2,(i==="optionalAccess"||i==="optionalCall")&&s==null)return;i==="access"||i==="optionalAccess"?(n=s,s=c(s)):(i==="call"||i==="optionalCall")&&(s=c((...h)=>s.call(n,...h)),n=void 0)}return s}const Lt="jest",Ll=["mock","unmock","enableAutomock","disableAutomock"];class Ms extends Ee{__init(){this.hoistedFunctionNames=[]}constructor(n,s,o,i){super(),this.rootTransformer=n,this.tokens=s,this.nameManager=o,this.importProcessor=i,Ms.prototype.__init.call(this)}process(){return this.tokens.currentToken().scopeDepth===0&&this.tokens.matches4(t.name,t.dot,t.name,t.parenL)&&this.tokens.identifierName()===Lt?Rl([this,"access",n=>n.importProcessor,"optionalAccess",n=>n.getGlobalNames,"call",n=>n(),"optionalAccess",n=>n.has,"call",n=>n(Lt)])?!1:this.extractHoistedCalls():!1}getHoistedCode(){return this.hoistedFunctionNames.length>0?this.hoistedFunctionNames.map(n=>`${n}();`).join(""):""}extractHoistedCalls(){this.tokens.removeToken();let n=!1;for(;this.tokens.matches3(t.dot,t.name,t.parenL);){const s=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);if(Ll.includes(s)){const i=this.nameManager.claimFreeName("__jestHoist");this.hoistedFunctionNames.push(i),this.tokens.replaceToken(`function ${i}(){${Lt}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR),this.tokens.appendCode(";}"),n=!1}else n?this.tokens.copyToken():this.tokens.replaceToken(`${Lt}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR),n=!0}return!0}}class Dl extends Ee{constructor(n){super(),this.tokens=n}process(){if(this.tokens.matches1(t.num)){const n=this.tokens.currentTokenCode();if(n.includes("_"))return this.tokens.replaceToken(n.replace(/_/g,"")),!0}return!1}}class Ol extends Ee{constructor(n,s){super(),this.tokens=n,this.nameManager=s}process(){return this.tokens.matches2(t._catch,t.braceL)?(this.tokens.copyToken(),this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`),!0):!1}}class Fl extends Ee{constructor(n,s){super(),this.tokens=n,this.nameManager=s}process(){if(this.tokens.matches1(t.nullishCoalescing)){const o=this.tokens.currentToken();return this.tokens.tokens[o.nullishStartIndex].isAsyncOperation?this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => ("):this.tokens.replaceTokenTrimmingLeftWhitespace(", () => ("),!0}if(this.tokens.matches1(t._delete)&&this.tokens.tokenAtRelativeIndex(1).isOptionalChainStart)return this.tokens.removeInitialToken(),!0;const s=this.tokens.currentToken().subscriptStartIndex;if(s!=null&&this.tokens.tokens[s].isOptionalChainStart&&this.tokens.tokenAtRelativeIndex(-1).type!==t._super){const o=this.nameManager.claimFreeName("_");let i;if(s>0&&this.tokens.matches1AtIndex(s-1,t._delete)&&this.isLastSubscriptInChain()?i=`${o} => delete ${o}`:i=`${o} => ${o}`,this.tokens.tokens[s].isAsyncOperation&&(i=`async ${i}`),this.tokens.matches2(t.questionDot,t.parenL)||this.tokens.matches2(t.questionDot,t.lessThan))this.justSkippedSuper()&&this.tokens.appendCode(".bind(this)"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${i}`);else if(this.tokens.matches2(t.questionDot,t.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${i}`);else if(this.tokens.matches1(t.questionDot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${i}.`);else if(this.tokens.matches1(t.dot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${i}.`);else if(this.tokens.matches1(t.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${i}[`);else if(this.tokens.matches1(t.parenL))this.justSkippedSuper()&&this.tokens.appendCode(".bind(this)"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${i}(`);else throw new Error("Unexpected subscript operator in optional chain.");return!0}return!1}isLastSubscriptInChain(){let n=0;for(let s=this.tokens.currentIndex()+1;;s++){if(s>=this.tokens.tokens.length)throw new Error("Reached the end of the code while finding the end of the access chain.");if(this.tokens.tokens[s].isOptionalChainStart?n++:this.tokens.tokens[s].isOptionalChainEnd&&n--,n<0)return!0;if(n===0&&this.tokens.tokens[s].subscriptStartIndex!=null)return!1}}justSkippedSuper(){let n=0,s=this.tokens.currentIndex()-1;for(;;){if(s<0)throw new Error("Reached the start of the code while finding the start of the access chain.");if(this.tokens.tokens[s].isOptionalChainStart?n--:this.tokens.tokens[s].isOptionalChainEnd&&n++,n<0)return!1;if(n===0&&this.tokens.tokens[s].subscriptStartIndex!=null)return this.tokens.tokens[s-1].type===t._super;s--}}}class jl extends Ee{constructor(n,s,o,i){super(),this.rootTransformer=n,this.tokens=s,this.importProcessor=o,this.options=i}process(){const n=this.tokens.currentIndex();if(this.tokens.identifierName()==="createReactClass"){const s=this.importProcessor&&this.importProcessor.getIdentifierReplacement("createReactClass");return s?this.tokens.replaceToken(`(0, ${s})`):this.tokens.copyToken(),this.tryProcessCreateClassCall(n),!0}if(this.tokens.matches3(t.name,t.dot,t.name)&&this.tokens.identifierName()==="React"&&this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+2)==="createClass"){const s=this.importProcessor&&this.importProcessor.getIdentifierReplacement("React")||"React";return s?(this.tokens.replaceToken(s),this.tokens.copyToken(),this.tokens.copyToken()):(this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.copyToken()),this.tryProcessCreateClassCall(n),!0}return!1}tryProcessCreateClassCall(n){const s=this.findDisplayName(n);s&&this.classNeedsDisplayName()&&(this.tokens.copyExpectedToken(t.parenL),this.tokens.copyExpectedToken(t.braceL),this.tokens.appendCode(`displayName: '${s}',`),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.braceR),this.tokens.copyExpectedToken(t.parenR))}findDisplayName(n){return n<2?null:this.tokens.matches2AtIndex(n-2,t.name,t.eq)?this.tokens.identifierNameAtIndex(n-2):n>=2&&this.tokens.tokens[n-2].identifierRole===v.ObjectKey?this.tokens.identifierNameAtIndex(n-2):this.tokens.matches2AtIndex(n-2,t._export,t._default)?this.getDisplayNameFromFilename():null}getDisplayNameFromFilename(){const s=(this.options.filePath||"unknown").split("/"),o=s[s.length-1],i=o.lastIndexOf("."),c=i===-1?o:o.slice(0,i);return c==="index"&&s[s.length-2]?s[s.length-2]:c}classNeedsDisplayName(){let n=this.tokens.currentIndex();if(!this.tokens.matches2(t.parenL,t.braceL))return!1;const s=n+1,o=this.tokens.tokens[s].contextId;if(o==null)throw new Error("Expected non-null context ID on object open-brace.");for(;n<this.tokens.tokens.length;n++){const i=this.tokens.tokens[n];if(i.type===t.braceR&&i.contextId===o){n++;break}if(this.tokens.identifierNameAtIndex(n)==="displayName"&&this.tokens.tokens[n].identifierRole===v.ObjectKey&&i.contextId===o)return!1}if(n===this.tokens.tokens.length)throw new Error("Unexpected end of input when processing React class.");return this.tokens.matches1AtIndex(n,t.parenR)||this.tokens.matches2AtIndex(n,t.comma,t.parenR)}}class Bs extends Ee{__init(){this.extractedDefaultExportName=null}constructor(n,s){super(),this.tokens=n,this.filePath=s,Bs.prototype.__init.call(this)}setExtractedDefaultExportName(n){this.extractedDefaultExportName=n}getPrefixCode(){return`
118
+ `:""}process(){return this.tokens.matches3(t._import,t.name,t.eq)?this.processImportEquals():this.tokens.matches1(t._import)?(this.processImport(),!0):this.tokens.matches2(t._export,t.eq)?(this.tokens.replaceToken("module.exports"),!0):this.tokens.matches1(t._export)&&!this.tokens.currentToken().isType?(this.hadExport=!0,this.processExport()):this.tokens.matches2(t.name,t.postIncDec)&&this.processPostIncDec()?!0:this.tokens.matches1(t.name)||this.tokens.matches1(t.jsxName)?this.processIdentifier():this.tokens.matches1(t.eq)?this.processAssignment():this.tokens.matches1(t.assign)?this.processComplexAssignment():this.tokens.matches1(t.preIncDec)?this.processPreIncDec():!1}processImportEquals(){const n=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.importProcessor.shouldAutomaticallyElideImportedName(n)?br(this.tokens):this.tokens.replaceToken("const"),!0}processImport(){if(this.tokens.matches2(t._import,t.parenL)){if(this.preserveDynamicImport){this.tokens.copyToken();return}const s=this.enableLegacyTypeScriptModuleInterop?"":`${this.helperManager.getHelperName("interopRequireWildcard")}(`;this.tokens.replaceToken(`Promise.resolve().then(() => ${s}require`);const o=this.tokens.currentToken().contextId;if(o==null)throw new Error("Expected context ID on dynamic import invocation.");for(this.tokens.copyToken();!this.tokens.matchesContextIdAndLabel(t.parenR,o);)this.rootTransformer.processToken();this.tokens.replaceToken(s?")))":"))");return}if(this.removeImportAndDetectIfShouldElide())this.tokens.removeToken();else{const s=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(s)),this.tokens.appendCode(this.importProcessor.claimImportCode(s))}Ke(this.tokens),this.tokens.matches1(t.semi)&&this.tokens.removeToken()}removeImportAndDetectIfShouldElide(){if(this.tokens.removeInitialToken(),this.tokens.matchesContextual(l._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,t.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._from))return this.removeRemainingImport(),!0;if(this.tokens.matches1(t.name)||this.tokens.matches1(t.star))return this.removeRemainingImport(),!1;if(this.tokens.matches1(t.string))return!1;let n=!1,s=!1;for(;!this.tokens.matches1(t.string);)(!n&&this.tokens.matches1(t.braceL)||this.tokens.matches1(t.comma))&&(this.tokens.removeToken(),this.tokens.matches1(t.braceR)||(s=!0),(this.tokens.matches2(t.name,t.comma)||this.tokens.matches2(t.name,t.braceR)||this.tokens.matches4(t.name,t.name,t.name,t.comma)||this.tokens.matches4(t.name,t.name,t.name,t.braceR))&&(n=!0)),this.tokens.removeToken();return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!n:this.isFlowTransformEnabled?s&&!n:!1}removeRemainingImport(){for(;!this.tokens.matches1(t.string);)this.tokens.removeToken()}processIdentifier(){const n=this.tokens.currentToken();if(n.shadowsGlobal)return!1;if(n.identifierRole===v.ObjectShorthand)return this.processObjectShorthand();if(n.identifierRole!==v.Access)return!1;const s=this.importProcessor.getIdentifierReplacement(this.tokens.identifierNameForToken(n));if(!s)return!1;let o=this.tokens.currentIndex()+1;for(;o<this.tokens.tokens.length&&this.tokens.tokens[o].type===t.parenR;)o++;return this.tokens.tokens[o].type===t.parenL?this.tokens.tokenAtRelativeIndex(1).type===t.parenL&&this.tokens.tokenAtRelativeIndex(-1).type!==t._new?(this.tokens.replaceToken(`${s}.call(void 0, `),this.tokens.removeToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR)):this.tokens.replaceToken(`(0, ${s})`):this.tokens.replaceToken(s),!0}processObjectShorthand(){const n=this.tokens.identifierName(),s=this.importProcessor.getIdentifierReplacement(n);return s?(this.tokens.replaceToken(`${n}: ${s}`),!0):!1}processExport(){if(this.tokens.matches2(t._export,t._enum)||this.tokens.matches3(t._export,t._const,t._enum))return this.hadNamedExport=!0,!1;if(this.tokens.matches2(t._export,t._default))return this.tokens.matches3(t._export,t._default,t._enum)?(this.hadDefaultExport=!0,!1):(this.processExportDefault(),!0);if(this.tokens.matches2(t._export,t.braceL))return this.processExportBindings(),!0;if(this.tokens.matches2(t._export,t.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(t.braceL)){for(;!this.tokens.matches1(t.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(t._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(l._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,t.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),Ke(this.tokens)),!0}if(this.hadNamedExport=!0,this.tokens.matches2(t._export,t._var)||this.tokens.matches2(t._export,t._let)||this.tokens.matches2(t._export,t._const))return this.processExportVar(),!0;if(this.tokens.matches2(t._export,t._function)||this.tokens.matches3(t._export,t.name,t._function))return this.processExportFunction(),!0;if(this.tokens.matches2(t._export,t._class)||this.tokens.matches3(t._export,t._abstract,t._class)||this.tokens.matches2(t._export,t.at))return this.processExportClass(),!0;if(this.tokens.matches2(t._export,t.star))return this.processExportStar(),!0;throw new Error("Unrecognized export syntax.")}processAssignment(){const n=this.tokens.currentIndex(),s=this.tokens.tokens[n-1];if(s.isType||s.type!==t.name||s.shadowsGlobal||n>=2&&this.tokens.matches1AtIndex(n-2,t.dot)||n>=2&&[t._var,t._let,t._const].includes(this.tokens.tokens[n-2].type))return!1;const o=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(s));return o?(this.tokens.copyToken(),this.tokens.appendCode(` ${o} =`),!0):!1}processComplexAssignment(){const n=this.tokens.currentIndex(),s=this.tokens.tokens[n-1];if(s.type!==t.name||s.shadowsGlobal||n>=2&&this.tokens.matches1AtIndex(n-2,t.dot))return!1;const o=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(s));return o?(this.tokens.appendCode(` = ${o}`),this.tokens.copyToken(),!0):!1}processPreIncDec(){const n=this.tokens.currentIndex(),s=this.tokens.tokens[n+1];if(s.type!==t.name||s.shadowsGlobal||n+2<this.tokens.tokens.length&&(this.tokens.matches1AtIndex(n+2,t.dot)||this.tokens.matches1AtIndex(n+2,t.bracketL)||this.tokens.matches1AtIndex(n+2,t.parenL)))return!1;const o=this.tokens.identifierNameForToken(s),i=this.importProcessor.resolveExportBinding(o);return i?(this.tokens.appendCode(`${i} = `),this.tokens.copyToken(),!0):!1}processPostIncDec(){const n=this.tokens.currentIndex(),s=this.tokens.tokens[n],o=this.tokens.tokens[n+1];if(s.type!==t.name||s.shadowsGlobal||n>=1&&this.tokens.matches1AtIndex(n-1,t.dot))return!1;const i=this.tokens.identifierNameForToken(s),c=this.importProcessor.resolveExportBinding(i);if(!c)return!1;const h=this.tokens.rawCodeForToken(o),m=this.importProcessor.getIdentifierReplacement(i)||i;if(h==="++")this.tokens.replaceToken(`(${m} = ${c} = ${m} + 1, ${m} - 1)`);else if(h==="--")this.tokens.replaceToken(`(${m} = ${c} = ${m} - 1, ${m} + 1)`);else throw new Error(`Unexpected operator: ${h}`);return this.tokens.removeToken(),!0}processExportDefault(){let n=!0;if(this.tokens.matches4(t._export,t._default,t._function,t.name)||this.tokens.matches5(t._export,t._default,t.name,t._function,t.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._async)){this.tokens.removeInitialToken(),this.tokens.removeToken();const s=this.processNamedFunction();this.tokens.appendCode(` exports.default = ${s};`)}else if(this.tokens.matches4(t._export,t._default,t._class,t.name)||this.tokens.matches5(t._export,t._default,t._abstract,t._class,t.name)||this.tokens.matches3(t._export,t._default,t.at)){this.tokens.removeInitialToken(),this.tokens.removeToken(),this.copyDecorators(),this.tokens.matches1(t._abstract)&&this.tokens.removeToken();const s=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.default = ${s};`)}else if(Er(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))n=!1,this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken();else if(this.reactHotLoaderTransformer){const s=this.nameManager.claimFreeName("_default");this.tokens.replaceToken(`let ${s}; exports.`),this.tokens.copyToken(),this.tokens.appendCode(` = ${s} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(s)}else this.tokens.replaceToken("exports."),this.tokens.copyToken(),this.tokens.appendCode(" =");n&&(this.hadDefaultExport=!0)}copyDecorators(){for(;this.tokens.matches1(t.at);)if(this.tokens.copyToken(),this.tokens.matches1(t.parenL))this.tokens.copyExpectedToken(t.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR);else{for(this.tokens.copyExpectedToken(t.name);this.tokens.matches1(t.dot);)this.tokens.copyExpectedToken(t.dot),this.tokens.copyExpectedToken(t.name);this.tokens.matches1(t.parenL)&&(this.tokens.copyExpectedToken(t.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR))}}processExportVar(){this.isSimpleExportVar()?this.processSimpleExportVar():this.processComplexExportVar()}isSimpleExportVar(){let n=this.tokens.currentIndex();if(n++,n++,!this.tokens.matches1AtIndex(n,t.name))return!1;for(n++;n<this.tokens.tokens.length&&this.tokens.tokens[n].isType;)n++;return!!this.tokens.matches1AtIndex(n,t.eq)}processSimpleExportVar(){this.tokens.removeInitialToken(),this.tokens.copyToken();const n=this.tokens.identifierName();for(;!this.tokens.matches1(t.eq);)this.rootTransformer.processToken();const s=this.tokens.currentToken().rhsEndIndex;if(s==null)throw new Error("Expected = token with an end index.");for(;this.tokens.currentIndex()<s;)this.rootTransformer.processToken();this.tokens.appendCode(`; exports.${n} = ${n}`)}processComplexExportVar(){this.tokens.removeInitialToken(),this.tokens.removeToken();const n=this.tokens.matches1(t.braceL);n&&this.tokens.appendCode("(");let s=0;for(;;)if(this.tokens.matches1(t.braceL)||this.tokens.matches1(t.dollarBraceL)||this.tokens.matches1(t.bracketL))s++,this.tokens.copyToken();else if(this.tokens.matches1(t.braceR)||this.tokens.matches1(t.bracketR))s--,this.tokens.copyToken();else{if(s===0&&!this.tokens.matches1(t.name)&&!this.tokens.currentToken().isType)break;if(this.tokens.matches1(t.eq)){const o=this.tokens.currentToken().rhsEndIndex;if(o==null)throw new Error("Expected = token with an end index.");for(;this.tokens.currentIndex()<o;)this.rootTransformer.processToken()}else{const o=this.tokens.currentToken();if(I1(o)){const i=this.tokens.identifierName();let c=this.importProcessor.getIdentifierReplacement(i);if(c===null)throw new Error(`Expected a replacement for ${i} in \`export var\` syntax.`);oo(o)&&(c=`${i}: ${c}`),this.tokens.replaceToken(c)}else this.rootTransformer.processToken()}}if(n){const o=this.tokens.currentToken().rhsEndIndex;if(o==null)throw new Error("Expected = token with an end index.");for(;this.tokens.currentIndex()<o;)this.rootTransformer.processToken();this.tokens.appendCode(")")}}processExportFunction(){this.tokens.replaceToken("");const n=this.processNamedFunction();this.tokens.appendCode(` exports.${n} = ${n};`)}processNamedFunction(){if(this.tokens.matches1(t._function))this.tokens.copyToken();else if(this.tokens.matches2(t.name,t._function)){if(!this.tokens.matchesContextual(l._async))throw new Error("Expected async keyword in function export.");this.tokens.copyToken(),this.tokens.copyToken()}if(this.tokens.matches1(t.star)&&this.tokens.copyToken(),!this.tokens.matches1(t.name))throw new Error("Expected identifier for exported function name.");const n=this.tokens.identifierName();if(this.tokens.copyToken(),this.tokens.currentToken().isType)for(this.tokens.removeInitialToken();this.tokens.currentToken().isType;)this.tokens.removeToken();return this.tokens.copyExpectedToken(t.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR),this.rootTransformer.processPossibleTypeRange(),this.tokens.copyExpectedToken(t.braceL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.braceR),n}processExportClass(){this.tokens.removeInitialToken(),this.copyDecorators(),this.tokens.matches1(t._abstract)&&this.tokens.removeToken();const n=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.${n} = ${n};`)}processExportBindings(){this.tokens.removeInitialToken(),this.tokens.removeToken();const n=Ar(this.tokens),s=[];for(;;){if(this.tokens.matches1(t.braceR)){this.tokens.removeToken();break}const o=It(this.tokens);for(;this.tokens.currentIndex()<o.endIndex;)this.tokens.removeToken();if(!(o.isType||!n&&this.shouldElideExportedIdentifier(o.leftName))){const c=o.rightName;c==="default"?this.hadDefaultExport=!0:this.hadNamedExport=!0;const h=o.leftName,m=this.importProcessor.getIdentifierReplacement(h);s.push(`exports.${c} = ${m||h};`)}if(this.tokens.matches1(t.braceR)){this.tokens.removeToken();break}if(this.tokens.matches2(t.comma,t.braceR)){this.tokens.removeToken(),this.tokens.removeToken();break}else if(this.tokens.matches1(t.comma))this.tokens.removeToken();else throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`)}if(this.tokens.matchesContextual(l._from)){this.tokens.removeToken();const o=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(o)),Ke(this.tokens)}else this.tokens.appendCode(s.join(" "));this.tokens.matches1(t.semi)&&this.tokens.removeToken()}processExportStar(){for(this.tokens.removeInitialToken();!this.tokens.matches1(t.string);)this.tokens.removeToken();const n=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(n)),Ke(this.tokens),this.tokens.matches1(t.semi)&&this.tokens.removeToken()}shouldElideExportedIdentifier(n){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.declarationInfo.valueDeclarations.has(n)}}class Cl extends Ee{constructor(n,s,o,i,c,h,m,g){super(),this.tokens=n,this.nameManager=s,this.helperManager=o,this.reactHotLoaderTransformer=i,this.isTypeScriptTransformEnabled=c,this.isFlowTransformEnabled=h,this.keepUnusedImports=m,this.nonTypeIdentifiers=c&&!m?F1(n,g):new Set,this.declarationInfo=c&&!m?Tr(n):wr,this.injectCreateRequireForImportRequire=!!g.injectCreateRequireForImportRequire}process(){if(this.tokens.matches3(t._import,t.name,t.eq))return this.processImportEquals();if(this.tokens.matches4(t._import,t.name,t.name,t.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._type)){this.tokens.removeInitialToken();for(let n=0;n<7;n++)this.tokens.removeToken();return!0}if(this.tokens.matches2(t._export,t.eq))return this.tokens.replaceToken("module.exports"),!0;if(this.tokens.matches5(t._export,t._import,t.name,t.name,t.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._type)){this.tokens.removeInitialToken();for(let n=0;n<8;n++)this.tokens.removeToken();return!0}if(this.tokens.matches1(t._import))return this.processImport();if(this.tokens.matches2(t._export,t._default))return this.processExportDefault();if(this.tokens.matches2(t._export,t.braceL))return this.processNamedExports();if(this.tokens.matches2(t._export,t.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(t.braceL)){for(;!this.tokens.matches1(t.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(t._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(l._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,t.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),Ke(this.tokens)),!0}return!1}processImportEquals(){const n=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.shouldAutomaticallyElideImportedName(n)?br(this.tokens):this.injectCreateRequireForImportRequire?(this.tokens.replaceToken("const"),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.replaceToken(this.helperManager.getHelperName("require"))):this.tokens.replaceToken("const"),!0}processImport(){if(this.tokens.matches2(t._import,t.parenL))return!1;const n=this.tokens.snapshot();if(this.removeImportTypeBindings()){for(this.tokens.restoreToSnapshot(n);!this.tokens.matches1(t.string);)this.tokens.removeToken();this.tokens.removeToken(),Ke(this.tokens),this.tokens.matches1(t.semi)&&this.tokens.removeToken()}return!0}removeImportTypeBindings(){if(this.tokens.copyExpectedToken(t._import),this.tokens.matchesContextual(l._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,t.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._from))return!0;if(this.tokens.matches1(t.string))return this.tokens.copyToken(),!1;this.tokens.matchesContextual(l._module)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._from)&&this.tokens.copyToken();let n=!1,s=!1,o=!1;if(this.tokens.matches1(t.name)&&(this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())?(this.tokens.removeToken(),this.tokens.matches1(t.comma)&&this.tokens.removeToken()):(n=!0,this.tokens.copyToken(),this.tokens.matches1(t.comma)&&(o=!0,this.tokens.removeToken()))),this.tokens.matches1(t.star))this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))?(this.tokens.removeToken(),this.tokens.removeToken(),this.tokens.removeToken()):(o&&this.tokens.appendCode(","),n=!0,this.tokens.copyExpectedToken(t.star),this.tokens.copyExpectedToken(t.name),this.tokens.copyExpectedToken(t.name));else if(this.tokens.matches1(t.braceL)){for(o&&this.tokens.appendCode(","),this.tokens.copyToken();!this.tokens.matches1(t.braceR);){s=!0;const i=It(this.tokens);if(i.isType||this.shouldAutomaticallyElideImportedName(i.rightName)){for(;this.tokens.currentIndex()<i.endIndex;)this.tokens.removeToken();this.tokens.matches1(t.comma)&&this.tokens.removeToken()}else{for(n=!0;this.tokens.currentIndex()<i.endIndex;)this.tokens.copyToken();this.tokens.matches1(t.comma)&&this.tokens.copyToken()}}this.tokens.copyExpectedToken(t.braceR)}return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!n:this.isFlowTransformEnabled?s&&!n:!1}shouldAutomaticallyElideImportedName(n){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.nonTypeIdentifiers.has(n)}processExportDefault(){if(Er(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))return this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken(),!0;if(!(this.tokens.matches4(t._export,t._default,t._function,t.name)||this.tokens.matches5(t._export,t._default,t.name,t._function,t.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._async)||this.tokens.matches4(t._export,t._default,t._class,t.name)||this.tokens.matches5(t._export,t._default,t._abstract,t._class,t.name))&&this.reactHotLoaderTransformer){const s=this.nameManager.claimFreeName("_default");return this.tokens.replaceToken(`let ${s}; export`),this.tokens.copyToken(),this.tokens.appendCode(` ${s} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(s),!0}return!1}processNamedExports(){if(!this.isTypeScriptTransformEnabled)return!1;this.tokens.copyExpectedToken(t._export),this.tokens.copyExpectedToken(t.braceL);const n=Ar(this.tokens);let s=!1;for(;!this.tokens.matches1(t.braceR);){const o=It(this.tokens);if(o.isType||!n&&this.shouldElideExportedName(o.leftName)){for(;this.tokens.currentIndex()<o.endIndex;)this.tokens.removeToken();this.tokens.matches1(t.comma)&&this.tokens.removeToken()}else{for(s=!0;this.tokens.currentIndex()<o.endIndex;)this.tokens.copyToken();this.tokens.matches1(t.comma)&&this.tokens.copyToken()}}return this.tokens.copyExpectedToken(t.braceR),!this.keepUnusedImports&&n&&!s&&(this.tokens.removeToken(),this.tokens.removeToken(),Ke(this.tokens)),!0}shouldElideExportedName(n){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&this.declarationInfo.typeDeclarations.has(n)&&!this.declarationInfo.valueDeclarations.has(n)}}class Pl extends Ee{constructor(n,s,o){super(),this.rootTransformer=n,this.tokens=s,this.isImportsTransformEnabled=o}process(){return this.rootTransformer.processPossibleArrowParamEnd()||this.rootTransformer.processPossibleAsyncArrowWithTypeParams()||this.rootTransformer.processPossibleTypeRange()?!0:this.tokens.matches1(t._enum)?(this.processEnum(),!0):this.tokens.matches2(t._export,t._enum)?(this.processNamedExportEnum(),!0):this.tokens.matches3(t._export,t._default,t._enum)?(this.processDefaultExportEnum(),!0):!1}processNamedExportEnum(){if(this.isImportsTransformEnabled){this.tokens.removeInitialToken();const n=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.tokens.appendCode(` exports.${n} = ${n};`)}else this.tokens.copyToken(),this.processEnum()}processDefaultExportEnum(){this.tokens.removeInitialToken(),this.tokens.removeToken();const n=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.isImportsTransformEnabled?this.tokens.appendCode(` exports.default = ${n};`):this.tokens.appendCode(` export default ${n};`)}processEnum(){this.tokens.replaceToken("const"),this.tokens.copyExpectedToken(t.name);let n=!1;this.tokens.matchesContextual(l._of)&&(this.tokens.removeToken(),n=this.tokens.matchesContextual(l._symbol),this.tokens.removeToken());const s=this.tokens.matches3(t.braceL,t.name,t.eq);this.tokens.appendCode(' = require("flow-enums-runtime")');const o=!n&&!s;for(this.tokens.replaceTokenTrimmingLeftWhitespace(o?".Mirrored([":"({");!this.tokens.matches1(t.braceR);){if(this.tokens.matches1(t.ellipsis)){this.tokens.removeToken();break}this.processEnumElement(n,s),this.tokens.matches1(t.comma)&&this.tokens.copyToken()}this.tokens.replaceToken(o?"]);":"});")}processEnumElement(n,s){if(n){const o=this.tokens.identifierName();this.tokens.copyToken(),this.tokens.appendCode(`: Symbol("${o}")`)}else s?(this.tokens.copyToken(),this.tokens.replaceTokenTrimmingLeftWhitespace(":"),this.tokens.copyToken()):this.tokens.replaceToken(`"${this.tokens.identifierName()}"`)}}function Rl(e){let n,s=e[0],o=1;for(;o<e.length;){const i=e[o],c=e[o+1];if(o+=2,(i==="optionalAccess"||i==="optionalCall")&&s==null)return;i==="access"||i==="optionalAccess"?(n=s,s=c(s)):(i==="call"||i==="optionalCall")&&(s=c((...h)=>s.call(n,...h)),n=void 0)}return s}const Lt="jest",Ll=["mock","unmock","enableAutomock","disableAutomock"];class Ms extends Ee{__init(){this.hoistedFunctionNames=[]}constructor(n,s,o,i){super(),this.rootTransformer=n,this.tokens=s,this.nameManager=o,this.importProcessor=i,Ms.prototype.__init.call(this)}process(){return this.tokens.currentToken().scopeDepth===0&&this.tokens.matches4(t.name,t.dot,t.name,t.parenL)&&this.tokens.identifierName()===Lt?Rl([this,"access",n=>n.importProcessor,"optionalAccess",n=>n.getGlobalNames,"call",n=>n(),"optionalAccess",n=>n.has,"call",n=>n(Lt)])?!1:this.extractHoistedCalls():!1}getHoistedCode(){return this.hoistedFunctionNames.length>0?this.hoistedFunctionNames.map(n=>`${n}();`).join(""):""}extractHoistedCalls(){this.tokens.removeToken();let n=!1;for(;this.tokens.matches3(t.dot,t.name,t.parenL);){const s=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);if(Ll.includes(s)){const i=this.nameManager.claimFreeName("__jestHoist");this.hoistedFunctionNames.push(i),this.tokens.replaceToken(`function ${i}(){${Lt}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR),this.tokens.appendCode(";}"),n=!1}else n?this.tokens.copyToken():this.tokens.replaceToken(`${Lt}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.parenR),n=!0}return!0}}class Dl extends Ee{constructor(n){super(),this.tokens=n}process(){if(this.tokens.matches1(t.num)){const n=this.tokens.currentTokenCode();if(n.includes("_"))return this.tokens.replaceToken(n.replace(/_/g,"")),!0}return!1}}class Ol extends Ee{constructor(n,s){super(),this.tokens=n,this.nameManager=s}process(){return this.tokens.matches2(t._catch,t.braceL)?(this.tokens.copyToken(),this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`),!0):!1}}class Fl extends Ee{constructor(n,s){super(),this.tokens=n,this.nameManager=s}process(){if(this.tokens.matches1(t.nullishCoalescing)){const o=this.tokens.currentToken();return this.tokens.tokens[o.nullishStartIndex].isAsyncOperation?this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => ("):this.tokens.replaceTokenTrimmingLeftWhitespace(", () => ("),!0}if(this.tokens.matches1(t._delete)&&this.tokens.tokenAtRelativeIndex(1).isOptionalChainStart)return this.tokens.removeInitialToken(),!0;const s=this.tokens.currentToken().subscriptStartIndex;if(s!=null&&this.tokens.tokens[s].isOptionalChainStart&&this.tokens.tokenAtRelativeIndex(-1).type!==t._super){const o=this.nameManager.claimFreeName("_");let i;if(s>0&&this.tokens.matches1AtIndex(s-1,t._delete)&&this.isLastSubscriptInChain()?i=`${o} => delete ${o}`:i=`${o} => ${o}`,this.tokens.tokens[s].isAsyncOperation&&(i=`async ${i}`),this.tokens.matches2(t.questionDot,t.parenL)||this.tokens.matches2(t.questionDot,t.lessThan))this.justSkippedSuper()&&this.tokens.appendCode(".bind(this)"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${i}`);else if(this.tokens.matches2(t.questionDot,t.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${i}`);else if(this.tokens.matches1(t.questionDot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${i}.`);else if(this.tokens.matches1(t.dot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${i}.`);else if(this.tokens.matches1(t.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${i}[`);else if(this.tokens.matches1(t.parenL))this.justSkippedSuper()&&this.tokens.appendCode(".bind(this)"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${i}(`);else throw new Error("Unexpected subscript operator in optional chain.");return!0}return!1}isLastSubscriptInChain(){let n=0;for(let s=this.tokens.currentIndex()+1;;s++){if(s>=this.tokens.tokens.length)throw new Error("Reached the end of the code while finding the end of the access chain.");if(this.tokens.tokens[s].isOptionalChainStart?n++:this.tokens.tokens[s].isOptionalChainEnd&&n--,n<0)return!0;if(n===0&&this.tokens.tokens[s].subscriptStartIndex!=null)return!1}}justSkippedSuper(){let n=0,s=this.tokens.currentIndex()-1;for(;;){if(s<0)throw new Error("Reached the start of the code while finding the start of the access chain.");if(this.tokens.tokens[s].isOptionalChainStart?n--:this.tokens.tokens[s].isOptionalChainEnd&&n++,n<0)return!1;if(n===0&&this.tokens.tokens[s].subscriptStartIndex!=null)return this.tokens.tokens[s-1].type===t._super;s--}}}class jl extends Ee{constructor(n,s,o,i){super(),this.rootTransformer=n,this.tokens=s,this.importProcessor=o,this.options=i}process(){const n=this.tokens.currentIndex();if(this.tokens.identifierName()==="createReactClass"){const s=this.importProcessor&&this.importProcessor.getIdentifierReplacement("createReactClass");return s?this.tokens.replaceToken(`(0, ${s})`):this.tokens.copyToken(),this.tryProcessCreateClassCall(n),!0}if(this.tokens.matches3(t.name,t.dot,t.name)&&this.tokens.identifierName()==="React"&&this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+2)==="createClass"){const s=this.importProcessor&&this.importProcessor.getIdentifierReplacement("React")||"React";return this.tokens.replaceToken(s),this.tokens.copyToken(),this.tokens.copyToken(),this.tryProcessCreateClassCall(n),!0}return!1}tryProcessCreateClassCall(n){const s=this.findDisplayName(n);s&&this.classNeedsDisplayName()&&(this.tokens.copyExpectedToken(t.parenL),this.tokens.copyExpectedToken(t.braceL),this.tokens.appendCode(`displayName: '${s}',`),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(t.braceR),this.tokens.copyExpectedToken(t.parenR))}findDisplayName(n){return n<2?null:this.tokens.matches2AtIndex(n-2,t.name,t.eq)?this.tokens.identifierNameAtIndex(n-2):n>=2&&this.tokens.tokens[n-2].identifierRole===v.ObjectKey?this.tokens.identifierNameAtIndex(n-2):this.tokens.matches2AtIndex(n-2,t._export,t._default)?this.getDisplayNameFromFilename():null}getDisplayNameFromFilename(){const s=(this.options.filePath||"unknown").split("/"),o=s[s.length-1],i=o.lastIndexOf("."),c=i===-1?o:o.slice(0,i);return c==="index"&&s[s.length-2]?s[s.length-2]:c}classNeedsDisplayName(){let n=this.tokens.currentIndex();if(!this.tokens.matches2(t.parenL,t.braceL))return!1;const s=n+1,o=this.tokens.tokens[s].contextId;if(o==null)throw new Error("Expected non-null context ID on object open-brace.");for(;n<this.tokens.tokens.length;n++){const i=this.tokens.tokens[n];if(i.type===t.braceR&&i.contextId===o){n++;break}if(this.tokens.identifierNameAtIndex(n)==="displayName"&&this.tokens.tokens[n].identifierRole===v.ObjectKey&&i.contextId===o)return!1}if(n===this.tokens.tokens.length)throw new Error("Unexpected end of input when processing React class.");return this.tokens.matches1AtIndex(n,t.parenR)||this.tokens.matches2AtIndex(n,t.comma,t.parenR)}}class Bs extends Ee{__init(){this.extractedDefaultExportName=null}constructor(n,s){super(),this.tokens=n,this.filePath=s,Bs.prototype.__init.call(this)}setExtractedDefaultExportName(n){this.extractedDefaultExportName=n}getPrefixCode(){return`
119
119
  (function () {
120
120
  var enterModule = require('react-hot-loader').enterModule;
121
121
  enterModule && enterModule(module);
package/dist/index.html CHANGED
@@ -6,8 +6,8 @@
6
6
  <base href="" />
7
7
  <link rel="preload" crossorigin href="./index.json" as="fetch" />
8
8
  <link rel="preload" crossorigin href="./fonts.json" as="fetch" />
9
- <script type="module" crossorigin src="./assets/index-jnIwSqo7.js"></script>
10
- <link rel="modulepreload" crossorigin href="./assets/sucrase-B167QcXN.js">
9
+ <script type="module" crossorigin src="./assets/index-Dy6rvr78.js"></script>
10
+ <link rel="modulepreload" crossorigin href="./assets/sucrase-Cw4LZf8f.js">
11
11
  <link rel="modulepreload" crossorigin href="./assets/compiler-sfc-CHbDt8t7.js">
12
12
  <link rel="stylesheet" crossorigin href="./assets/index-vGiKZPT9.css">
13
13
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuebro/runtime",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "lint": "eslint .",
@@ -18,8 +18,8 @@
18
18
  "@unocss/preset-web-fonts": "^66.3.3",
19
19
  "@unocss/preset-wind4": "^66.3.3",
20
20
  "@unocss/runtime": "^66.3.3",
21
- "@vuebro/sfc-loader": "^1.2.24",
22
- "@vuebro/shared": "^1.0.7",
21
+ "@vuebro/sfc-loader": "^1.2.25",
22
+ "@vuebro/shared": "^1.0.9",
23
23
  "@vueuse/core": "^13.5.0",
24
24
  "globals": "^16.3.0",
25
25
  "vue": "^3.5.17",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@eslint/eslintrc": "^3.3.1",
30
- "@eslint/js": "^9.30.1",
30
+ "@eslint/js": "^9.31.0",
31
31
  "@types/node": "^24.0.13",
32
32
  "@vitejs/plugin-vue": "^6.0.0",
33
33
  "eslint-config-prettier": "^10.1.5",
@@ -40,7 +40,7 @@
40
40
  "prettier": "^3.6.2",
41
41
  "typescript-eslint": "^8.36.0",
42
42
  "vite": "^7.0.4",
43
- "vite-plugin-static-copy": "^3.1.0",
43
+ "vite-plugin-static-copy": "^3.1.1",
44
44
  "vue-eslint-parser": "^10.2.0",
45
45
  "vue-tsc": "^3.0.1"
46
46
  },