@modern-js/module-tools-v2
Version:
The meta-framework suite designed from scratch for frontend-focused modern web development.
1 lines • 138 kB
JavaScript
(()=>{var e={49:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.clear=clear;t.clearPath=clearPath;t.clearScope=clearScope;t.scope=t.path=void 0;let n=new WeakMap;t.path=n;let s=new WeakMap;t.scope=s;function clear(){clearPath();clearScope()}function clearPath(){t.path=n=new WeakMap}function clearScope(){t.scope=s=new WeakMap}},214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var s=n(348);var r=n(740);const{VISITOR_KEYS:i}=r;class TraversalContext{constructor(e,t,n,s){this.queue=null;this.priorityQueue=null;this.parentPath=s;this.scope=e;this.state=n;this.opts=t}shouldVisit(e){const t=this.opts;if(t.enter||t.exit)return true;if(t[e.type])return true;const n=i[e.type];if(!(n!=null&&n.length))return false;for(const t of n){if(e[t])return true}return false}create(e,t,n,r){return s.default.get({parentPath:this.parentPath,parent:e,container:t,key:n,listKey:r})}maybeQueue(e,t){if(this.queue){if(t){this.queue.push(e)}else{this.priorityQueue.push(e)}}}visitMultiple(e,t,n){if(e.length===0)return false;const s=[];for(let r=0;r<e.length;r++){const i=e[r];if(i&&this.shouldVisit(i)){s.push(this.create(t,e,r,n))}}return this.visitQueue(s)}visitSingle(e,t){if(this.shouldVisit(e[t])){return this.visitQueue([this.create(e,e,t)])}else{return false}}visitQueue(e){this.queue=e;this.priorityQueue=[];const t=new WeakSet;let n=false;for(const s of e){s.resync();if(s.contexts.length===0||s.contexts[s.contexts.length-1]!==this){s.pushContext(this)}if(s.key===null)continue;const{node:r}=s;if(t.has(r))continue;if(r)t.add(r);if(s.visit()){n=true;break}if(this.priorityQueue.length){n=this.visitQueue(this.priorityQueue);this.priorityQueue=[];this.queue=e;if(n)break}}for(const t of e){t.popContext()}this.queue=null;return n}visit(e,t){const n=e[t];if(!n)return false;if(Array.isArray(n)){return this.visitMultiple(n,e,t)}else{return this.visitSingle(e,t)}}}t["default"]=TraversalContext},737:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;class Hub{getCode(){}getScope(){}addHelper(){throw new Error("Helpers are not supported by the default hub.")}buildError(e,t,n=TypeError){return new n(t)}}t["default"]=Hub},701:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"Hub",{enumerable:true,get:function(){return f.default}});Object.defineProperty(t,"NodePath",{enumerable:true,get:function(){return o.default}});Object.defineProperty(t,"Scope",{enumerable:true,get:function(){return l.default}});t.visitors=t["default"]=void 0;var s=n(63);t.visitors=s;var r=n(740);var i=n(49);var a=n(569);var o=n(348);var l=n(556);var f=n(737);const{VISITOR_KEYS:c,removeProperties:u,traverseFast:p}=r;function traverse(e,t={},n,r,i){if(!e)return;if(!t.noScope&&!n){if(e.type!=="Program"&&e.type!=="File"){throw new Error("You must pass a scope and parentPath unless traversing a Program/File. "+`Instead of that you tried to traverse a ${e.type} node without `+"passing scope and parentPath.")}}if(!c[e.type]){return}s.explode(t);(0,a.traverseNode)(e,t,n,r,i)}var d=traverse;t["default"]=d;traverse.visitors=s;traverse.verify=s.verify;traverse.explode=s.explode;traverse.cheap=function(e,t){return p(e,t)};traverse.node=function(e,t,n,s,r,i){(0,a.traverseNode)(e,t,n,s,r,i)};traverse.clearNode=function(e,t){u(e,t);i.path.delete(e)};traverse.removeProperties=function(e,t){p(e,traverse.clearNode,t);return e};function hasDenylistedType(e,t){if(e.node.type===t.type){t.has=true;e.stop()}}traverse.hasType=function(e,t,n){if(n!=null&&n.includes(e.type))return false;if(e.type===t)return true;const s={has:false,type:t};traverse(e,{noScope:true,denylist:n,enter:hasDenylistedType},null,s);return s.has};traverse.cache=i},937:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.find=find;t.findParent=findParent;t.getAncestry=getAncestry;t.getDeepestCommonAncestorFrom=getDeepestCommonAncestorFrom;t.getEarliestCommonAncestorFrom=getEarliestCommonAncestorFrom;t.getFunctionParent=getFunctionParent;t.getStatementParent=getStatementParent;t.inType=inType;t.isAncestor=isAncestor;t.isDescendant=isDescendant;var s=n(740);var r=n(348);const{VISITOR_KEYS:i}=s;function findParent(e){let t=this;while(t=t.parentPath){if(e(t))return t}return null}function find(e){let t=this;do{if(e(t))return t}while(t=t.parentPath);return null}function getFunctionParent(){return this.findParent((e=>e.isFunction()))}function getStatementParent(){let e=this;do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement()){break}else{e=e.parentPath}}while(e);if(e&&(e.isProgram()||e.isFile())){throw new Error("File/Program node, we can't possibly find a statement parent to this")}return e}function getEarliestCommonAncestorFrom(e){return this.getDeepestCommonAncestorFrom(e,(function(e,t,n){let s;const r=i[e.type];for(const e of n){const n=e[t+1];if(!s){s=n;continue}if(n.listKey&&s.listKey===n.listKey){if(n.key<s.key){s=n;continue}}const i=r.indexOf(s.parentKey);const a=r.indexOf(n.parentKey);if(i>a){s=n}}return s}))}function getDeepestCommonAncestorFrom(e,t){if(!e.length){return this}if(e.length===1){return e[0]}let n=Infinity;let s,r;const i=e.map((e=>{const t=[];do{t.unshift(e)}while((e=e.parentPath)&&e!==this);if(t.length<n){n=t.length}return t}));const a=i[0];e:for(let e=0;e<n;e++){const t=a[e];for(const n of i){if(n[e]!==t){break e}}s=e;r=t}if(r){if(t){return t(r,s,i)}else{return r}}else{throw new Error("Couldn't find intersection")}}function getAncestry(){let e=this;const t=[];do{t.push(e)}while(e=e.parentPath);return t}function isAncestor(e){return e.isDescendant(this)}function isDescendant(e){return!!this.findParent((t=>t===e))}function inType(...e){let t=this;while(t){for(const n of e){if(t.node.type===n)return true}t=t.parentPath}return false}},613:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.addComment=addComment;t.addComments=addComments;t.shareCommentsWithSiblings=shareCommentsWithSiblings;var s=n(740);const{addComment:r,addComments:i}=s;function shareCommentsWithSiblings(){if(typeof this.key==="string")return;const e=this.node;if(!e)return;const t=e.trailingComments;const n=e.leadingComments;if(!t&&!n)return;const s=this.getSibling(this.key-1);const r=this.getSibling(this.key+1);const i=Boolean(s.node);const a=Boolean(r.node);if(i&&!a){s.addComments("trailing",t)}else if(a&&!i){r.addComments("leading",n)}}function addComment(e,t,n){r(this.node,e,t,n)}function addComments(e,t){i(this.node,e,t)}},266:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t._call=_call;t._getQueueContexts=_getQueueContexts;t._resyncKey=_resyncKey;t._resyncList=_resyncList;t._resyncParent=_resyncParent;t._resyncRemoved=_resyncRemoved;t.call=call;t.isBlacklisted=t.isDenylisted=isDenylisted;t.popContext=popContext;t.pushContext=pushContext;t.requeue=requeue;t.resync=resync;t.setContext=setContext;t.setKey=setKey;t.setScope=setScope;t.setup=setup;t.skip=skip;t.skipKey=skipKey;t.stop=stop;t.visit=visit;var s=n(569);var r=n(348);function call(e){const t=this.opts;this.debug(e);if(this.node){if(this._call(t[e]))return true}if(this.node){return this._call(t[this.node.type]&&t[this.node.type][e])}return false}function _call(e){if(!e)return false;for(const t of e){if(!t)continue;const e=this.node;if(!e)return true;const n=t.call(this.state,this,this.state);if(n&&typeof n==="object"&&typeof n.then==="function"){throw new Error(`You appear to be using a plugin with an async traversal visitor, `+`which your current version of Babel does not support. `+`If you're using a published plugin, you may need to upgrade `+`your @babel/core version.`)}if(n){throw new Error(`Unexpected return value from visitor method ${t}`)}if(this.node!==e)return true;if(this._traverseFlags>0)return true}return false}function isDenylisted(){var e;const t=(e=this.opts.denylist)!=null?e:this.opts.blacklist;return t&&t.indexOf(this.node.type)>-1}function restoreContext(e,t){if(e.context!==t){e.context=t;e.state=t.state;e.opts=t.opts}}function visit(){if(!this.node){return false}if(this.isDenylisted()){return false}if(this.opts.shouldSkip&&this.opts.shouldSkip(this)){return false}const e=this.context;if(this.shouldSkip||this.call("enter")){this.debug("Skip...");return this.shouldStop}restoreContext(this,e);this.debug("Recursing into...");this.shouldStop=(0,s.traverseNode)(this.node,this.opts,this.scope,this.state,this,this.skipKeys);restoreContext(this,e);this.call("exit");return this.shouldStop}function skip(){this.shouldSkip=true}function skipKey(e){if(this.skipKeys==null){this.skipKeys={}}this.skipKeys[e]=true}function stop(){this._traverseFlags|=r.SHOULD_SKIP|r.SHOULD_STOP}function setScope(){if(this.opts&&this.opts.noScope)return;let e=this.parentPath;if((this.key==="key"||this.listKey==="decorators")&&e.isMethod()){e=e.parentPath}let t;while(e&&!t){if(e.opts&&e.opts.noScope)return;t=e.scope;e=e.parentPath}this.scope=this.getScope(t);if(this.scope)this.scope.init()}function setContext(e){if(this.skipKeys!=null){this.skipKeys={}}this._traverseFlags=0;if(e){this.context=e;this.state=e.state;this.opts=e.opts}this.setScope();return this}function resync(){if(this.removed)return;this._resyncParent();this._resyncList();this._resyncKey()}function _resyncParent(){if(this.parentPath){this.parent=this.parentPath.node}}function _resyncKey(){if(!this.container)return;if(this.node===this.container[this.key])return;if(Array.isArray(this.container)){for(let e=0;e<this.container.length;e++){if(this.container[e]===this.node){return this.setKey(e)}}}else{for(const e of Object.keys(this.container)){if(this.container[e]===this.node){return this.setKey(e)}}}this.key=null}function _resyncList(){if(!this.parent||!this.inList)return;const e=this.parent[this.listKey];if(this.container===e)return;this.container=e||null}function _resyncRemoved(){if(this.key==null||!this.container||this.container[this.key]!==this.node){this._markRemoved()}}function popContext(){this.contexts.pop();if(this.contexts.length>0){this.setContext(this.contexts[this.contexts.length-1])}else{this.setContext(undefined)}}function pushContext(e){this.contexts.push(e);this.setContext(e)}function setup(e,t,n,s){this.listKey=n;this.container=t;this.parentPath=e||this.parentPath;this.setKey(s)}function setKey(e){var t;this.key=e;this.node=this.container[this.key];this.type=(t=this.node)==null?void 0:t.type}function requeue(e=this){if(e.removed)return;const t=this.contexts;for(const n of t){n.maybeQueue(e)}}function _getQueueContexts(){let e=this;let t=this.contexts;while(!t.length){e=e.parentPath;if(!e)break;t=e.contexts}return t}},137:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.arrowFunctionToExpression=arrowFunctionToExpression;t.arrowFunctionToShadowed=arrowFunctionToShadowed;t.ensureBlock=ensureBlock;t.toComputedKey=toComputedKey;t.unwrapFunctionEnvironment=unwrapFunctionEnvironment;var s=n(740);var r=n(816);var i=n(34);var a=n(63);const{arrowFunctionExpression:o,assignmentExpression:l,binaryExpression:f,blockStatement:c,callExpression:u,conditionalExpression:p,expressionStatement:d,identifier:h,isIdentifier:g,jsxIdentifier:m,logicalExpression:y,LOGICAL_OPERATORS:E,memberExpression:b,metaProperty:v,numericLiteral:S,objectExpression:C,restElement:x,returnStatement:P,sequenceExpression:T,spreadElement:k,stringLiteral:A,super:I,thisExpression:O,toExpression:w,unaryExpression:D}=s;function toComputedKey(){let e;if(this.isMemberExpression()){e=this.node.property}else if(this.isProperty()||this.isMethod()){e=this.node.key}else{throw new ReferenceError("todo")}if(!this.node.computed){if(g(e))e=A(e.name)}return e}function ensureBlock(){const e=this.get("body");const t=e.node;if(Array.isArray(e)){throw new Error("Can't convert array path to a block statement")}if(!t){throw new Error("Can't convert node without a body")}if(e.isBlockStatement()){return t}const n=[];let s="body";let r;let i;if(e.isStatement()){i="body";r=0;n.push(e.node)}else{s+=".body.0";if(this.isFunction()){r="argument";n.push(P(e.node))}else{r="expression";n.push(d(e.node))}}this.node.body=c(n);const a=this.get(s);e.setup(a,i?a.node[i]:a.node,i,r);return this.node}function arrowFunctionToShadowed(){if(!this.isArrowFunctionExpression())return;this.arrowFunctionToExpression()}function unwrapFunctionEnvironment(){if(!this.isArrowFunctionExpression()&&!this.isFunctionExpression()&&!this.isFunctionDeclaration()){throw this.buildCodeFrameError("Can only unwrap the environment of a function.")}hoistFunctionEnvironment(this)}function arrowFunctionToExpression({allowInsertArrow:e=true,specCompliant:t=false,noNewArrows:n=!t}={}){if(!this.isArrowFunctionExpression()){throw this.buildCodeFrameError("Cannot convert non-arrow function to a function expression.")}const{thisBinding:s,fnPath:r}=hoistFunctionEnvironment(this,n,e);r.ensureBlock();r.node.type="FunctionExpression";if(!n){const e=s?null:r.scope.generateUidIdentifier("arrowCheckId");if(e){r.parentPath.scope.push({id:e,init:C([])})}r.get("body").unshiftContainer("body",d(u(this.hub.addHelper("newArrowCheck"),[O(),e?h(e.name):h(s)])));r.replaceWith(u(b((0,i.default)(this,true)||r.node,h("bind")),[e?h(e.name):O()]))}}const F=(0,a.merge)([{CallExpression(e,{allSuperCalls:t}){if(!e.get("callee").isSuper())return;t.push(e)}},r.default]);function hoistFunctionEnvironment(e,t=true,n=true){let s;let r=e.findParent((e=>{if(e.isArrowFunctionExpression()){var t;(t=s)!=null?t:s=e;return false}return e.isFunction()||e.isProgram()||e.isClassProperty({static:false})||e.isClassPrivateProperty({static:false})}));const i=r.isClassMethod({kind:"constructor"});if(r.isClassProperty()||r.isClassPrivateProperty()){if(s){r=s}else if(n){e.replaceWith(u(o([],w(e.node)),[]));r=e.get("callee");e=r.get("body")}else{throw e.buildCodeFrameError("Unable to transform arrow inside class property")}}const{thisPaths:a,argumentsPaths:l,newTargetPaths:c,superProps:d,superCalls:g}=getScopeInformation(e);if(i&&g.length>0){if(!n){throw g[0].buildCodeFrameError("Unable to handle nested super() usage in arrow")}const e=[];r.traverse(F,{allSuperCalls:e});const t=getSuperBinding(r);e.forEach((e=>{const n=h(t);n.loc=e.node.callee.loc;e.get("callee").replaceWith(n)}))}if(l.length>0){const e=getBinding(r,"arguments",(()=>{const args=()=>h("arguments");if(r.scope.path.isProgram()){return p(f("===",D("typeof",args()),A("undefined")),r.scope.buildUndefinedNode(),args())}else{return args()}}));l.forEach((t=>{const n=h(e);n.loc=t.node.loc;t.replaceWith(n)}))}if(c.length>0){const e=getBinding(r,"newtarget",(()=>v(h("new"),h("target"))));c.forEach((t=>{const n=h(e);n.loc=t.node.loc;t.replaceWith(n)}))}if(d.length>0){if(!n){throw d[0].buildCodeFrameError("Unable to handle nested super.prop usage")}const e=d.reduce(((e,t)=>e.concat(standardizeSuperProperty(t))),[]);e.forEach((e=>{const t=e.node.computed?"":e.get("property").node.name;const n=e.parentPath.isAssignmentExpression({left:e.node});const s=e.parentPath.isCallExpression({callee:e.node});const i=getSuperPropBinding(r,n,t);const o=[];if(e.node.computed){o.push(e.get("property").node)}if(n){const t=e.parentPath.node.right;o.push(t)}const l=u(h(i),o);if(s){e.parentPath.unshiftContainer("arguments",O());e.replaceWith(b(l,h("call")));a.push(e.parentPath.get("arguments.0"))}else if(n){e.parentPath.replaceWith(l)}else{e.replaceWith(l)}}))}let y;if(a.length>0||!t){y=getThisBinding(r,i);if(t||i&&hasSuperClass(r)){a.forEach((e=>{const t=e.isJSX()?m(y):h(y);t.loc=e.node.loc;e.replaceWith(t)}));if(!t)y=null}}return{thisBinding:y,fnPath:e}}function isLogicalOp(e){return E.includes(e)}function standardizeSuperProperty(e){if(e.parentPath.isAssignmentExpression()&&e.parentPath.node.operator!=="="){const t=e.parentPath;const n=t.node.operator.slice(0,-1);const s=t.node.right;const r=isLogicalOp(n);if(e.node.computed){const i=e.scope.generateDeclaredUidIdentifier("tmp");const a=e.node.object;const o=e.node.property;t.get("left").replaceWith(b(a,l("=",i,o),true));t.get("right").replaceWith(rightExpression(r?"=":n,b(a,h(i.name),true),s))}else{const i=e.node.object;const a=e.node.property;t.get("left").replaceWith(b(i,a));t.get("right").replaceWith(rightExpression(r?"=":n,b(i,h(a.name)),s))}if(r){t.replaceWith(y(n,t.node.left,t.node.right))}else{t.node.operator="="}return[t.get("left"),t.get("right").get("left")]}else if(e.parentPath.isUpdateExpression()){const t=e.parentPath;const n=e.scope.generateDeclaredUidIdentifier("tmp");const s=e.node.computed?e.scope.generateDeclaredUidIdentifier("prop"):null;const r=[l("=",n,b(e.node.object,s?l("=",s,e.node.property):e.node.property,e.node.computed)),l("=",b(e.node.object,s?h(s.name):e.node.property,e.node.computed),f(e.parentPath.node.operator[0],h(n.name),S(1)))];if(!e.parentPath.node.prefix){r.push(h(n.name))}t.replaceWith(T(r));const i=t.get("expressions.0.right");const a=t.get("expressions.1.left");return[i,a]}return[e];function rightExpression(e,t,n){if(e==="="){return l("=",t,n)}else{return f(e,t,n)}}}function hasSuperClass(e){return e.isClassMethod()&&!!e.parentPath.parentPath.node.superClass}const B=(0,a.merge)([{CallExpression(e,{supers:t,thisBinding:n}){if(!e.get("callee").isSuper())return;if(t.has(e.node))return;t.add(e.node);e.replaceWithMultiple([e.node,l("=",h(n),h("this"))])}},r.default]);function getThisBinding(e,t){return getBinding(e,"this",(n=>{if(!t||!hasSuperClass(e))return O();e.traverse(B,{supers:new WeakSet,thisBinding:n})}))}function getSuperBinding(e){return getBinding(e,"supercall",(()=>{const t=e.scope.generateUidIdentifier("args");return o([x(t)],u(I(),[k(h(t.name))]))}))}function getSuperPropBinding(e,t,n){const s=t?"set":"get";return getBinding(e,`superprop_${s}:${n||""}`,(()=>{const s=[];let r;if(n){r=b(I(),h(n))}else{const t=e.scope.generateUidIdentifier("prop");s.unshift(t);r=b(I(),h(t.name),true)}if(t){const t=e.scope.generateUidIdentifier("value");s.push(t);r=l("=",r,h(t.name))}return o(s,r)}))}function getBinding(e,t,n){const s="binding:"+t;let r=e.getData(s);if(!r){const i=e.scope.generateUidIdentifier(t);r=i.name;e.setData(s,r);e.scope.push({id:i,init:n(r)})}return r}const M=(0,a.merge)([{ThisExpression(e,{thisPaths:t}){t.push(e)},JSXIdentifier(e,{thisPaths:t}){if(e.node.name!=="this")return;if(!e.parentPath.isJSXMemberExpression({object:e.node})&&!e.parentPath.isJSXOpeningElement({name:e.node})){return}t.push(e)},CallExpression(e,{superCalls:t}){if(e.get("callee").isSuper())t.push(e)},MemberExpression(e,{superProps:t}){if(e.get("object").isSuper())t.push(e)},Identifier(e,{argumentsPaths:t}){if(!e.isReferencedIdentifier({name:"arguments"}))return;let n=e.scope;do{if(n.hasOwnBinding("arguments")){n.rename("arguments");return}if(n.path.isFunction()&&!n.path.isArrowFunctionExpression()){break}}while(n=n.parent);t.push(e)},MetaProperty(e,{newTargetPaths:t}){if(!e.get("meta").isIdentifier({name:"new"}))return;if(!e.get("property").isIdentifier({name:"target"}))return;t.push(e)}},r.default]);function getScopeInformation(e){const t=[];const n=[];const s=[];const r=[];const i=[];e.traverse(M,{thisPaths:t,argumentsPaths:n,newTargetPaths:s,superProps:r,superCalls:i});return{thisPaths:t,argumentsPaths:n,newTargetPaths:s,superProps:r,superCalls:i}}},954:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.evaluate=evaluate;t.evaluateTruthy=evaluateTruthy;const n=["String","Number","Math"];const s=["random"];function evaluateTruthy(){const e=this.evaluate();if(e.confident)return!!e.value}function deopt(e,t){if(!t.confident)return;t.deoptPath=e;t.confident=false}function evaluateCached(e,t){const{node:n}=e;const{seen:s}=t;if(s.has(n)){const r=s.get(n);if(r.resolved){return r.value}else{deopt(e,t);return}}else{const r={resolved:false};s.set(n,r);const i=_evaluate(e,t);if(t.confident){r.resolved=true;r.value=i}return i}}function _evaluate(e,t){if(!t.confident)return;if(e.isSequenceExpression()){const n=e.get("expressions");return evaluateCached(n[n.length-1],t)}if(e.isStringLiteral()||e.isNumericLiteral()||e.isBooleanLiteral()){return e.node.value}if(e.isNullLiteral()){return null}if(e.isTemplateLiteral()){return evaluateQuasis(e,e.node.quasis,t)}if(e.isTaggedTemplateExpression()&&e.get("tag").isMemberExpression()){const n=e.get("tag.object");const{node:{name:s}}=n;const r=e.get("tag.property");if(n.isIdentifier()&&s==="String"&&!e.scope.getBinding(s)&&r.isIdentifier()&&r.node.name==="raw"){return evaluateQuasis(e,e.node.quasi.quasis,t,true)}}if(e.isConditionalExpression()){const n=evaluateCached(e.get("test"),t);if(!t.confident)return;if(n){return evaluateCached(e.get("consequent"),t)}else{return evaluateCached(e.get("alternate"),t)}}if(e.isExpressionWrapper()){return evaluateCached(e.get("expression"),t)}if(e.isMemberExpression()&&!e.parentPath.isCallExpression({callee:e.node})){const t=e.get("property");const n=e.get("object");if(n.isLiteral()&&t.isIdentifier()){const e=n.node.value;const s=typeof e;if(s==="number"||s==="string"){return e[t.node.name]}}}if(e.isReferencedIdentifier()){const n=e.scope.getBinding(e.node.name);if(n&&n.constantViolations.length>0){return deopt(n.path,t)}if(n&&e.node.start<n.path.node.end){return deopt(n.path,t)}if(n!=null&&n.hasValue){return n.value}else{if(e.node.name==="undefined"){return n?deopt(n.path,t):undefined}else if(e.node.name==="Infinity"){return n?deopt(n.path,t):Infinity}else if(e.node.name==="NaN"){return n?deopt(n.path,t):NaN}const s=e.resolve();if(s===e){return deopt(e,t)}else{return evaluateCached(s,t)}}}if(e.isUnaryExpression({prefix:true})){if(e.node.operator==="void"){return undefined}const n=e.get("argument");if(e.node.operator==="typeof"&&(n.isFunction()||n.isClass())){return"function"}const s=evaluateCached(n,t);if(!t.confident)return;switch(e.node.operator){case"!":return!s;case"+":return+s;case"-":return-s;case"~":return~s;case"typeof":return typeof s}}if(e.isArrayExpression()){const n=[];const s=e.get("elements");for(const e of s){const s=e.evaluate();if(s.confident){n.push(s.value)}else{return deopt(s.deopt,t)}}return n}if(e.isObjectExpression()){const n={};const s=e.get("properties");for(const e of s){if(e.isObjectMethod()||e.isSpreadElement()){return deopt(e,t)}const s=e.get("key");let r=s;if(e.node.computed){r=r.evaluate();if(!r.confident){return deopt(r.deopt,t)}r=r.value}else if(r.isIdentifier()){r=r.node.name}else{r=r.node.value}const i=e.get("value");let a=i.evaluate();if(!a.confident){return deopt(a.deopt,t)}a=a.value;n[r]=a}return n}if(e.isLogicalExpression()){const n=t.confident;const s=evaluateCached(e.get("left"),t);const r=t.confident;t.confident=n;const i=evaluateCached(e.get("right"),t);const a=t.confident;switch(e.node.operator){case"||":t.confident=r&&(!!s||a);if(!t.confident)return;return s||i;case"&&":t.confident=r&&(!s||a);if(!t.confident)return;return s&&i}}if(e.isBinaryExpression()){const n=evaluateCached(e.get("left"),t);if(!t.confident)return;const s=evaluateCached(e.get("right"),t);if(!t.confident)return;switch(e.node.operator){case"-":return n-s;case"+":return n+s;case"/":return n/s;case"*":return n*s;case"%":return n%s;case"**":return Math.pow(n,s);case"<":return n<s;case">":return n>s;case"<=":return n<=s;case">=":return n>=s;case"==":return n==s;case"!=":return n!=s;case"===":return n===s;case"!==":return n!==s;case"|":return n|s;case"&":return n&s;case"^":return n^s;case"<<":return n<<s;case">>":return n>>s;case">>>":return n>>>s}}if(e.isCallExpression()){const r=e.get("callee");let i;let a;if(r.isIdentifier()&&!e.scope.getBinding(r.node.name)&&n.indexOf(r.node.name)>=0){a=global[r.node.name]}if(r.isMemberExpression()){const e=r.get("object");const t=r.get("property");if(e.isIdentifier()&&t.isIdentifier()&&n.indexOf(e.node.name)>=0&&s.indexOf(t.node.name)<0){i=global[e.node.name];a=i[t.node.name]}if(e.isLiteral()&&t.isIdentifier()){const n=typeof e.node.value;if(n==="string"||n==="number"){i=e.node.value;a=i[t.node.name]}}}if(a){const n=e.get("arguments").map((e=>evaluateCached(e,t)));if(!t.confident)return;return a.apply(i,n)}}deopt(e,t)}function evaluateQuasis(e,t,n,s=false){let r="";let i=0;const a=e.get("expressions");for(const e of t){if(!n.confident)break;r+=s?e.value.raw:e.value.cooked;const t=a[i++];if(t)r+=String(evaluateCached(t,n))}if(!n.confident)return;return r}function evaluate(){const e={confident:true,deoptPath:null,seen:new Map};let t=evaluateCached(this,e);if(!e.confident)t=undefined;return{confident:e.confident,deopt:e.deoptPath,value:t}}},322:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t._getKey=_getKey;t._getPattern=_getPattern;t.get=get;t.getAllNextSiblings=getAllNextSiblings;t.getAllPrevSiblings=getAllPrevSiblings;t.getBindingIdentifierPaths=getBindingIdentifierPaths;t.getBindingIdentifiers=getBindingIdentifiers;t.getCompletionRecords=getCompletionRecords;t.getNextSibling=getNextSibling;t.getOpposite=getOpposite;t.getOuterBindingIdentifierPaths=getOuterBindingIdentifierPaths;t.getOuterBindingIdentifiers=getOuterBindingIdentifiers;t.getPrevSibling=getPrevSibling;t.getSibling=getSibling;var s=n(348);var r=n(740);const{getBindingIdentifiers:i,getOuterBindingIdentifiers:a,isDeclaration:o,numericLiteral:l,unaryExpression:f}=r;const c=0;const u=1;function NormalCompletion(e){return{type:c,path:e}}function BreakCompletion(e){return{type:u,path:e}}function getOpposite(){if(this.key==="left"){return this.getSibling("right")}else if(this.key==="right"){return this.getSibling("left")}return null}function addCompletionRecords(e,t,n){if(e){t.push(..._getCompletionRecords(e,n))}return t}function completionRecordForSwitch(e,t,n){let s=[];for(let r=0;r<e.length;r++){const i=e[r];const a=_getCompletionRecords(i,n);const o=[];const l=[];for(const e of a){if(e.type===c){o.push(e)}if(e.type===u){l.push(e)}}if(o.length){s=o}t.push(...l)}t.push(...s);return t}function normalCompletionToBreak(e){e.forEach((e=>{e.type=u}))}function replaceBreakStatementInBreakCompletion(e,t){e.forEach((e=>{if(e.path.isBreakStatement({label:null})){if(t){e.path.replaceWith(f("void",l(0)))}else{e.path.remove()}}}))}function getStatementListCompletion(e,t){const n=[];if(t.canHaveBreak){let s=[];for(let r=0;r<e.length;r++){const i=e[r];const a=Object.assign({},t,{inCaseClause:false});if(i.isBlockStatement()&&(t.inCaseClause||t.shouldPopulateBreak)){a.shouldPopulateBreak=true}else{a.shouldPopulateBreak=false}const o=_getCompletionRecords(i,a);if(o.length>0&&o.every((e=>e.type===u))){if(s.length>0&&o.every((e=>e.path.isBreakStatement({label:null})))){normalCompletionToBreak(s);n.push(...s);if(s.some((e=>e.path.isDeclaration()))){n.push(...o);replaceBreakStatementInBreakCompletion(o,true)}replaceBreakStatementInBreakCompletion(o,false)}else{n.push(...o);if(!t.shouldPopulateBreak){replaceBreakStatementInBreakCompletion(o,true)}}break}if(r===e.length-1){n.push(...o)}else{s=[];for(let e=0;e<o.length;e++){const t=o[e];if(t.type===u){n.push(t)}if(t.type===c){s.push(t)}}}}}else if(e.length){for(let s=e.length-1;s>=0;s--){const r=_getCompletionRecords(e[s],t);if(r.length>1||r.length===1&&!r[0].path.isVariableDeclaration()){n.push(...r);break}}}return n}function _getCompletionRecords(e,t){let n=[];if(e.isIfStatement()){n=addCompletionRecords(e.get("consequent"),n,t);n=addCompletionRecords(e.get("alternate"),n,t)}else if(e.isDoExpression()||e.isFor()||e.isWhile()||e.isLabeledStatement()){return addCompletionRecords(e.get("body"),n,t)}else if(e.isProgram()||e.isBlockStatement()){return getStatementListCompletion(e.get("body"),t)}else if(e.isFunction()){return _getCompletionRecords(e.get("body"),t)}else if(e.isTryStatement()){n=addCompletionRecords(e.get("block"),n,t);n=addCompletionRecords(e.get("handler"),n,t)}else if(e.isCatchClause()){return addCompletionRecords(e.get("body"),n,t)}else if(e.isSwitchStatement()){return completionRecordForSwitch(e.get("cases"),n,t)}else if(e.isSwitchCase()){return getStatementListCompletion(e.get("consequent"),{canHaveBreak:true,shouldPopulateBreak:false,inCaseClause:true})}else if(e.isBreakStatement()){n.push(BreakCompletion(e))}else{n.push(NormalCompletion(e))}return n}function getCompletionRecords(){const e=_getCompletionRecords(this,{canHaveBreak:false,shouldPopulateBreak:false,inCaseClause:false});return e.map((e=>e.path))}function getSibling(e){return s.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:e}).setContext(this.context)}function getPrevSibling(){return this.getSibling(this.key-1)}function getNextSibling(){return this.getSibling(this.key+1)}function getAllNextSiblings(){let e=this.key;let t=this.getSibling(++e);const n=[];while(t.node){n.push(t);t=this.getSibling(++e)}return n}function getAllPrevSiblings(){let e=this.key;let t=this.getSibling(--e);const n=[];while(t.node){n.push(t);t=this.getSibling(--e)}return n}function get(e,t=true){if(t===true)t=this.context;const n=e.split(".");if(n.length===1){return this._getKey(e,t)}else{return this._getPattern(n,t)}}function _getKey(e,t){const n=this.node;const r=n[e];if(Array.isArray(r)){return r.map(((i,a)=>s.default.get({listKey:e,parentPath:this,parent:n,container:r,key:a}).setContext(t)))}else{return s.default.get({parentPath:this,parent:n,container:n,key:e}).setContext(t)}}function _getPattern(e,t){let n=this;for(const s of e){if(s==="."){n=n.parentPath}else{if(Array.isArray(n)){n=n[s]}else{n=n.get(s,t)}}}return n}function getBindingIdentifiers(e){return i(this.node,e)}function getOuterBindingIdentifiers(e){return a(this.node,e)}function getBindingIdentifierPaths(e=false,t=false){const n=this;const s=[n];const r=Object.create(null);while(s.length){const n=s.shift();if(!n)continue;if(!n.node)continue;const a=i.keys[n.node.type];if(n.isIdentifier()){if(e){const e=r[n.node.name]=r[n.node.name]||[];e.push(n)}else{r[n.node.name]=n}continue}if(n.isExportDeclaration()){const e=n.get("declaration");if(o(e)){s.push(e)}continue}if(t){if(n.isFunctionDeclaration()){s.push(n.get("id"));continue}if(n.isFunctionExpression()){continue}}if(a){for(let e=0;e<a.length;e++){const t=a[e];const r=n.get(t);if(Array.isArray(r)){s.push(...r)}else if(r.node){s.push(r)}}}}return r}function getOuterBindingIdentifierPaths(e){return this.getBindingIdentifierPaths(e,true)}},348:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=t.SHOULD_STOP=t.SHOULD_SKIP=t.REMOVED=void 0;var s=n(107);var r=n(731);var i=n(701);var a=n(556);var o=n(740);var l=o;var f=n(49);var c=n(821);var u=n(937);var p=n(154);var d=n(309);var h=n(954);var g=n(137);var m=n(869);var y=n(266);var E=n(288);var b=n(890);var v=n(322);var S=n(613);const{validate:C}=o;const x=r("babel");const P=1<<0;t.REMOVED=P;const T=1<<1;t.SHOULD_STOP=T;const k=1<<2;t.SHOULD_SKIP=k;class NodePath{constructor(e,t){this.contexts=[];this.state=null;this.opts=null;this._traverseFlags=0;this.skipKeys=null;this.parentPath=null;this.container=null;this.listKey=null;this.key=null;this.node=null;this.type=null;this.parent=t;this.hub=e;this.data=null;this.context=null;this.scope=null}static get({hub:e,parentPath:t,parent:n,container:s,listKey:r,key:i}){if(!e&&t){e=t.hub}if(!n){throw new Error("To get a node path the parent needs to exist")}const a=s[i];let o=f.path.get(n);if(!o){o=new Map;f.path.set(n,o)}let l=o.get(a);if(!l){l=new NodePath(e,n);if(a)o.set(a,l)}l.setup(t,s,r,i);return l}getScope(e){return this.isScope()?new a.default(this):e}setData(e,t){if(this.data==null){this.data=Object.create(null)}return this.data[e]=t}getData(e,t){if(this.data==null){this.data=Object.create(null)}let n=this.data[e];if(n===undefined&&t!==undefined)n=this.data[e]=t;return n}hasNode(){return this.node!=null}buildCodeFrameError(e,t=SyntaxError){return this.hub.buildError(this.node,e,t)}traverse(e,t){(0,i.default)(this.node,e,this.scope,t,this)}set(e,t){C(this.node,e,t);this.node[e]=t}getPathLocation(){const e=[];let t=this;do{let n=t.key;if(t.inList)n=`${t.listKey}[${n}]`;e.unshift(n)}while(t=t.parentPath);return e.join(".")}debug(e){if(!x.enabled)return;x(`${this.getPathLocation()} ${this.type}: ${e}`)}toString(){return(0,c.default)(this.node).code}get inList(){return!!this.listKey}set inList(e){if(!e){this.listKey=null}}get parentKey(){return this.listKey||this.key}get shouldSkip(){return!!(this._traverseFlags&k)}set shouldSkip(e){if(e){this._traverseFlags|=k}else{this._traverseFlags&=~k}}get shouldStop(){return!!(this._traverseFlags&T)}set shouldStop(e){if(e){this._traverseFlags|=T}else{this._traverseFlags&=~T}}get removed(){return!!(this._traverseFlags&P)}set removed(e){if(e){this._traverseFlags|=P}else{this._traverseFlags&=~P}}}Object.assign(NodePath.prototype,u,p,d,h,g,m,y,E,b,v,S);for(const e of l.TYPES){const t=`is${e}`;const n=l[t];NodePath.prototype[t]=function(e){return n(this.node,e)};NodePath.prototype[`assert${e}`]=function(t){if(!n(this.node,t)){throw new TypeError(`Expected node path of type ${e}`)}}}for(const e of Object.keys(s)){if(e[0]==="_")continue;if(l.TYPES.indexOf(e)<0)l.TYPES.push(e);const t=s[e];NodePath.prototype[`is${e}`]=function(e){return t.checkPath(this,e)}}var A=NodePath;t["default"]=A},154:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t._getTypeAnnotation=_getTypeAnnotation;t.baseTypeStrictlyMatches=baseTypeStrictlyMatches;t.couldBeBaseType=couldBeBaseType;t.getTypeAnnotation=getTypeAnnotation;t.isBaseType=isBaseType;t.isGenericType=isGenericType;var s=n(990);var r=n(740);const{anyTypeAnnotation:i,isAnyTypeAnnotation:a,isBooleanTypeAnnotation:o,isEmptyTypeAnnotation:l,isFlowBaseAnnotation:f,isGenericTypeAnnotation:c,isIdentifier:u,isMixedTypeAnnotation:p,isNumberTypeAnnotation:d,isStringTypeAnnotation:h,isTypeAnnotation:g,isUnionTypeAnnotation:m,isVoidTypeAnnotation:y,stringTypeAnnotation:E,voidTypeAnnotation:b}=r;function getTypeAnnotation(){let e=this.getData("typeAnnotation");if(e!=null){return e}e=this._getTypeAnnotation()||i();if(g(e))e=e.typeAnnotation;this.setData("typeAnnotation",e);return e}const v=new WeakSet;function _getTypeAnnotation(){const e=this.node;if(!e){if(this.key==="init"&&this.parentPath.isVariableDeclarator()){const e=this.parentPath.parentPath;const t=e.parentPath;if(e.key==="left"&&t.isForInStatement()){return E()}if(e.key==="left"&&t.isForOfStatement()){return i()}return b()}else{return}}if(e.typeAnnotation){return e.typeAnnotation}if(v.has(e)){return}v.add(e);try{var t;let n=s[e.type];if(n){return n.call(this,e)}n=s[this.parentPath.type];if((t=n)!=null&&t.validParent){return this.parentPath.getTypeAnnotation()}}finally{v.delete(e)}}function isBaseType(e,t){return _isBaseType(e,this.getTypeAnnotation(),t)}function _isBaseType(e,t,n){if(e==="string"){return h(t)}else if(e==="number"){return d(t)}else if(e==="boolean"){return o(t)}else if(e==="any"){return a(t)}else if(e==="mixed"){return p(t)}else if(e==="empty"){return l(t)}else if(e==="void"){return y(t)}else{if(n){return false}else{throw new Error(`Unknown base type ${e}`)}}}function couldBeBaseType(e){const t=this.getTypeAnnotation();if(a(t))return true;if(m(t)){for(const n of t.types){if(a(n)||_isBaseType(e,n,true)){return true}}return false}else{return _isBaseType(e,t,true)}}function baseTypeStrictlyMatches(e){const t=this.getTypeAnnotation();const n=e.getTypeAnnotation();if(!a(t)&&f(t)){return n.type===t.type}return false}function isGenericType(e){const t=this.getTypeAnnotation();return c(t)&&u(t.id,{name:e})}},467:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=_default;var s=n(740);const{BOOLEAN_NUMBER_BINARY_OPERATORS:r,createFlowUnionType:i,createTSUnionType:a,createTypeAnnotationBasedOnTypeof:o,createUnionTypeAnnotation:l,isTSTypeAnnotation:f,numberTypeAnnotation:c,voidTypeAnnotation:u}=s;function _default(e){if(!this.isReferenced())return;const t=this.scope.getBinding(e.name);if(t){if(t.identifier.typeAnnotation){return t.identifier.typeAnnotation}else{return getTypeAnnotationBindingConstantViolations(t,this,e.name)}}if(e.name==="undefined"){return u()}else if(e.name==="NaN"||e.name==="Infinity"){return c()}else if(e.name==="arguments"){}}function getTypeAnnotationBindingConstantViolations(e,t,n){const s=[];const r=[];let o=getConstantViolationsBefore(e,t,r);const c=getConditionalAnnotation(e,t,n);if(c){const t=getConstantViolationsBefore(e,c.ifStatement);o=o.filter((e=>t.indexOf(e)<0));s.push(c.typeAnnotation)}if(o.length){o.push(...r);for(const e of o){s.push(e.getTypeAnnotation())}}if(!s.length){return}if(f(s[0])&&a){return a(s)}if(i){return i(s)}return l(s)}function getConstantViolationsBefore(e,t,n){const s=e.constantViolations.slice();s.unshift(e.path);return s.filter((e=>{e=e.resolve();const s=e._guessExecutionStatusRelativeTo(t);if(n&&s==="unknown")n.push(e);return s==="before"}))}function inferAnnotationFromBinaryExpression(e,t){const n=t.node.operator;const s=t.get("right").resolve();const i=t.get("left").resolve();let a;if(i.isIdentifier({name:e})){a=s}else if(s.isIdentifier({name:e})){a=i}if(a){if(n==="==="){return a.getTypeAnnotation()}if(r.indexOf(n)>=0){return c()}return}if(n!=="==="&&n!=="==")return;let l;let f;if(i.isUnaryExpression({operator:"typeof"})){l=i;f=s}else if(s.isUnaryExpression({operator:"typeof"})){l=s;f=i}if(!l)return;if(!l.get("argument").isIdentifier({name:e}))return;f=f.resolve();if(!f.isLiteral())return;const u=f.node.value;if(typeof u!=="string")return;return o(u)}function getParentConditionalPath(e,t,n){let s;while(s=t.parentPath){if(s.isIfStatement()||s.isConditionalExpression()){if(t.key==="test"){return}return s}if(s.isFunction()){if(s.parentPath.scope.getBinding(n)!==e)return}t=s}}function getConditionalAnnotation(e,t,n){const s=getParentConditionalPath(e,t,n);if(!s)return;const r=s.get("test");const o=[r];const c=[];for(let e=0;e<o.length;e++){const t=o[e];if(t.isLogicalExpression()){if(t.node.operator==="&&"){o.push(t.get("left"));o.push(t.get("right"))}}else if(t.isBinaryExpression()){const e=inferAnnotationFromBinaryExpression(n,t);if(e)c.push(e)}}if(c.length){if(f(c[0])&&a){return{typeAnnotation:a(c),ifStatement:s}}if(i){return{typeAnnotation:i(c),ifStatement:s}}return{typeAnnotation:l(c),ifStatement:s}}return getConditionalAnnotation(s,n)}},990:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ArrayExpression=ArrayExpression;t.AssignmentExpression=AssignmentExpression;t.BinaryExpression=BinaryExpression;t.BooleanLiteral=BooleanLiteral;t.CallExpression=CallExpression;t.ConditionalExpression=ConditionalExpression;t.ClassDeclaration=t.ClassExpression=t.FunctionDeclaration=t.ArrowFunctionExpression=t.FunctionExpression=Func;Object.defineProperty(t,"Identifier",{enumerable:true,get:function(){return r.default}});t.LogicalExpression=LogicalExpression;t.NewExpression=NewExpression;t.NullLiteral=NullLiteral;t.NumericLiteral=NumericLiteral;t.ObjectExpression=ObjectExpression;t.ParenthesizedExpression=ParenthesizedExpression;t.RegExpLiteral=RegExpLiteral;t.RestElement=RestElement;t.SequenceExpression=SequenceExpression;t.StringLiteral=StringLiteral;t.TaggedTemplateExpression=TaggedTemplateExpression;t.TemplateLiteral=TemplateLiteral;t.TypeCastExpression=TypeCastExpression;t.UnaryExpression=UnaryExpression;t.UpdateExpression=UpdateExpression;t.VariableDeclarator=VariableDeclarator;var s=n(740);var r=n(467);const{BOOLEAN_BINARY_OPERATORS:i,BOOLEAN_UNARY_OPERATORS:a,NUMBER_BINARY_OPERATORS:o,NUMBER_UNARY_OPERATORS:l,STRING_UNARY_OPERATORS:f,anyTypeAnnotation:c,arrayTypeAnnotation:u,booleanTypeAnnotation:p,buildMatchMemberExpression:d,createFlowUnionType:h,createTSUnionType:g,createUnionTypeAnnotation:m,genericTypeAnnotation:y,identifier:E,isTSTypeAnnotation:b,nullLiteralTypeAnnotation:v,numberTypeAnnotation:S,stringTypeAnnotation:C,tupleTypeAnnotation:x,unionTypeAnnotation:P,voidTypeAnnotation:T}=s;function VariableDeclarator(){var e;const t=this.get("id");if(!t.isIdentifier())return;const n=this.get("init");let s=n.getTypeAnnotation();if(((e=s)==null?void 0:e.type)==="AnyTypeAnnotation"){if(n.isCallExpression()&&n.get("callee").isIdentifier({name:"Array"})&&!n.scope.hasBinding("Array",true)){s=ArrayExpression()}}return s}function TypeCastExpression(e){return e.typeAnnotation}TypeCastExpression.validParent=true;function NewExpression(e){if(this.get("callee").isIdentifier()){return y(e.callee)}}function TemplateLiteral(){return C()}function UnaryExpression(e){const t=e.operator;if(t==="void"){return T()}else if(l.indexOf(t)>=0){return S()}else if(f.indexOf(t)>=0){return C()}else if(a.indexOf(t)>=0){return p()}}function BinaryExpression(e){const t=e.operator;if(o.indexOf(t)>=0){return S()}else if(i.indexOf(t)>=0){return p()}else if(t==="+"){const e=this.get("right");const t=this.get("left");if(t.isBaseType("number")&&e.isBaseType("number")){return S()}else if(t.isBaseType("string")||e.isBaseType("string")){return C()}return P([C(),S()])}}function LogicalExpression(){const e=[this.get("left").getTypeAnnotation(),this.get("right").getTypeAnnotation()];if(b(e[0])&&g){return g(e)}if(h){return h(e)}return m(e)}function ConditionalExpression(){const e=[this.get("consequent").getTypeAnnotation(),this.get("alternate").getTypeAnnotation()];if(b(e[0])&&g){return g(e)}if(h){return h(e)}return m(e)}function SequenceExpression(){return this.get("expressions").pop().getTypeAnnotation()}function ParenthesizedExpression(){return this.get("expression").getTypeAnnotation()}function AssignmentExpression(){return this.get("right").getTypeAnnotation()}function UpdateExpression(e){const t=e.operator;if(t==="++"||t==="--"){return S()}}function StringLiteral(){return C()}function NumericLiteral(){return S()}function BooleanLiteral(){return p()}function NullLiteral(){return v()}function RegExpLiteral(){return y(E("RegExp"))}function ObjectExpression(){return y(E("Object"))}function ArrayExpression(){return y(E("Array"))}function RestElement(){return ArrayExpression()}RestElement.validParent=true;function Func(){return y(E("Function"))}const k=d("Array.from");const A=d("Object.keys");const I=d("Object.values");const O=d("Object.entries");function CallExpression(){const{callee:e}=this.node;if(A(e)){return u(C())}else if(k(e)||I(e)){return u(c())}else if(O(e)){return u(x([C(),c()]))}return resolveCall(this.get("callee"))}function TaggedTemplateExpression(){return resolveCall(this.get("tag"))}function resolveCall(e){e=e.resolve();if(e.isFunction()){if(e.is("async")){if(e.is("generator")){return y(E("AsyncIterator"))}else{return y(E("Promise"))}}else{if(e.node.returnType){return e.node.returnType}else{}}}}},869:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t._guessExecutionStatusRelativeTo=_guessExecutionStatusRelativeTo;t._guessExecutionStatusRelativeToDifferentFunctions=_guessExecutionStatusRelativeToDifferentFunctions;t._resolve=_resolve;t.canHaveVariableDeclarationOrExpression=canHaveVariableDeclarationOrExpression;t.canSwapBetweenExpressionAndStatement=canSwapBetweenExpressionAndStatement;t.equals=equals;t.getSource=getSource;t.has=has;t.is=void 0;t.isCompletionRecord=isCompletionRecord;t.isConstantExpression=isConstantExpression;t.isInStrictMode=isInStrictMode;t.isNodeType=isNodeType;t.isStatementOrBlock=isStatementOrBlock;t.isStatic=isStatic;t.isnt=isnt;t.matchesPattern=matchesPattern;t.referencesImport=referencesImport;t.resolve=resolve;t.willIMaybeExecuteBefore=willIMaybeExecuteBefore;var s=n(740);const{STATEMENT_OR_BLOCK_KEYS:r,VISITOR_KEYS:i,isBlockStatement:a,isExpression:o,isIdentifier:l,isLiteral:f,isStringLiteral:c,isType:u,matchesPattern:p}=s;function matchesPattern(e,t){return p(this.node,e,t)}function has(e){const t=this.node&&this.node[e];if(t&&Array.isArray(t)){return!!t.length}else{return!!t}}function isStatic(){return this.scope.isStatic(this.node)}const d=has;t.is=d;function isnt(e){return!this.has(e)}function equals(e,t){return this.node[e]===t}function isNodeType(e){return u(this.type,e)}function canHaveVariableDeclarationOrExpression(){return(this.key==="init"||this.key==="left")&&this.parentPath.isFor()}function canSwapBetweenExpressionAndStatement(e){if(this.key!=="body"||!this.parentPath.isArrowFunctionExpression()){return false}if(this.isExpression()){return a(e)}else if(this.isBlockStatement()){return o(e)}return false}function isCompletionRecord(e){let t=this;let n=true;do{const{type:s,container:r}=t;if(!n&&(t.isFunction()||s==="StaticBlock")){return!!e}n=false;if(Array.isArray(r)&&t.key!==r.length-1){return false}}while((t=t.parentPath)&&!t.isProgram()&&!t.isDoExpression());return true}function isStatementOrBlock(){if(this.parentPath.isLabeledStatement()||a(this.container)){return false}else{return r.includes(this.key)}}function referencesImport(e,t){if(!this.isReferencedIdentifier()){if(this.isJSXMemberExpression()&&this.node.property.name===t||(this.isMemberExpression()||this.isOptionalMemberExpression())&&(this.node.computed?c(this.node.property,{value:t}):this.node.property.name===t)){const t=this.get("object");return t.isReferencedIdentifier()&&t.referencesImport(e,"*")}return false}const n=this.scope.getBinding(this.node.name);if(!n||n.kind!=="module")return false;const s=n.path;const r=s.parentPath;if(!r.isImportDeclaration())return false;if(r.node.source.value===e){if(!t)return true}else{return false}if(s.isImportDefaultSpecifier()&&t==="default"){return true}if(s.isImportNamespaceSpecifier()&&t==="*"){return true}if(s.isImportSpecifier()&&l(s.node.imported,{name:t})){return true}return false}function getSource(){const e=this.node;if(e.end){const t=this.hub.getCode();if(t)return t.slice(e.start,e.end)}return""}function willIMaybeExecuteBefore(e){return this._guessExecutionStatusRelativeTo(e)!=="after"}function getOuterFunction(e){return(e.scope.getFunctionParent()||e.scope.getProgramParent()).path}function isExecutionUncertain(e,t){switch(e){case"LogicalExpression":return t==="right";case"ConditionalExpression":case"IfStatement":return t==="consequent"||t==="alternate";case"WhileStatement":case"DoWhileStatement":case"ForInStatement":case"ForOfStatement":return t==="body";case"ForStatement":return t==="body"||t==="update";case"SwitchStatement":return t==="cases";case"TryStatement":return t==="handler";case"AssignmentPattern":return t==="right";case"OptionalMemberExpression":return t==="property";case"OptionalCallExpression":return t==="arguments";default:return false}}function isExecutionUncertainInList(e,t){for(let n=0;n<t;n++){const t=e[n];if(isExecutionUncertain(t.parent.type,t.parentKey)){return true}}return false}function _guessExecutionStatusRelativeTo(e){const t={this:getOuterFunction(this),target:getOuterFunction(e)};if(t.target.node!==t.this.node){return this._guessExecutionStatusRelativeToDifferentFunctions(t.target)}const n={target:e.getAncestry(),this:this.getAncestry()};if(n.target.indexOf(this)>=0)return"after";if(n.this.indexOf(e)>=0)return"before";let s;const r={target:0,this:0};while(!s&&r.this<n.this.length){const e=n.this[r.this];r.target=n.target.indexOf(e);if(r.target>=0){s=e}else{r.this++}}if(!s){throw new Error("Internal Babel error - The two compared nodes"+" don't appear to belong to the same program.")}if(isExecutionUncertainInList(n.this,r.this-1)||isExecutionUncertainInList(n.target,r.target-1)){return"unknown"}const a={this:n.this[r.this-1],target:n.target[r.target-1]};if(a.target.listKey&&a.this.listKey&&a.target.container===a.this.container){return a.target.key>a.this.key?"before":"after"}const o=i[s.type];const l={this:o.indexOf(a.this.parentKey),target:o.indexOf(a.target.parentKey)};return l.target>l.this?"before":"after"}const h=new WeakSet;function _guessExecutionStatusRelativeToDifferentFunctions(e){if(!e.isFunctionDeclaration()||e.parentPath.isExportDeclaration()){return"unknown"}const t=e.scope.getBinding(e.node.id.name);if(!t.references)return"before";const n=t.referencePaths;let s;for(const t of n){const n=!!t.find((t=>t.node===e.node));if(n)continue;if(t.key!=="callee"||!t.parentPath.isCallExpression()){return"unknown"}if(h.has(t.node))continue;h.add(t.node);const r=this._guessExecutionStatusRelativeTo(t);h.delete(t.node);if(s&&s!==r){return"unknown"}else{s=r}}return s}function resolve(e,t){return this._resolve(e,t)||this}function _resolve(e,t){if(t&&t.indexOf(this)>=0)return;t=t||[];t.push(this);if(this.isVariableDeclarator()){if(this.get("id").isIdentifier()){return this.get("init").resolve(e,t)}else{}}else if(this.isReferencedIdentifier()){const n=this.scope.getBinding(this.node.name);if(!n)return;if(!n.constant)return;if(n.kind==="module")return;if(n.path!==this){const s=n.path.resolve(e,t);if(this.find((e=>e.node===s.node)))return;return s}}else if(this.isTypeCastExpression()){return this.get("expression").resolve(e,t)}else if(e&&this.isMemberExpression()){const n=this.toComputedKey();if(!f(n))return;const s=n.value;const r=this.get("object").resolve(e,t);if(r.isObjectExpression()){const n=r.get("properties");for(const r of n){if(!r.isProperty())continue;const n=r.get("key");let i=r.isnt("computed")&&n.isIdentifier({name:s});i=i||n.isLiteral({value:s});if(i)return r.get("value").resolve(e,t)}}else if(r.isArrayExpression()&&!isNaN(+s)){const n=r.get("elements");const i=n[s];if(i)return i.resolve(e,t)}}}function isConstantExpression(){if(this.isIdentifier()){const e=this.scope.getBinding(this.node.name);if(!e)return false;return e.constant}if(this.isLiteral()){if(this.isRegExpLiteral()){return false}if(this.isTemplateLiteral()){return this.get("expressions").every((e=>e.isConstantExpression()))}return true}if(this.isUnaryExpression()){if(this.node.operator!=="void"){return false}return this.get("argument").isConstantExpression()}if(this.isBinaryExpression()){return this.get("left").isConstantExpression()&&this.get("right").isConstantExpression()}return false}function isInStrictMode(){const e=this.isProgram()?this:this.parentPath;const t=e.find((e=>{if(e.isProgram({sourceType:"module"}))return true;if(e.isClass())return true;if(!e.isProgram()&&!e.isFunction())return false;if(e.isArrowFunctionExpression()&&!e.get("body").isBlockStatement()){return false}const t=e.isFunction()?e.node.body:e.node;for(const e of t.directives