(e,t,r,s,a,o,l,c,u,d)
| 112 | value: ${o.name} |
| 113 | }); |
| 114 | `,t)}function buildPrivateMethodDeclaration(e,t,r,s=false){const i=r.get(t.node.key.id.name);const{id:a,methodId:o,getId:l,setId:c,getterDeclared:p,setterDeclared:u,static:d}=i;const{params:f,body:h,generator:y,async:g}=t.node;const b=l&&f.length===0;const T=c&&f.length>0;if(b&&p||T&&u){r.set(t.node.key.id.name,Object.assign({},i,{initAdded:true}));return null}if(newHelpers(e)&&(b||T)&&!s){const e=t.get("body").scope;const r=e.generateUidIdentifier("this");const s={thisRef:r,argumentsPath:[]};t.traverse(m,s);if(s.argumentsPath.length){const t=e.generateUidIdentifier("arguments");e.push({id:t,init:n.template.expression.ast`[].slice.call(arguments, 1)`});for(const e of s.argumentsPath){e.replaceWith(n.types.cloneNode(t))}}f.unshift(n.types.cloneNode(r))}let S=o;if(b){r.set(t.node.key.id.name,Object.assign({},i,{getterDeclared:true,initAdded:true}));S=l}else if(T){r.set(t.node.key.id.name,Object.assign({},i,{setterDeclared:true,initAdded:true}));S=c}else if(d&&!s){S=a}return inheritPropComments(n.types.functionDeclaration(n.types.cloneNode(S),f,h,y,g),t)}const m=s.visitors.environmentVisitor({Identifier(e,t){if(t.argumentsPath&&e.node.name==="arguments"){t.argumentsPath.push(e)}},UnaryExpression(e){const{node:t}=e;if(t.operator==="delete"){const r=(0,c.skipTransparentExprWrapperNodes)(t.argument);if(n.types.isThisExpression(r)){e.replaceWith(n.types.booleanLiteral(true))}}},ThisExpression(e,t){t.needsClassRef=true;e.replaceWith(n.types.cloneNode(t.thisRef))},MetaProperty(e){const{node:t,scope:r}=e;if(t.meta.name==="new"&&t.property.name==="target"){e.replaceWith(r.buildUndefinedNode())}}});const y={ReferencedIdentifier(e,t){if(e.scope.bindingIdentifierEquals(e.node.name,t.innerBinding)){t.needsClassRef=true;e.node.name=t.thisRef.name}}};function replaceThisContext(e,t,r){var n;const s={thisRef:t,needsClassRef:false,innerBinding:r};if(!e.isMethod()){e.traverse(m,s)}if(r!=null&&(n=s.thisRef)!=null&&n.name&&s.thisRef.name!==r.name){e.traverse(y,s)}return s.needsClassRef}function isNameOrLength({key:e,computed:t}){if(e.type==="Identifier"){return!t&&(e.name==="name"||e.name==="length")}if(e.type==="StringLiteral"){return e.value==="name"||e.value==="length"}return false}function inheritPropComments(e,t){n.types.inheritLeadingComments(e,t.node);n.types.inheritInnerComments(e,t.node);return e}function inheritLoc(e,t){e.start=t.start;e.end=t.end;e.loc=t.loc;return e}function buildFieldsInitNodes(e,t,r,s,a,o,l,c,u,d){let f=0;let h;const m=[];const y=[];let g=false;const b=[];let T=null;const S=n.types.isIdentifier(t)?()=>t:()=>{h!=null?h:h=r[0].scope.generateUidIdentifierBasedOnNode(t);return h};const x=e!=null?e:r[0].scope.generateUidIdentifier((d==null?void 0:d.name)||"Class");e!=null?e:e=n.types.cloneNode(d);for(const t of r){if(t.isClassProperty()){p.assertFieldTransformed(t)}const r=!(n.types.isStaticBlock!=null&&n.types.isStaticBlock(t.node))&&t.node.static;const h=!r;const T=t.isPrivate();const E=!T;const P=t.isProperty();const v=!P;const A=t.isStaticBlock==null?void 0:t.isStaticBlock();if(r)f|=1;if(r||v&&T||A){new i.default({methodPath:t,constantSuper:u,file:a,refToPreserve:d,getSuperRef:S,getObjectRef(){f|=2;if(r||A){return x}else{return n.types.memberExpression(x,n.types.identifier("prototype"))}}}).replace();const e=replaceThisContext(t,x,d);if(e){f|=2}}g=false;switch(true){case A:{const e=t.node.body;if(e.length===1&&n.types.isExpressionStatement(e[0])){m.push(inheritPropComments(e[0],t))}else{m.push(n.types.inheritsComments(n.template.statement.ast`(() => { ${e} })()`,t.node))}break}case r&&T&&P&&l:m.push(buildPrivateFieldInitLoose(n.types.cloneNode(e),t,s));break;case r&&T&&P&&!l:if(!newHelpers(a)){m.push(buildPrivateStaticFieldInitSpecOld(t,s))}else{m.push(buildPrivateStaticFieldInitSpec(t,s,c))}break;case r&&E&&P&&o:if(!isNameOrLength(t.node)){m.push(buildPublicFieldInitLoose(n.types.cloneNode(e),t));break}case r&&E&&P&&!o:m.push(buildPublicFieldInitSpec(n.types.cloneNode(e),t,a));break;case h&&T&&P&&l:y.push(buildPrivateFieldInitLoose(n.types.thisExpression(),t,s));break;case h&&T&&P&&!l:y.push(buildPrivateInstanceFieldInitSpec(n.types.thisExpression(),t,s,a));break;case h&&T&&v&&l:y.unshift(buildPrivateMethodInitLoose(n.types.thisExpression(),t,s));b.push(buildPrivateMethodDeclaration(a,t,s,l));break;case h&&T&&v&&!l:y.unshift(buildPrivateInstanceMethodInitSpec(n.types.thisExpression(),t,s,a));b.push(buildPrivateMethodDeclaration(a,t,s,l));break;case r&&T&&v&&!l:if(!newHelpers(a)){m.unshift(buildPrivateStaticFieldInitSpecOld(t,s))}b.push(buildPrivateMethodDeclaration(a,t,s,l));break;case r&&T&&v&&l:m.unshift(buildPrivateStaticMethodInitLoose(n.types.cloneNode(e),t,a,s));b.push(buildPrivateMethodDeclaration(a,t,s,l));break;case h&&E&&P&&o:y.push(buildPublicFieldInitLoose(n.types.thisExpression(),t));break;case h&&E&&P&&!o:g=true;y.push(buildPublicFieldInitSpec(n.types.thisExpression(),t,a));break;default:throw new Error("Unreachable.")}}if(f&2&&d!=null){T=n.types.expressionStatement(n.types.assignmentExpression("=",n.types.cloneNode(x),n.types.cloneNode(d)))}return{staticNodes:m.filter(Boolean),instanceNodes:y.filter(Boolean),lastInstanceNodeReturnsThis:g,pureStaticNodes:b.filter(Boolean),classBindingNode:T,wrapClass(t){for(const e of r){e.node.leadingComments=null;e.remove()}if(h){t.scope.push({id:n.types.cloneNode(h)});t.set("superClass",n.types.assignmentExpression("=",h,t.node.superClass))}if(f!==0){if(t.isClassExpression()){t.scope.push({id:e});t.replaceWith(n.types.assignmentExpression("=",n.types.cloneNode(e),t.node))}else{if(d==null){t.node.id=e}if(T!=null){t.scope.push({id:x})}}}return t}}}},3713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"FEATURES",{enumerable:true,get:function(){return c.FEATURES}});Object.defineProperty(t,"buildCheckInRHS",{enumerable:true,get:function(){return i.buildCheckInRHS}});t.createClassFeaturePlugin=createClassFeaturePlugin;Object.defineProperty(t,"enableFeature",{enumerable:true,get:function(){return c.enableFeature}});Object.defineProperty(t,"injectInitialization",{enumerable:true,get:function(){return l.injectInitialization}});var n=r(2358);var s=r(7849);var i=r(4697);var a=r(7009);var o=r(4073);var l=r(5040);var c=r(1409);var p=r(1238);const u="@babel/plugin-class-features/version";function createClassFeaturePlugin({name:e,feature:t,loose:d,manipulateOptions:f,api:h,inherits:m,decoratorVersion:y}){var g;if(t&c.FEATURES.decorators){{if(y==="2023-11"||y==="2023-05"||y==="2023-01"||y==="2022-03"||y==="2021-12"){return(0,a.default)(h,{loose:d},y,m)}}}{h!=null?h:h={assumption:()=>void 0}}const b=h.assumption("setPublicClassFields");const T=h.assumption("privateFieldsAsSymbols");const S=h.assumption("privateFieldsAsProperties");const x=(g=h.assumption("noUninitializedPrivateFieldAccess"))!=null?g:false;const E=h.assumption("constantSuper");const P=h.assumption("noDocumentAll");if(S&&T){throw new Error(`Cannot enable both the "privateFieldsAsProperties" and `+`"privateFieldsAsSymbols" assumptions as the same time.`)}const v=S||T;if(d===true){const t=[];if(b!==undefined){t.push(`"setPublicClassFields"`)}if(S!==undefined){t.push(`"privateFieldsAsProperties"`)}if(T!==undefined){t.push(`"privateFieldsAsSymbols"`)}if(t.length!==0){console.warn(`[${e}]: You are using the "loose: true" option and you are`+` explicitly setting a value for the ${t.join(" and ")}`+` assumption${t.length>1?"s":""}. The "loose" option`+` can cause incompatibilities with the other class features`+` plugins, so it's recommended that you replace it with the`+` following top-level option:\n`+`\t"assumptions": {\n`+`\t\t"setPublicClassFields": true,\n`+`\t\t"privateFieldsAsSymbols": true\n`+`\t}`)}}return{name:e,manipulateOptions:f,inherits:m,pre(e){(0,c.enableFeature)(e,t,d);{if(typeof e.get(u)==="number"){e.set(u,"7.27.0");return}}if(!e.get(u)||s.lt(e.get(u),"7.27.0")){e.set(u,"7.27.0")}},visitor:{Class(e,{file:s}){if(s.get(u)!=="7.27.0")return;if(!(0,c.shouldTransform)(e,s))return;const d=e.isClassDeclaration();if(d)(0,p.assertFieldTransformed)(e);const f=(0,c.isLoose)(s,t);let h;const m=(0,a.hasDecorators)(e.node);const y=[];const g=[];const A=[];const w=new Set;const I=e.get("body");for(const e of I.get("body")){if((e.isClassProperty()||e.isClassMethod())&&e.node.computed){A.push(e)}if(e.isPrivate()){const{name:t}=e.node.key.id;const r=`get ${t}`;const n=`set ${t}`;if(e.isClassPrivateMethod()){if(e.node.kind==="get"){if(w.has(r)||w.has(t)&&!w.has(n)){throw e.buildCodeFrameError("Duplicate private field")}w.add(r).add(t)}else if(e.node.kind==="set"){if(w.has(n)||w.has(t)&&!w.has(r)){throw e.buildCodeFrameError("Duplicate private field")}w.add(n).add(t)}}else{if(w.has(t)&&!w.has(r)&&!w.has(n)||w.has(t)&&(w.has(r)||w.has(n))){throw e.buildCodeFrameError("Duplicate private field")}w.add(t)}}if(e.isClassMethod({kind:"constructor"})){h=e}else{g.push(e);if(e.isProperty()||e.isPrivate()||e.isStaticBlock!=null&&e.isStaticBlock()){y.push(e)}}}{if(!y.length&&!m)return}const C=e.node.id;let O;if(!C||!d){{var N;(N=e.ensureFunctionName)!=null?N:e.ensureFunctionName=r(8026).NodePath.prototype.ensureFunctionName}e.ensureFunctionName(false);O=e.scope.generateUidIdentifier((C==null?void 0:C.name)||"Class")}const k=O!=null?O:n.types.cloneNode(C);const _=(0,i.buildPrivateNamesMap)(k.name,v!=null?v:f,y,s);const D=(0,i.buildPrivateNamesNodes)(_,S!=null?S:f,T!=null?T:false,s);(0,i.transformPrivateNamesUsage)(k,e,_,{privateFieldsAsProperties:v!=null?v:f,noUninitializedPrivateFieldAccess:x,noDocumentAll:P,innerBinding:C},s);let M,L,j,F,B,R,U;{if(m){L=B=M=[];({instanceNodes:j,wrapClass:U}=(0,o.buildDecoratedClass)(k,e,g,s))}else{M=(0,l.extractComputedKeys)(e,A,s);({staticNodes:L,pureStaticNodes:B,instanceNodes:j,lastInstanceNodeReturnsThis:F,classBindingNode:R,wrapClass:U}=(0,i.buildFieldsInitNodes)(O,e.node.superClass,y,_,s,b!=null?b:f,v!=null?v:f,x,E!=null?E:f,C))}}if(j.length>0){(0,l.injectInitialization)(e,h,j,((e,t)=>{{if(m)return}for(const r of y){if(n.types.isStaticBlock!=null&&n.types.isStaticBlock(r.node)||r.node.static)continue;r.traverse(e,t)}}),F)}const K=U(e);K.insertBefore([...D,...M]);if(L.length>0){K.insertAfter(L)}if(B.length>0){K.find((e=>e.isStatement()||e.isDeclaration())).insertAfter(B)}if(R!=null&&d){K.insertAfter(R)}},ExportDefaultDeclaration(e,{file:t}){{if(t.get(u)!=="7.27.0")return;const s=e.get("declaration");if(s.isClassDeclaration()&&(0,a.hasDecorators)(s.node)){if(s.node.id){{var n;(n=e.splitExportDeclaration)!=null?n:e.splitExportDeclaration=r(8026).NodePath.prototype.splitExportDeclaration}e.splitExportDeclaration()}else{s.node.type="ClassExpression"}}}}}}}},5040:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.extractComputedKeys=extractComputedKeys;t.injectInitialization=injectInitialization;t.memoiseComputedKey=memoiseComputedKey;var n=r(2358);var s=r(8026);const i=s.visitors.environmentVisitor({Super(e){const{node:t,parentPath:r}=e;if(r.isCallExpression({callee:t})){this.push(r)}}});const a={"TSTypeAnnotation|TypeAnnotation"(e){e.skip()},ReferencedIdentifier(e,{scope:t}){if(t.hasOwnBinding(e.node.name)){t.rename(e.node.name);e.skip()}}};function handleClassTDZ(e,t){if(t.classBinding&&t.classBinding===e.scope.getBinding(e.node.name)){const r=t.file.addHelper("classNameTDZError");const s=n.types.callExpression(r,[n.types.stringLiteral(e.node.name)]);e.replaceWith(n.types.sequenceExpression([s,e.node]));e.skip()}}const o={ReferencedIdentifier:handleClassTDZ,"TSTypeAnnotation|TypeAnnotation"(e){e.skip()}};function injectInitialization(e,t,r,s,o){if(!r.length)return;const l=!!e.node.superClass;if(!t){const r=n.types.classMethod("constructor",n.types.identifier("constructor"),[],n.types.blockStatement([]));if(l){r.params=[n.types.restElement(n.types.identifier("args"))];r.body.body.push(n.template.statement.ast`super(...args)`)}[t]=e.get("body").unshiftContainer("body",r)}if(s){s(a,{scope:t.scope})}if(l){const e=[];t.traverse(i,e);let s=true;for(const t of e){if(s){s=false}else{r=r.map((e=>n.types.cloneNode(e)))}if(!t.parentPath.isExpressionStatement()){const e=[t.node,...r.map((e=>n.types.toExpression(e)))];if(!o)e.push(n.types.thisExpression());t.replaceWith(n.types.sequenceExpression(e))}else{t.insertAfter(r)}}}else{t.get("body").unshiftContainer("body",r)}}function memoiseComputedKey(e,t,r){const s=n.types.isIdentifier(e)&&t.hasUid(e.name);if(s){return}const i=n.types.isAssignmentExpression(e,{operator:"="})&&n.types.isIdentifier(e.left)&&t.hasUid(e.left.name);if(i){return n.types.cloneNode(e)}else{const s=n.types.identifier(r);t.push({id:s,kind:"let"});return n.types.assignmentExpression("=",n.types.cloneNode(s),e)}}function extractComputedKeys(e,t,r){const{scope:s}=e;const i=[];const a={classBinding:e.node.id&&s.getBinding(e.node.id.name),file:r};for(const e of t){const t=e.get("key");if(t.isReferencedIdentifier()){handleClassTDZ(t,a)}else{t.traverse(o,a)}const r=e.node;if(!t.isConstantExpression()){const e=memoiseComputedKey(t.node,s,s.generateUidBasedOnNode(t.node));if(e){i.push(n.types.expressionStatement(e));r.key=n.types.cloneNode(e.left)}}}return i}},1238:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.assertFieldTransformed=assertFieldTransformed;function assertFieldTransformed(e){if(e.node.declare||false){throw e.buildCodeFrameError(`TypeScript 'declare' fields must first be transformed by `+`@babel/plugin-transform-typescript.\n`+`If you have already enabled that plugin (or '@babel/preset-typescript'), make sure `+`that it runs before any plugin related to additional class features:\n`+` - @babel/plugin-transform-class-properties\n`+` - @babel/plugin-transform-private-methods\n`+` - @babel/plugin-proposal-decorators`)}}},3034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(3061);function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e){Object.keys(e).forEach((function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}}))}t.default=e;return Object.freeze(t)}var s=_interopNamespace(n);function willPathCastToBoolean(e){const t=e;const{node:r,parentPath:n}=t;if(n.isLogicalExpression()){const{operator:e,right:t}=n.node;if(e==="&&"||e==="||"||e==="??"&&r===t){return willPathCastToBoolean(n)}}if(n.isSequenceExpression()){const{expressions:e}=n.node;if(e[e.length-1]===r){return willPathCastToBoolean(n)}else{return true}}return n.isConditional({test:r})||n.isUnaryExpression({operator:"!"})||n.isLoop({test:r})}const{LOGICAL_OPERATORS:i,arrowFunctionExpression:a,assignmentExpression:o,binaryExpression:l,booleanLiteral:c,callExpression:p,cloneNode:u,conditionalExpression:d,identifier:f,isMemberExpression:h,isOptionalCallExpression:m,isOptionalMemberExpression:y,isUpdateExpression:g,logicalExpression:b,memberExpression:T,nullLiteral:S,optionalCallExpression:x,optionalMemberExpression:E,sequenceExpression:P,updateExpression:v}=s;class AssignmentMemoiser{constructor(){this._map=void 0;this._map=new WeakMap}has(e){return this._map.has(e)}get(e){if(!this.has(e))return;const t=this._map.get(e);const{value:r}=t;t.count--;if(t.count===0){return o("=",r,e)}return r}set(e,t,r){return this._map.set(e,{count:r,value:t})}}function toNonOptional(e,t){const{node:r}=e;if(y(r)){return T(t,r.property,r.computed)}if(e.isOptionalCallExpression()){const r=e.get("callee");if(e.node.optional&&r.isOptionalMemberExpression()){const n=r.node.object;const s=e.scope.maybeGenerateMemoised(n);r.get("object").replaceWith(o("=",s,n));return p(T(t,f("call")),[s,...e.node.arguments])}return p(t,e.node.arguments)}return e.node}function isInDetachedTree(e){while(e){if(e.isProgram())break;const{parentPath:t,container:r,listKey:n}=e;const s=t.node;if(n){if(r!==s[n]){return true}}else{if(r!==s)return true}e=t}return false}const A={memoise(){},handle(e,t){const{node:r,parent:n,parentPath:s,scope:i}=e;if(e.isOptionalMemberExpression()){if(isInDetachedTree(e))return;const g=e.find((({node:t,parent:r})=>{if(y(r)){return r.optional||r.object!==t}if(m(r)){return t!==e.node&&r.optional||r.callee!==t}return true}));if(i.path.isPattern()){g.replaceWith(p(a([],g.node),[]));return}const T=willPathCastToBoolean(g);const P=g.parentPath;if(P.isUpdateExpression({argument:r})){throw e.buildCodeFrameError(`can't handle update expression`)}const v=P.isAssignmentExpression({left:g.node});const A=P.isUnaryExpression({operator:"delete"});if(A&&g.isOptionalMemberExpression()&&g.get("property").isPrivateName()){throw e.buildCodeFrameError(`can't delete a private class element`)}let w=e;for(;;){if(w.isOptionalMemberExpression()){if(w.node.optional)break;w=w.get("object");continue}else if(w.isOptionalCallExpression()){if(w.node.optional)break;w=w.get("callee");continue}throw new Error(`Internal error: unexpected ${w.node.type}`)}const I=w.isOptionalMemberExpression()?w.node.object:w.node.callee;const C=i.maybeGenerateMemoised(I);const O=C!=null?C:I;const N=s.isOptionalCallExpression({callee:r});const isOptionalCall=e=>N;const k=s.isCallExpression({callee:r});w.replaceWith(toNonOptional(w,O));if(isOptionalCall()){if(n.optional){s.replaceWith(this.optionalCall(e,n.arguments))}else{s.replaceWith(this.call(e,n.arguments))}}else if(k){e.replaceWith(this.boundGet(e))}else if(this.delete&&s.isUnaryExpression({operator:"delete"})){s.replaceWith(this.delete(e))}else if(s.isAssignmentExpression()){handleAssignment(this,e,s)}else{e.replaceWith(this.get(e))}let _=e.node;for(let t=e;t!==g;){const e=t.parentPath;if(e===g&&isOptionalCall()&&n.optional){_=e.node;break}_=toNonOptional(e,_);t=e}let D;const M=g.parentPath;if(h(_)&&M.isOptionalCallExpression({callee:g.node,optional:true})){const{object:t}=_;D=e.scope.maybeGenerateMemoised(t);if(D){_.object=o("=",D,t)}}let L=g;if(A||v){L=M;_=M.node}const j=C?o("=",u(O),u(I)):u(O);if(T){let e;if(t){e=l("!=",j,S())}else{e=b("&&",l("!==",j,S()),l("!==",u(O),i.buildUndefinedNode()))}L.replaceWith(b("&&",e,_))}else{let e;if(t){e=l("==",j,S())}else{e=b("||",l("===",j,S()),l("===",u(O),i.buildUndefinedNode()))}L.replaceWith(d(e,A?c(true):i.buildUndefinedNode(),_))}if(D){const e=M.node;M.replaceWith(x(E(e.callee,f("call"),false,true),[u(D),...e.arguments],false))}return}if(g(n,{argument:r})){if(this.simpleSet){e.replaceWith(this.simpleSet(e));return}const{operator:t,prefix:a}=n;this.memoise(e,2);const l=i.generateUidIdentifierBasedOnNode(r);i.push({id:l});const c=[o("=",u(l),this.get(e))];if(a){c.push(v(t,u(l),a));const r=P(c);s.replaceWith(this.set(e,r));return}else{const n=i.generateUidIdentifierBasedOnNode(r);i.push({id:n});c.push(o("=",u(n),v(t,u(l),a)),u(l));const p=P(c);s.replaceWith(P([this.set(e,p),u(n)]));return}}if(s.isAssignmentExpression({left:r})){handleAssignment(this,e,s);return}if(s.isCallExpression({callee:r})){s.replaceWith(this.call(e,s.node.arguments));return}if(s.isOptionalCallExpression({callee:r})){if(i.path.isPattern()){s.replaceWith(p(a([],s.node),[]));return}s.replaceWith(this.optionalCall(e,s.node.arguments));return}if(this.delete&&s.isUnaryExpression({operator:"delete"})){s.replaceWith(this.delete(e));return}if(s.isForXStatement({left:r})||s.isObjectProperty({value:r})&&s.parentPath.isObjectPattern()||s.isAssignmentPattern({left:r})&&s.parentPath.isObjectProperty({value:n})&&s.parentPath.parentPath.isObjectPattern()||s.isArrayPattern()||s.isAssignmentPattern({left:r})&&s.parentPath.isArrayPattern()||s.isRestElement()){e.replaceWith(this.destructureSet(e));return}if(s.isTaggedTemplateExpression()){e.replaceWith(this.boundGet(e))}else{e.replaceWith(this.get(e))}}};function handleAssignment(e,t,r){if(e.simpleSet){t.replaceWith(e.simpleSet(t));return}const{operator:n,right:s}=r.node;if(n==="="){r.replaceWith(e.set(t,s))}else{const a=n.slice(0,-1);if(i.includes(a)){e.memoise(t,1);r.replaceWith(b(a,e.get(t),e.set(t,s)))}else{e.memoise(t,2);r.replaceWith(e.set(t,l(a,e.get(t),s)))}}}function memberExpressionToFunctions(e,t,r){e.traverse(t,Object.assign({},A,r,{memoiser:new AssignmentMemoiser}))}t["default"]=memberExpressionToFunctions},8e3:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=r(9491);var s=r(3061);const{callExpression:i,cloneNode:a,expressionStatement:o,identifier:l,importDeclaration:c,importDefaultSpecifier:p,importNamespaceSpecifier:u,importSpecifier:d,memberExpression:f,stringLiteral:h,variableDeclaration:m,variableDeclarator:y}=s;class ImportBuilder{constructor(e,t,r){this._statements=[];this._resultName=null;this._importedSource=void 0;this._scope=t;this._hub=r;this._importedSource=e}done(){return{statements:this._statements,resultName:this._resultName}}import(){this._statements.push(c([],h(this._importedSource)));return this}require(){this._statements.push(o(i(l("require"),[h(this._importedSource)])));return this}namespace(e="namespace"){const t=this._scope.generateUidIdentifier(e);const r=this._statements[this._statements.length-1];n(r.type==="ImportDeclaration");n(r.specifiers.length===0);r.specifiers=[u(t)];this._resultName=a(t);return this}default(e){const t=this._scope.generateUidIdentifier(e);const r=this._statements[this._statements.length-1];n(r.type==="ImportDeclaration");n(r.specifiers.length===0);r.specifiers=[p(t)];this._resultName=a(t);return this}named(e,t){if(t==="default")return this.default(e);const r=this._scope.generateUidIdentifier(e);const s=this._statements[this._statements.length-1];n(s.type==="ImportDeclaration");n(s.specifiers.length===0);s.specifiers=[d(r,l(t))];this._resultName=a(r);return this}var(e){const t=this._scope.generateUidIdentifier(e);let r=this._statements[this._statements.length-1];if(r.type!=="ExpressionStatement"){n(this._resultName);r=o(this._resultName);this._statements.push(r)}this._statements[this._statements.length-1]=m("var",[y(t,r.expression)]);this._resultName=a(t);return this}defaultInterop(){return this._interop(this._hub.addHelper("interopRequireDefault"))}wildcardInterop(){return this._interop(this._hub.addHelper("interopRequireWildcard"))}_interop(e){const t=this._statements[this._statements.length-1];if(t.type==="ExpressionStatement"){t.expression=i(e,[t.expression])}else if(t.type==="VariableDeclaration"){n(t.declarations.length===1);t.declarations[0].init=i(e,[t.declarations[0].init])}else{n.fail("Unexpected type.")}return this}prop(e){const t=this._statements[this._statements.length-1];if(t.type==="ExpressionStatement"){t.expression=f(t.expression,l(e))}else if(t.type==="VariableDeclaration"){n(t.declarations.length===1);t.declarations[0].init=f(t.declarations[0].init,l(e))}else{n.fail("Unexpected type:"+t.type)}return this}read(e){this._resultName=f(this._resultName,l(e))}}t["default"]=ImportBuilder},4955:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=r(9491);var s=r(3061);var i=r(8e3);var a=r(2488);const{identifier:o,importSpecifier:l,numericLiteral:c,sequenceExpression:p,isImportDeclaration:u}=s;class ImportInjector{constructor(e,t,r){this._defaultOpts={importedSource:null,importedType:"commonjs",importedInterop:"babel",importingInterop:"babel",ensureLiveReference:false,ensureNoContext:false,importPosition:"before"};const n=e.find((e=>e.isProgram()));this._programPath=n;this._programScope=n.scope;this._hub=n.hub;this._defaultOpts=this._applyDefaults(t,r,true)}addDefault(e,t){return this.addNamed("default",e,t)}addNamed(e,t,r){n(typeof e==="string");return this._generateImport(this._applyDefaults(t,r),e)}addNamespace(e,t){return this._generateImport(this._applyDefaults(e,t),null)}addSideEffect(e,t){return this._generateImport(this._applyDefaults(e,t),void 0)}_applyDefaults(e,t,r=false){let s;if(typeof e==="string"){s=Object.assign({},this._defaultOpts,{importedSource:e},t)}else{n(!t,"Unexpected secondary arguments.");s=Object.assign({},this._defaultOpts,e)}if(!r&&t){if(t.nameHint!==undefined)s.nameHint=t.nameHint;if(t.blockHoist!==undefined)s.blockHoist=t.blockHoist}return s}_generateImport(e,t){const r=t==="default";const n=!!t&&!r;const s=t===null;const{importedSource:o,importedType:l,importedInterop:u,importingInterop:d,ensureLiveReference:f,ensureNoContext:h,nameHint:m,importPosition:y,blockHoist:g}=e;let b=m||t;const T=(0,a.default)(this._programPath);const S=T&&d==="node";const x=T&&d==="babel";if(y==="after"&&!T){throw new Error(`"importPosition": "after" is only supported in modules`)}const E=new i.default(o,this._programScope,this._hub);if(l==="es6"){if(!S&&!x){throw new Error("Cannot import an ES6 module from CommonJS")}E.import();if(s){E.namespace(m||o)}else if(r||n){E.named(b,t)}}else if(l!=="commonjs"){throw new Error(`Unexpected interopType "${l}"`)}else if(u==="babel"){if(S){b=b!=="default"?b:o;const e=`${o}$es6Default`;E.import();if(s){E.default(e).var(b||o).wildcardInterop()}else if(r){if(f){E.default(e).var(b||o).defaultInterop().read("default")}else{E.default(e).var(b).defaultInterop().prop(t)}}else if(n){E.default(e).read(t)}}else if(x){E.import();if(s){E.namespace(b||o)}else if(r||n){E.named(b,t)}}else{E.require();if(s){E.var(b||o).wildcardInterop()}else if((r||n)&&f){if(r){b=b!=="default"?b:o;E.var(b).read(t);E.defaultInterop()}else{E.var(o).read(t)}}else if(r){E.var(b).defaultInterop().prop(t)}else if(n){E.var(b).prop(t)}}}else if(u==="compiled"){if(S){E.import();if(s){E.default(b||o)}else if(r||n){E.default(o).read(b)}}else if(x){E.import();if(s){E.namespace(b||o)}else if(r||n){E.named(b,t)}}else{E.require();if(s){E.var(b||o)}else if(r||n){if(f){E.var(o).read(b)}else{E.prop(t).var(b)}}}}else if(u==="uncompiled"){if(r&&f){throw new Error("No live reference for commonjs default")}if(S){E.import();if(s){E.default(b||o)}else if(r){E.default(b)}else if(n){E.default(o).read(b)}}else if(x){E.import();if(s){E.default(b||o)}else if(r){E.default(b)}else if(n){E.named(b,t)}}else{E.require();if(s){E.var(b||o)}else if(r){E.var(b)}else if(n){if(f){E.var(o).read(b)}else{E.var(b).prop(t)}}}}else{throw new Error(`Unknown importedInterop "${u}".`)}const{statements:P,resultName:v}=E.done();this._insertStatements(P,y,g);if((r||n)&&h&&v.type!=="Identifier"){return p([c(0),v])}return v}_insertStatements(e,t="before",r=3){if(t==="after"){if(this._insertStatementsAfter(e))return}else{if(this._insertStatementsBefore(e,r))return}this._programPath.unshiftContainer("body",e)}_insertStatementsBefore(e,t){if(e.length===1&&u(e[0])&&isValueImport(e[0])){const t=this._programPath.get("body").find((e=>e.isImportDeclaration()&&isValueImport(e.node)));if((t==null?void 0:t.node.source.value)===e[0].source.value&&maybeAppendImportSpecifiers(t.node,e[0])){return true}}e.forEach((e=>{e._blockHoist=t}));const r=this._programPath.get("body").find((e=>{const t=e.node._blockHoist;return Number.isFinite(t)&&t<4}));if(r){r.insertBefore(e);return true}return false}_insertStatementsAfter(e){const t=new Set(e);const r=new Map;for(const t of e){if(u(t)&&isValueImport(t)){const e=t.source.value;if(!r.has(e))r.set(e,[]);r.get(e).push(t)}}let n=null;for(const e of this._programPath.get("body")){if(e.isImportDeclaration()&&isValueImport(e.node)){n=e;const s=e.node.source.value;const i=r.get(s);if(!i)continue;for(const r of i){if(!t.has(r))continue;if(maybeAppendImportSpecifiers(e.node,r)){t.delete(r)}}}}if(t.size===0)return true;if(n)n.insertAfter(Array.from(t));return!!n}}t["default"]=ImportInjector;function isValueImport(e){return e.importKind!=="type"&&e.importKind!=="typeof"}function hasNamespaceImport(e){return e.specifiers.length===1&&e.specifiers[0].type==="ImportNamespaceSpecifier"||e.specifiers.length===2&&e.specifiers[1].type==="ImportNamespaceSpecifier"}function hasDefaultImport(e){return e.specifiers.length>0&&e.specifiers[0].type==="ImportDefaultSpecifier"}function maybeAppendImportSpecifiers(e,t){if(!e.specifiers.length){e.specifiers=t.specifiers;return true}if(!t.specifiers.length)return true;if(hasNamespaceImport(e)||hasNamespaceImport(t))return false;if(hasDefaultImport(t)){if(hasDefaultImport(e)){t.specifiers[0]=l(t.specifiers[0].local,o("default"))}else{e.specifiers.unshift(t.specifiers.shift())}}e.specifiers.push(...t.specifiers);return true}},6912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"ImportInjector",{enumerable:true,get:function(){return n.default}});t.addDefault=addDefault;t.addNamed=addNamed;t.addNamespace=addNamespace;t.addSideEffect=addSideEffect;Object.defineProperty(t,"isModule",{enumerable:true,get:function(){return s.default}});var n=r(4955);var s=r(2488);function addDefault(e,t,r){return new n.default(e).addDefault(t,r)}function addNamed(e,t,r,s){return new n.default(e).addNamed(t,r,s)}function addNamespace(e,t,r){return new n.default(e).addNamespace(t,r)}function addSideEffect(e,t,r){return new n.default(e).addSideEffect(t,r)}},2488:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=isModule;function isModule(e){return e.node.sourceType==="module"}},3747:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.buildDynamicImport=buildDynamicImport;var n=r(2358);{t.getDynamicImportSource=function getDynamicImportSource(e){const[t]=e.arguments;return n.types.isStringLiteral(t)||n.types.isTemplateLiteral(t)?t:n.template.expression.ast`\`\${${t}}\``}}function buildDynamicImport(e,t,r,s){const i=n.types.isCallExpression(e)?e.arguments[0]:e.source;if(n.types.isStringLiteral(i)||n.types.isTemplateLiteral(i)&&i.quasis.length===0){if(t){return n.template.expression.ast` |
| 115 | Promise.resolve().then(() => ${s(i)}) |
| 116 | `}else return s(i)}const a=n.types.isTemplateLiteral(i)?n.types.identifier("specifier"):n.types.templateLiteral([n.types.templateElement({raw:""}),n.types.templateElement({raw:""})],[n.types.identifier("specifier")]);if(t){return n.template.expression.ast` |
| 117 | (specifier => |
nothing calls this directly
no test coverage detected