From 8977f9274284a4ae90db8b42fce1a9f229cd4637 Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Wed, 5 Feb 2020 00:14:56 +0300 Subject: [PATCH 1/3] Refactoring of CLI code related with source code. Fixed directory name logging --- dist/index.cli.js | 13764 +++++++++++++++- dist/index.js | 13119 ++++++++++++++- src/cli/JavaScriptObfuscatorCLI.ts | 81 +- src/cli/utils/CLIUtils.ts | 29 +- src/cli/utils/SourceCodeReader.ts | 26 +- src/types/cli/TSourceCodeData.ts | 3 - .../cli/utils/SourceCodeReader.spec.ts | 39 +- yarn.lock | 242 +- 8 files changed, 26995 insertions(+), 308 deletions(-) delete mode 100644 src/types/cli/TSourceCodeData.ts diff --git a/dist/index.cli.js b/dist/index.cli.js index 1a92c449..6245501a 100644 --- a/dist/index.cli.js +++ b/dist/index.cli.js @@ -21,5 +21,13767 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -require("source-map-support").install(),module.exports=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=241)}([function(e,t){e.exports=require("inversify")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(33);class n{static isArrayPatternNode(e){return e.type===o.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===o.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===o.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===o.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===o.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===o.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===o.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===o.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===o.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===o.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===o.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===o.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===o.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return n.isFunctionDeclarationNode(e)||n.isFunctionExpressionNode(e)||n.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===o.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===o.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===o.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===o.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===o.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const r=n.isLabeledStatementNode(t)&&t.label===e,o=n.isContinueStatementNode(t)&&t.label===e,i=n.isBreakStatementNode(t)&&t.label===e;return r||o||i}static isLabeledStatementNode(e){return e.type===o.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===o.NodeType.Literal}static isMemberExpressionNode(e){return e.type===o.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===o.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return n.isProgramNode(e)||n.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return n.isNodeWithLexicalScope(e)||n.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return n.isProgramNode(e)||n.isBlockStatementNode(e)&&n.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return n.isProgramNode(e)||n.isBlockStatementNode(e)||n.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===o.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===o.NodeType.ObjectExpression}static isProgramNode(e){return e.type===o.NodeType.Program}static isPropertyNode(e){return e.type===o.NodeType.Property}static parentNodeIsPropertyNode(e,t){return n.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return n.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return n.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===o.NodeType.RestElement}static isReturnStatementNode(e){return e.type===o.NodeType.ReturnStatement}static isSuperNode(e){return e.type===o.NodeType.Super}static isSwitchCaseNode(e){return e.type===o.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===o.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===o.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===o.NodeType.UnaryExpression}static isUseStrictOperator(e){return n.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===o.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===o.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===o.NodeType.WhileStatement}}t.NodeGuards=n,n.nodesWithLexicalStatements=[o.NodeType.ArrowFunctionExpression,o.NodeType.FunctionDeclaration,o.NodeType.FunctionExpression,o.NodeType.MethodDefinition]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(46)),i=o(r(13)),a=r(43),s=r(55),c=r(4),d=r(15);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:n.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),c.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+n.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return c.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(r=>{if("parentNode"===r)return;const o=e[r];let n;n=null===o||o instanceof RegExp?o:Array.isArray(o)?o.map(l.cloneRecursive):"object"==typeof o?l.cloneRecursive(o):o,t[r]=n}),t}}t.NodeUtils=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o={configurable:!0,enumerable:!0};function n(e,t,r){Reflect.hasMetadata(e,r)||Reflect.defineMetadata(e,t,r)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(r,i)=>{const a=r[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return n("_initialized",!1,r),n("_initializablePropertiesSet",new Set,r),n("_wrappedMethodsSet",new Set,r),function(e,t){const r=Object.getOwnPropertyNames(e),n=[t,"constructor"];r.forEach(r=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(n.includes(r)||a.has(r)||s.has(r))return;if("function"!=typeof e[r])return;const c=null!==(i=Object.getOwnPropertyDescriptor(e,r))&&void 0!==i?i:o,d=c.value;Object.defineProperty(e,r,Object.assign(Object.assign({},c),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(r)})}(r,e),function(e,t,r){var n;const i=null!==(n=Object.getOwnPropertyDescriptor(e,t))&&void 0!==n?n:o,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[r],e}}))}(r,e,i),function(e,t){var r;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const n=`_${t.toString()}`,i=null!==(r=Object.getOwnPropertyDescriptor(e,n))&&void 0!==r?r:o;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[n])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[n]},set:function(e){this[n]=e}})),i}(r,i)}}},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(46)),i=r(33);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,r){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,r){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,r){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:r,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,r){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},r&&{alternate:r}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:n.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,r){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,r=!1){return{type:i.NodeType.MemberExpression,computed:r,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,r,o){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:r,computed:o,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,r=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:r,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,r=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:r,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),h=r(113),N=r(114);let b=o=class{constructor(e,t,r,o){this.cachedNode=null,this.identifierNamesGenerator=e(o),this.customNodeFormatter=t,this.randomGenerator=r,this.options=o}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(o.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};b.globalVariableTemplateFunctions=[h.GlobalVariableTemplate1(),N.GlobalVariableTemplate2()],b=o=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],b),t.AbstractCustomNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3);let f=class{constructor(e,t){this.randomGenerator=e,this.options=t}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractNodeTransformer=f},function(e,t){e.exports=require("estraverse")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static getParentNodeWithStatements(e){return n.getParentNodesWithStatementsRecursive(e,1)[0]}static getParentNodesWithStatements(e){return n.getParentNodesWithStatementsRecursive(e)}static getNextSiblingStatement(e){return n.getSiblingStatementByOffset(e,1)}static getPreviousSiblingStatement(e){return n.getSiblingStatementByOffset(e,-1)}static getRootStatementOfNode(e){if(o.NodeGuards.isProgramNode(e))throw new Error("Unable to find root statement for `Program` node");const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithStatements(t)?e:n.getRootStatementOfNode(t)}static getScopeOfNode(e){const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithStatements(t)?t:n.getScopeOfNode(t)}static getParentNodesWithStatementsRecursive(e,t=1/0,r=[],i=0){if(r.length>=t)return r;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(o.NodeGuards.isProgramNode(e)||o.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&r.push(e),e!==a?n.getParentNodesWithStatementsRecursive(a,t,r,++i):r}static getSiblingStatementByOffset(e,t){const r=n.getScopeOfNode(e),i=o.NodeGuards.isSwitchCaseNode(r)?r.consequent:r.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static set(e,t){var r;e.metadata=Object.assign(null!==(r=e.metadata)&&void 0!==r?r:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===o.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===o.get(e,"replacedLiteral")}}t.NodeMetadata=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(72),a=r(82),s=r(95),c=r(106),d=r(156),l=r(157),u=r(161),f=r(162),p=r(173),m=r(195),g=r(210),y=r(215),h=r(225),N=r(70),b=r(229),v=r(231),I=r(232),S=r(233);t.InversifyContainerFacade=class{constructor(){this.container=new o.Container}static getFactory(e){return t=>r=>t.container.getNamed(e,r)}static getCacheFactory(e){return t=>{const r=new Map;return o=>{if(r.has(o))return r.get(o);const n=t.container.getNamed(e,o);return r.set(o,n),n}}}static getConstructorFactory(e,...t){return r=>{const o=new Map,n=[];return i=>{if(t.forEach((e,t)=>{n[t]||(n[t]=r.container.get(e))}),o.has(i))return new(o.get(i))(...n);const a=r.container.getNamed(e,i);return o.set(i,a),new a(...n)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,r){this.container.bind(n.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new I.SourceCode(e,t)).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>r).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ILogger).to(N.Logger).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IJavaScriptObfuscator).to(h.JavaScriptObfuscator).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ITransformersRunner).to(S.TransformersRunner).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IObfuscatedCode).to(v.ObfuscatedCode),this.container.bind(n.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,r)=>{const o=e.container.get(n.ServiceIdentifiers.IObfuscatedCode);return o.initialize(t,r),o}),this.container.bind(n.ServiceIdentifiers.IObfuscationEventEmitter).to(b.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(c.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(u.nodeTransformersModule),this.container.load(f.obfuscatingTransformersModule),this.container.load(p.optionsModule),this.container.load(m.preparingTransformersModule),this.container.load(g.storagesModule),this.container.load(y.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static append(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e),...t])}static appendToOptimalBlockScope(e,t,r,o=0){const i=e.length?n.getOptimalBlockScope(e,o):t;n.prepend(i,r)}static getOptimalBlockScope(e,t,r=1/0){const o=e[t];if(r<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return r>1&&o.callsGraph.length?n.getOptimalBlockScope(o.callsGraph,0,--r):o.callee}static insertBefore(e,t,r){const o=n.getScopeStatements(e).indexOf(r);n.insertAtIndex(e,t,o)}static insertAfter(e,t,r){const o=n.getScopeStatements(e).indexOf(r);n.insertAtIndex(e,t,o+1)}static insertAtIndex(e,t,r){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e).slice(0,r),...t,...n.getScopeStatements(e).slice(r)])}static prepend(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...t,...n.getScopeStatements(e)])}static getScopeStatements(e){return o.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){o.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.ObfuscationTarget=o.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.StringArrayEncoding=o.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(69);const o=r(1),n=r(16);class i{static obfuscate(e,t={}){const r=new n.InversifyContainerFacade;r.load(e,"",t);const i=r.get(o.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return r.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.4"?"0.24.4":"unknown"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(5),f=r(2),p=r(3);let m=class{constructor(e,t,r){this.identifierNamesGenerator=e(r),this.randomGenerator=t,this.options=r}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const r=this.customNodes.get(e);r&&t(r)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==u.TIdentifierNamesGeneratorFactory&&u.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],m),t.AbstractCustomNodeGroup=m},function(e,t){e.exports=require("@gradecam/tsenum")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=o,o.hexadecimalPrefix="0x"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.IdentifierNamesGenerator=o.MakeEnum({DictionaryIdentifierNamesGenerator:"dictionary",HexadecimalIdentifierNamesGenerator:"hexadecimal",MangledIdentifierNamesGenerator:"mangled"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.SourceMapMode=o.MakeEnum({Inline:"inline",Separate:"separate"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(31),n=r(20),i=r(32);t.NO_ADDITIONAL_NODES_PRESET=Object.freeze({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!1,seed:0,selfDefending:!1,shuffleStringArray:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:0,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NumberUtils=class{static toHex(e){return e.toString(16)}static isCeil(e){return e%1==0}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(2);let l=class{constructor(e){this.options=e}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IOptions&&d.IOptions)?o:Object])],l),t.AbstractObfuscatingReplacer=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(31),n=r(20),i=r(32);t.DEFAULT_PRESET=Object.freeze({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!0,seed:0,selfDefending:!1,shuffleStringArray:!0,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:10,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Dot=".",e.Comma=","}(t.StringSeparator||(t.StringSeparator={}))},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{};n=o([r(0).injectable()],n),t.AbstractCalleeDataExtractor=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecmaVersion=11},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);t.NodeLiteralUtils=class{static isProhibitedLiteralNode(e,t){return!(!o.NodeGuards.isPropertyNode(t)||t.computed||t.key!==e)||!!o.NodeGuards.isImportDeclarationNode(t)}}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3);let g=o=class{constructor(e,t,r){this.replacerDataByControlFlowStorageId=new Map,this.controlFlowCustomNodeFactory=e,this.randomGenerator=t,this.options=r}static getStorageKeysByIdForCurrentStorage(e,t){let r;return r=e.has(t)?e.get(t):new Map,r}insertCustomNodeToControlFlowStorage(e,t,r,n){const i=t.getStorageId(),a=o.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,i),s=a.get(r);if(this.randomGenerator.getMathRandom(){const r=this.randomGenerator.getRandomString(e);return t.getStorage().has(r)?c(e):r},d=c(5);return a.set(r,[d]),this.replacerDataByControlFlowStorageId.set(i,a),t.set(d,e),d}};g=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],g),t.AbstractControlFlowReplacer=g},function(e,t){e.exports=require("escodegen")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n const that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3);let f=class{constructor(e,t){this.preservedNamesSet=new Set,this.randomGenerator=e,this.options=t}preserveName(e){this.preservedNamesSet.add(e)}isValidIdentifierName(e){return this.notReservedName(e)&&!this.preservedNamesSet.has(e)}notReservedName(e){return!this.options.reservedNames.length||!this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractIdentifierNamesGenerator=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(7);let m=class{constructor(e,t){this.randomGenerator=e,this.options=t}initialize(){this.storage=new Map,this.storageId=this.randomGenerator.getRandomString(6)}get(e){return this.storage.get(e)}getOrThrow(e){const t=this.get(e);if(!t)throw new Error(`No value found in map storage with key \`${e}\``);return t}getKeyOf(e){for(const[t,r]of this.storage)if(e===r)return t;return null}getLength(){return this.storage.size}getStorage(){return this.storage}getStorageId(){return this.storageId}has(e){return this.storage.has(e)}mergeWith(e,t=!1){this.storage=new Map([...this.storage,...e.getStorage()]),t&&(this.storageId=e.getStorageId())}set(e,t){this.storage.set(e,t)}};a([p.initializable(),s("design:type",String)],m.prototype,"storageId",void 0),a([p.initializable(),s("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],m.prototype,"storage",void 0),a([d.postConstruct(),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],m.prototype,"initialize",null),m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MapStorage=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(17),f=r(2),p=r(3),m=r(18),g=r(45),y=r(4);let h=class extends g.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}getControlFlowStorageCallNode(e,t,r,o){const n=this.controlFlowCustomNodeFactory(m.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);n.initialize(e,t,r,o);const i=n.getNode()[0];if(!i||!y.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};h=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==u.TControlFlowCustomNodeFactory&&u.TControlFlowCustomNodeFactory)?o:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],h),t.ExpressionWithOperatorControlFlowReplacer=h},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(r(85)),a=n(r(86)),s=n(r(56));class c{static parse(e,t){const r=c.sourceTypes.length;for(let o=0;o"),u=`...${i.substring(s,d).replace(/^\s+/,"")}...`;throw new Error(`ERROR in ${a}line ${r.line}: ${t}\n${l} ${u}`)}}t.ASTParserFacade=c,c.colorError=s.default.red,c.nearestSymbolsCount=15,c.sourceTypes=["script","module"]},function(e,t){e.exports=require("chalk")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BasePropertiesExtractor="BasePropertiesExtractor",e.ObjectExpressionToVariableDeclarationExtractor="ObjectExpressionToVariableDeclarationExtractor"}(t.ObjectExpressionExtractor||(t.ObjectExpressionExtractor={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ObjectExpressionVariableDeclarationHostNode="ObjectExpressionVariableDeclarationHostNode"}(t.ObjectExpressionKeysTransformerCustomNode||(t.ObjectExpressionKeysTransformerCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t){e.exports=require("class-validator")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListObfuscatingGuard="BlackListObfuscatingGuard",e.ConditionalCommentObfuscatingGuard="ConditionalCommentObfuscatingGuard",e.ReservedStringObfuscatingGuard="ReservedStringObfuscatingGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(4);let s=o=class{constructor(){this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}static isConditionalComment(e){return o.obfuscationEnableCommentRegExp.test(e.value)||o.obfuscationDisableCommentRegExp.test(e.value)}check(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!a.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;const t=e.leadingComments,r=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),r&&(this.obfuscationAllowedForNextNode=this.checkComments(r)),this.obfuscationAllowedForCurrentNode}checkComments(e){const t=e.length;let r=this.obfuscationAllowedForCurrentNode;for(let n=0;n=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(218)),m=r(219),g=r(2),y=r(220),h=r(7);let N=o=class{constructor(e,t){this.sourceCode=e,this.options=t}initialize(){this.randomGenerator=new m.Chance(this.getRawSeed())}getMathRandom(){return this.getRandomInteger(0,99999)/1e5}getRandomGenerator(){return this.randomGenerator}getRandomInteger(e,t){return this.getRandomGenerator().integer({min:e,max:t})}getRandomString(e,t=o.randomGeneratorPool){return this.getRandomGenerator().string({length:e,pool:t})}getInputSeed(){return this.options.seed.toString()}getRawSeed(){const e=this.getInputSeed();return`${e}`.split("|").length>1?e:`${e}|${p.default(this.sourceCode.getSourceCode())}`}};N.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s([h.initializable(),c("design:type","function"==typeof(n=void 0!==m.Chance&&m.Chance.Chance)?n:Object)],N.prototype,"randomGenerator",void 0),s([u.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],N.prototype,"initialize",null),N=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.ISourceCode)),d(1,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(i=void 0!==y.ISourceCode&&y.ISourceCode)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],N),t.RandomGenerator=N},function(e,t){e.exports=require("reflect-metadata")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(56)),f=r(2),p=r(71);let m=o=class{constructor(e){this.options=e}static log(e,t,r,o){const n=e(`\n${t} ${r}`);console.log(n,null!=o?o:"")}info(e,t){this.options.log&&o.log(o.colorInfo,p.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&o.log(o.colorSuccess,p.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&o.log(o.colorWarn,p.LoggingPrefix.Base,e,t)}};m.colorInfo=u.default.cyan,m.colorSuccess=u.default.green,m.colorWarn=u.default.yellow,m=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IOptions&&f.IOptions)?n:Object])],m),t.Logger=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(52),s=r(73),c=r(75),d=r(76),l=r(77),u=r(78),f=r(79),p=r(81);t.analyzersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICallsGraphAnalyzer).to(s.CallsGraphAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer).to(u.PrevailingKindOfVariablesAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IScopeAnalyzer).to(f.ScopeAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IStringArrayStorageAnalyzer).to(p.StringArrayStorageAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(d.FunctionExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(l.ObjectExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(74),p=r(52),m=r(4),g=r(14);let y=o=class{constructor(e){this.calleeDataExtractorFactory=e}static getLimitIndex(e){const t=e-1,r=o.limitThresholdActivationLength-1;let n=t;return t>r&&(n=Math.round(r+t*o.limitThreshold),n>t&&(n=t)),n}analyze(e){return this.analyzeRecursive(e.body)}analyzeRecursive(e){const t=o.getLimitIndex(e.length),r=[],n=e.length;for(let o=0;ot);o++){const t=e[o];u.traverse(t,{enter:o=>{if(m.NodeGuards.isCallExpressionNode(o))return t.parentNode!==g.NodeStatementUtils.getParentNodeWithStatements(o)?u.VisitorOption.Skip:void this.analyzeCallExpressionNode(r,e,o)}})}return r}analyzeCallExpressionNode(e,t,r){o.calleeDataExtractorsList.forEach(o=>{const n=this.calleeDataExtractorFactory(o).extract(t,r.callee);n&&e.push(Object.assign(Object.assign({},n),{callsGraph:this.analyzeRecursive(n.callee.body)}))})}};y.calleeDataExtractorsList=[p.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,p.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,p.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],y.limitThresholdActivationLength=25,y.limitThreshold=.002,y=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__ICalleeDataExtractor)),a("design:paramtypes",["function"==typeof(n=void 0!==f.TCalleeDataExtractorFactory&&f.TCalleeDataExtractorFactory)?n:Object])],y),t.CallsGraphAnalyzer=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(13)),s=r(42),c=r(4),d=r(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){if(!c.NodeGuards.isIdentifierNode(t))return null;const r=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name);return r?{callee:r,name:t.name}:null}getCalleeBlockStatement(e,t){let r=null;return a.traverse(e,{enter:e=>{if(c.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return r=e.body,a.VisitorOption.Break}}),r}};l=o([i.injectable()],l),t.FunctionDeclarationCalleeDataExtractor=l},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(13)),s=r(42),c=r(4),d=r(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){var r;let o=null;return c.NodeGuards.isIdentifierNode(t)&&(o=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name)),c.NodeGuards.isFunctionExpressionNode(t)&&(o=t.body),o?{callee:o,name:null!==(r=t.name)&&void 0!==r?r:null}:null}getCalleeBlockStatement(e,t){let r=null;return a.traverse(e,{enter:(e,o)=>{if(c.NodeGuards.isFunctionExpressionNode(e)&&o&&c.NodeGuards.isVariableDeclaratorNode(o)&&c.NodeGuards.isIdentifierNode(o.id)&&o.id.name===t)return r=e.body,a.VisitorOption.Break}}),r}};l=o([i.injectable()],l),t.FunctionExpressionCalleeDataExtractor=l},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=i(r(13)),c=r(42),d=r(4),l=r(14);let u=o=class extends c.AbstractCalleeDataExtractor{static isValidTargetPropertyNode(e,t){if(!e.key)return!1;const r=d.NodeGuards.isIdentifierNode(e.key)&&e.key.name===t,o=d.NodeGuards.isLiteralNode(e.key)&&Boolean(e.key.value)&&e.key.value===t;return r||o}extract(e,t){if(!d.NodeGuards.isMemberExpressionNode(t))return null;const r=this.createObjectMembersCallsChain([],t);if(!r.length)return null;const o=r[r.length-1],n=this.getCalleeBlockStatement(l.NodeStatementUtils.getParentNodeWithStatements(e[0]),r);return n?{callee:n,name:o}:null}createObjectMembersCallsChain(e,t){if(d.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!d.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return d.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(d.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}getCalleeBlockStatement(e,t){const r=t.shift();if(!r)return null;let o=null;return s.traverse(e,{enter:e=>{if(d.NodeGuards.isVariableDeclaratorNode(e)&&d.NodeGuards.isIdentifierNode(e.id)&&e.init&&d.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===r)return o=this.findCalleeBlockStatement(e.init.properties,t),s.VisitorOption.Break}}),o}findCalleeBlockStatement(e,t){const r=t.shift();if(!r)return null;for(const n of e)if(o.isValidTargetPropertyNode(n,r)){if(d.NodeGuards.isObjectExpressionNode(n.value))return this.findCalleeBlockStatement(n.value.properties,t);if(d.NodeGuards.isFunctionExpressionNode(n.value))return n.value.body}return null}};u=o=n([a.injectable()],u),t.ObjectExpressionCalleeDataExtractor=u},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(34),p=r(4);let m=o=class{constructor(e){this.prevailingKindOfVariables=o.defaultKindOfVariables,this.arrayUtils=e}analyze(e){var t;const r=[];u.traverse(e,{enter:e=>{p.NodeGuards.isVariableDeclarationNode(e)&&r.push(e.kind)}}),this.prevailingKindOfVariables=null!==(t=this.arrayUtils.findMostOccurringElement(r))&&void 0!==t?t:o.defaultKindOfVariables}getPrevailingKind(){return this.prevailingKindOfVariables}};m.defaultKindOfVariables="var",m=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IArrayUtils)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IArrayUtils&&f.IArrayUtils)?n:Object])],m),t.PrevailingKindOfVariablesAnalyzer=m},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=i(r(80)),c=i(r(13)),d=r(43),l=r(4);let u=o=class{constructor(){this.scopeManager=null}static attachMissingRanges(e){c.replace(e,{enter:e=>(e.range||(e.range=[o.emptyRangeValue,o.emptyRangeValue]),e)})}static isRootNode(e){return l.NodeGuards.isProgramNode(e)||e.parentNode===e}analyze(e){const t=o.sourceTypes.length;o.attachMissingRanges(e);for(let r=0;r{if("class"===e.type&&e.upper){if(!e.variables.length)return;const t=e.variables[0],r=e.upper.variables.find(e=>t.defs.some(e=>"ClassName"===e.type)&&e.name===t.name);null==r||r.references.push(...e.variables[0].references)}});for(const t of e.childScopes)this.sanitizeScopes(t)}};u.eslintScopeOptions={ecmaVersion:d.ecmaVersion,optimistic:!0},u.sourceTypes=["script","module"],u.emptyRangeValue=0,u=o=n([a.injectable()],u),t.ScopeAnalyzer=u},function(e,t){e.exports=require("eslint-scope")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(13)),m=r(2),g=r(3),y=r(35),h=r(4),N=r(15),b=r(44);let v=o=class{constructor(e,t,r){this.stringArrayStorageData=new Map,this.stringArrayStorage=e,this.randomGenerator=t,this.options=r}analyze(e){this.options.stringArray&&p.traverse(e,{enter:(e,t)=>{if(t)return N.NodeMetadata.isIgnoredNode(e)?p.VisitorOption.Skip:void(h.NodeGuards.isLiteralNode(e)&&this.analyzeLiteralNode(e,t))}})}getItemDataForLiteralNode(e){return this.stringArrayStorageData.get(e)}analyzeLiteralNode(e,t){"string"==typeof e.value&&(b.NodeLiteralUtils.isProhibitedLiteralNode(e,t)||this.shouldAddValueToStringArray(e.value)&&this.stringArrayStorageData.set(e,this.stringArrayStorage.getOrThrow(e.value)))}shouldAddValueToStringArray(e){return e.length>=o.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}};v.minimumLengthForStringArray=3,v=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.IStringArrayStorage)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==y.IStringArrayStorage&&y.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==m.IOptions&&m.IOptions)?a:Object])],v),t.StringArrayStorageAnalyzer=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(53),s=r(21),c=r(83),d=r(84),l=r(87),u=r(88),f=r(90),p=r(93),m=r(94);t.controlFlowTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(l.CallExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(i.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(54);let h=o=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.BinaryExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}};h.usingExistingIdentifierChance=.5,h=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.BinaryExpressionControlFlowReplacer=h},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(17),y=r(34),h=r(2),N=r(3),b=r(18),v=r(11),I=r(12),S=r(4),O=r(6);let j=o=class extends I.AbstractNodeTransformer{constructor(e,t,r,o){super(r,o),this.controlFlowCustomNodeFactory=e,this.arrayUtils=t}static isProhibitedStatementNode(e){const t=S.NodeGuards.isBreakStatementNode(e)||S.NodeGuards.isContinueStatementNode(e),r=S.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),o=S.NodeGuards.isClassDeclarationNode(e);return S.NodeGuards.isFunctionDeclarationNode(e)||t||r||o}static canTransformBlockStatementNode(e){let t=!0;return m.traverse(e,{enter:e=>{if(S.NodeGuards.isWhileStatementNode(e))return m.VisitorOption.Skip;o.isProhibitedStatementNode(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}getVisitor(e){switch(e){case v.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&S.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!o.canTransformBlockStatementNode(e))return e;const r=e.body,n=this.arrayUtils.createWithRange(r.length),i=this.arrayUtils.shuffle(n),a=n.map(e=>i.indexOf(e)),s=this.controlFlowCustomNodeFactory(b.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);s.initialize(r,i,a);const c=s.getNode()[0];return O.NodeUtils.parentizeNode(c,t),c}};j=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IControlFlowCustomNode)),l(1,f.inject(p.ServiceIdentifiers.IArrayUtils)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TControlFlowCustomNodeFactory&&g.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==h.IOptions&&h.IOptions)?s:Object])],j),t.BlockStatementControlFlowTransformer=j},function(e,t){e.exports=require("acorn")},function(e,t){e.exports=require("acorn-import-meta")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(45),h=r(4);let N=o=class extends y.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){const n=e.callee;if(!h.NodeGuards.isIdentifierNode(n))return e;const i=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionFunctionNode),s=e.arguments;a.initialize(s);const c=this.insertCustomNodeToControlFlowStorage(a,r,i,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),c,n,s)}getControlFlowStorageCallNode(e,t,r,o){const n=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);n.initialize(e,t,r,o);const i=n.getNode()[0];if(!i||!h.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};N.usingExistingIdentifierChance=.5,N=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.CallExpressionControlFlowReplacer=N},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(89),y=r(2),h=r(3),N=r(57),b=r(58),v=r(21),I=r(33),S=r(11),O=r(12),j=r(8),_=r(4),C=r(14),R=r(6);let F=o=class extends O.AbstractNodeTransformer{constructor(e,t,r,o){super(r,o),this.deadCodeInjectionRootAstHostNodeSet=new Set,this.collectedBlockStatements=[],this.collectedBlockStatementsTotalLength=0,this.deadCodeInjectionCustomNodeFactory=e,this.transformersRunner=t}static isProhibitedNodeInsideCollectedBlockStatement(e){return _.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e)||_.NodeGuards.isAwaitExpressionNode(e)||_.NodeGuards.isSuperNode(e)}static isScopeHoistingFunctionDeclaration(e){if(!_.NodeGuards.isFunctionDeclarationNode(e))return!1;const t=C.NodeStatementUtils.getScopeOfNode(e),r=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,o=r.indexOf(e);if(0===o)return!1;const n=r.slice(0,o),i=j.NodeFactory.blockStatementNode(n),a=e.id.name;let s=!1;return m.traverse(i,{enter:e=>{if(_.NodeGuards.isIdentifierNode(e)&&e.name===a)return s=!0,m.VisitorOption.Break}}),s}static isValidCollectedBlockStatementNode(e){if(!e.body.length)return!1;let t=0,r=!0;return m.traverse(e,{enter:e=>{if(_.NodeGuards.isBlockStatementNode(e)&&t++,t>o.maxNestedBlockStatementsCount||o.isProhibitedNodeInsideCollectedBlockStatement(e)||o.isScopeHoistingFunctionDeclaration(e))return r=!1,m.VisitorOption.Break}}),r}static isValidWrappedBlockStatementNode(e){if(!e.body.length)return!1;let t=!0;if(m.traverse(e,{enter:e=>{if(o.isScopeHoistingFunctionDeclaration(e))return t=!1,m.VisitorOption.Break}}),!t)return!1;return C.NodeStatementUtils.getParentNodeWithStatements(e).type!==I.NodeType.Program}getVisitor(e){switch(e){case S.TransformationStage.DeadCodeInjection:return{enter:(e,t)=>{if(t&&_.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),e},leave:(e,t)=>{if(t&&_.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};case S.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:(e,t)=>{if(t&&this.isDeadCodeInjectionRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}analyzeNode(e,t){m.traverse(e,{enter:e=>{if(!_.NodeGuards.isBlockStatementNode(e))return;const t=R.NodeUtils.clone(e);if(!o.isValidCollectedBlockStatementNode(t))return;const r=this.makeClonedBlockStatementNodeUnique(t);this.collectedBlockStatements.push(r)}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}transformNode(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!o.isValidWrappedBlockStatementNode(e))return e;const r=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,r),i=this.collectedBlockStatements.splice(n,1)[0];return i===e?e:this.replaceBlockStatementNode(e,i,t)}restoreNode(e,t){const r=e.body[0];if(!_.NodeGuards.isFunctionDeclarationNode(r))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return r.body}isDeadCodeInjectionRootAstHostNode(e){return _.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}makeClonedBlockStatementNodeUnique(e){const t=j.NodeFactory.functionExpressionNode([],e);return R.NodeUtils.parentizeNode(t,t),R.NodeUtils.parentizeNode(e,t),this.transformersRunner.transform(t,o.transformersToRenameBlockScopeIdentifiers,S.TransformationStage.Obfuscating).body}replaceBlockStatementNode(e,t,r){const n=j.NodeFactory.blockStatementNode([j.NodeFactory.functionDeclarationNode(o.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);const i=this.deadCodeInjectionCustomNodeFactory(b.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);i.initialize(e,n);const a=i.getNode()[0];return R.NodeUtils.parentizeNode(a,r),a}};F.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",F.maxNestedBlockStatementsCount=4,F.minCollectedBlockStatementsCount=5,F.transformersToRenameBlockScopeIdentifiers=[v.NodeTransformer.LabeledStatementTransformer,v.NodeTransformer.ScopeIdentifiersTransformer],F=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),l(1,f.inject(p.ServiceIdentifiers.ITransformersRunner)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TDeadNodeInjectionCustomNodeFactory&&g.TDeadNodeInjectionCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.ITransformersRunner&&N.ITransformersRunner)?i:Object,"function"==typeof(a=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==y.IOptions&&y.IOptions)?s:Object])],F),t.DeadCodeInjectionTransformer=F},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=f(r(13)),y=r(17),h=r(91),N=r(92),b=r(2),v=r(3),I=r(18),S=r(53),O=r(33),j=r(11),_=r(12),C=r(19),R=r(4),F=r(15),T=r(14),w=r(6);let x=o=class extends _.AbstractNodeTransformer{constructor(e,t,r,o,n){super(o,n),this.controlFlowData=new Map,this.visitedFunctionNodes=new Set,this.hostNodesWithControlFlowNode=new Set,this.controlFlowStorageFactory=e,this.controlFlowReplacerFactory=t,this.controlFlowCustomNodeFactory=r}getVisitor(e){switch(e){case j.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.visitedFunctionNodes.add(e),!R.NodeGuards.isBlockStatementNode(e.body))return e;const r=this.getHostNode(e.body),o=this.getControlFlowStorage(r);if(this.controlFlowData.set(r,o),this.transformFunctionBody(e.body,o),!o.getLength())return e;const n=this.controlFlowCustomNodeFactory(I.ControlFlowCustomNode.ControlFlowStorageNode);return n.initialize(o),C.NodeAppender.prepend(r,n.getNode()),this.hostNodesWithControlFlowNode.add(r),w.NodeUtils.parentizeAst(e),e}getControlFlowStorage(e){const t=this.controlFlowStorageFactory();if(this.controlFlowData.has(e)){this.hostNodesWithControlFlowNode.has(e)&&(R.NodeGuards.isSwitchCaseNode(e)?e.consequent.shift():e.body.shift());const r=this.controlFlowData.get(e);t.mergeWith(r,!0)}return t}getHostNode(e){const t=T.NodeStatementUtils.getParentNodesWithStatements(e);return 1===t.length?e:(t.pop(),t.length>o.hostNodeSearchMinDepth&&t.splice(0,o.hostNodeSearchMinDepth),t.length>o.hostNodeSearchMaxDepth&&(t.length=o.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}isVisitedFunctionNode(e){return(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}transformFunctionBody(e,t){g.replace(e,{enter:(e,r)=>{if(F.NodeMetadata.isIgnoredNode(e))return g.VisitorOption.Skip;if(this.isVisitedFunctionNode(e)||!r)return g.VisitorOption.Skip;if(!o.controlFlowReplacersMap.has(e.type))return e;if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold)return e;const n=o.controlFlowReplacersMap.get(e.type);return void 0===n?e:Object.assign(Object.assign({},this.controlFlowReplacerFactory(n).replace(e,r,t)),{parentNode:r})}})}};x.controlFlowReplacersMap=new Map([[O.NodeType.BinaryExpression,S.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[O.NodeType.CallExpression,S.ControlFlowReplacer.CallExpressionControlFlowReplacer],[O.NodeType.LogicalExpression,S.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[O.NodeType.Literal,S.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),x.hostNodeSearchMinDepth=0,x.hostNodeSearchMaxDepth=2,x=o=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),u(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),u(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==N.TControlFlowStorageFactory&&N.TControlFlowStorageFactory)?n:Object,"function"==typeof(i=void 0!==h.TControlFlowReplacerFactory&&h.TControlFlowReplacerFactory)?i:Object,"function"==typeof(a=void 0!==y.TControlFlowCustomNodeFactory&&y.TControlFlowCustomNodeFactory)?a:Object,"function"==typeof(s=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==b.IOptions&&b.IOptions)?c:Object])],x),t.FunctionControlFlowTransformer=x},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(54),h=r(4),N=r(6);let b=o=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){if(this.checkForProhibitedExpressions(e.left,e.right))return e;const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.LogicalExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}checkForProhibitedExpressions(e,t){return[e,t].some(e=>{let t;return t=h.NodeGuards.isUnaryExpressionNode(e)?N.NodeUtils.getUnaryExpressionArgumentNode(e):e,!(h.NodeGuards.isLiteralNode(t)||h.NodeGuards.isIdentifierNode(t)||h.NodeGuards.isObjectExpressionNode(t)||h.NodeGuards.isExpressionStatementNode(t))})}};b.usingExistingIdentifierChance=.5,b=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionControlFlowReplacer=b},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(45),h=r(4);let N=o=class extends y.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){if(h.NodeGuards.isPropertyNode(t)&&t.key===e)return e;if("string"!=typeof e.value||e.value.length<3)return e;const n=String(e.value),i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralNode);i.initialize(e.value);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a)}getControlFlowStorageCallNode(e,t){const r=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode);r.initialize(e,t);const o=r.getNode()[0];if(!o||!h.NodeGuards.isExpressionStatementNode(o))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return o.expression}};N.usingExistingIdentifierChance=1,N=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.StringLiteralControlFlowReplacer=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(16),i=r(1),a=r(21),s=r(59),c=r(96),d=r(98),l=r(99),u=r(100),f=r(102),p=r(103),m=r(104),g=r(105);t.convertingTransformersModule=new o.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.MemberExpressionTransformer).whenTargetNamed(a.NodeTransformer.MemberExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(l.MethodDefinitionTransformer).whenTargetNamed(a.NodeTransformer.MethodDefinitionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.ObjectExpressionKeysTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionKeysTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.ObjectExpressionTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.SplitStringTransformer).whenTargetNamed(a.NodeTransformer.SplitStringTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.TemplateLiteralTransformer).whenTargetNamed(a.NodeTransformer.TemplateLiteralTransformer),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(c.ObjectExpressionToVariableDeclarationExtractor).whenTargetNamed(s.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(g.BasePropertiesExtractor).whenTargetNamed(s.ObjectExpressionExtractor.BasePropertiesExtractor),e(i.ServiceIdentifiers.Factory__IObjectExpressionExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObjectExpressionExtractor))})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(97),l=r(60),u=r(19),f=r(4),p=r(14),m=r(6);let g=class{constructor(e){this.objectExpressionKeysTransformerCustomNodeFactory=e}extract(e,t){return this.transformObjectExpressionToVariableDeclaration(e,t)}transformObjectExpressionToVariableDeclaration(e,t){const r=e.properties,o=this.getObjectExpressionHostNode(r),n=this.getObjectExpressionIdentifierNode(o),i=this.getObjectExpressionNode(o),a=[o],s=p.NodeStatementUtils.getScopeOfNode(t);return u.NodeAppender.insertBefore(s,a,t),m.NodeUtils.parentizeAst(o),m.NodeUtils.parentizeNode(o,s),{nodeToReplace:n,objectExpressionHostStatement:o,objectExpressionNode:i}}getObjectExpressionHostNode(e){const t=this.objectExpressionKeysTransformerCustomNodeFactory(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode);t.initialize(e);const r=t.getNode()[0];if(!r||!f.NodeGuards.isVariableDeclarationNode(r))throw new Error("`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node");return r}getObjectExpressionIdentifierNode(e){const t=e.declarations[0].id;if(!f.NodeGuards.isIdentifierNode(t))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property");return t}getObjectExpressionNode(e){var t;const r=null!==(t=e.declarations[0].init)&&void 0!==t?t:null;if(!r||!f.NodeGuards.isObjectExpressionNode(r))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property");return r}};g=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)),i("design:paramtypes",["function"==typeof(o=void 0!==d.TObjectExpressionKeysTransformerCustomNodeFactory&&d.TObjectExpressionKeysTransformerCustomNodeFactory)?o:Object])],g),t.ObjectExpressionToVariableDeclarationExtractor=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(8),g=r(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isMemberExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(g.NodeGuards.isIdentifierNode(e.property)){if(e.computed)return e;e.computed=!0,e.property=m.NodeFactory.literalNode(e.property.name)}return e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MemberExpressionTransformer=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(11),m=r(12),g=r(8),y=r(4);let h=o=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&y.NodeGuards.isMethodDefinitionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return y.NodeGuards.isIdentifierNode(e.key)?this.replaceIdentifierKey(e,e.key):y.NodeGuards.isLiteralNode(e.key)?this.replaceLiteralKey(e,e.key):e}replaceIdentifierKey(e,t){return o.ignoredNames.includes(t.name)||e.computed||(e.computed=!0,e.key=g.NodeFactory.literalNode(t.name)),e}replaceLiteralKey(e,t){return"string"!=typeof t.value||o.ignoredNames.includes(t.value)||e.computed||(e.computed=!0),e}};h.ignoredNames=["constructor"],h=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.MethodDefinitionTransformer=h},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(13)),m=r(101),g=r(2),y=r(3),h=r(11),N=r(12),b=r(4),v=r(14),I=r(59);let S=o=class extends N.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.objectExpressionExtractorFactory=e}static isProhibitedHostStatement(e,t){return o.isReferencedIdentifierName(e,t)}static isReferencedIdentifierName(e,t){const r=[];let o=!1,n=!1;return p.traverse(t,{enter:t=>{t===e&&(n=!0),b.NodeGuards.isIdentifierNode(t)&&(n?r.includes(t.name)&&(o=!0):r.push(t.name))},leave:t=>{if(t===e)return n=!1,p.VisitorOption.Break}}),o}getVisitor(e){if(!this.options.transformObjectKeys)return null;switch(e){case h.TransformationStage.Converting:return{leave:(e,t)=>{if(t&&b.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(!e.properties.length)return e;const r=v.NodeStatementUtils.getRootStatementOfNode(e);return o.isProhibitedHostStatement(e,r)?e:this.applyObjectExpressionKeysExtractorsRecursive(o.objectExpressionExtractorNames,e,r)}applyObjectExpressionKeysExtractorsRecursive(e,t,r){const o=[...e],n=o.shift();if(!n)return t;const{nodeToReplace:i,objectExpressionHostStatement:a,objectExpressionNode:s}=this.objectExpressionExtractorFactory(n).extract(t,r);return this.applyObjectExpressionKeysExtractorsRecursive(o,s,a),i}};S.objectExpressionExtractorNames=[I.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor,I.ObjectExpressionExtractor.BasePropertiesExtractor],S=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.Factory__IObjectExpressionExtractor)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==m.TObjectExpressionExtractorFactory&&m.TObjectExpressionExtractorFactory)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],S),t.ObjectExpressionKeysTransformer=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(8),g=r(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return e.properties.forEach(e=>{e.key&&(e.computed?this.transformComputedProperty(e):this.transformBaseProperty(e))}),e}transformComputedProperty(e){g.NodeGuards.isLiteralNode(e.key)&&"string"==typeof e.key.value&&(e.key=m.NodeFactory.literalNode(e.key.value))}transformBaseProperty(e){e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=m.NodeFactory.literalNode(e.key.name))}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.ObjectExpressionTransformer=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(2),m=r(3),g=r(21),y=r(11),h=r(12),N=r(8),b=r(4),v=r(44),I=r(6);let S=o=class extends h.AbstractNodeTransformer{constructor(e,t){super(e,t),this.runAfter=[g.NodeTransformer.ObjectExpressionKeysTransformer,g.NodeTransformer.TemplateLiteralTransformer]}static chunkString(e,t){const r=Math.ceil(e.length/t),o=[];let n=0;for(let i=0;i{if(this.options.splitStrings)return t&&b.NodeGuards.isLiteralNode(e)?this.transformNode(e,t):void 0}};default:return null}}transformNode(e,t){if(v.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;const r=this.transformLiteralNodeByChunkLength(e,t,o.firstPassChunkLength);return f.replace(r,{enter:(e,t)=>{if(t&&b.NodeGuards.isLiteralNode(e))return this.transformLiteralNodeByChunkLength(e,t,this.options.splitStringsChunkLength)}})}transformLiteralNodeByChunkLength(e,t,r){if("string"!=typeof e.value)return e;if(r>=e.value.length)return e;const n=o.chunkString(e.value,r),i=this.transformStringChunksToBinaryExpressionNode(n);return I.NodeUtils.parentizeAst(i),I.NodeUtils.parentizeNode(i,t),i}transformStringChunksToBinaryExpressionNode(e){const t=e.shift(),r=e.shift();if(!t||!r)throw new Error("First and second chunks values should not be empty");const o=N.NodeFactory.binaryExpressionNode("+",N.NodeFactory.literalNode(t),N.NodeFactory.literalNode(r));return e.reduce((e,t)=>{const r=N.NodeFactory.literalNode(t);return N.NodeFactory.binaryExpressionNode("+",e,r)},o)}};S.firstPassChunkLength=1e3,S=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],S),t.SplitStringTransformer=S},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(11),m=r(12),g=r(8),y=r(4),h=r(6);let N=o=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}static isLiteralNodeWithStringValue(e){return!!e&&y.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}static isValidTemplateLiteralNode(e,t){return y.NodeGuards.isTemplateLiteralNode(e)&&!y.NodeGuards.isTaggedTemplateExpressionNode(t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&o.isValidTemplateLiteralNode(e,t))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const r=e.expressions;let n,i=[];if(e.quasis.forEach(e=>{i.push(g.NodeFactory.literalNode(e.value.cooked));const t=r.shift();t&&i.push(t)}),i=i.filter(e=>!(y.NodeGuards.isLiteralNode(e)&&""===e.value)),o.isLiteralNodeWithStringValue(i[0])||o.isLiteralNodeWithStringValue(i[1])||i.unshift(g.NodeFactory.literalNode("")),i.length>1){let e=g.NodeFactory.binaryExpressionNode("+",i.shift(),i.shift());i.forEach(t=>{e=g.NodeFactory.binaryExpressionNode("+",e,t)}),n=e}else n=i[0];return h.NodeUtils.parentizeAst(n),h.NodeUtils.parentizeNode(n,t),n}};N=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.TemplateLiteralTransformer=N},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(19),s=r(8),c=r(4),d=r(14);let l=o=class{static getPropertyNodeKeyName(e){const t=e.key;return!c.NodeGuards.isLiteralNode(t)||"string"!=typeof t.value&&"number"!=typeof t.value?c.NodeGuards.isIdentifierNode(t)?t.name:null:t.value.toString()}static isProhibitedPattern(e){return!e||c.NodeGuards.isObjectPatternNode(e)||c.NodeGuards.isArrayPatternNode(e)||c.NodeGuards.isAssignmentPatternNode(e)||c.NodeGuards.isRestElementNode(e)}extract(e,t){const r=e.parentNode;return r&&c.NodeGuards.isVariableDeclaratorNode(r)&&c.NodeGuards.isIdentifierNode(r.id)?this.transformObjectExpressionNode(e,t,r.id):{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}transformObjectExpressionNode(e,t,r){const o=e.properties,[n,i]=this.extractPropertiesToExpressionStatements(o,t,r),s=d.NodeStatementUtils.getScopeOfNode(t);return this.filterExtractedObjectExpressionProperties(e,i),a.NodeAppender.insertAfter(s,n,t),{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}extractPropertiesToExpressionStatements(e,t,r){const n=e.length,i=[],a=[];for(let d=0;d!t.includes(r))}};l=o=n([i.injectable()],l),t.BasePropertiesExtractor=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(18),s=r(23),c=r(61),d=r(58),l=r(60),u=r(107),f=r(108),p=r(109),m=r(110),g=r(111),y=r(112),h=r(115),N=r(116),b=r(117),v=r(118),I=r(119),S=r(120),O=r(122),j=r(124),_=r(126),C=r(128),R=r(130),F=r(134),T=r(136),w=r(137),x=r(138),E=r(140),G=r(142),P=r(149),A=r(151),M=r(154),D=r(155);t.customNodesModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICustomNode).to(O.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(i.ServiceIdentifiers.ICustomNode).to(_.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(i.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(i.ServiceIdentifiers.ICustomNode).to(R.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(F.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(i.ServiceIdentifiers.ICustomNode).to(x.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(E.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(i.ServiceIdentifiers.ICustomNode).to(G.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(i.ServiceIdentifiers.ICustomNode).to(P.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(i.ServiceIdentifiers.ICustomNode).to(A.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.BinaryExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BlockStatementControlFlowFlatteningNode).whenTargetNamed(a.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(I.CallExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(S.ControlFlowStorageNode).whenTargetNamed(a.ControlFlowCustomNode.ControlFlowStorageNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(T.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(w.LogicalExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(D.StringLiteralNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(M.StringLiteralControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(b.BlockStatementDeadCodeInjectionNode).whenTargetNamed(d.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.ObjectExpressionVariableDeclarationHostNode).whenTargetNamed(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode),e(i.ServiceIdentifiers.ICustomNodeGroup).to(u.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(f.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(p.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(m.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(g.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(i.ServiceIdentifiers.Factory__ICustomNode).toFactory(o.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNode)),e(i.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions)),e(i.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(o.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNodeGroup)),e(i.ServiceIdentifiers.ICustomNodeFormatter).to(j.CustomNodeFormatter).inSingletonScope()})},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),h=r(7),N=r(23),b=r(22),v=r(27),I=r(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.ConsoleOutputDisableExpressionNode,o=>{I.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,r,1):e;I.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.disableConsoleOutput)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.ConsoleOutputDisableExpressionNode),r=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,r)}};c([h.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.ConsoleOutputCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),h=r(7),N=r(23),b=r(22),v=r(27),I=r(19),S=r(4);let O=class extends v.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionCallNode,o=>{I.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionNode,t=>{I.NodeAppender.append(e,t.getNode())}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionIntervalNode,t=>{const r=S.NodeGuards.isSwitchCaseNode(e)?e.consequent.length:e.body.length,o=this.randomGenerator.getRandomInteger(0,r);I.NodeAppender.insertAtIndex(e,t.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,r,1):e;I.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.debugProtection)return;const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionNode),o=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionCallNode),n=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);r.initialize(e),o.initialize(e,t),n.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(N.CustomNode.DebugProtectionFunctionNode,r),this.customNodes.set(N.CustomNode.DebugProtectionFunctionCallNode,o),this.options.debugProtectionInterval&&this.customNodes.set(N.CustomNode.DebugProtectionFunctionIntervalNode,n),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,i)}};c([h.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],O.prototype,"customNodes",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.DebugProtectionCustomNodeGroup=O},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),h=r(7),N=r(23),b=r(22),v=r(27),I=r(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DomainLockNode,o=>{I.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,r,1):e;I.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.domainLock.length)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.DomainLockNode),r=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.DomainLockNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,r)}};c([h.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.DomainLockCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),h=r(7),N=r(23),b=r(22),v=r(27),I=r(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.SelfDefendingUnicodeNode,o=>{I.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,r,1):e;I.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.selfDefending)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.SelfDefendingUnicodeNode),r=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,r)}};c([h.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.SelfDefendingCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=r(26),g=r(5),y=r(2),h=r(3),N=r(35),b=r(7),v=r(23),I=r(22),S=r(27),O=r(19);let j=class extends S.AbstractCustomNodeGroup{constructor(e,t,r,o,n){super(r,o,n),this.appendEvent=I.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e,this.stringArrayStorage=t}appendCustomNodes(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(v.CustomNode.StringArrayNode,t=>{O.NodeAppender.prepend(e,t.getNode())}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayCallsWrapper,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayRotateFunctionNode,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}))}initialize(){if(this.customNodes=new Map,!this.options.stringArray)return;const e=this.customNodeFactory(v.CustomNode.StringArrayNode),t=this.customNodeFactory(v.CustomNode.StringArrayCallsWrapper),r=this.customNodeFactory(v.CustomNode.StringArrayRotateFunctionNode),o=this.stringArrayStorage.getStorageName(),n=this.stringArrayStorage.getStorageCallsWrapperName(),i=this.stringArrayStorage.getRotationAmount();e.initialize(this.stringArrayStorage,o),t.initialize(o,n),r.initialize(o,i),this.customNodes.set(v.CustomNode.StringArrayNode,e),this.customNodes.set(v.CustomNode.StringArrayCallsWrapper,t),this.options.rotateStringArray&&this.customNodes.set(v.CustomNode.StringArrayRotateFunctionNode,r)}};d([b.initializable(),l("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],j.prototype,"customNodes",void 0),j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.Factory__ICustomNode)),u(1,f.inject(p.ServiceIdentifiers.IStringArrayStorage)),u(2,f.inject(p.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u(3,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(4,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==m.TCustomNodeFactory&&m.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.IStringArrayStorage&&N.IStringArrayStorage)?i:Object,"function"==typeof(a=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.StringArrayCustomNodeGroup=j},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),h=r(8);let N=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.properties=e}getNodeStructure(e){return[h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()),h.NodeFactory.objectExpressionNode(this.properties))],"const")]}};N=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.ObjectExpressionVariableDeclarationHostNode=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n let that;\n \n try {\n const getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n const getGlobal = function () {\n let globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n const that = getGlobal();\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),h=r(8),N=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.binaryExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BinaryExpressionFunctionNode=b},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),h=r(10),N=r(8),b=r(4),v=r(6);let I=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=r}getNodeStructure(e){const t=this.randomGenerator.getRandomString(6),r=this.randomGenerator.getRandomString(6),o=N.NodeFactory.blockStatementNode([N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(t),N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join("|")),N.NodeFactory.identifierNode("split")),[N.NodeFactory.literalNode("|")]))],"const"),N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(r),N.NodeFactory.literalNode(0))],"let"),N.NodeFactory.whileStatementNode(N.NodeFactory.literalNode(!0),N.NodeFactory.blockStatementNode([N.NodeFactory.switchStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(t),N.NodeFactory.updateExpressionNode("++",N.NodeFactory.identifierNode(r)),!0),this.shuffledKeys.map((e,t)=>{const r=this.blockStatementBody[e],o=[r];return b.NodeGuards.isReturnStatementNode(r)||o.push(N.NodeFactory.continueStatement()),N.NodeFactory.switchCaseNode(N.NodeFactory.literalNode(String(t)),o)})),N.NodeFactory.breakStatement()]))]);return v.NodeUtils.parentizeAst(o),[o]}};s([y.initializable(),c("design:type",Array)],I.prototype,"blockStatementBody",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"originalKeysIndexesInShuffledArray",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"shuffledKeys",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.BlockStatementControlFlowFlatteningNode=I},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),h=r(8),N=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.blockStatementNode=e,this.deadCodeInjectionRootAstHostNode=t}getNodeStructure(e){const t=this.randomGenerator.getMathRandom()>.5,r=this.randomGenerator.getMathRandom()>.5,o=t?"===":"!==",n=this.randomGenerator.getRandomString(5),i=r?n:this.randomGenerator.getRandomString(5),[a,s]=t===r?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],c=h.NodeFactory.blockStatementNode([h.NodeFactory.ifStatementNode(h.NodeFactory.binaryExpressionNode(o,h.NodeFactory.literalNode(n),h.NodeFactory.literalNode(i)),a,s)]);return N.NodeUtils.parentizeAst(c),[c]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BlockStatementDeadCodeInjectionNode=b},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),h=r(7),N=r(10),b=r(8),v=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r,o){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.callee=r,this.expressionArguments=o}getNodeStructure(){const e=b.NodeFactory.expressionStatementNode(b.NodeFactory.callExpressionNode(b.NodeFactory.memberExpressionNode(b.NodeFactory.identifierNode(this.controlFlowStorageName),b.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.callee,...this.expressionArguments]));return v.NodeUtils.parentizeAst(e),[e]}};c([h.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof ESTree&&ESTree.Expression)?o:Object)],I.prototype,"callee",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageName",void 0),c([h.initializable(),d("design:type",Array)],I.prototype,"expressionArguments",void 0),I=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],I),t.CallExpressionControlFlowStorageCallNode=I},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),h=r(10),N=r(8),b=r(6);let v=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.expressionArguments=e}getNodeStructure(e){const t=N.NodeFactory.identifierNode("callee"),r=[],o=this.expressionArguments.length;for(let e=0;e=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(121),m=r(5),g=r(2),y=r(3),h=r(9),N=r(7),b=r(10),v=r(8),I=r(4),S=r(6);let O=class extends b.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.controlFlowStorage=e}getNodeStructure(e){const t=Array.from(this.controlFlowStorage.getStorage()).map(([e,t])=>{const r=t.getNode()[0];if(!I.NodeGuards.isExpressionStatementNode(r))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return v.NodeFactory.propertyNode(v.NodeFactory.identifierNode(e),r.expression)});let r=v.NodeFactory.variableDeclarationNode([v.NodeFactory.variableDeclaratorNode(v.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()),v.NodeFactory.objectExpressionNode(t))],"const");return r=S.NodeUtils.parentizeAst(r),[r]}};c([N.initializable(),d("design:type","function"==typeof(o=void 0!==p.TControlFlowStorage&&p.TControlFlowStorage)?o:Object)],O.prototype,"controlFlowStorage",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.ControlFlowStorageNode=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(20),h=r(123),N=r(47),b=r(7),v=r(10),I=r(6);let S=class extends v.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():N.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(h.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([b.initializable(),c("design:type",String)],S.prototype,"callsControllerFunctionName",void 0),S=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],S),t.ConsoleOutputDisableExpressionNode=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n const c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.table = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.table = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=s(r(13)),f=c(r(125)),p=r(62),m=r(4);let g=class{constructor(e){this.prevailingKindOfVariables=e.getPrevailingKind()}formatTemplate(e,t){return f.default(e,t)}formatStructure(e){for(const t of e)u.replace(t,{enter:e=>{if(m.NodeGuards.isVariableDeclarationNode(e))return"var"===this.prevailingKindOfVariables&&(e.kind="var"),e}});return e}};g=n([d.injectable(),a(0,d.inject(l.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),i("design:paramtypes",["function"==typeof(o=void 0!==p.IPrevailingKindOfVariablesAnalyzer&&p.IPrevailingKindOfVariablesAnalyzer)?o:Object])],g),t.CustomNodeFormatter=g},function(e,t){e.exports=require("string-template")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),h=r(127),N=r(10),b=r(6);let v=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"callsControllerFunctionName",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionCallNode=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(\n this,\n function () {\n const regExp1 = new RegExp('function *\\\\( *\\\\)');\n const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');\n \n const result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n }\n )();\n })();\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),h=r(129),N=r(10),b=r(6);let v=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionIntervalNode=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(20),h=r(7),N=r(131),b=r(132),v=r(133),I=r(10),S=r(6);let O=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?N.DebuggerTemplate():b.DebuggerTemplateNoEval();return this.customNodeFormatter.formatTemplate(v.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([h.initializable(),c("design:type",String)],O.prototype,"debugProtectionFunctionName",void 0),O=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],O),t.DebugProtectionFunctionNode=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n const func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(48),g=r(2),y=r(3),h=r(9),N=r(20),b=r(7),v=r(135),I=r(47),S=r(10),O=r(6);let j=class extends S.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.cryptUtils=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.domainLock.join(";"),[t,r]=this.cryptUtils.hideString(e,3*e.length),o=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():I.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(v.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:r,domains:t,globalVariableTemplate:o,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([b.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.ICryptUtils)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.ICryptUtils&&m.ICryptUtils)?s:Object])],j),t.DomainLockNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n const func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (let i = 0; i < 1000; i--) {\n const isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n const regExp = new RegExp("[{diff}]", "g");\n const domains = "{domains}".replace(regExp, "").split(";");\n let document;\n let domain;\n let location;\n let hostname;\n\n for (let d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (let d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n\n if (!("~" > domain)) {\n for (let d2 in that[document]) {\n if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) {\n location = d2;\n \n break;\n }\n }\n\n for (let d3 in that[document][location]) {\n if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) {\n hostname = d3;\n \n break;\n }\n }\n }\n \n if (!document || !that[document]) {\n return;\n }\n \n const documentDomain = that[document][domain];\n const documentLocationHostName = !!that[document][location] && that[document][location][hostname];\n const currentDomain = documentDomain || documentLocationHostName;\n \n if (!currentDomain) {\n return;\n }\n \n let ok = false;\n \n for (let i = 0; i < domains.length; i++) {\n const domain = domains[i];\n const position = currentDomain.length - domain.length;\n const lastIndex = currentDomain.indexOf(domain, position);\n const endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),h=r(10),N=r(8),b=r(6);let v=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r,o){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=r,this.rightValue=o}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.ExpressionWithOperatorControlFlowStorageCallNode=v},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),h=r(8),N=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.logicalExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionFunctionNode=b},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(22),h=r(7),N=r(139),b=r(36),v=r(10),I=r(25),S=r(6),O=r(9);let j=class extends v.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.appendEvent===y.ObfuscationEvent.AfterObfuscation?I.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed})).getObfuscatedCode():this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([h.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),c([h.initializable(),d("design:type","function"==typeof(o=void 0!==y.ObfuscationEvent&&y.ObfuscationEvent)?o:Object)],j.prototype,"appendEvent",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==O.ICustomNodeFormatter&&O.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],j),t.NodeCallsControllerFunctionNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n const {singleNodeCallControllerFunctionName} = (function(){\n let firstCall = true;\n \n return function (context, fn){\n const rfn = firstCall ? function(){\n if(fn){\n const res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),h=r(9),N=r(7),b=r(36),v=r(141),I=r(10),S=r(25),O=r(6);let j=class extends I.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return S.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],j),t.SelfDefendingUnicodeNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return !regExp.test(func1.toString());\n };\n \n const test2 = function () {\n const regExp = new RegExp('${e.encode("(\\\\[x|u](\\w){2,4})+",!0)}');\n \n return regExp.test(func2.toString());\n };\n \n const recursiveFunc1 = function (string) {\n const i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n const recursiveFunc2 = function (string) {\n const i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+"")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n `}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),h=r(9),N=r(20),b=r(24),v=r(7),I=r(36),S=r(143),O=r(47),j=r(144),_=r(145),C=r(146),R=r(147),F=r(148),T=r(10),w=r(25),x=r(6);let E=class extends T.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}getNodeStructure(e){return x.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.getDecodeStringArrayTemplate();return w.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(R.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),Object.assign(Object.assign({},I.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}getDecodeStringArrayTemplate(){const e=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():O.GlobalVariableNoEvalTemplate(),t=this.customNodeFormatter.formatTemplate(S.AtobTemplate(),{globalVariableTemplate:e});let r="",o="";switch(this.options.selfDefending&&(o=this.customNodeFormatter.formatTemplate(_.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case b.StringArrayEncoding.Rc4:r=this.customNodeFormatter.formatTemplate(F.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:j.Rc4Template(),selfDefendingCode:o,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case b.StringArrayEncoding.Base64:r=this.customNodeFormatter.formatTemplate(C.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:o,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return r}};c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayName",void 0),c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayCallsWrapperName",void 0),E=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],E),t.StringArrayCallsWrapper=E},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n const str = String(input).replace(/=+$/, '');\n let output = '';\n for (\n let bc = 0, bs, buffer, idx = 0;\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n }\n );\n })();\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n const rc4 = function (str, key) {\n let s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (let k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n let i;\n \t \n\t for (i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (let y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){const r=e.getRandomString(6),o=e.getRandomString(6),n=e.getRandomString(6),i=e.getRandomString(6),a=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),d=e.getRandomString(6),l=e.getRandomString(6);return`\n const StatesClass = function (${r}) {\n this.${r} = ${r};\n this.${o} = [1, 0, 0];\n this.${n} = function(){return 'newState';};\n this.${i} = '${t.encode("\\w+ *\\(\\) *{\\w+ *",!0)}';\n this.${a} = '${t.encode("['|\"].+['|\"];? *}",!0)}';\n };\n \n StatesClass.prototype.${s} = function () {\n const regExp = new RegExp(this.${i} + this.${a});\n const expression = regExp.test(this.${n}.toString())\n ? --this.${o}[1]\n : --this.${o}[0];\n \n return this.${c}(expression);\n };\n \n StatesClass.prototype.${c} = function (${l}) {\n if (!Boolean(~${l})) {\n return ${l};\n }\n \n return this.${d}(this.${r});\n };\n\n StatesClass.prototype.${d} = function (${r}) {\n for (let i = 0, len = this.${o}.length; i < len; i++) {\n this.${o}.push(Math.round(Math.random()));\n len = this.${o}.length;\n }\n \n return ${r}(this.${o}[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).${s}();\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){const t=e.getRandomString(6),r=e.getRandomString(6),o=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.${r} = function (str) {\n const string = atob(str);\n let newStringChars = [];\n \n for (let i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.${o} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${o}[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.${r}(value);\n {stringArrayCallsWrapperName}.${o}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n const {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n let value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){const t=e.getRandomString(6),r=e.getRandomString(6),o=e.getRandomString(6),n=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.${r} = rc4;\n \n {stringArrayCallsWrapperName}.${o} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${o}[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.${n} === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.${n} = true;\n }\n \n value = {stringArrayCallsWrapperName}.${r}(value, key);\n {stringArrayCallsWrapperName}.${o}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),h=r(35),N=r(7),b=r(150),v=r(10),I=r(6);let S=class extends v.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.stringArrayStorage=e,this.stringArrayName=t}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(b.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}};c([N.initializable(),d("design:type","function"==typeof(o=void 0!==h.IStringArrayStorage&&h.IStringArrayStorage)?o:Object)],S.prototype,"stringArrayStorage",void 0),c([N.initializable(),d("design:type",String)],S.prototype,"stringArrayName",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],S),t.StringArrayNode=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n const {stringArrayName} = [{stringArray}];\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),h=r(9),N=r(7),b=r(36),v=r(152),I=r(153),S=r(10),O=r(25),j=r(6),_=r(37);let C=class extends S.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayRotationAmount=t}getNodeStructure(e){return j.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate();let r="";return r=this.options.selfDefending?this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):`${t}(++${e})`,O.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(I.StringArrayRotateFunctionTemplate(),{code:r,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotationAmount:_.NumberUtils.toHex(this.stringArrayRotationAmount),whileFunctionName:t}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],C.prototype,"stringArrayName",void 0),c([N.initializable(),d("design:type",Number)],C.prototype,"stringArrayRotationAmount",void 0),C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.StringArrayRotateFunctionNode=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const selfDefendingFunc = function () {\n const object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n let updatedCookie = name + "=" + value;\n let i = 0;\n \n for (let i = 0, len = options.length; i < len; i++) {\n const propName = options[i];\n \n updatedCookie += "; " + propName;\n \n const propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += "=" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n const matches = document(new RegExp(\n "(?:^|; )" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + "=([^;]*)"\n ));\n \n const func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n let cookie = '';\n const result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n const {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotationAmount});\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),h=r(10),N=r(8),b=r(6);let v=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.StringLiteralControlFlowStorageCallNode=v},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),h=r(10),N=r(8);let b=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.literalValue=e}getNodeStructure(e){return[N.NodeFactory.expressionStatementNode(N.NodeFactory.literalNode(this.literalValue))]}};s([y.initializable(),c("design:type",String)],b.prototype,"literalValue",void 0),b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.StringLiteralNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0);t.finalizingTransformersModule=new o.ContainerModule(e=>{})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(31),a=r(158),s=r(159),c=r(160);t.generatorsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(a.DictionaryIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(c.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(n.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(){let e=null;return t=>r=>{if(e)return e;let o;switch(r.identifierNamesGenerator){case i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return e=o,o}}())})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(34),p=r(2),m=r(3),g=r(49);let y=o=class extends g.AbstractIdentifierNamesGenerator{constructor(e,t,r){super(e,t),this.arrayUtils=r,this.identifierNamesSet=new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)),this.identifiersIterator=this.identifierNamesSet.values()}static incrementIdentifierName(e){let t="",r=!1;for(const o of e)r||o!==o.toUpperCase()?r||o!==o.toLowerCase()?t+=o:(t+=o.toUpperCase(),r=!0):t+=o.toLowerCase();return r?t:null}generate(){if(!this.identifierNamesSet.size)throw new Error("Too many identifiers in the code, add more words to identifiers dictionary");const e=this.identifiersIterator.next();return e.done?(this.identifierNamesSet=new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])),this.identifiersIterator=this.identifierNamesSet.values(),this.generate()):e.value}generateWithPrefix(){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate()}`.replace("__","_")}getInitialIdentifierNames(e){const t=e.filter(Boolean).map(e=>e.toLowerCase());return this.arrayUtils.shuffle(t)}getIncrementedIdentifierNames(e){const t=[];for(const r of e){const e=o.incrementIdentifierName(r);e&&t.push(e)}return this.arrayUtils.shuffle(t)}};y=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(1,l.inject(u.ServiceIdentifiers.IOptions)),d(2,l.inject(u.ServiceIdentifiers.IArrayUtils)),c("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object,"function"==typeof(a=void 0!==f.IArrayUtils&&f.IArrayUtils)?a:Object])],y),t.DictionaryIdentifierNamesGenerator=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(49),m=r(37),g=r(30);let y=o=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.randomVariableNameSet=new Set}generate(e){const t=this.randomGenerator.getRandomInteger(1e4,99999999),r=m.NumberUtils.toHex(t),n=g.Utils.hexadecimalPrefix.length+1,i=e?e-n:o.baseIdentifierNameLength,a=r.substr(0,i),s=`_${g.Utils.hexadecimalPrefix}${a}`;return this.randomVariableNameSet.has(s)?this.generate(e):(this.randomVariableNameSet.add(s),s)}generateWithPrefix(e){const t=this.generate(e);return`${this.options.identifiersPrefix}${t}`.replace("__","_")}};y.baseIdentifierNameLength=6,y=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],y),t.HexadecimalIdentifierNamesGenerator=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(49);let m=o=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.previousMangledName=o.initMangledNameCharacter}generate(e){const t=this.generateNewMangledName(this.previousMangledName);return this.previousMangledName=t,t}generateWithPrefix(e){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate(e)}`}isValidIdentifierName(e){return super.isValidIdentifierName(e)&&!o.reservedNamesSet.has(e)}generateNewMangledName(e){let t=(e=>{const t=o.nameSequence,r=t.length,n=e.length,i=e=>"0".repeat(e);let a=n-1;do{const o=e[a],s=t.indexOf(o);if(s!==r-1){return e.substring(0,a)+t[s+1]+i(n-(a+1))}--a}while(a>=0);return`a${i(n)}`})(e);return this.isValidIdentifierName(t)||(t=this.generateNewMangledName(t)),t}};m.initMangledNameCharacter="9",m.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),m.reservedNamesSet=new Set(["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"]),m=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MangledIdentifierNamesGenerator=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1);t.nodeTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.Factory__INodeTransformer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeTransformer))})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(38),s=r(63),c=r(21),d=r(163),l=r(164),u=r(165),f=r(167),p=r(169),m=r(170),g=r(171);t.obfuscatingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(u.LabeledStatementTransformer).whenTargetNamed(c.NodeTransformer.LabeledStatementTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.LiteralTransformer).whenTargetNamed(c.NodeTransformer.LiteralTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ScopeIdentifiersTransformer).whenTargetNamed(c.NodeTransformer.ScopeIdentifiersTransformer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(l.BooleanLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(p.NumberLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(m.StringLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(d.BaseIdentifierObfuscatingReplacer).whenTargetNamed(a.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),e(i.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObfuscatingReplacer)),e(i.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer))})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(5),u=r(2),f=r(39),p=r(8);let m=class extends f.AbstractObfuscatingReplacer{constructor(e,t){super(t),this.blockScopesMap=new Map,this.identifierNamesGenerator=e(t)}replace(e,t){let r=e.name;if(this.blockScopesMap.has(t)){const e=this.blockScopesMap.get(t);e.has(r)&&(r=e.get(r))}return p.NodeFactory.identifierNode(r)}storeGlobalName(e,t){const r=e.name;if(this.isReservedName(r))return;const o=this.identifierNamesGenerator.generateWithPrefix();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(r,o)}storeLocalName(e,t){const r=e.name;if(this.isReservedName(r))return;const o=this.identifierNamesGenerator.generate();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(r,o)}preserveName(e){this.identifierNamesGenerator.preserveName(e)}isReservedName(e){return!!this.options.reservedNames.length&&this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==l.TIdentifierNamesGeneratorFactory&&l.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==u.IOptions&&u.IOptions)?n:Object])],m),t.BaseIdentifierObfuscatingReplacer=m},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(39),f=r(8);let p=o=class extends u.AbstractObfuscatingReplacer{constructor(e){super(e)}static getTrueUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",o.getFalseUnaryExpressionNode())}static getFalseUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",f.NodeFactory.arrayExpressionNode())}replace(e){const t=e.value;if("boolean"!=typeof t)throw new Error("`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value");return t?o.getTrueUnaryExpressionNode():o.getFalseUnaryExpressionNode()}};p=o=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.BooleanLiteralObfuscatingReplacer=p},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(50),m=r(2),g=r(3),y=r(38),h=r(11),N=r(12),b=r(4),v=r(166);let I=class extends N.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.identifierObfuscatingReplacer=e(y.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case h.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&b.NodeGuards.isLabeledStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const r=v.NodeLexicalScopeUtils.getLexicalScope(e);return r?(this.storeLabeledStatementName(e,r),this.replaceLabeledStatementName(e,r),e):e}storeLabeledStatementName(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label,t)}replaceLabeledStatementName(e,t){f.replace(e,{enter:(e,r)=>{if(r&&b.NodeGuards.isLabelIdentifierNode(e,r)){const r=this.identifierObfuscatingReplacer.replace(e,t);e.name=r.name}}})}};I=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(2,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierObfuscatingReplacerFactory&&p.TIdentifierObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==m.IOptions&&m.IOptions)?i:Object])],I),t.LabeledStatementTransformer=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static getLexicalScope(e){return n.getLexicalScopesRecursive(e,1)[0]}static getLexicalScopes(e){return n.getLexicalScopesRecursive(e)}static getLexicalScopesRecursive(e,t=1/0,r=[],i=0){if(r.length>=t)return r;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithLexicalScope(e)&&r.push(e),e!==a?n.getLexicalScopesRecursive(a,t,r,++i):r}}t.NodeLexicalScopeUtils=n},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(168),m=r(29),g=r(2),y=r(3),h=r(64),N=r(63),b=r(11),v=r(12),I=r(8),S=r(4),O=r(44),j=r(15),_=r(6);let C=class extends v.AbstractNodeTransformer{constructor(e,t,r,o,n){super(t,r),this.literalObfuscatingReplacerFactory=e,this.stringArrayStorageAnalyzer=o,this.escapeSequenceEncoder=n}getVisitor(e){switch(e){case b.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(S.NodeGuards.isProgramNode(e)&&this.analyzeNode(e),t&&S.NodeGuards.isLiteralNode(e)&&!j.NodeMetadata.isReplacedLiteral(e))return this.transformNode(e,t)}};case b.TransformationStage.Finalizing:return{enter:(e,t)=>{if(t&&S.NodeGuards.isLiteralNode(e))return this.encodeLiteralNodeToEscapeSequence(e,t)}};default:return null}}analyzeNode(e){this.stringArrayStorageAnalyzer.analyze(e)}transformNode(e,t){if(O.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;let r;switch(typeof e.value){case"boolean":r=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e);break;case"number":r=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e);break;case"string":r=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e);break;default:r=e}return _.NodeUtils.parentizeNode(r,t),r}encodeLiteralNodeToEscapeSequence(e,t){return"string"!=typeof e.value?e:I.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(e.value,this.options.unicodeEscapeSequence))}};C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IObfuscatingReplacer)),l(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(2,u.inject(f.ServiceIdentifiers.IOptions)),l(3,u.inject(f.ServiceIdentifiers.IStringArrayStorageAnalyzer)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TLiteralObfuscatingReplacerFactory&&p.TLiteralObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==g.IOptions&&g.IOptions)?i:Object,"function"==typeof(a=void 0!==h.IStringArrayStorageAnalyzer&&h.IStringArrayStorageAnalyzer)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.LiteralTransformer=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(2),l=r(39),u=r(8),f=r(37),p=r(30);let m=class extends l.AbstractObfuscatingReplacer{constructor(e){super(e),this.numberLiteralCache=new Map}replace(e){const t=e.value;if("number"!=typeof t)throw new Error("`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value");let r;return this.numberLiteralCache.has(t)?r=this.numberLiteralCache.get(t):(r=f.NumberUtils.isCeil(t)?`${p.Utils.hexadecimalPrefix}${f.NumberUtils.toHex(t)}`:String(t),this.numberLiteralCache.set(t,r)),u.NodeFactory.literalNode(t,r)}};m=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IOptions&&d.IOptions)?o:Object])],m),t.NumberLiteralObfuscatingReplacer=m},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(2),p=r(35),m=r(64),g=r(7),y=r(24),h=r(39),N=r(15),b=r(8),v=r(37),I=r(30);let S=o=class extends h.AbstractObfuscatingReplacer{constructor(e,t,r){super(r),this.nodesCache=new Map,this.stringArrayStorage=e,this.stringArrayStorageAnalyzer=t}static getHexadecimalLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}static getRc4KeyLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}initialize(){this.stringArrayStorageCallsWrapperName=this.stringArrayStorage.getStorageCallsWrapperName(),this.options.shuffleStringArray&&this.stringArrayStorage.shuffleStorage(),this.options.rotateStringArray&&this.stringArrayStorage.rotateStorage()}replace(e){const t=e.value;if("string"!=typeof t)throw new Error("`StringLiteralObfuscatingReplacer` should accept only literals with `string` value");const r=this.stringArrayStorageAnalyzer.getItemDataForLiteralNode(e),o=`${t}-${Boolean(r)}`;if(this.nodesCache.has(o)&&this.options.stringArrayEncoding!==y.StringArrayEncoding.Rc4)return this.nodesCache.get(o);const n=r?this.replaceWithStringArrayCallNode(r):this.replaceWithLiteralNode(t);return this.nodesCache.set(o,n),n}replaceWithLiteralNode(e){return b.NodeFactory.literalNode(e)}replaceWithStringArrayCallNode(e){const{index:t,decodeKey:r}=e,n=`${I.Utils.hexadecimalPrefix}${v.NumberUtils.toHex(t)}`,i=[o.getHexadecimalLiteralNode(n)];r&&i.push(o.getRc4KeyLiteralNode(r));const a=b.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName);return b.NodeFactory.callExpressionNode(a,i)}};s([g.initializable(),c("design:type",String)],S.prototype,"stringArrayStorageCallsWrapperName",void 0),s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],S.prototype,"initialize",null),S=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IStringArrayStorage)),d(1,l.inject(u.ServiceIdentifiers.IStringArrayStorageAnalyzer)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==p.IStringArrayStorage&&p.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==m.IStringArrayStorageAnalyzer&&m.IStringArrayStorageAnalyzer)?i:Object,"function"==typeof(a=void 0!==f.IOptions&&f.IOptions)?a:Object])],S),t.StringLiteralObfuscatingReplacer=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(50),y=r(2),h=r(3),N=r(172),b=r(38),v=r(11),I=r(12),S=r(4),O=r(15);let j=o=class extends I.AbstractNodeTransformer{constructor(e,t,r,o){super(t,r),this.lexicalScopesWithObjectPatternWithoutDeclarationMap=new Map,this.identifierObfuscatingReplacer=e(b.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),this.scopeAnalyzer=o}getVisitor(e){switch(e){case v.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&S.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.transformNode(e,t)}};default:return null}}analyzeNode(e,t){this.scopeAnalyzer.analyze(e)}transformNode(e,t){const r=this.scopeAnalyzer.acquireScope(e);return this.traverseScopeVariables(r),e}traverseScopeVariables(e){const t=e.variableScope,r=S.NodeGuards.isNodeWithBlockLexicalScope(t.block)?t.block:null,n=o.globalScopeNames.includes(t.type);if(r){for(const t of e.variables)if(t.name!==o.argumentsVariableName){if(!this.options.renameGlobals&&n){if(!t.defs.every(e=>"ImportBinding"===e.type||"CatchClause"===e.type))continue}this.transformScopeVariableIdentifiers(t,r,n)}for(const t of e.childScopes)this.traverseScopeVariables(t)}}transformScopeVariableIdentifiers(e,t,r){for(const o of e.identifiers)this.isReplaceableIdentifierNode(o,t,e)&&(this.storeIdentifierName(o,t,r),this.replaceIdentifierName(o,t,e))}storeIdentifierName(e,t,r){r?this.identifierObfuscatingReplacer.storeGlobalName(e,t):this.identifierObfuscatingReplacer.storeLocalName(e,t)}replaceIdentifierName(e,t,r){const o=this.identifierObfuscatingReplacer.replace(e,t);e.name=o.name,r.references.forEach(t=>{t.identifier.name=e.name})}isReplaceableIdentifierNode(e,t,r){const o=e.parentNode;return!(!o||O.NodeMetadata.isIgnoredNode(e)||this.isProhibitedPropertyNode(e,o)||this.isProhibitedClassDeclarationNameIdentifierNode(r,e,o)||this.isProhibitedExportNamedClassDeclarationIdentifierNode(e,o)||this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,o)||this.isProhibitedExportNamedVariableDeclarationIdentifierNode(e,o)||this.isProhibitedImportSpecifierNode(e,o)||this.isProhibitedVariableNameUsedInObjectPatternNode(r,e,t)||S.NodeGuards.isLabelIdentifierNode(e,o))}isProhibitedClassDeclarationNameIdentifierNode(e,t,r){return S.NodeGuards.isClassDeclarationNode(e.scope.block)&&S.NodeGuards.isClassDeclarationNode(r)&&r.id===t}isProhibitedExportNamedClassDeclarationIdentifierNode(e,t){return S.NodeGuards.isClassDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,t){return S.NodeGuards.isFunctionDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedVariableDeclarationIdentifierNode(e,t){return S.NodeGuards.isVariableDeclaratorNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isVariableDeclarationNode(t.parentNode)&&!!t.parentNode.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode.parentNode)}isProhibitedImportSpecifierNode(e,t){return S.NodeGuards.isImportSpecifierNode(t)&&t.imported.name===t.local.name}isProhibitedPropertyNode(e,t){return S.NodeGuards.isPropertyNode(t)&&!t.computed&&t.key===e}isProhibitedVariableNameUsedInObjectPatternNode(e,t,r){let o=this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(r);if(!1===o)return!1;if(!e.defs.some(e=>"var"===e.kind))return!1;let n=!1;return m.traverse(r,{enter:(e,r)=>{if(S.NodeGuards.isObjectPatternNode(e)&&r&&S.NodeGuards.isAssignmentExpressionNode(r)){o=!0;const r=e.properties;for(const e of r)if(!e.computed&&e.shorthand&&S.NodeGuards.isIdentifierNode(e.key)&&t.name===e.key.name)return n=!0,m.VisitorOption.Break}}}),this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(r,null!=o&&o),n}};j.argumentsVariableName="arguments",j.globalScopeNames=["global","module"],j=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),l(1,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(2,f.inject(p.ServiceIdentifiers.IOptions)),l(3,f.inject(p.ServiceIdentifiers.IScopeAnalyzer)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierObfuscatingReplacerFactory&&g.TIdentifierObfuscatingReplacerFactory)?n:Object,"function"==typeof(i=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.IOptions&&y.IOptions)?a:Object,"function"==typeof(s=void 0!==N.IScopeAnalyzer&&N.IScopeAnalyzer)?s:Object])],j),t.ScopeIdentifiersTransformer=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(174),a=r(181);t.optionsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IOptions).to(i.Options).inSingletonScope(),e(n.ServiceIdentifiers.IOptionsNormalizer).to(a.OptionsNormalizer).inSingletonScope()})},function(e,t,r){"use strict";var o,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=r(28),m=r(0),g=r(1),y=r(65),h=r(175),N=r(176),b=r(177),v=r(31),I=r(20),S=r(32),O=r(24),j=r(40),_=r(178),C=r(179);let R=o=class{constructor(e,t){Object.assign(this,j.DEFAULT_PRESET,e);const r=y.validateSync(this,o.validatorOptions);if(r.length)throw new ReferenceError(`Validation failed. errors:\n${_.ValidationErrorsFormatter.format(r)}`);Object.assign(this,t.normalize(this))}};R.validatorOptions={validationError:{target:!1}},l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"compact",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"controlFlowFlattening",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"controlFlowFlatteningThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"deadCodeInjection",void 0),l([y.IsNumber(),u("design:type",Number)],R.prototype,"deadCodeInjectionThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtection",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtectionInterval",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"disableConsoleOutput",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),C.IsAllowedForObfuscationTargets([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval]),u("design:type",Array)],R.prototype,"domainLock",void 0),l([y.IsIn([v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,v.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,v.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]),u("design:type","function"==typeof(n=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?n:Object)],R.prototype,"identifierNamesGenerator",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"identifiersPrefix",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),y.ValidateIf(e=>e.identifierNamesGenerator===v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),y.ArrayNotEmpty(),u("design:type",Array)],R.prototype,"identifiersDictionary",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFileName",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFilePath",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"log",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"renameGlobals",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedNames",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedStrings",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"rotateStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"selfDefending",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"shuffleStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"sourceMap",void 0),l([y.IsString(),y.ValidateIf(e=>Boolean(e.sourceMapBaseUrl)),y.IsUrl({require_protocol:!0,require_tld:!1,require_valid_protocol:!0}),u("design:type",String)],R.prototype,"sourceMapBaseUrl",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"sourceMapFileName",void 0),l([y.IsIn([S.SourceMapMode.Inline,S.SourceMapMode.Separate]),u("design:type","function"==typeof(i=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?i:Object)],R.prototype,"sourceMapMode",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"splitStrings",void 0),l([y.IsNumber(),y.ValidateIf(e=>Boolean(e.splitStrings)),y.Min(1),u("design:type",Number)],R.prototype,"splitStringsChunkLength",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"stringArray",void 0),l([y.IsIn([!0,!1,O.StringArrayEncoding.Base64,O.StringArrayEncoding.Rc4]),u("design:type","function"==typeof(a=void 0!==N.TStringArrayEncoding&&N.TStringArrayEncoding)?a:Object)],R.prototype,"stringArrayEncoding",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"stringArrayThreshold",void 0),l([y.IsIn([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval,I.ObfuscationTarget.Node]),u("design:type","function"==typeof(s=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?s:Object)],R.prototype,"target",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"transformObjectKeys",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"unicodeEscapeSequence",void 0),R=o=l([m.injectable(),f(0,m.inject(g.ServiceIdentifiers.TInputOptions)),f(1,m.inject(g.ServiceIdentifiers.IOptionsNormalizer)),u("design:paramtypes",["function"==typeof(c=void 0!==h.TInputOptions&&h.TInputOptions)?c:Object,"function"==typeof(d=void 0!==b.IOptionsNormalizer&&b.IOptionsNormalizer)?d:Object])],R),t.Options=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static format(e){return e.reduce((e,t)=>[...e,o.formatWithNestedConstraints(t)],[]).join("\n")}static formatWithNestedConstraints(e){const t=e.constraints;return`${`\`${e.property}\` errors:\n`}${Object.keys(t).map(e=>` - ${t[e]}\n`).join()}`}}t.ValidationErrorsFormatter=o},function(e,t,r){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(65),i=o(r(180)),a=r(41),s=r(40);t.IsAllowedForObfuscationTargets=function(e,t){return(r,o)=>{n.registerDecorator({propertyName:o,constraints:[e],name:"IsAllowedForObfuscationTargets",options:t,target:r.constructor,validator:{validate(t,r){const n=r.object,a=s.DEFAULT_PRESET[o];return i.default(t,a)||e.includes(n.target)},defaultMessage:t=>`This option allowed only for obfuscation targets: ${e.join(`${a.StringSeparator.Comma} `)}`}})}}},function(e,t){e.exports=require("fast-deep-equal")},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(182),s=r(183),c=r(184),d=r(185),l=r(186),u=r(187),f=r(188),p=r(189),m=r(190),g=r(191),y=r(192),h=r(193),N=r(194);let b=o=class{normalize(e){let t=Object.assign({},e);for(const e of o.normalizerRules)t=e(t);return t}};b.normalizerRules=[a.ControlFlowFlatteningThresholdRule,s.DeadCodeInjectionRule,c.DeadCodeInjectionThresholdRule,d.DomainLockRule,l.InputFileNameRule,u.SeedRule,f.SelfDefendingRule,p.SourceMapBaseUrlRule,m.SourceMapFileNameRule,g.SplitStringsChunkLengthRule,y.StringArrayRule,h.StringArrayEncodingRule,N.StringArrayThresholdRule],b=o=n([i.injectable()],b),t.OptionsNormalizer=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControlFlowFlatteningThresholdRule=e=>(0===e.controlFlowFlatteningThreshold&&(e=Object.assign(Object.assign({},e),{controlFlowFlattening:!1,controlFlowFlatteningThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(40);t.DeadCodeInjectionRule=e=>(e.deadCodeInjection&&((e=Object.assign(Object.assign({},e),{deadCodeInjection:!0,stringArray:!0})).stringArrayThreshold||(e=Object.assign(Object.assign({},e),{stringArray:!0,stringArrayThreshold:o.DEFAULT_PRESET.stringArrayThreshold}))),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeadCodeInjectionThresholdRule=e=>(0===e.deadCodeInjectionThreshold&&(e=Object.assign(Object.assign({},e),{deadCodeInjection:!1,deadCodeInjectionThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(30);t.DomainLockRule=e=>{if(e.domainLock.length){const t=[];for(const r of e.domainLock)t.push(o.Utils.extractDomainFrom(r));e=Object.assign(Object.assign({},e),{domainLock:t})}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(41);t.InputFileNameRule=e=>{let{inputFileName:t}=e;return t&&(t=t.replace(/^\/+/,"").split(o.StringSeparator.Dot).slice(0,-1).join(o.StringSeparator.Dot)||t,e=Object.assign(Object.assign({},e),{inputFileName:`${t}.js`})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeedRule=e=>{if(e.seed)return Object.assign(Object.assign({},e),{seed:e.seed});return Object.assign(Object.assign({},e),{seed:(t=0,r=999999999,Math.floor(Math.random()*(r-t+1)+t))});var t,r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingRule=e=>(e.selfDefending&&(e=Object.assign(Object.assign({},e),{compact:!0,selfDefending:!0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapBaseUrlRule=e=>{const{sourceMapBaseUrl:t}=e;return e.sourceMapFileName?(t&&!t.endsWith("/")&&(e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:`${t}/`})),e):e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:""})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(41);t.SourceMapFileNameRule=e=>{let{sourceMapFileName:t}=e;if(t){t=t.replace(/^\/+/,"").replace(/(?:\.js)?(?:\.map)?$/,"");let r=t.split(o.StringSeparator.Dot);const n=r.length,i=r[n-1];n>1&&i.length<=3&&(r=r.slice(0,-1)),t=r.join(o.StringSeparator.Dot),e=Object.assign(Object.assign({},e),{sourceMapFileName:`${t}.js.map`})}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SplitStringsChunkLengthRule=e=>e=0===e.splitStringsChunkLength?Object.assign(Object.assign({},e),{splitStrings:!1,splitStringsChunkLength:0}):Object.assign(Object.assign({},e),{splitStringsChunkLength:Math.floor(e.splitStringsChunkLength)})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRule=e=>(e.stringArray||(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,shuffleStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(24);t.StringArrayEncodingRule=e=>(!0===e.stringArrayEncoding&&(e=Object.assign(Object.assign({},e),{stringArrayEncoding:o.StringArrayEncoding.Base64})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayThresholdRule=e=>(0===e.stringArrayThreshold&&(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(21),s=r(66),c=r(196),d=r(197),l=r(67),u=r(198),f=r(202),p=r(204),m=r(205),g=r(207),y=r(208),h=r(209);t.preparingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.CommentsTransformer).whenTargetNamed(a.NodeTransformer.CommentsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.CustomNodesTransformer).whenTargetNamed(a.NodeTransformer.CustomNodesTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.EvalCallExpressionTransformer).whenTargetNamed(a.NodeTransformer.EvalCallExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.MetadataTransformer).whenTargetNamed(a.NodeTransformer.MetadataTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.ObfuscatingGuardsTransformer).whenTargetNamed(a.NodeTransformer.ObfuscatingGuardsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ParentificationTransformer).whenTargetNamed(a.NodeTransformer.ParentificationTransformer),e(i.ServiceIdentifiers.INodeGuard).to(c.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.BlackListObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(l.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ConditionalCommentObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(y.ReservedStringObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ReservedStringObfuscatingGuard),e(i.ServiceIdentifiers.Factory__INodeGuard).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeGuard)),e(i.ServiceIdentifiers.INodeTransformer).to(h.VariablePreserveTransformer).whenTargetNamed(a.NodeTransformer.VariablePreserveTransformer)})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=r(4);let c=o=class{constructor(){this.blackListGuardsLength=o.blackListGuards.length}check(e){for(let t=0;t=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(2),m=r(3),g=r(11),y=r(12),h=r(4),N=r(67);let b=o=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case g.TransformationStage.Initializing:return{leave:e=>{if(h.NodeGuards.isProgramNode(e))return this.transformNode(e)}};default:return null}}transformNode(e){if(!e.comments||!e.comments.length)return e;const t=this.transformComments(e.comments);return 0===t.length?e:e.body.length?(f.traverse(e,{enter:r=>{if(r===e)return;const o=t.findIndex(e=>e.range&&r.range&&e.range[0]0&&(e.trailingComments=t.reverse()),e):(e.leadingComments=t,e)}transformComments(e){return e.filter(e=>o.preservedWords.some(t=>e.value.includes(t))||N.ConditionalCommentObfuscatingGuard.isConditionalComment(e)).reverse()}};b.preservedWords=["@license","@preserve"],b=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],b),t.CommentsTransformer=b},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=r(199),g=r(200),y=r(2),h=r(3),N=r(201),b=r(62),v=r(22),I=r(11),S=r(12),O=r(4);let j=class extends S.AbstractNodeTransformer{constructor(e,t,r,o,n,i){super(n,i),this.callsGraphData=[],this.callsGraphAnalyzer=e,this.prevailingKindOfVariablesAnalyzer=t,this.obfuscationEventEmitter=r,this.customNodeGroupStorage=o}getVisitor(e){switch(e){case I.TransformationStage.Preparing:return{leave:(e,t)=>{if(O.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.appendCustomNodesBeforeObfuscation(e,t),this.transformNode(e,t)}};case I.TransformationStage.Finalizing:return{leave:(e,t)=>{O.NodeGuards.isProgramNode(e)&&this.appendCustomNodesAfterObfuscation(e,t)}};default:return null}}analyzeNode(e,t){this.callsGraphData=this.callsGraphAnalyzer.analyze(e),this.prevailingKindOfVariablesAnalyzer.analyze(e)}transformNode(e,t){return e}appendCustomNodesBeforeObfuscation(e,t){this.customNodeGroupStorage.getStorage().forEach(e=>{e.initialize(),this.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(v.ObfuscationEvent.BeforeObfuscation,e,this.callsGraphData)}appendCustomNodesAfterObfuscation(e,t){this.obfuscationEventEmitter.emit(v.ObfuscationEvent.AfterObfuscation,e,this.callsGraphData)}};j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.ICallsGraphAnalyzer)),u(1,f.inject(p.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),u(2,f.inject(p.ServiceIdentifiers.IObfuscationEventEmitter)),u(3,f.inject(p.ServiceIdentifiers.TCustomNodeGroupStorage)),u(4,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(5,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(o=void 0!==N.ICallsGraphAnalyzer&&N.ICallsGraphAnalyzer)?o:Object,"function"==typeof(n=void 0!==b.IPrevailingKindOfVariablesAnalyzer&&b.IPrevailingKindOfVariablesAnalyzer)?n:Object,"function"==typeof(i=void 0!==g.IObfuscationEventEmitter&&g.IObfuscationEventEmitter)?i:Object,"function"==typeof(a=void 0!==m.TCustomNodeGroupStorage&&m.TCustomNodeGroupStorage)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.CustomNodesTransformer=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(203)),p=r(2),m=r(3),g=r(11),y=r(12),h=r(8),N=r(4),b=r(6);let v=o=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t),this.evalRootAstHostNodeSet=new Set}static extractEvalStringFromCallExpressionArgument(e){return N.NodeGuards.isLiteralNode(e)?o.extractEvalStringFromLiteralNode(e):N.NodeGuards.isTemplateLiteralNode(e)?o.extractEvalStringFromTemplateLiteralNode(e):null}static extractEvalStringFromLiteralNode(e){return"string"==typeof e.value?e.value:null}static extractEvalStringFromTemplateLiteralNode(e){const t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(t&&N.NodeGuards.isCallExpressionNode(e)&&N.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return this.transformNode(e,t)}};case g.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:(e,t)=>{if(t&&this.isEvalRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}transformNode(e,t){const r=e.arguments[0];if(!r)return e;const n=o.extractEvalStringFromCallExpressionArgument(r);if(!n)return e;let i;try{i=b.NodeUtils.convertCodeToStructure(n)}catch(t){return e}const a=h.NodeFactory.functionExpressionNode([],h.NodeFactory.blockStatementNode(i));return this.evalRootAstHostNodeSet.add(a),a}restoreNode(e,t){const r=e.body.body,o=b.NodeUtils.convertStructureToCode(r);return h.NodeFactory.callExpressionNode(h.NodeFactory.identifierNode("eval"),[h.NodeFactory.literalNode(f.default(o))])}isEvalRootAstHostNode(e){return N.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}};v=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],v),t.EvalCallExpressionTransformer=v},function(e,t){e.exports=require("js-string-escape")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(4),g=r(15);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return g.NodeMetadata.set(e,{ignoredNode:!1}),m.NodeGuards.isLiteralNode(e)&&g.NodeMetadata.set(e,{replacedLiteral:!1}),e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MetadataTransformer=y},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(206),p=r(2),m=r(3),g=r(66),y=r(11),h=r(12),N=r(15);let b=o=class extends h.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.obfuscatingGuards=o.obfuscatingGuardsList.map(e)}getVisitor(e){switch(e){case y.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){const r=this.obfuscatingGuards.every(t=>t.check(e));return N.NodeMetadata.set(e,{ignoredNode:!r}),e}};b.obfuscatingGuardsList=[g.ObfuscatingGuard.BlackListObfuscatingGuard,g.ObfuscatingGuard.ConditionalCommentObfuscatingGuard,g.ObfuscatingGuard.ReservedStringObfuscatingGuard],b=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__INodeGuard)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TObfuscatingGuardFactory&&f.TObfuscatingGuardFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.ObfuscatingGuardsTransformer=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(6);let g=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return m.NodeUtils.parentizeNode(e,t)}};g=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],g),t.ParentificationTransformer=g},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(2),d=r(1),l=r(4);let u=class{constructor(e){this.options=e}check(e){return!this.options.reservedStrings.length||!l.NodeGuards.isLiteralNode(e)||"string"!=typeof e.value||!this.isReservedString(e.value)}isReservedString(e){return this.options.reservedStrings.some(t=>null!==new RegExp(t,"g").exec(e))}};u=n([s.injectable(),a(0,s.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==c.IOptions&&c.IOptions)?o:Object])],u),t.ReservedStringObfuscatingGuard=u},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(50),u=r(2),f=r(3),p=r(38),m=r(1),g=r(11),y=r(12),h=r(4);let N=class extends y.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(h.NodeGuards.isIdentifierNode(e)&&t&&(h.NodeGuards.parentNodeIsPropertyNode(e,t)||h.NodeGuards.parentNodeIsMemberExpressionNode(e,t)||h.NodeGuards.parentNodeIsMethodDefinitionNode(e,t)||h.NodeGuards.isLabelIdentifierNode(e,t)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return this.identifierObfuscatingReplacer.preserveName(e.name),e}};N=a([d.injectable(),c(0,d.inject(m.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,d.inject(m.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(m.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==l.TIdentifierObfuscatingReplacerFactory&&l.TIdentifierObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.VariablePreserveTransformer=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(211),a=r(212),s=r(214);t.storagesModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.TCustomNodeGroupStorage).to(a.CustomNodeGroupStorage).inSingletonScope(),e(n.ServiceIdentifiers.IStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(n.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(i.ControlFlowStorage),e(n.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(e=>()=>{const t=new(e.container.get(n.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(n.ServiceIdentifiers.IRandomGenerator),e.container.get(n.ServiceIdentifiers.IOptions));return t.initialize(),t})})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(51);let p=class extends f.MapStorage{constructor(e,t){super(e,t)}};p=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.ControlFlowStorage=p},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(213),p=r(2),m=r(3),g=r(61),y=r(51);let h=o=class extends y.MapStorage{constructor(e,t,r){super(t,r),this.customNodeGroupFactory=e}initialize(){super.initialize(),o.customNodeGroupsList.forEach(e=>{const t=this.customNodeGroupFactory(e);this.storage.set(e,t)})}};h.customNodeGroupsList=[g.CustomNodeGroup.ConsoleOutputCustomNodeGroup,g.CustomNodeGroup.DebugProtectionCustomNodeGroup,g.CustomNodeGroup.DomainLockCustomNodeGroup,g.CustomNodeGroup.SelfDefendingCustomNodeGroup,g.CustomNodeGroup.StringArrayCustomNodeGroup],s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],h.prototype,"initialize",null),h=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__ICustomNodeGroup)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TCustomNodeGroupFactory&&f.TCustomNodeGroupFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.CustomNodeGroupStorage=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=r(5),y=r(34),h=r(48),N=r(29),b=r(2),v=r(3),I=r(7),S=r(24),O=r(51);let j=o=class extends O.MapStorage{constructor(e,t,r,n,i,a){super(r,n),this.rc4EncodedValuesSourcesCache=new Map,this.rotationAmount=0,this.identifierNamesGenerator=e(n),this.arrayUtils=t,this.cryptUtils=i,this.escapeSequenceEncoder=a,this.rc4Keys=this.randomGenerator.getRandomGenerator().n(()=>this.randomGenerator.getRandomGenerator().string({length:o.rc4KeyLength}),o.rc4KeysCount)}initialize(){super.initialize();const e=this.identifierNamesGenerator.generate(o.stringArrayNameLength),t=this.identifierNamesGenerator.generate(o.stringArrayNameLength);this.stringArrayStorageName=`${this.options.identifiersPrefix}${e}`,this.stringArrayStorageCallsWrapperName=`${this.options.identifiersPrefix}${t}`,this.rotationAmount=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(o.minimumRotationAmount,o.maximumRotationAmount):0}get(e){return this.getOrSetIfDoesNotExist(e)}getRotationAmount(){return this.rotationAmount}getStorageId(){return this.stringArrayStorageName}getStorageName(){return this.getStorageId()}getStorageCallsWrapperName(){return this.stringArrayStorageCallsWrapperName}rotateStorage(){this.getLength()&&(this.storage=new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()),this.rotationAmount)))}shuffleStorage(){this.storage=new Map(this.arrayUtils.shuffle(Array.from(this.storage.entries())).map(([e,t],r)=>(t.index=r,[e,t])).sort(([,e],[,t])=>e.index-t.index))}toString(){return Array.from(this.storage.values()).map(e=>`'${this.escapeSequenceEncoder.encode(e.encodedValue,this.options.unicodeEscapeSequence)}'`).toString()}getOrSetIfDoesNotExist(e){const{encodedValue:t,decodeKey:r}=this.getEncodedValue(e),o=this.storage.get(t);if(o)return o;const n={encodedValue:t,decodeKey:r,value:e,index:this.getLength()};return this.storage.set(t,n),n}getEncodedValue(e){var t;switch(this.options.stringArrayEncoding){case S.StringArrayEncoding.Rc4:{const r=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),o=this.cryptUtils.btoa(this.cryptUtils.rc4(e,r)),n=null!==(t=this.rc4EncodedValuesSourcesCache.get(o))&&void 0!==t?t:[];let i=n.length;return(!i||!n.includes(e))&&(n.push(e),i++),this.rc4EncodedValuesSourcesCache.set(o,n),i>1?this.getEncodedValue(e):{encodedValue:o,decodeKey:r}}case S.StringArrayEncoding.Base64:{const t=null;return{encodedValue:this.cryptUtils.btoa(e),decodeKey:t}}default:return{encodedValue:e,decodeKey:null}}}};j.minimumRotationAmount=100,j.maximumRotationAmount=500,j.rc4KeyLength=4,j.rc4KeysCount=50,j.stringArrayNameLength=7,l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageName",void 0),l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageCallsWrapperName",void 0),l([p.postConstruct(),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],j.prototype,"initialize",null),j=o=l([p.injectable(),f(0,p.inject(m.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),f(1,p.inject(m.ServiceIdentifiers.IArrayUtils)),f(2,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f(3,p.inject(m.ServiceIdentifiers.IOptions)),f(4,p.inject(m.ServiceIdentifiers.ICryptUtils)),f(5,p.inject(m.ServiceIdentifiers.IEscapeSequenceEncoder)),u("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==b.IOptions&&b.IOptions)?s:Object,"function"==typeof(c=void 0!==h.ICryptUtils&&h.ICryptUtils)?c:Object,"function"==typeof(d=void 0!==N.IEscapeSequenceEncoder&&N.IEscapeSequenceEncoder)?d:Object])],j),t.StringArrayStorage=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(216),a=r(217),s=r(221),c=r(222),d=r(223),l=r(68);t.utilsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IArrayUtils).to(i.ArrayUtils).inSingletonScope(),e(n.ServiceIdentifiers.IRandomGenerator).to(l.RandomGenerator).inSingletonScope(),e(n.ServiceIdentifiers.ICryptUtils).to(a.CryptUtils).inSingletonScope(),e(n.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope(),e(n.ServiceIdentifiers.ILevelledTopologicalSorter).to(c.LevelledTopologicalSorter),e(n.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder).to(d.NodeTransformerNamesGroupsBuilder).inSingletonScope()})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(3);let l=class{constructor(e){this.randomGenerator=e}createWithRange(e){const t=[];for(let r=0;rn&&(o=i,n=e),r[i]=e}return o}rotate(e,t){if(!e.length)throw new ReferenceError("Cannot rotate empty array.");if(t<=0)return e;const r=e;let o;for(;t--;)o=r.pop(),o&&r.unshift(o);return r}shuffle(e){const t=[...e];for(let e=t.length;e;e--){const r=Math.floor(this.randomGenerator.getMathRandom()*e);[t[e-1],t[r]]=[t[r],t[e-1]]}return t}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IRandomGenerator&&d.IRandomGenerator)?o:Object])],l),t.ArrayUtils=l},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(3),l=r(68),u=r(30);let f=class{constructor(e){this.randomGenerator=e}btoa(e){let t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(`${u.Utils.hexadecimalPrefix}${t}`,16)));for(let r,o,n=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|n)||(i="=",n%1);t+=i.charAt(63&r>>8-n%1*8)){if(o=e.charCodeAt(n+=.75),o>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|o}return t}hideString(e,t){let r=this.randomGenerator.getRandomGenerator().string({length:t,pool:l.RandomGenerator.randomGeneratorPool}).replace(new RegExp(`[${o=e,o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}]`,"g"),"");var o;const n=r.split("");return this.randomGenerator.getRandomGenerator().shuffle(n),r=n.join(""),[((e,t)=>{let r=-1,o=-1,n="";for(;r=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.stringsCache=new Map}encode(e,t){const r=`${e}-${String(t)}`;if(this.stringsCache.has(r))return this.stringsCache.get(r);const o=new RegExp("[\\s\\S]","g"),n=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const c=e.replace(o,e=>t||n.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(r,c),this.stringsCache.set(`${c}-${String(t)}`,c),c}};n=o([r(0).injectable()],n),t.EscapeSequenceEncoder=n},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],r={};for(const o of e)void 0===r[o]&&this.visit(t,r,o);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const r of t){for(let t=r.length-1;t>=0;t-=1)r[t]===e&&r.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const r of e)this.hasPrecedents(r)||t.push(r);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const r=this.graph.get(t);return r&&!r.includes(e)&&r.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,r){const o=t[r];if("visiting"===o)throw new Error(`Detected cycle involving node: ${r}`);if(o)return;t[r]="visiting";const n=this.getPrecedents(r);for(const r of n)this.visit(e,t,r);t[r]="ok",e.push(r)}};n=o([r(0).injectable()],n),t.LevelledTopologicalSorter=n},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(224);let l=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),r=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of r)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const r=[];for(const o of e){const e=t[o].runAfter;if(e&&e.length)for(const n of e){void 0===t[n]?r.push([o,null]):r.push([n,o])}else r.push([o,null])}return r}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.ILevelledTopologicalSorter)),i("design:paramtypes",["function"==typeof(o=void 0!==d.ILevelledTopologicalSorter&&d.ILevelledTopologicalSorter)?o:Object])],l),t.NodeTransformerNamesGroupsBuilder=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=f(r(46)),y=r(226),h=r(227),N=r(2),b=r(3),v=r(57),I=r(228),S=r(21),O=r(11),j=r(43),_=r(55),C=r(4);let R=o=class{constructor(e,t,r,o,n){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=r,this.logger=o,this.options=n}obfuscate(e){const t=Date.now();this.logger.info(I.LoggingMessage.Version,"0.24.4"),this.logger.info(I.LoggingMessage.ObfuscationStarted),this.logger.info(I.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const r=this.parseCode(e),o=this.transformAstTree(r),n=this.generateCode(e,o),i=(Date.now()-t)/1e3;return this.logger.success(I.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(n)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return _.ASTParserFacade.parse(t,o.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,O.TransformationStage.Initializing),!C.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,O.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,O.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,O.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,O.TransformationStage.Converting),e=this.runTransformationStage(e,O.TransformationStage.Obfuscating),e=this.runTransformationStage(e,O.TransformationStage.Finalizing)):(this.logger.warn(I.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const r=Object.assign({},o.escodegenParams);this.options.sourceMap&&(r.sourceMap=this.options.inputFileName||"sourceMap",r.sourceContent=e);const n=g.generate(t,Object.assign(Object.assign({},r),{format:{compact:this.options.compact}}));return n.map=n.map?n.map.toString():"",n}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(I.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,o.transformersList,t)}};R.parseOptions={ecmaVersion:j.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},R.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},R.transformersList=[S.NodeTransformer.BlockStatementControlFlowTransformer,S.NodeTransformer.CommentsTransformer,S.NodeTransformer.CustomNodesTransformer,S.NodeTransformer.DeadCodeInjectionTransformer,S.NodeTransformer.EvalCallExpressionTransformer,S.NodeTransformer.FunctionControlFlowTransformer,S.NodeTransformer.LabeledStatementTransformer,S.NodeTransformer.LiteralTransformer,S.NodeTransformer.MemberExpressionTransformer,S.NodeTransformer.MetadataTransformer,S.NodeTransformer.MethodDefinitionTransformer,S.NodeTransformer.ObfuscatingGuardsTransformer,S.NodeTransformer.ObjectExpressionKeysTransformer,S.NodeTransformer.ObjectExpressionTransformer,S.NodeTransformer.ParentificationTransformer,S.NodeTransformer.ScopeIdentifiersTransformer,S.NodeTransformer.SplitStringTransformer,S.NodeTransformer.TemplateLiteralTransformer,S.NodeTransformer.VariablePreserveTransformer],R=o=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.ITransformersRunner)),u(1,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(2,p.inject(m.ServiceIdentifiers.Factory__IObfuscatedCode)),u(3,p.inject(m.ServiceIdentifiers.ILogger)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==v.ITransformersRunner&&v.ITransformersRunner)?n:Object,"function"==typeof(i=void 0!==b.IRandomGenerator&&b.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.TObfuscatedCodeFactory&&y.TObfuscatedCodeFactory)?a:Object,"function"==typeof(s=void 0!==h.ILogger&&h.ILogger)?s:Object,"function"==typeof(c=void 0!==N.IOptions&&N.IOptions)?c:Object])],R),t.JavaScriptObfuscator=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(230));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=o([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t){e.exports=require("eventemitter3")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(48),u=r(7),f=r(32),p=r(2);let m=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case f.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case f.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};i([u.initializable(),a("design:type",String)],m.prototype,"obfuscatedCode",void 0),i([u.initializable(),a("design:type",String)],m.prototype,"sourceMap",void 0),m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.ICryptUtils)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==l.ICryptUtils&&l.ICryptUtils)?o:Object,"function"==typeof(n=void 0!==p.IOptions&&p.IOptions)?n:Object])],m),t.ObfuscatedCode=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(234),p=r(235),m=r(236),g=r(4),y=r(15);let h=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,r){if(!t.length)return e;let o,n;this.cachedNodeTransformersData.has(t)?[o,n]=this.cachedNodeTransformersData.get(t):(o=this.buildNormalizedNodeTransformers(t),n=this.nodeTransformerNamesGroupsBuilder.build(o),this.cachedNodeTransformersData.set(t,[o,n]));for(const t of n){const n=[],i=[];for(const e of t){const t=o[e].getVisitor(r);t&&(t.enter&&n.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(n.length||i.length)&&u.replace(e,{enter:this.mergeVisitorsForDirection(n,m.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,m.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const r=e.length;return r?(o,n)=>{if(y.NodeMetadata.isIgnoredNode(o))return u.VisitorOption.Skip;for(let i=0;ie}};h=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__INodeTransformer)),s(1,d.inject(l.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),a("design:paramtypes",["function"==typeof(o=void 0!==f.TNodeTransformerFactory&&f.TNodeTransformerFactory)?o:Object,"function"==typeof(n=void 0!==p.INodeTransformerNamesGroupsBuilder&&p.INodeTransformerNamesGroupsBuilder)?n:Object])],h),t.TransformersRunner=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const c=s(r(243)),d=s(r(238)),l=r(244),u=r(7),f=r(40),p=r(245),m=r(246),g=r(247),y=r(248),h=r(249),N=r(250),b=r(251),v=r(25),I=r(254);class S{constructor(e){this.rawArguments=e,this.arguments=e.slice(2)}static filterOptions(e){const t={};return Object.keys(e).forEach(r=>{void 0!==e[r]&&(t[r]=e[r])}),t}static processSourceCodeWithoutSourceMap(e,t,r){const o=v.JavaScriptObfuscator.obfuscate(e,r).getObfuscatedCode();b.CLIUtils.writeFile(t,o)}static processSourceCodeWithSourceMap(e,t,r){var o;const n=b.CLIUtils.getOutputSourceMapPath(t,null!==(o=r.sourceMapFileName)&&void 0!==o?o:"");r=Object.assign(Object.assign({},r),{sourceMapFileName:d.basename(n)});const i=v.JavaScriptObfuscator.obfuscate(e,r);b.CLIUtils.writeFile(t,i.getObfuscatedCode()),"separate"===r.sourceMapMode&&i.getSourceMap()&&b.CLIUtils.writeFile(n,i.getSourceMap())}initialize(){this.inputPath=d.normalize(this.arguments[0]||""),this.commands=new c.Command,this.configureCommands(),this.configureHelp(),this.inputCLIOptions=this.commands.opts()}run(){if(!this.arguments.length||this.arguments.includes("--help"))return void this.commands.outputHelp();const e=new I.SourceCodeReader(this.inputCLIOptions).readSourceCode(this.inputPath);this.processSourceCodeData(e)}buildOptions(){const e=S.filterOptions(this.inputCLIOptions),t=this.inputCLIOptions.config,r=t?d.resolve(t,"."):"",o=r?b.CLIUtils.getUserConfig(r):{},n=d.basename(this.inputPath),i=this.inputPath;return Object.assign(Object.assign(Object.assign(Object.assign({},f.DEFAULT_PRESET),o),e),{inputFileName:n,inputFilePath:i})}configureCommands(){this.commands.usage(" [options]").version(null!=="0.24.4"?"0.24.4":"unknown","-v, --version").option("-o, --output ","Output path for obfuscated code").option("--compact ","Disable one line output code compacting",m.BooleanSanitizer).option("--config ","Name of js / json config file").option("--control-flow-flattening ","Enables control flow flattening",m.BooleanSanitizer).option("--control-flow-flattening-threshold ","The probability that the control flow flattening transformation will be applied to the node",parseFloat).option("--dead-code-injection ","Enables dead code injection",m.BooleanSanitizer).option("--dead-code-injection-threshold ","The probability that the dead code injection transformation will be applied to the node",parseFloat).option("--debug-protection ","Disable browser Debug panel (can cause DevTools enabled browser freeze)",m.BooleanSanitizer).option("--debug-protection-interval ","Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)",m.BooleanSanitizer).option("--disable-console-output ","Allow console.log, console.info, console.error and console.warn messages output into browser console",m.BooleanSanitizer).option("--domain-lock (comma separated, without whitespaces)","Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)",p.ArraySanitizer).option("--exclude (comma separated, without whitespaces)","A filename or glob which indicates files to exclude from obfuscation",p.ArraySanitizer).option("--identifier-names-generator ","Sets identifier names generator. Values: hexadecimal, mangled, dictionary. Default: hexadecimal",g.IdentifierNamesGeneratorSanitizer).option("--identifiers-prefix ","Sets prefix for all global identifiers.").option("--identifiers-dictionary (comma separated, without whitespaces)","Identifiers dictionary (comma separated) for `--identifier-names-generator dictionary` option",p.ArraySanitizer).option("--log ","Enables logging of the information to the console",m.BooleanSanitizer).option("--reserved-names (comma separated, without whitespaces)","Disables obfuscation and generation of identifiers, which being matched by passed RegExp patterns (comma separated)",p.ArraySanitizer).option("--reserved-strings (comma separated, without whitespaces)","Disables transformation of string literals, which being matched by passed RegExp patterns (comma separated)",p.ArraySanitizer).option("--rename-globals ","Allows to enable obfuscation of global variable and function names with declaration.",m.BooleanSanitizer).option("--rotate-string-array ","Enable rotation of string array values during obfuscation",m.BooleanSanitizer).option("--seed ","Sets seed for random generator. This is useful for creating repeatable results.",parseFloat).option("--self-defending ","Disables self-defending for obfuscated code",m.BooleanSanitizer).option("--shuffle-string-array ","Randomly shuffles string array items",m.BooleanSanitizer).option("--source-map ","Enables source map generation",m.BooleanSanitizer).option("--source-map-base-url ","Sets base url to the source map import url when `--source-map-mode=separate`").option("--source-map-file-name ","Sets file name for output source map when `--source-map-mode=separate`").option("--source-map-mode ","Specify source map output mode. Values: inline, separate. Default: separate",h.SourceMapModeSanitizer).option("--split-strings ","Splits literal strings into chunks with length of `splitStringsChunkLength` option value",m.BooleanSanitizer).option("--split-strings-chunk-length ","Sets chunk length of `splitStrings` option",parseFloat).option("--string-array ","Disables gathering of all literal strings into an array and replacing every literal string with an array call",m.BooleanSanitizer).option("--string-array-encoding ","Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed. Values: true, false, base64, rc4. Default: false",N.StringArrayEncodingSanitizer).option("--string-array-threshold ","The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)",parseFloat).option("--target ","Allows to set target environment for obfuscated code. Values: browser, browser-no-eval, node. Default: browser",y.ObfuscationTargetSanitizer).option("--transform-object-keys ","Enables transformation of object keys",m.BooleanSanitizer).option("--unicode-escape-sequence ","Allows to enable/disable string conversion to unicode escape sequence",m.BooleanSanitizer).parse(this.rawArguments)}configureHelp(){this.commands.on("--help",()=>{console.log(" Examples:\n"),console.log(" %> javascript-obfuscator input_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_directory_name --compact true --self-defending false"),console.log("")})}processSourceCodeData(e){const t=this.inputCLIOptions.output?d.normalize(this.inputCLIOptions.output):"";if(Array.isArray(e))e.forEach(({filePath:e,content:r},o)=>{const n=t?d.join(t,e):b.CLIUtils.getOutputCodePath(e);this.processSourceCode(r,n,o)});else{const r=t||b.CLIUtils.getOutputCodePath(this.inputPath);this.processSourceCode(e,r,null)}}processSourceCode(e,t,r){var o;let n=this.buildOptions();if(null!==r){const e=`${null!==(o=this.inputCLIOptions.identifiersPrefix)&&void 0!==o?o:S.baseIdentifiersPrefix}${r}`;n=Object.assign(Object.assign({},n),{identifiersPrefix:e})}n.sourceMap?S.processSourceCodeWithSourceMap(e,t,n):S.processSourceCodeWithoutSourceMap(e,t,n)}}S.encoding="utf8",S.obfuscatedFilePrefix="-obfuscated",S.baseIdentifiersPrefix="a",i([u.initializable(),a("design:type","function"==typeof(o=void 0!==c&&c.CommanderStatic)?o:Object)],S.prototype,"commands",void 0),i([u.initializable(),a("design:type","function"==typeof(n=void 0!==l.TInputCLIOptions&&l.TInputCLIOptions)?n:Object)],S.prototype,"inputCLIOptions",void 0),i([u.initializable(),a("design:type",String)],S.prototype,"inputPath",void 0),t.JavaScriptObfuscatorCLI=S},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("fs")},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(242);e.exports=o.JavaScriptObfuscatorCLI},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(69);const o=r(237);t.JavaScriptObfuscatorCLI=class{static obfuscate(e){const t=new o.JavaScriptObfuscatorCLI(e);t.initialize(),t.run()}}},function(e,t){e.exports=require("commander")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArraySanitizer=e=>{if(e.endsWith(","))throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1','value2'");return e.split(",").map(e=>e.trim())}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=e=>"true"===e||"1"===e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(31);t.IdentifierNamesGeneratorSanitizer=e=>{if(!Object.keys(o.IdentifierNamesGenerator).some(t=>o.IdentifierNamesGenerator[t]===e))throw new ReferenceError("Invalid value of `--identifier-names-generator` option");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(20);t.ObfuscationTargetSanitizer=e=>{if(!Object.keys(o.ObfuscationTarget).some(t=>o.ObfuscationTarget[t]===e))throw new ReferenceError("Invalid value of `--target` option");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(32);t.SourceMapModeSanitizer=e=>{if(!Object.keys(o.SourceMapMode).some(t=>o.SourceMapMode[t]===e))throw new ReferenceError("Invalid value of `--source-map-mode` option");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(24);t.StringArrayEncodingSanitizer=e=>{switch(e){case"true":case"1":case o.StringArrayEncoding.Base64:return!0;case o.StringArrayEncoding.Rc4:return o.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(239)),i=o(r(252)),a=o(r(238)),s=r(41),c=r(237);t.CLIUtils=class{static getOutputCodePath(e){return a.normalize(e).split(s.StringSeparator.Dot).map((e,t)=>0===t?`${e}${c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix}`:e).join(s.StringSeparator.Dot)}static getOutputSourceMapPath(e,t=""){return t&&(e=`${e.substring(0,e.lastIndexOf("/"))}/${t}`),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e=`${e.split(s.StringSeparator.Dot)[0]}.js.map`,e}static getUserConfig(e){let t;try{t=r(253)(e)}catch(r){try{t=require(e)}catch(e){throw new ReferenceError("Given config path must be a valid `.js` or `.json` file path")}}return t}static writeFile(e,t){i.sync(a.dirname(e)),n.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}},function(e,t){e.exports=require("mkdirp")},function(e,t){function r(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id=253},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(r(239)),a=o(r(238)),s=n(r(255)),c=r(71),d=r(237),l=r(70);class u{constructor(e){this.options=e}static isExcludedPath(e,t=[]){if(!t.length)return!1;const r=a.basename(e),o=!!s.default([e],t).length;return t.some(t=>e.includes(t)||r.includes(t))||o}static isDirectoryPath(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}static isFilePath(e){try{return i.statSync(e).isFile()}catch(e){return!1}}static logFilePath(e){const t=a.normalize(e);l.Logger.log(l.Logger.colorInfo,c.LoggingPrefix.CLI,`Obfuscating file: ${t}...`)}readSourceCode(e){if(u.isFilePath(e)&&this.isValidFile(e))return this.readFile(e);if(u.isDirectoryPath(e)&&this.isValidDirectory(e))return this.readDirectoryRecursive(e);const t=u.availableInputExtensions.map(e=>`\`${e}\``).join(", ");throw new ReferenceError(`Given input path must be a valid ${t} file or directory path`)}readDirectoryRecursive(e,t=[]){return i.readdirSync(e,d.JavaScriptObfuscatorCLI.encoding).forEach(r=>{const o=`${e}/${r}`;if(u.isDirectoryPath(o)&&this.isValidDirectory(o))t.push(...this.readDirectoryRecursive(o));else if(u.isFilePath(o)&&this.isValidFile(o)){const e=this.readFile(o);t.push({filePath:o,content:e})}}),t}readFile(e){return u.logFilePath(e),i.readFileSync(e,d.JavaScriptObfuscatorCLI.encoding)}isValidDirectory(e){return!u.isExcludedPath(e,this.options.exclude)}isValidFile(e){return u.availableInputExtensions.includes(a.extname(e))&&!e.includes(d.JavaScriptObfuscatorCLI.obfuscatedFilePrefix)&&!u.isExcludedPath(e,this.options.exclude)}}t.SourceCodeReader=u,u.availableInputExtensions=[".js"]},function(e,t){e.exports=require("multimatch")}]); + +require("source-map-support").install(); + + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.cli.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./index.cli.ts": +/*!**********************!*\ + !*** ./index.cli.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const JavaScriptObfuscatorCLIFacade_1 = __webpack_require__(/*! ./src/JavaScriptObfuscatorCLIFacade */ "./src/JavaScriptObfuscatorCLIFacade.ts"); +module.exports = JavaScriptObfuscatorCLIFacade_1.JavaScriptObfuscatorCLI; + + +/***/ }), + +/***/ "./src/ASTParserFacade.ts": +/*!********************************!*\ + !*** ./src/ASTParserFacade.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const acorn = __importStar(__webpack_require__(/*! acorn */ "acorn")); +const acorn_import_meta_1 = __importDefault(__webpack_require__(/*! acorn-import-meta */ "acorn-import-meta")); +const chalk_1 = __importDefault(__webpack_require__(/*! chalk */ "chalk")); +class ASTParserFacade { + static parse(inputData, config) { + const sourceTypeLength = ASTParserFacade.sourceTypes.length; + for (let i = 0; i < sourceTypeLength; i++) { + try { + return ASTParserFacade.parseType(inputData, config, ASTParserFacade.sourceTypes[i]); + } + catch (error) { + if (i < sourceTypeLength - 1) { + continue; + } + throw new Error(ASTParserFacade.processParsingError(inputData, error.message, error.loc)); + } + } + throw new Error('Acorn parsing error'); + } + static parseType(inputData, inputConfig, sourceType) { + const { sourceCode } = inputData; + const comments = []; + const config = Object.assign(Object.assign({}, inputConfig), { onComment: comments, sourceType }); + const program = acorn + .Parser.extend(acorn_import_meta_1.default) + .parse(sourceCode, config); + if (comments.length) { + program.comments = comments; + } + return program; + } + static processParsingError(inputData, errorMessage, position) { + if (!position || !position.line || !position.column) { + throw new Error(errorMessage); + } + const { sourceCode, inputFilePath } = inputData; + const sourceCodeLines = sourceCode.split(/\r?\n/); + const errorLine = sourceCodeLines[position.line - 1]; + if (!errorLine) { + throw new Error(errorMessage); + } + const formattedInputFilePath = inputFilePath + ? `${inputFilePath}, ` + : ''; + const startErrorIndex = Math.max(0, position.column - ASTParserFacade.nearestSymbolsCount); + const endErrorIndex = Math.min(errorLine.length, position.column + ASTParserFacade.nearestSymbolsCount); + const formattedPointer = ASTParserFacade.colorError('>'); + const formattedCodeSlice = `...${errorLine.substring(startErrorIndex, endErrorIndex).replace(/^\s+/, '')}...`; + throw new Error(`ERROR in ${formattedInputFilePath}line ${position.line}: ${errorMessage}\n${formattedPointer} ${formattedCodeSlice}`); + } +} +exports.ASTParserFacade = ASTParserFacade; +ASTParserFacade.colorError = chalk_1.default.red; +ASTParserFacade.nearestSymbolsCount = 15; +ASTParserFacade.sourceTypes = [ + 'script', + 'module' +]; + + +/***/ }), + +/***/ "./src/JavaScriptObfuscator.ts": +/*!*************************************!*\ + !*** ./src/JavaScriptObfuscator.ts ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var JavaScriptObfuscator_1, _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ./container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const escodegen = __importStar(__webpack_require__(/*! escodegen */ "escodegen")); +const TObfuscatedCodeFactory_1 = __webpack_require__(/*! ./types/container/source-code/TObfuscatedCodeFactory */ "./src/types/container/source-code/TObfuscatedCodeFactory.ts"); +const ILogger_1 = __webpack_require__(/*! ./interfaces/logger/ILogger */ "./src/interfaces/logger/ILogger.ts"); +const IOptions_1 = __webpack_require__(/*! ./interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ./interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ITransformersRunner_1 = __webpack_require__(/*! ./interfaces/node-transformers/ITransformersRunner */ "./src/interfaces/node-transformers/ITransformersRunner.ts"); +const LoggingMessage_1 = __webpack_require__(/*! ./enums/logger/LoggingMessage */ "./src/enums/logger/LoggingMessage.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ./enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ./enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const EcmaVersion_1 = __webpack_require__(/*! ./constants/EcmaVersion */ "./src/constants/EcmaVersion.ts"); +const ASTParserFacade_1 = __webpack_require__(/*! ./ASTParserFacade */ "./src/ASTParserFacade.ts"); +const NodeGuards_1 = __webpack_require__(/*! ./node/NodeGuards */ "./src/node/NodeGuards.ts"); +let JavaScriptObfuscator = JavaScriptObfuscator_1 = class JavaScriptObfuscator { + constructor(transformersRunner, randomGenerator, obfuscatedCodeFactory, logger, options) { + this.transformersRunner = transformersRunner; + this.randomGenerator = randomGenerator; + this.obfuscatedCodeFactory = obfuscatedCodeFactory; + this.logger = logger; + this.options = options; + } + obfuscate(sourceCode) { + const timeStart = Date.now(); + this.logger.info(LoggingMessage_1.LoggingMessage.Version, "0.24.4"); + this.logger.info(LoggingMessage_1.LoggingMessage.ObfuscationStarted); + this.logger.info(LoggingMessage_1.LoggingMessage.RandomGeneratorSeed, this.randomGenerator.getInputSeed()); + const astTree = this.parseCode(sourceCode); + const obfuscatedAstTree = this.transformAstTree(astTree); + const generatorOutput = this.generateCode(sourceCode, obfuscatedAstTree); + const obfuscationTime = (Date.now() - timeStart) / 1000; + this.logger.success(LoggingMessage_1.LoggingMessage.ObfuscationCompleted, obfuscationTime); + return this.getObfuscatedCode(generatorOutput); + } + parseCode(sourceCode) { + const inputData = { + sourceCode, + inputFilePath: this.options.inputFilePath + }; + return ASTParserFacade_1.ASTParserFacade.parse(inputData, JavaScriptObfuscator_1.parseOptions); + } + transformAstTree(astTree) { + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Initializing); + const isEmptyAstTree = NodeGuards_1.NodeGuards.isProgramNode(astTree) + && !astTree.body.length + && !astTree.leadingComments + && !astTree.trailingComments; + if (isEmptyAstTree) { + this.logger.warn(LoggingMessage_1.LoggingMessage.EmptySourceCode); + return astTree; + } + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Preparing); + if (this.options.deadCodeInjection) { + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.DeadCodeInjection); + } + if (this.options.controlFlowFlattening) { + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.ControlFlowFlattening); + } + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Converting); + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Obfuscating); + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Finalizing); + return astTree; + } + generateCode(sourceCode, astTree) { + const escodegenParams = Object.assign({}, JavaScriptObfuscator_1.escodegenParams); + if (this.options.sourceMap) { + escodegenParams.sourceMap = this.options.inputFileName || 'sourceMap'; + escodegenParams.sourceContent = sourceCode; + } + const generatorOutput = escodegen.generate(astTree, Object.assign(Object.assign({}, escodegenParams), { format: { + compact: this.options.compact + } })); + generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : ''; + return generatorOutput; + } + getObfuscatedCode(generatorOutput) { + return this.obfuscatedCodeFactory(generatorOutput.code, generatorOutput.map); + } + runTransformationStage(astTree, transformationStage) { + this.logger.info(LoggingMessage_1.LoggingMessage.TransformationStage, transformationStage); + return this.transformersRunner.transform(astTree, JavaScriptObfuscator_1.transformersList, transformationStage); + } +}; +JavaScriptObfuscator.parseOptions = { + ecmaVersion: EcmaVersion_1.ecmaVersion, + allowHashBang: true, + allowImportExportEverywhere: true, + allowReturnOutsideFunction: true, + locations: true, + ranges: true +}; +JavaScriptObfuscator.escodegenParams = { + comment: true, + verbatim: 'x-verbatim-property', + sourceMapWithCode: true +}; +JavaScriptObfuscator.transformersList = [ + NodeTransformer_1.NodeTransformer.BlockStatementControlFlowTransformer, + NodeTransformer_1.NodeTransformer.CommentsTransformer, + NodeTransformer_1.NodeTransformer.CustomNodesTransformer, + NodeTransformer_1.NodeTransformer.DeadCodeInjectionTransformer, + NodeTransformer_1.NodeTransformer.EvalCallExpressionTransformer, + NodeTransformer_1.NodeTransformer.FunctionControlFlowTransformer, + NodeTransformer_1.NodeTransformer.LabeledStatementTransformer, + NodeTransformer_1.NodeTransformer.LiteralTransformer, + NodeTransformer_1.NodeTransformer.MemberExpressionTransformer, + NodeTransformer_1.NodeTransformer.MetadataTransformer, + NodeTransformer_1.NodeTransformer.MethodDefinitionTransformer, + NodeTransformer_1.NodeTransformer.ObfuscatingGuardsTransformer, + NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer, + NodeTransformer_1.NodeTransformer.ObjectExpressionTransformer, + NodeTransformer_1.NodeTransformer.ParentificationTransformer, + NodeTransformer_1.NodeTransformer.ScopeIdentifiersTransformer, + NodeTransformer_1.NodeTransformer.SplitStringTransformer, + NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer, + NodeTransformer_1.NodeTransformer.VariablePreserveTransformer +]; +JavaScriptObfuscator = JavaScriptObfuscator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatedCode)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ILogger)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof ITransformersRunner_1.ITransformersRunner !== "undefined" && ITransformersRunner_1.ITransformersRunner) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof TObfuscatedCodeFactory_1.TObfuscatedCodeFactory !== "undefined" && TObfuscatedCodeFactory_1.TObfuscatedCodeFactory) === "function" ? _c : Object, typeof (_d = typeof ILogger_1.ILogger !== "undefined" && ILogger_1.ILogger) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], JavaScriptObfuscator); +exports.JavaScriptObfuscator = JavaScriptObfuscator; + + +/***/ }), + +/***/ "./src/JavaScriptObfuscatorCLIFacade.ts": +/*!**********************************************!*\ + !*** ./src/JavaScriptObfuscatorCLIFacade.ts ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +__webpack_require__(/*! reflect-metadata */ "reflect-metadata"); +const JavaScriptObfuscatorCLI_1 = __webpack_require__(/*! ./cli/JavaScriptObfuscatorCLI */ "./src/cli/JavaScriptObfuscatorCLI.ts"); +class JavaScriptObfuscatorCLIFacade { + static obfuscate(argv) { + const javaScriptObfuscatorCLI = new JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI(argv); + javaScriptObfuscatorCLI.initialize(); + javaScriptObfuscatorCLI.run(); + } +} +exports.JavaScriptObfuscatorCLI = JavaScriptObfuscatorCLIFacade; + + +/***/ }), + +/***/ "./src/JavaScriptObfuscatorFacade.ts": +/*!*******************************************!*\ + !*** ./src/JavaScriptObfuscatorFacade.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +__webpack_require__(/*! reflect-metadata */ "reflect-metadata"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ./container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const InversifyContainerFacade_1 = __webpack_require__(/*! ./container/InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +class JavaScriptObfuscatorFacade { + static obfuscate(sourceCode, inputOptions = {}) { + const inversifyContainerFacade = new InversifyContainerFacade_1.InversifyContainerFacade(); + inversifyContainerFacade.load(sourceCode, '', inputOptions); + const javaScriptObfuscator = inversifyContainerFacade + .get(ServiceIdentifiers_1.ServiceIdentifiers.IJavaScriptObfuscator); + const obfuscatedCode = javaScriptObfuscator.obfuscate(sourceCode); + inversifyContainerFacade.unload(); + return obfuscatedCode; + } +} +exports.JavaScriptObfuscator = JavaScriptObfuscatorFacade; +JavaScriptObfuscatorFacade.version = (_a = "0.24.4") !== null && _a !== void 0 ? _a : 'unknown'; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/CallsGraphAnalyzer.ts": +/*!******************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/CallsGraphAnalyzer.ts ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var CallsGraphAnalyzer_1, _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TCalleeDataExtractorFactory_1 = __webpack_require__(/*! ../../types/container/calls-graph-analyzer/TCalleeDataExtractorFactory */ "./src/types/container/calls-graph-analyzer/TCalleeDataExtractorFactory.ts"); +const CalleeDataExtractor_1 = __webpack_require__(/*! ../../enums/analyzers/calls-graph-analyzer/CalleeDataExtractor */ "./src/enums/analyzers/calls-graph-analyzer/CalleeDataExtractor.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let CallsGraphAnalyzer = CallsGraphAnalyzer_1 = class CallsGraphAnalyzer { + constructor(calleeDataExtractorFactory) { + this.calleeDataExtractorFactory = calleeDataExtractorFactory; + } + static getLimitIndex(blockScopeBodyLength) { + const lastIndex = blockScopeBodyLength - 1; + const limitThresholdActivationIndex = CallsGraphAnalyzer_1.limitThresholdActivationLength - 1; + let limitIndex = lastIndex; + if (lastIndex > limitThresholdActivationIndex) { + limitIndex = Math.round(limitThresholdActivationIndex + (lastIndex * CallsGraphAnalyzer_1.limitThreshold)); + if (limitIndex > lastIndex) { + limitIndex = lastIndex; + } + } + return limitIndex; + } + analyze(astTree) { + return this.analyzeRecursive(astTree.body); + } + analyzeRecursive(blockScopeBody) { + const limitIndex = CallsGraphAnalyzer_1.getLimitIndex(blockScopeBody.length); + const callsGraphData = []; + const blockScopeBodyLength = blockScopeBody.length; + for (let index = 0; index < blockScopeBodyLength; index++) { + if (index > limitIndex) { + break; + } + const blockScopeBodyNode = blockScopeBody[index]; + estraverse.traverse(blockScopeBodyNode, { + enter: (node) => { + if (!NodeGuards_1.NodeGuards.isCallExpressionNode(node)) { + return; + } + if (blockScopeBodyNode.parentNode !== NodeStatementUtils_1.NodeStatementUtils.getParentNodeWithStatements(node)) { + return estraverse.VisitorOption.Skip; + } + this.analyzeCallExpressionNode(callsGraphData, blockScopeBody, node); + } + }); + } + return callsGraphData; + } + analyzeCallExpressionNode(callsGraphData, blockScopeBody, callExpressionNode) { + CallsGraphAnalyzer_1.calleeDataExtractorsList.forEach((calleeDataExtractorName) => { + const calleeData = this.calleeDataExtractorFactory(calleeDataExtractorName) + .extract(blockScopeBody, callExpressionNode.callee); + if (!calleeData) { + return; + } + callsGraphData.push(Object.assign(Object.assign({}, calleeData), { callsGraph: this.analyzeRecursive(calleeData.callee.body) })); + }); + } +}; +CallsGraphAnalyzer.calleeDataExtractorsList = [ + CalleeDataExtractor_1.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor, + CalleeDataExtractor_1.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor, + CalleeDataExtractor_1.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor +]; +CallsGraphAnalyzer.limitThresholdActivationLength = 25; +CallsGraphAnalyzer.limitThreshold = 0.002; +CallsGraphAnalyzer = CallsGraphAnalyzer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICalleeDataExtractor)), + __metadata("design:paramtypes", [typeof (_a = typeof TCalleeDataExtractorFactory_1.TCalleeDataExtractorFactory !== "undefined" && TCalleeDataExtractorFactory_1.TCalleeDataExtractorFactory) === "function" ? _a : Object]) +], CallsGraphAnalyzer); +exports.CallsGraphAnalyzer = CallsGraphAnalyzer; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts": +/*!**************************************************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +let AbstractCalleeDataExtractor = class AbstractCalleeDataExtractor { +}; +AbstractCalleeDataExtractor = __decorate([ + inversify_1.injectable() +], AbstractCalleeDataExtractor); +exports.AbstractCalleeDataExtractor = AbstractCalleeDataExtractor; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts": +/*!*************************************************************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const AbstractCalleeDataExtractor_1 = __webpack_require__(/*! ./AbstractCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let FunctionDeclarationCalleeDataExtractor = class FunctionDeclarationCalleeDataExtractor extends AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor { + extract(blockScopeBody, callee) { + if (!NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { + return null; + } + const calleeBlockStatement = this.getCalleeBlockStatement(NodeStatementUtils_1.NodeStatementUtils.getParentNodeWithStatements(blockScopeBody[0]), callee.name); + if (!calleeBlockStatement) { + return null; + } + return { + callee: calleeBlockStatement, + name: callee.name + }; + } + getCalleeBlockStatement(targetNode, name) { + let calleeBlockStatement = null; + estraverse.traverse(targetNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) && node.id.name === name) { + calleeBlockStatement = node.body; + return estraverse.VisitorOption.Break; + } + } + }); + return calleeBlockStatement; + } +}; +FunctionDeclarationCalleeDataExtractor = __decorate([ + inversify_1.injectable() +], FunctionDeclarationCalleeDataExtractor); +exports.FunctionDeclarationCalleeDataExtractor = FunctionDeclarationCalleeDataExtractor; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts": +/*!************************************************************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const AbstractCalleeDataExtractor_1 = __webpack_require__(/*! ./AbstractCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let FunctionExpressionCalleeDataExtractor = class FunctionExpressionCalleeDataExtractor extends AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor { + extract(blockScopeBody, callee) { + var _a; + let calleeBlockStatement = null; + if (NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { + calleeBlockStatement = this.getCalleeBlockStatement(NodeStatementUtils_1.NodeStatementUtils.getParentNodeWithStatements(blockScopeBody[0]), callee.name); + } + if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(callee)) { + calleeBlockStatement = callee.body; + } + if (!calleeBlockStatement) { + return null; + } + return { + callee: calleeBlockStatement, + name: (_a = callee.name) !== null && _a !== void 0 ? _a : null + }; + } + getCalleeBlockStatement(targetNode, name) { + let calleeBlockStatement = null; + estraverse.traverse(targetNode, { + enter: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) && + parentNode && + NodeGuards_1.NodeGuards.isVariableDeclaratorNode(parentNode) && + NodeGuards_1.NodeGuards.isIdentifierNode(parentNode.id) && + parentNode.id.name === name) { + calleeBlockStatement = node.body; + return estraverse.VisitorOption.Break; + } + } + }); + return calleeBlockStatement; + } +}; +FunctionExpressionCalleeDataExtractor = __decorate([ + inversify_1.injectable() +], FunctionExpressionCalleeDataExtractor); +exports.FunctionExpressionCalleeDataExtractor = FunctionExpressionCalleeDataExtractor; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts": +/*!**********************************************************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var ObjectExpressionCalleeDataExtractor_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const AbstractCalleeDataExtractor_1 = __webpack_require__(/*! ./AbstractCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor_1 = class ObjectExpressionCalleeDataExtractor extends AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor { + static isValidTargetPropertyNode(propertyNode, nextItemInCallsChain) { + if (!propertyNode.key) { + return false; + } + const isTargetPropertyNodeWithIdentifierKey = NodeGuards_1.NodeGuards.isIdentifierNode(propertyNode.key) && propertyNode.key.name === nextItemInCallsChain; + const isTargetPropertyNodeWithLiteralKey = NodeGuards_1.NodeGuards.isLiteralNode(propertyNode.key) && + Boolean(propertyNode.key.value) && + propertyNode.key.value === nextItemInCallsChain; + return isTargetPropertyNodeWithIdentifierKey || isTargetPropertyNodeWithLiteralKey; + } + extract(blockScopeBody, callee) { + if (!NodeGuards_1.NodeGuards.isMemberExpressionNode(callee)) { + return null; + } + const objectMembersCallsChain = this.createObjectMembersCallsChain([], callee); + if (!objectMembersCallsChain.length) { + return null; + } + const functionExpressionName = objectMembersCallsChain[objectMembersCallsChain.length - 1]; + const calleeBlockStatement = this.getCalleeBlockStatement(NodeStatementUtils_1.NodeStatementUtils.getParentNodeWithStatements(blockScopeBody[0]), objectMembersCallsChain); + if (!calleeBlockStatement) { + return null; + } + return { + callee: calleeBlockStatement, + name: functionExpressionName + }; + } + createObjectMembersCallsChain(currentChain, memberExpression) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpression.property) && memberExpression.computed === false) { + currentChain.unshift(memberExpression.property.name); + } + else if (NodeGuards_1.NodeGuards.isLiteralNode(memberExpression.property) && + (typeof memberExpression.property.value === 'string' || + typeof memberExpression.property.value === 'number')) { + currentChain.unshift(memberExpression.property.value); + } + else { + return currentChain; + } + if (NodeGuards_1.NodeGuards.isMemberExpressionNode(memberExpression.object)) { + return this.createObjectMembersCallsChain(currentChain, memberExpression.object); + } + else if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpression.object)) { + currentChain.unshift(memberExpression.object.name); + } + return currentChain; + } + getCalleeBlockStatement(targetNode, objectMembersCallsChain) { + const objectName = objectMembersCallsChain.shift(); + if (!objectName) { + return null; + } + let calleeBlockStatement = null; + estraverse.traverse(targetNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isVariableDeclaratorNode(node) && + NodeGuards_1.NodeGuards.isIdentifierNode(node.id) && + node.init && + NodeGuards_1.NodeGuards.isObjectExpressionNode(node.init) && + node.id.name === objectName) { + calleeBlockStatement = this.findCalleeBlockStatement(node.init.properties, objectMembersCallsChain); + return estraverse.VisitorOption.Break; + } + } + }); + return calleeBlockStatement; + } + findCalleeBlockStatement(objectExpressionProperties, objectMembersCallsChain) { + const nextItemInCallsChain = objectMembersCallsChain.shift(); + if (!nextItemInCallsChain) { + return null; + } + for (const propertyNode of objectExpressionProperties) { + if (!ObjectExpressionCalleeDataExtractor_1.isValidTargetPropertyNode(propertyNode, nextItemInCallsChain)) { + continue; + } + if (NodeGuards_1.NodeGuards.isObjectExpressionNode(propertyNode.value)) { + return this.findCalleeBlockStatement(propertyNode.value.properties, objectMembersCallsChain); + } + if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(propertyNode.value)) { + return propertyNode.value.body; + } + } + return null; + } +}; +ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor_1 = __decorate([ + inversify_1.injectable() +], ObjectExpressionCalleeDataExtractor); +exports.ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor; + + +/***/ }), + +/***/ "./src/analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer.ts": +/*!**************************************************************************************************!*\ + !*** ./src/analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer.ts ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var PrevailingKindOfVariablesAnalyzer_1, _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const IArrayUtils_1 = __webpack_require__(/*! ../../interfaces/utils/IArrayUtils */ "./src/interfaces/utils/IArrayUtils.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let PrevailingKindOfVariablesAnalyzer = PrevailingKindOfVariablesAnalyzer_1 = class PrevailingKindOfVariablesAnalyzer { + constructor(arrayUtils) { + this.prevailingKindOfVariables = PrevailingKindOfVariablesAnalyzer_1.defaultKindOfVariables; + this.arrayUtils = arrayUtils; + } + analyze(astTree) { + var _a; + const variableKinds = []; + estraverse.traverse(astTree, { + enter: (node) => { + if (!NodeGuards_1.NodeGuards.isVariableDeclarationNode(node)) { + return; + } + variableKinds.push(node.kind); + } + }); + this.prevailingKindOfVariables = (_a = this.arrayUtils.findMostOccurringElement(variableKinds)) !== null && _a !== void 0 ? _a : PrevailingKindOfVariablesAnalyzer_1.defaultKindOfVariables; + } + getPrevailingKind() { + return this.prevailingKindOfVariables; + } +}; +PrevailingKindOfVariablesAnalyzer.defaultKindOfVariables = 'var'; +PrevailingKindOfVariablesAnalyzer = PrevailingKindOfVariablesAnalyzer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), + __metadata("design:paramtypes", [typeof (_a = typeof IArrayUtils_1.IArrayUtils !== "undefined" && IArrayUtils_1.IArrayUtils) === "function" ? _a : Object]) +], PrevailingKindOfVariablesAnalyzer); +exports.PrevailingKindOfVariablesAnalyzer = PrevailingKindOfVariablesAnalyzer; + + +/***/ }), + +/***/ "./src/analyzers/scope-analyzer/ScopeAnalyzer.ts": +/*!*******************************************************!*\ + !*** ./src/analyzers/scope-analyzer/ScopeAnalyzer.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var ScopeAnalyzer_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const eslintScope = __importStar(__webpack_require__(/*! eslint-scope */ "eslint-scope")); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const EcmaVersion_1 = __webpack_require__(/*! ../../constants/EcmaVersion */ "./src/constants/EcmaVersion.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ScopeAnalyzer = ScopeAnalyzer_1 = class ScopeAnalyzer { + constructor() { + this.scopeManager = null; + } + static attachMissingRanges(astTree) { + estraverse.replace(astTree, { + enter: (node) => { + if (!node.range) { + node.range = [ + ScopeAnalyzer_1.emptyRangeValue, + ScopeAnalyzer_1.emptyRangeValue + ]; + } + return node; + } + }); + } + static isRootNode(node) { + return NodeGuards_1.NodeGuards.isProgramNode(node) || node.parentNode === node; + } + analyze(astTree) { + const sourceTypeLength = ScopeAnalyzer_1.sourceTypes.length; + ScopeAnalyzer_1.attachMissingRanges(astTree); + for (let i = 0; i < sourceTypeLength; i++) { + try { + this.scopeManager = eslintScope.analyze(astTree, Object.assign(Object.assign({}, ScopeAnalyzer_1.eslintScopeOptions), { sourceType: ScopeAnalyzer_1.sourceTypes[i] })); + return; + } + catch (error) { + if (i < sourceTypeLength - 1) { + continue; + } + throw new Error(error); + } + } + throw new Error('Scope analyzing error'); + } + acquireScope(node) { + if (!this.scopeManager) { + throw new Error('Scope manager is not defined'); + } + const scope = this.scopeManager.acquire(node, ScopeAnalyzer_1.isRootNode(node)); + if (!scope) { + throw new Error('Cannot acquire scope for node'); + } + this.sanitizeScopes(scope); + return scope; + } + sanitizeScopes(scope) { + scope.childScopes.forEach((childScope) => { + if (childScope.type === 'class' && childScope.upper) { + if (!childScope.variables.length) { + return; + } + const classNameVariable = childScope.variables[0]; + const upperVariable = childScope.upper.variables + .find((variable) => { + const isValidClassNameVariable = classNameVariable.defs + .some((definition) => definition.type === 'ClassName'); + return isValidClassNameVariable && variable.name === classNameVariable.name; + }); + upperVariable === null || upperVariable === void 0 ? void 0 : upperVariable.references.push(...childScope.variables[0].references); + } + }); + for (const childScope of scope.childScopes) { + this.sanitizeScopes(childScope); + } + } +}; +ScopeAnalyzer.eslintScopeOptions = { + ecmaVersion: EcmaVersion_1.ecmaVersion, + optimistic: true +}; +ScopeAnalyzer.sourceTypes = [ + 'script', + 'module' +]; +ScopeAnalyzer.emptyRangeValue = 0; +ScopeAnalyzer = ScopeAnalyzer_1 = __decorate([ + inversify_1.injectable() +], ScopeAnalyzer); +exports.ScopeAnalyzer = ScopeAnalyzer; + + +/***/ }), + +/***/ "./src/analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer.ts": +/*!***********************************************************************************!*\ + !*** ./src/analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer.ts ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var StringArrayStorageAnalyzer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IStringArrayStorage_1 = __webpack_require__(/*! ../../interfaces/storages/string-array-storage/IStringArrayStorage */ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +const NodeLiteralUtils_1 = __webpack_require__(/*! ../../node/NodeLiteralUtils */ "./src/node/NodeLiteralUtils.ts"); +let StringArrayStorageAnalyzer = StringArrayStorageAnalyzer_1 = class StringArrayStorageAnalyzer { + constructor(stringArrayStorage, randomGenerator, options) { + this.stringArrayStorageData = new Map(); + this.stringArrayStorage = stringArrayStorage; + this.randomGenerator = randomGenerator; + this.options = options; + } + analyze(astTree) { + if (!this.options.stringArray) { + return; + } + estraverse.traverse(astTree, { + enter: (node, parentNode) => { + if (!parentNode) { + return; + } + if (NodeMetadata_1.NodeMetadata.isIgnoredNode(node)) { + return estraverse.VisitorOption.Skip; + } + if (!NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return; + } + this.analyzeLiteralNode(node, parentNode); + } + }); + } + getItemDataForLiteralNode(literalNode) { + return this.stringArrayStorageData.get(literalNode); + } + analyzeLiteralNode(literalNode, parentNode) { + if (typeof literalNode.value !== 'string') { + return; + } + if (NodeLiteralUtils_1.NodeLiteralUtils.isProhibitedLiteralNode(literalNode, parentNode)) { + return; + } + if (!this.shouldAddValueToStringArray(literalNode.value)) { + return; + } + this.stringArrayStorageData.set(literalNode, this.stringArrayStorage.getOrThrow(literalNode.value)); + } + shouldAddValueToStringArray(value) { + return value.length >= StringArrayStorageAnalyzer_1.minimumLengthForStringArray + && this.randomGenerator.getMathRandom() <= this.options.stringArrayThreshold; + } +}; +StringArrayStorageAnalyzer.minimumLengthForStringArray = 3; +StringArrayStorageAnalyzer = StringArrayStorageAnalyzer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorage)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IStringArrayStorage_1.IStringArrayStorage !== "undefined" && IStringArrayStorage_1.IStringArrayStorage) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], StringArrayStorageAnalyzer); +exports.StringArrayStorageAnalyzer = StringArrayStorageAnalyzer; + + +/***/ }), + +/***/ "./src/cli/JavaScriptObfuscatorCLI.ts": +/*!********************************************!*\ + !*** ./src/cli/JavaScriptObfuscatorCLI.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const commander = __importStar(__webpack_require__(/*! commander */ "commander")); +const path = __importStar(__webpack_require__(/*! path */ "path")); +const TInputCLIOptions_1 = __webpack_require__(/*! ../types/options/TInputCLIOptions */ "./src/types/options/TInputCLIOptions.ts"); +const Initializable_1 = __webpack_require__(/*! ../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const Default_1 = __webpack_require__(/*! ../options/presets/Default */ "./src/options/presets/Default.ts"); +const ArraySanitizer_1 = __webpack_require__(/*! ./sanitizers/ArraySanitizer */ "./src/cli/sanitizers/ArraySanitizer.ts"); +const BooleanSanitizer_1 = __webpack_require__(/*! ./sanitizers/BooleanSanitizer */ "./src/cli/sanitizers/BooleanSanitizer.ts"); +const IdentifierNamesGeneratorSanitizer_1 = __webpack_require__(/*! ./sanitizers/IdentifierNamesGeneratorSanitizer */ "./src/cli/sanitizers/IdentifierNamesGeneratorSanitizer.ts"); +const ObfuscatingTargetSanitizer_1 = __webpack_require__(/*! ./sanitizers/ObfuscatingTargetSanitizer */ "./src/cli/sanitizers/ObfuscatingTargetSanitizer.ts"); +const SourceMapModeSanitizer_1 = __webpack_require__(/*! ./sanitizers/SourceMapModeSanitizer */ "./src/cli/sanitizers/SourceMapModeSanitizer.ts"); +const StringArrayEncodingSanitizer_1 = __webpack_require__(/*! ./sanitizers/StringArrayEncodingSanitizer */ "./src/cli/sanitizers/StringArrayEncodingSanitizer.ts"); +const CLIUtils_1 = __webpack_require__(/*! ./utils/CLIUtils */ "./src/cli/utils/CLIUtils.ts"); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ../JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +const SourceCodeReader_1 = __webpack_require__(/*! ./utils/SourceCodeReader */ "./src/cli/utils/SourceCodeReader.ts"); +class JavaScriptObfuscatorCLI { + constructor(argv) { + this.rawArguments = argv; + this.arguments = argv.slice(2); + } + static buildOptions(inputOptions, inputCodePath) { + const inputCLIOptions = JavaScriptObfuscatorCLI.filterOptions(inputOptions); + const configFilePath = inputOptions.config; + const configFileLocation = configFilePath ? path.resolve(configFilePath, '.') : ''; + const configFileOptions = configFileLocation ? CLIUtils_1.CLIUtils.getUserConfig(configFileLocation) : {}; + const inputFileName = path.basename(inputCodePath); + const inputFilePath = inputCodePath; + console.log(inputFilePath, inputFileName); + return Object.assign(Object.assign(Object.assign(Object.assign({}, Default_1.DEFAULT_PRESET), configFileOptions), inputCLIOptions), { inputFileName, + inputFilePath }); + } + static filterOptions(options) { + const filteredOptions = {}; + Object + .keys(options) + .forEach((option) => { + if (options[option] === undefined) { + return; + } + filteredOptions[option] = options[option]; + }); + return filteredOptions; + } + static processSourceCodeWithoutSourceMap(sourceCode, outputCodePath, options) { + const obfuscatedCode = JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(sourceCode, options).getObfuscatedCode(); + CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscatedCode); + } + static processSourceCodeWithSourceMap(sourceCode, outputCodePath, options) { + var _a; + const outputSourceMapPath = CLIUtils_1.CLIUtils.getOutputSourceMapPath(outputCodePath, (_a = options.sourceMapFileName) !== null && _a !== void 0 ? _a : ''); + options = Object.assign(Object.assign({}, options), { sourceMapFileName: path.basename(outputSourceMapPath) }); + const obfuscatedCode = JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(sourceCode, options); + CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscatedCode.getObfuscatedCode()); + if (options.sourceMapMode === 'separate' && obfuscatedCode.getSourceMap()) { + CLIUtils_1.CLIUtils.writeFile(outputSourceMapPath, obfuscatedCode.getSourceMap()); + } + } + initialize() { + this.inputPath = path.normalize(this.arguments[0] || ''); + this.commands = (new commander.Command()); + this.configureCommands(); + this.configureHelp(); + this.inputCLIOptions = this.commands.opts(); + } + run() { + const canShowHelp = !this.arguments.length || this.arguments.includes('--help'); + if (canShowHelp) { + this.commands.outputHelp(); + return; + } + const sourceCodeData = new SourceCodeReader_1.SourceCodeReader(this.inputCLIOptions) + .readSourceCode(this.inputPath); + this.processSourceCodeData(sourceCodeData); + } + configureCommands() { + var _a; + this.commands + .usage(' [options]') + .version((_a = "0.24.4") !== null && _a !== void 0 ? _a : 'unknown', '-v, --version') + .option('-o, --output ', 'Output path for obfuscated code') + .option('--compact ', 'Disable one line output code compacting', BooleanSanitizer_1.BooleanSanitizer) + .option('--config ', 'Name of js / json config file') + .option('--control-flow-flattening ', 'Enables control flow flattening', BooleanSanitizer_1.BooleanSanitizer) + .option('--control-flow-flattening-threshold ', 'The probability that the control flow flattening transformation will be applied to the node', parseFloat) + .option('--dead-code-injection ', 'Enables dead code injection', BooleanSanitizer_1.BooleanSanitizer) + .option('--dead-code-injection-threshold ', 'The probability that the dead code injection transformation will be applied to the node', parseFloat) + .option('--debug-protection ', 'Disable browser Debug panel (can cause DevTools enabled browser freeze)', BooleanSanitizer_1.BooleanSanitizer) + .option('--debug-protection-interval ', 'Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)', BooleanSanitizer_1.BooleanSanitizer) + .option('--disable-console-output ', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', BooleanSanitizer_1.BooleanSanitizer) + .option('--domain-lock (comma separated, without whitespaces)', 'Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)', ArraySanitizer_1.ArraySanitizer) + .option('--exclude (comma separated, without whitespaces)', 'A filename or glob which indicates files to exclude from obfuscation', ArraySanitizer_1.ArraySanitizer) + .option('--identifier-names-generator ', 'Sets identifier names generator. ' + + 'Values: hexadecimal, mangled, dictionary. ' + + 'Default: hexadecimal', IdentifierNamesGeneratorSanitizer_1.IdentifierNamesGeneratorSanitizer) + .option('--identifiers-prefix ', 'Sets prefix for all global identifiers.') + .option('--identifiers-dictionary (comma separated, without whitespaces)', 'Identifiers dictionary (comma separated) for `--identifier-names-generator dictionary` option', ArraySanitizer_1.ArraySanitizer) + .option('--log ', 'Enables logging of the information to the console', BooleanSanitizer_1.BooleanSanitizer) + .option('--reserved-names (comma separated, without whitespaces)', 'Disables obfuscation and generation of identifiers, which being matched by passed RegExp patterns (comma separated)', ArraySanitizer_1.ArraySanitizer) + .option('--reserved-strings (comma separated, without whitespaces)', 'Disables transformation of string literals, which being matched by passed RegExp patterns (comma separated)', ArraySanitizer_1.ArraySanitizer) + .option('--rename-globals ', 'Allows to enable obfuscation of global variable and function names with declaration.', BooleanSanitizer_1.BooleanSanitizer) + .option('--rotate-string-array ', 'Enable rotation of string array values during obfuscation', BooleanSanitizer_1.BooleanSanitizer) + .option('--seed ', 'Sets seed for random generator. This is useful for creating repeatable results.', parseFloat) + .option('--self-defending ', 'Disables self-defending for obfuscated code', BooleanSanitizer_1.BooleanSanitizer) + .option('--shuffle-string-array ', 'Randomly shuffles string array items', BooleanSanitizer_1.BooleanSanitizer) + .option('--source-map ', 'Enables source map generation', BooleanSanitizer_1.BooleanSanitizer) + .option('--source-map-base-url ', 'Sets base url to the source map import url when `--source-map-mode=separate`') + .option('--source-map-file-name ', 'Sets file name for output source map when `--source-map-mode=separate`') + .option('--source-map-mode ', 'Specify source map output mode. ' + + 'Values: inline, separate. ' + + 'Default: separate', SourceMapModeSanitizer_1.SourceMapModeSanitizer) + .option('--split-strings ', 'Splits literal strings into chunks with length of `splitStringsChunkLength` option value', BooleanSanitizer_1.BooleanSanitizer) + .option('--split-strings-chunk-length ', 'Sets chunk length of `splitStrings` option', parseFloat) + .option('--string-array ', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', BooleanSanitizer_1.BooleanSanitizer) + .option('--string-array-encoding ', 'Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed. ' + + 'Values: true, false, base64, rc4. ' + + 'Default: false', StringArrayEncodingSanitizer_1.StringArrayEncodingSanitizer) + .option('--string-array-threshold ', 'The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)', parseFloat) + .option('--target ', 'Allows to set target environment for obfuscated code. ' + + 'Values: browser, browser-no-eval, node. ' + + 'Default: browser', ObfuscatingTargetSanitizer_1.ObfuscationTargetSanitizer) + .option('--transform-object-keys ', 'Enables transformation of object keys', BooleanSanitizer_1.BooleanSanitizer) + .option('--unicode-escape-sequence ', 'Allows to enable/disable string conversion to unicode escape sequence', BooleanSanitizer_1.BooleanSanitizer) + .parse(this.rawArguments); + } + configureHelp() { + this.commands.on('--help', () => { + console.log(' Examples:\n'); + console.log(' %> javascript-obfuscator input_file_name.js --compact true --self-defending false'); + console.log(' %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false'); + console.log(' %> javascript-obfuscator input_directory_name --compact true --self-defending false'); + console.log(''); + }); + } + processSourceCodeData(sourceCodeData) { + sourceCodeData.forEach(({ filePath, content }, index) => { + const outputCodePath = CLIUtils_1.CLIUtils.getOutputCodePath(filePath, this.inputCLIOptions.output); + this.processSourceCode(content, filePath, outputCodePath, index); + }); + } + processSourceCode(sourceCode, inputCodePath, outputCodePath, sourceCodeIndex) { + var _a; + let options = JavaScriptObfuscatorCLI.buildOptions(this.inputCLIOptions, inputCodePath); + if (sourceCodeIndex !== null) { + const baseIdentifiersPrefix = (_a = this.inputCLIOptions.identifiersPrefix) !== null && _a !== void 0 ? _a : JavaScriptObfuscatorCLI.baseIdentifiersPrefix; + const identifiersPrefix = `${baseIdentifiersPrefix}${sourceCodeIndex}`; + options = Object.assign(Object.assign({}, options), { identifiersPrefix }); + } + if (options.sourceMap) { + JavaScriptObfuscatorCLI.processSourceCodeWithSourceMap(sourceCode, outputCodePath, options); + } + else { + JavaScriptObfuscatorCLI.processSourceCodeWithoutSourceMap(sourceCode, outputCodePath, options); + } + } +} +JavaScriptObfuscatorCLI.encoding = 'utf8'; +JavaScriptObfuscatorCLI.obfuscatedFilePrefix = '-obfuscated'; +JavaScriptObfuscatorCLI.baseIdentifiersPrefix = 'a'; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof commander !== "undefined" && commander.CommanderStatic) === "function" ? _a : Object) +], JavaScriptObfuscatorCLI.prototype, "commands", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_b = typeof TInputCLIOptions_1.TInputCLIOptions !== "undefined" && TInputCLIOptions_1.TInputCLIOptions) === "function" ? _b : Object) +], JavaScriptObfuscatorCLI.prototype, "inputCLIOptions", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], JavaScriptObfuscatorCLI.prototype, "inputPath", void 0); +exports.JavaScriptObfuscatorCLI = JavaScriptObfuscatorCLI; + + +/***/ }), + +/***/ "./src/cli/sanitizers/ArraySanitizer.ts": +/*!**********************************************!*\ + !*** ./src/cli/sanitizers/ArraySanitizer.ts ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ArraySanitizer = (value) => { + if (value.endsWith(',')) { + throw new SyntaxError('Multiple values should be wrapped inside quotes: --option-name \'value1\',\'value2\''); + } + return value.split(',').map((string) => string.trim()); +}; + + +/***/ }), + +/***/ "./src/cli/sanitizers/BooleanSanitizer.ts": +/*!************************************************!*\ + !*** ./src/cli/sanitizers/BooleanSanitizer.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BooleanSanitizer = (value) => { + return value === 'true' || value === '1'; +}; + + +/***/ }), + +/***/ "./src/cli/sanitizers/IdentifierNamesGeneratorSanitizer.ts": +/*!*****************************************************************!*\ + !*** ./src/cli/sanitizers/IdentifierNamesGeneratorSanitizer.ts ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const IdentifierNamesGenerator_1 = __webpack_require__(/*! ../../enums/generators/identifier-names-generators/IdentifierNamesGenerator */ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts"); +exports.IdentifierNamesGeneratorSanitizer = (value) => { + const isCorrectIdentifierNamesGenerator = Object + .keys(IdentifierNamesGenerator_1.IdentifierNamesGenerator) + .some((key) => { + return IdentifierNamesGenerator_1.IdentifierNamesGenerator[key] === value; + }); + if (!isCorrectIdentifierNamesGenerator) { + throw new ReferenceError('Invalid value of `--identifier-names-generator` option'); + } + return value; +}; + + +/***/ }), + +/***/ "./src/cli/sanitizers/ObfuscatingTargetSanitizer.ts": +/*!**********************************************************!*\ + !*** ./src/cli/sanitizers/ObfuscatingTargetSanitizer.ts ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +exports.ObfuscationTargetSanitizer = (value) => { + const isCorrectTarget = Object + .keys(ObfuscationTarget_1.ObfuscationTarget) + .some((key) => { + return ObfuscationTarget_1.ObfuscationTarget[key] === value; + }); + if (!isCorrectTarget) { + throw new ReferenceError('Invalid value of `--target` option'); + } + return value; +}; + + +/***/ }), + +/***/ "./src/cli/sanitizers/SourceMapModeSanitizer.ts": +/*!******************************************************!*\ + !*** ./src/cli/sanitizers/SourceMapModeSanitizer.ts ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const SourceMapMode_1 = __webpack_require__(/*! ../../enums/source-map/SourceMapMode */ "./src/enums/source-map/SourceMapMode.ts"); +exports.SourceMapModeSanitizer = (value) => { + const isCorrectSourceMapMode = Object + .keys(SourceMapMode_1.SourceMapMode) + .some((key) => { + return SourceMapMode_1.SourceMapMode[key] === value; + }); + if (!isCorrectSourceMapMode) { + throw new ReferenceError('Invalid value of `--source-map-mode` option'); + } + return value; +}; + + +/***/ }), + +/***/ "./src/cli/sanitizers/StringArrayEncodingSanitizer.ts": +/*!************************************************************!*\ + !*** ./src/cli/sanitizers/StringArrayEncodingSanitizer.ts ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const StringArrayEncoding_1 = __webpack_require__(/*! ../../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +exports.StringArrayEncodingSanitizer = (value) => { + switch (value) { + case 'true': + case '1': + case StringArrayEncoding_1.StringArrayEncoding.Base64: + return true; + case StringArrayEncoding_1.StringArrayEncoding.Rc4: + return StringArrayEncoding_1.StringArrayEncoding.Rc4; + default: + return false; + } +}; + + +/***/ }), + +/***/ "./src/cli/utils sync recursive": +/*!****************************!*\ + !*** ./src/cli/utils sync ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function webpackEmptyContext(req) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; +} +webpackEmptyContext.keys = function() { return []; }; +webpackEmptyContext.resolve = webpackEmptyContext; +module.exports = webpackEmptyContext; +webpackEmptyContext.id = "./src/cli/utils sync recursive"; + +/***/ }), + +/***/ "./src/cli/utils/CLIUtils.ts": +/*!***********************************!*\ + !*** ./src/cli/utils/CLIUtils.ts ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = __importStar(__webpack_require__(/*! fs */ "fs")); +const mkdirp = __importStar(__webpack_require__(/*! mkdirp */ "mkdirp")); +const path = __importStar(__webpack_require__(/*! path */ "path")); +const StringSeparator_1 = __webpack_require__(/*! ../../enums/StringSeparator */ "./src/enums/StringSeparator.ts"); +const JavaScriptObfuscatorCLI_1 = __webpack_require__(/*! ../JavaScriptObfuscatorCLI */ "./src/cli/JavaScriptObfuscatorCLI.ts"); +class CLIUtils { + static getOutputCodePath(inputPath, baseOutputPath) { + const normalizedBaseOutputPath = baseOutputPath + ? path.normalize(baseOutputPath) + : null; + if (!normalizedBaseOutputPath) { + return path + .normalize(inputPath) + .split(StringSeparator_1.StringSeparator.Dot) + .map((value, index) => { + return index === 0 ? `${value}${JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.obfuscatedFilePrefix}` : value; + }) + .join(StringSeparator_1.StringSeparator.Dot); + } + const isDirectoryPath = path.extname(normalizedBaseOutputPath) === ''; + return isDirectoryPath + ? path.join(normalizedBaseOutputPath, inputPath) + : normalizedBaseOutputPath; + } + static getOutputSourceMapPath(outputCodePath, sourceMapFileName = '') { + if (sourceMapFileName) { + outputCodePath = `${outputCodePath.substring(0, outputCodePath.lastIndexOf('/'))}/${sourceMapFileName}`; + } + if (!/\.js\.map$/.test(outputCodePath)) { + outputCodePath = `${outputCodePath.split(StringSeparator_1.StringSeparator.Dot)[0]}.js.map`; + } + else if (/\.js$/.test(outputCodePath)) { + outputCodePath += '.map'; + } + return outputCodePath; + } + static getUserConfig(configPath) { + let config; + try { + config = __webpack_require__("./src/cli/utils sync recursive")(configPath); + } + catch (_a) { + try { + config = require(configPath); + } + catch (_b) { + throw new ReferenceError('Given config path must be a valid `.js` or `.json` file path'); + } + } + return config; + } + static writeFile(outputPath, data) { + mkdirp.sync(path.dirname(outputPath)); + fs.writeFileSync(outputPath, data, { + encoding: JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.encoding + }); + } +} +exports.CLIUtils = CLIUtils; + + +/***/ }), + +/***/ "./src/cli/utils/SourceCodeReader.ts": +/*!*******************************************!*\ + !*** ./src/cli/utils/SourceCodeReader.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = __importStar(__webpack_require__(/*! fs */ "fs")); +const path = __importStar(__webpack_require__(/*! path */ "path")); +const multimatch_1 = __importDefault(__webpack_require__(/*! multimatch */ "multimatch")); +const LoggingPrefix_1 = __webpack_require__(/*! ../../enums/logger/LoggingPrefix */ "./src/enums/logger/LoggingPrefix.ts"); +const JavaScriptObfuscatorCLI_1 = __webpack_require__(/*! ../JavaScriptObfuscatorCLI */ "./src/cli/JavaScriptObfuscatorCLI.ts"); +const Logger_1 = __webpack_require__(/*! ../../logger/Logger */ "./src/logger/Logger.ts"); +class SourceCodeReader { + constructor(options) { + this.options = options; + } + static isExcludedPath(filePath, excludePatterns = []) { + if (!excludePatterns.length) { + return false; + } + const fileName = path.basename(filePath); + const isExcludedFilePathByGlobPattern = !!multimatch_1.default([filePath], excludePatterns).length; + const isExcludedFilePathByInclusion = excludePatterns.some((excludePattern) => filePath.includes(excludePattern) || fileName.includes(excludePattern)); + return isExcludedFilePathByInclusion || isExcludedFilePathByGlobPattern; + } + static isDirectoryPath(filePath) { + try { + return fs.statSync(filePath).isDirectory(); + } + catch (_a) { + return false; + } + } + static isFilePath(filePath) { + try { + return fs.statSync(filePath).isFile(); + } + catch (_a) { + return false; + } + } + static logFilePath(filePath) { + const normalizedFilePath = path.normalize(filePath); + Logger_1.Logger.log(Logger_1.Logger.colorInfo, LoggingPrefix_1.LoggingPrefix.CLI, `Obfuscating file: ${normalizedFilePath}...`); + } + readSourceCode(inputPath) { + if (SourceCodeReader.isFilePath(inputPath) && this.isValidFile(inputPath)) { + return [this.readFile(inputPath)]; + } + if (SourceCodeReader.isDirectoryPath(inputPath) && this.isValidDirectory(inputPath)) { + return this.readDirectoryRecursive(inputPath); + } + const availableFilePaths = SourceCodeReader + .availableInputExtensions + .map((extension) => `\`${extension}\``) + .join(', '); + throw new ReferenceError(`Given input path must be a valid ${availableFilePaths} file or directory path`); + } + readDirectoryRecursive(directoryPath, filesData = []) { + fs.readdirSync(directoryPath, JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.encoding) + .forEach((fileName) => { + const filePath = `${directoryPath}/${fileName}`; + if (SourceCodeReader.isDirectoryPath(filePath) && this.isValidDirectory(filePath)) { + filesData.push(...this.readDirectoryRecursive(filePath)); + } + else if (SourceCodeReader.isFilePath(filePath) && this.isValidFile(filePath)) { + const fileData = this.readFile(filePath); + filesData.push(fileData); + } + }); + return filesData; + } + readFile(filePath) { + SourceCodeReader.logFilePath(filePath); + return { + filePath, + content: fs.readFileSync(filePath, JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.encoding) + }; + } + isValidDirectory(directoryPath) { + return !SourceCodeReader.isExcludedPath(directoryPath, this.options.exclude); + } + isValidFile(filePath) { + return SourceCodeReader.availableInputExtensions.includes(path.extname(filePath)) + && !filePath.includes(JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.obfuscatedFilePrefix) + && !SourceCodeReader.isExcludedPath(filePath, this.options.exclude); + } +} +exports.SourceCodeReader = SourceCodeReader; +SourceCodeReader.availableInputExtensions = [ + '.js' +]; + + +/***/ }), + +/***/ "./src/constants/EcmaVersion.ts": +/*!**************************************!*\ + !*** ./src/constants/EcmaVersion.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ecmaVersion = 11; + + +/***/ }), + +/***/ "./src/container/InversifyContainerFacade.ts": +/*!***************************************************!*\ + !*** ./src/container/InversifyContainerFacade.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ./ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const AnalyzersModule_1 = __webpack_require__(/*! ./modules/analyzers/AnalyzersModule */ "./src/container/modules/analyzers/AnalyzersModule.ts"); +const ControlFlowTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/ControlFlowTransformersModule */ "./src/container/modules/node-transformers/ControlFlowTransformersModule.ts"); +const ConvertingTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/ConvertingTransformersModule */ "./src/container/modules/node-transformers/ConvertingTransformersModule.ts"); +const CustomNodesModule_1 = __webpack_require__(/*! ./modules/custom-nodes/CustomNodesModule */ "./src/container/modules/custom-nodes/CustomNodesModule.ts"); +const FinalizingTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/FinalizingTransformersModule */ "./src/container/modules/node-transformers/FinalizingTransformersModule.ts"); +const GeneratorsModule_1 = __webpack_require__(/*! ./modules/generators/GeneratorsModule */ "./src/container/modules/generators/GeneratorsModule.ts"); +const NodeTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/NodeTransformersModule */ "./src/container/modules/node-transformers/NodeTransformersModule.ts"); +const ObfuscatingTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/ObfuscatingTransformersModule */ "./src/container/modules/node-transformers/ObfuscatingTransformersModule.ts"); +const OptionsModule_1 = __webpack_require__(/*! ./modules/options/OptionsModule */ "./src/container/modules/options/OptionsModule.ts"); +const PreparingTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/PreparingTransformersModule */ "./src/container/modules/node-transformers/PreparingTransformersModule.ts"); +const StoragesModule_1 = __webpack_require__(/*! ./modules/storages/StoragesModule */ "./src/container/modules/storages/StoragesModule.ts"); +const UtilsModule_1 = __webpack_require__(/*! ./modules/utils/UtilsModule */ "./src/container/modules/utils/UtilsModule.ts"); +const JavaScriptObfuscator_1 = __webpack_require__(/*! ../JavaScriptObfuscator */ "./src/JavaScriptObfuscator.ts"); +const Logger_1 = __webpack_require__(/*! ../logger/Logger */ "./src/logger/Logger.ts"); +const ObfuscationEventEmitter_1 = __webpack_require__(/*! ../event-emitters/ObfuscationEventEmitter */ "./src/event-emitters/ObfuscationEventEmitter.ts"); +const ObfuscatedCode_1 = __webpack_require__(/*! ../source-code/ObfuscatedCode */ "./src/source-code/ObfuscatedCode.ts"); +const SourceCode_1 = __webpack_require__(/*! ../source-code/SourceCode */ "./src/source-code/SourceCode.ts"); +const TransformersRunner_1 = __webpack_require__(/*! ../node-transformers/TransformersRunner */ "./src/node-transformers/TransformersRunner.ts"); +class InversifyContainerFacade { + constructor() { + this.container = new inversify_1.Container(); + } + static getFactory(serviceIdentifier) { + return (context) => { + return (bindingName) => { + return context.container.getNamed(serviceIdentifier, bindingName); + }; + }; + } + static getCacheFactory(serviceIdentifier) { + return (context) => { + const cache = new Map(); + return (bindingName) => { + if (cache.has(bindingName)) { + return cache.get(bindingName); + } + const object = context.container.getNamed(serviceIdentifier, bindingName); + cache.set(bindingName, object); + return object; + }; + }; + } + static getConstructorFactory(serviceIdentifier, ...dependencies) { + return (context) => { + const cache = new Map(); + const cachedDependencies = []; + return (bindingName) => { + dependencies.forEach((dependency, index) => { + if (!cachedDependencies[index]) { + cachedDependencies[index] = context.container.get(dependency); + } + }); + if (cache.has(bindingName)) { + return new (cache.get(bindingName))(...cachedDependencies); + } + const constructor = context.container + .getNamed(serviceIdentifier, bindingName); + cache.set(bindingName, constructor); + return new constructor(...cachedDependencies); + }; + }; + } + get(serviceIdentifier) { + return this.container.get(serviceIdentifier); + } + getNamed(serviceIdentifier, named) { + return this.container.getNamed(serviceIdentifier, named); + } + load(sourceCode, sourceMap, options) { + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.ISourceCode) + .toDynamicValue(() => new SourceCode_1.SourceCode(sourceCode, sourceMap)) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.TInputOptions) + .toDynamicValue(() => options) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.ILogger) + .to(Logger_1.Logger) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.IJavaScriptObfuscator) + .to(JavaScriptObfuscator_1.JavaScriptObfuscator) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner) + .to(TransformersRunner_1.TransformersRunner) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatedCode) + .to(ObfuscatedCode_1.ObfuscatedCode); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatedCode) + .toFactory((context) => { + return (obfuscatedCodeAsString, sourceMapAsString) => { + const obfuscatedCode = context.container + .get(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatedCode); + obfuscatedCode.initialize(obfuscatedCodeAsString, sourceMapAsString); + return obfuscatedCode; + }; + }); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationEventEmitter) + .to(ObfuscationEventEmitter_1.ObfuscationEventEmitter) + .inSingletonScope(); + this.container.load(AnalyzersModule_1.analyzersModule); + this.container.load(ControlFlowTransformersModule_1.controlFlowTransformersModule); + this.container.load(ConvertingTransformersModule_1.convertingTransformersModule); + this.container.load(CustomNodesModule_1.customNodesModule); + this.container.load(FinalizingTransformersModule_1.finalizingTransformersModule); + this.container.load(GeneratorsModule_1.generatorsModule); + this.container.load(NodeTransformersModule_1.nodeTransformersModule); + this.container.load(ObfuscatingTransformersModule_1.obfuscatingTransformersModule); + this.container.load(OptionsModule_1.optionsModule); + this.container.load(PreparingTransformersModule_1.preparingTransformersModule); + this.container.load(StoragesModule_1.storagesModule); + this.container.load(UtilsModule_1.utilsModule); + } + unload() { + this.container.unbindAll(); + } +} +exports.InversifyContainerFacade = InversifyContainerFacade; + + +/***/ }), + +/***/ "./src/container/ServiceIdentifiers.ts": +/*!*********************************************!*\ + !*** ./src/container/ServiceIdentifiers.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ServiceIdentifiers; +(function (ServiceIdentifiers) { + ServiceIdentifiers["Factory__ICalleeDataExtractor"] = "Factory"; + ServiceIdentifiers["Factory__IControlFlowCustomNode"] = "Factory"; + ServiceIdentifiers["Factory__IControlFlowReplacer"] = "Factory"; + ServiceIdentifiers["Factory__ICustomNode"] = "Factory"; + ServiceIdentifiers["Factory__ICustomNodeGroup"] = "Factory"; + ServiceIdentifiers["Factory__IDeadCodeInjectionCustomNode"] = "Factory"; + ServiceIdentifiers["Factory__IIdentifierNamesGenerator"] = "Factory"; + ServiceIdentifiers["Factory__IIdentifierObfuscatingReplacer"] = "Factory"; + ServiceIdentifiers["Factory__INodeGuard"] = "Factory"; + ServiceIdentifiers["Factory__INodeTransformer"] = "Factory"; + ServiceIdentifiers["Factory__IObfuscatedCode"] = "Factory"; + ServiceIdentifiers["Factory__IObfuscatingReplacer"] = "Factory"; + ServiceIdentifiers["Factory__IObjectExpressionKeysTransformerCustomNode"] = "Factory"; + ServiceIdentifiers["Factory__IObjectExpressionExtractor"] = "Factory"; + ServiceIdentifiers["Factory__TControlFlowStorage"] = "Factory"; + ServiceIdentifiers["IArrayUtils"] = "IArrayUtils"; + ServiceIdentifiers["ICalleeDataExtractor"] = "ICalleeDataExtractor"; + ServiceIdentifiers["ICallsGraphAnalyzer"] = "ICallsGraphAnalyzer"; + ServiceIdentifiers["ICryptUtils"] = "ICryptUtils"; + ServiceIdentifiers["ICustomNode"] = "ICustomNode"; + ServiceIdentifiers["ICustomNodeGroup"] = "ICustomNodeGroup"; + ServiceIdentifiers["IControlFlowReplacer"] = "IControlFlowReplacer"; + ServiceIdentifiers["ICustomNodeFormatter"] = "ICustomNodeFormatter"; + ServiceIdentifiers["IEscapeSequenceEncoder"] = "IEscapeSequenceEncoder"; + ServiceIdentifiers["IIdentifierNamesGenerator"] = "IIdentifierNamesGenerator"; + ServiceIdentifiers["IIdentifierObfuscatingReplacer"] = "IIdentifierObfuscatingReplacer"; + ServiceIdentifiers["IJavaScriptObfuscator"] = "IJavaScriptObfuscator"; + ServiceIdentifiers["ILevelledTopologicalSorter"] = "ILevelledTopologicalSorter"; + ServiceIdentifiers["ILogger"] = "ILogger"; + ServiceIdentifiers["INodeGuard"] = "INodeGuard"; + ServiceIdentifiers["INodeTransformer"] = "INodeTransformer"; + ServiceIdentifiers["INodeTransformerNamesGroupsBuilder"] = "INodeTransformerNamesGroupsBuilder"; + ServiceIdentifiers["IObfuscationEventEmitter"] = "IObfuscationEventEmitter"; + ServiceIdentifiers["IObfuscatedCode"] = "IObfuscatedCode"; + ServiceIdentifiers["IOptions"] = "IOptions"; + ServiceIdentifiers["IOptionsNormalizer"] = "IOptionsNormalizer"; + ServiceIdentifiers["IObfuscatingReplacer"] = "IObfuscatingReplacer"; + ServiceIdentifiers["IPrevailingKindOfVariablesAnalyzer"] = "IPrevailingKindOfVariablesAnalyzer"; + ServiceIdentifiers["IObjectExpressionExtractor"] = "IObjectExpressionExtractor"; + ServiceIdentifiers["IRandomGenerator"] = "IRandomGenerator"; + ServiceIdentifiers["ISourceCode"] = "ISourceCode"; + ServiceIdentifiers["ISourceMapCorrector"] = "ISourceMapCorrector"; + ServiceIdentifiers["IScopeAnalyzer"] = "IScopeAnalyzer"; + ServiceIdentifiers["IStringArrayStorage"] = "IStringArrayStorage"; + ServiceIdentifiers["IStringArrayStorageAnalyzer"] = "IStringArrayStorageAnalyzer"; + ServiceIdentifiers["ITransformersRunner"] = "ITransformersRunner"; + ServiceIdentifiers["Newable__ICustomNode"] = "Newable"; + ServiceIdentifiers["Newable__TControlFlowStorage"] = "Newable"; + ServiceIdentifiers["TCustomNodeGroupStorage"] = "TCustomNodeGroupStorage"; + ServiceIdentifiers["TInputOptions"] = "TInputOptions"; +})(ServiceIdentifiers = exports.ServiceIdentifiers || (exports.ServiceIdentifiers = {})); + + +/***/ }), + +/***/ "./src/container/modules/analyzers/AnalyzersModule.ts": +/*!************************************************************!*\ + !*** ./src/container/modules/analyzers/AnalyzersModule.ts ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const CalleeDataExtractor_1 = __webpack_require__(/*! ../../../enums/analyzers/calls-graph-analyzer/CalleeDataExtractor */ "./src/enums/analyzers/calls-graph-analyzer/CalleeDataExtractor.ts"); +const CallsGraphAnalyzer_1 = __webpack_require__(/*! ../../../analyzers/calls-graph-analyzer/CallsGraphAnalyzer */ "./src/analyzers/calls-graph-analyzer/CallsGraphAnalyzer.ts"); +const FunctionDeclarationCalleeDataExtractor_1 = __webpack_require__(/*! ../../../analyzers/calls-graph-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts"); +const FunctionExpressionCalleeDataExtractor_1 = __webpack_require__(/*! ../../../analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts"); +const ObjectExpressionCalleeDataExtractor_1 = __webpack_require__(/*! ../../../analyzers/calls-graph-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts"); +const PrevailingKindOfVariablesAnalyzer_1 = __webpack_require__(/*! ../../../analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer */ "./src/analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer.ts"); +const ScopeAnalyzer_1 = __webpack_require__(/*! ../../../analyzers/scope-analyzer/ScopeAnalyzer */ "./src/analyzers/scope-analyzer/ScopeAnalyzer.ts"); +const StringArrayStorageAnalyzer_1 = __webpack_require__(/*! ../../../analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer */ "./src/analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer.ts"); +exports.analyzersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICallsGraphAnalyzer) + .to(CallsGraphAnalyzer_1.CallsGraphAnalyzer) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer) + .to(PrevailingKindOfVariablesAnalyzer_1.PrevailingKindOfVariablesAnalyzer) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IScopeAnalyzer) + .to(ScopeAnalyzer_1.ScopeAnalyzer) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorageAnalyzer) + .to(StringArrayStorageAnalyzer_1.StringArrayStorageAnalyzer) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor) + .to(FunctionDeclarationCalleeDataExtractor_1.FunctionDeclarationCalleeDataExtractor) + .whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor) + .to(FunctionExpressionCalleeDataExtractor_1.FunctionExpressionCalleeDataExtractor) + .whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor) + .to(ObjectExpressionCalleeDataExtractor_1.ObjectExpressionCalleeDataExtractor) + .whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICalleeDataExtractor) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor)); +}); + + +/***/ }), + +/***/ "./src/container/modules/custom-nodes/CustomNodesModule.ts": +/*!*****************************************************************!*\ + !*** ./src/container/modules/custom-nodes/CustomNodesModule.ts ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const CustomNodeGroup_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNodeGroup */ "./src/enums/custom-nodes/CustomNodeGroup.ts"); +const DeadCodeInjectionCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/DeadCodeInjectionCustomNode */ "./src/enums/custom-nodes/DeadCodeInjectionCustomNode.ts"); +const ObjectExpressionKeysTransformerCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode */ "./src/enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode.ts"); +const ConsoleOutputCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup */ "./src/custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup.ts"); +const DebugProtectionCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup */ "./src/custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup.ts"); +const DomainLockCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup */ "./src/custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup.ts"); +const SelfDefendingCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup */ "./src/custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup.ts"); +const StringArrayCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup */ "./src/custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup.ts"); +const ObjectExpressionVariableDeclarationHostNode_1 = __webpack_require__(/*! ../../../custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode */ "./src/custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode.ts"); +const BinaryExpressionFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode */ "./src/custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode.ts"); +const BlockStatementControlFlowFlatteningNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode */ "./src/custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode.ts"); +const BlockStatementDeadCodeInjectionNode_1 = __webpack_require__(/*! ../../../custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode */ "./src/custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode.ts"); +const CallExpressionControlFlowStorageCallNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode */ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts"); +const CallExpressionFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode */ "./src/custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode.ts"); +const ControlFlowStorageNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode */ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.ts"); +const ConsoleOutputDisableExpressionNode_1 = __webpack_require__(/*! ../../../custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode */ "./src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.ts"); +const CustomNodeFormatter_1 = __webpack_require__(/*! ../../../custom-nodes/CustomNodeFormatter */ "./src/custom-nodes/CustomNodeFormatter.ts"); +const DebugProtectionFunctionCallNode_1 = __webpack_require__(/*! ../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode */ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts"); +const DebugProtectionFunctionIntervalNode_1 = __webpack_require__(/*! ../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode */ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts"); +const DebugProtectionFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode */ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts"); +const DomainLockNode_1 = __webpack_require__(/*! ../../../custom-nodes/domain-lock-nodes/DomainLockNode */ "./src/custom-nodes/domain-lock-nodes/DomainLockNode.ts"); +const ExpressionWithOperatorControlFlowStorageCallNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode */ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode.ts"); +const LogicalExpressionFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode */ "./src/custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode.ts"); +const NodeCallsControllerFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode */ "./src/custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode.ts"); +const SelfDefendingUnicodeNode_1 = __webpack_require__(/*! ../../../custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode */ "./src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts"); +const StringArrayCallsWrapper_1 = __webpack_require__(/*! ../../../custom-nodes/string-array-nodes/StringArrayCallsWrapper */ "./src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts"); +const StringArrayNode_1 = __webpack_require__(/*! ../../../custom-nodes/string-array-nodes/StringArrayNode */ "./src/custom-nodes/string-array-nodes/StringArrayNode.ts"); +const StringArrayRotateFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/string-array-nodes/StringArrayRotateFunctionNode */ "./src/custom-nodes/string-array-nodes/StringArrayRotateFunctionNode.ts"); +const StringLiteralControlFlowStorageCallNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode */ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode.ts"); +const StringLiteralNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/StringLiteralNode */ "./src/custom-nodes/control-flow-flattening-nodes/StringLiteralNode.ts"); +exports.customNodesModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode) + .whenTargetNamed(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode) + .whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode) + .whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(DebugProtectionFunctionNode_1.DebugProtectionFunctionNode) + .whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(DomainLockNode_1.DomainLockNode) + .whenTargetNamed(CustomNode_1.CustomNode.DomainLockNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode) + .whenTargetNamed(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode) + .whenTargetNamed(CustomNode_1.CustomNode.SelfDefendingUnicodeNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(StringArrayCallsWrapper_1.StringArrayCallsWrapper) + .whenTargetNamed(CustomNode_1.CustomNode.StringArrayCallsWrapper); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(StringArrayNode_1.StringArrayNode) + .whenTargetNamed(CustomNode_1.CustomNode.StringArrayNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(StringArrayRotateFunctionNode_1.StringArrayRotateFunctionNode) + .whenTargetNamed(CustomNode_1.CustomNode.StringArrayRotateFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(BinaryExpressionFunctionNode_1.BinaryExpressionFunctionNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.BinaryExpressionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(BlockStatementControlFlowFlatteningNode_1.BlockStatementControlFlowFlatteningNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(CallExpressionControlFlowStorageCallNode_1.CallExpressionControlFlowStorageCallNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(CallExpressionFunctionNode_1.CallExpressionFunctionNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(ControlFlowStorageNode_1.ControlFlowStorageNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.ControlFlowStorageNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(ExpressionWithOperatorControlFlowStorageCallNode_1.ExpressionWithOperatorControlFlowStorageCallNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(LogicalExpressionFunctionNode_1.LogicalExpressionFunctionNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.LogicalExpressionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(StringLiteralNode_1.StringLiteralNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(StringLiteralControlFlowStorageCallNode_1.StringLiteralControlFlowStorageCallNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(BlockStatementDeadCodeInjectionNode_1.BlockStatementDeadCodeInjectionNode) + .whenTargetNamed(DeadCodeInjectionCustomNode_1.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(ObjectExpressionVariableDeclarationHostNode_1.ObjectExpressionVariableDeclarationHostNode) + .whenTargetNamed(ObjectExpressionKeysTransformerCustomNode_1.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(ConsoleOutputCustomNodeGroup_1.ConsoleOutputCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.ConsoleOutputCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(DebugProtectionCustomNodeGroup_1.DebugProtectionCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.DebugProtectionCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(DomainLockCustomNodeGroup_1.DomainLockCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.DomainLockCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(SelfDefendingCustomNodeGroup_1.SelfDefendingCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.SelfDefendingCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(StringArrayCustomNodeGroup_1.StringArrayCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.StringArrayCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions, ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions, ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNodeGroup) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter) + .to(CustomNodeFormatter_1.CustomNodeFormatter) + .inSingletonScope(); +}); + + +/***/ }), + +/***/ "./src/container/modules/generators/GeneratorsModule.ts": +/*!**************************************************************!*\ + !*** ./src/container/modules/generators/GeneratorsModule.ts ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IdentifierNamesGenerator_1 = __webpack_require__(/*! ../../../enums/generators/identifier-names-generators/IdentifierNamesGenerator */ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts"); +const DictionaryIdentifierNamesGenerator_1 = __webpack_require__(/*! ../../../generators/identifier-names-generators/DictionaryIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts"); +const HexadecimalIdentifierNamesGenerator_1 = __webpack_require__(/*! ../../../generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.ts"); +const MangledIdentifierNamesGenerator_1 = __webpack_require__(/*! ../../../generators/identifier-names-generators/MangledIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.ts"); +exports.generatorsModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator) + .to(DictionaryIdentifierNamesGenerator_1.DictionaryIdentifierNamesGenerator) + .inSingletonScope() + .whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator) + .to(HexadecimalIdentifierNamesGenerator_1.HexadecimalIdentifierNamesGenerator) + .inSingletonScope() + .whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator) + .to(MangledIdentifierNamesGenerator_1.MangledIdentifierNamesGenerator) + .inSingletonScope() + .whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator); + function identifierNameGeneratorFactory() { + let cachedIdentifierNamesGenerator = null; + return (context) => (options) => { + if (cachedIdentifierNamesGenerator) { + return cachedIdentifierNamesGenerator; + } + let identifierNamesGenerator; + switch (options.identifierNamesGenerator) { + case IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator: + identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator); + break; + case IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator: + identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator); + break; + case IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator: + default: + identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator); + } + cachedIdentifierNamesGenerator = identifierNamesGenerator; + return identifierNamesGenerator; + }; + } + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator) + .toFactory(identifierNameGeneratorFactory()); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/ControlFlowTransformersModule.ts": +/*!**********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/ControlFlowTransformersModule.ts ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ControlFlowReplacer_1 = __webpack_require__(/*! ../../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const BinaryExpressionControlFlowReplacer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer.ts"); +const BlockStatementControlFlowTransformer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer */ "./src/node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer.ts"); +const CallExpressionControlFlowReplacer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer.ts"); +const DeadCodeInjectionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer */ "./src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts"); +const FunctionControlFlowTransformer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/FunctionControlFlowTransformer */ "./src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.ts"); +const LogicalExpressionControlFlowReplacer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.ts"); +const StringLiteralControlFlowReplacer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer.ts"); +exports.controlFlowTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(BlockStatementControlFlowTransformer_1.BlockStatementControlFlowTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.BlockStatementControlFlowTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(DeadCodeInjectionTransformer_1.DeadCodeInjectionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.DeadCodeInjectionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(FunctionControlFlowTransformer_1.FunctionControlFlowTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.FunctionControlFlowTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer) + .to(BinaryExpressionControlFlowReplacer_1.BinaryExpressionControlFlowReplacer) + .whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.BinaryExpressionControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer) + .to(CallExpressionControlFlowReplacer_1.CallExpressionControlFlowReplacer) + .whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.CallExpressionControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer) + .to(LogicalExpressionControlFlowReplacer_1.LogicalExpressionControlFlowReplacer) + .whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.LogicalExpressionControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer) + .to(StringLiteralControlFlowReplacer_1.StringLiteralControlFlowReplacer) + .whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.StringLiteralControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowReplacer) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer)); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/ConvertingTransformersModule.ts": +/*!*********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/ConvertingTransformersModule.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const ObjectExpressionExtractor_1 = __webpack_require__(/*! ../../../enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor */ "./src/enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor.ts"); +const ObjectExpressionToVariableDeclarationExtractor_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor */ "./src/node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor.ts"); +const MemberExpressionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/MemberExpressionTransformer */ "./src/node-transformers/converting-transformers/MemberExpressionTransformer.ts"); +const MethodDefinitionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/MethodDefinitionTransformer */ "./src/node-transformers/converting-transformers/MethodDefinitionTransformer.ts"); +const ObjectExpressionKeysTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/ObjectExpressionKeysTransformer */ "./src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.ts"); +const ObjectExpressionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/ObjectExpressionTransformer */ "./src/node-transformers/converting-transformers/ObjectExpressionTransformer.ts"); +const SplitStringTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/SplitStringTransformer */ "./src/node-transformers/converting-transformers/SplitStringTransformer.ts"); +const TemplateLiteralTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/TemplateLiteralTransformer */ "./src/node-transformers/converting-transformers/TemplateLiteralTransformer.ts"); +const BasePropertiesExtractor_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/object-expression-extractors/BasePropertiesExtractor */ "./src/node-transformers/converting-transformers/object-expression-extractors/BasePropertiesExtractor.ts"); +exports.convertingTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(MemberExpressionTransformer_1.MemberExpressionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.MemberExpressionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(MethodDefinitionTransformer_1.MethodDefinitionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.MethodDefinitionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ObjectExpressionKeysTransformer_1.ObjectExpressionKeysTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ObjectExpressionTransformer_1.ObjectExpressionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ObjectExpressionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(SplitStringTransformer_1.SplitStringTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.SplitStringTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(TemplateLiteralTransformer_1.TemplateLiteralTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObjectExpressionExtractor) + .to(ObjectExpressionToVariableDeclarationExtractor_1.ObjectExpressionToVariableDeclarationExtractor) + .whenTargetNamed(ObjectExpressionExtractor_1.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObjectExpressionExtractor) + .to(BasePropertiesExtractor_1.BasePropertiesExtractor) + .whenTargetNamed(ObjectExpressionExtractor_1.ObjectExpressionExtractor.BasePropertiesExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObjectExpressionExtractor) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IObjectExpressionExtractor)); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/FinalizingTransformersModule.ts": +/*!*********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/FinalizingTransformersModule.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +exports.finalizingTransformersModule = new inversify_1.ContainerModule((bind) => { +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/NodeTransformersModule.ts": +/*!***************************************************************************!*\ + !*** ./src/container/modules/node-transformers/NodeTransformersModule.ts ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +exports.nodeTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeTransformer) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer)); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/ObfuscatingTransformersModule.ts": +/*!**********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/ObfuscatingTransformersModule.ts ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts"); +const LiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const BaseIdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer.ts"); +const BooleanLiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer.ts"); +const LabeledStatementTransformer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/LabeledStatementTransformer */ "./src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts"); +const LiteralTransformer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/LiteralTransformer */ "./src/node-transformers/obfuscating-transformers/LiteralTransformer.ts"); +const NumberLiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer.ts"); +const StringLiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer.ts"); +const ScopeIdentifiersTransformer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer */ "./src/node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer.ts"); +exports.obfuscatingTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(LabeledStatementTransformer_1.LabeledStatementTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.LabeledStatementTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(LiteralTransformer_1.LiteralTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.LiteralTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ScopeIdentifiersTransformer_1.ScopeIdentifiersTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ScopeIdentifiersTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer) + .to(BooleanLiteralObfuscatingReplacer_1.BooleanLiteralObfuscatingReplacer) + .whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer) + .to(NumberLiteralObfuscatingReplacer_1.NumberLiteralObfuscatingReplacer) + .whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer) + .to(StringLiteralObfuscatingReplacer_1.StringLiteralObfuscatingReplacer) + .whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierObfuscatingReplacer) + .to(BaseIdentifierObfuscatingReplacer_1.BaseIdentifierObfuscatingReplacer) + .whenTargetNamed(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatingReplacer) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierObfuscatingReplacer)); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/PreparingTransformersModule.ts": +/*!********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/PreparingTransformersModule.ts ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const ObfuscatingGuard_1 = __webpack_require__(/*! ../../../enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard */ "./src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts"); +const BlackListObfuscatingGuard_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard */ "./src/node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard.ts"); +const CommentsTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/CommentsTransformer */ "./src/node-transformers/preparing-transformers/CommentsTransformer.ts"); +const ConditionalCommentObfuscatingGuard_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard */ "./src/node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard.ts"); +const CustomNodesTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/CustomNodesTransformer */ "./src/node-transformers/preparing-transformers/CustomNodesTransformer.ts"); +const EvalCallExpressionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/EvalCallExpressionTransformer */ "./src/node-transformers/preparing-transformers/EvalCallExpressionTransformer.ts"); +const MetadataTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/MetadataTransformer */ "./src/node-transformers/preparing-transformers/MetadataTransformer.ts"); +const ObfuscatingGuardsTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/ObfuscatingGuardsTransformer */ "./src/node-transformers/preparing-transformers/ObfuscatingGuardsTransformer.ts"); +const ParentificationTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/ParentificationTransformer */ "./src/node-transformers/preparing-transformers/ParentificationTransformer.ts"); +const ReservedStringObfuscatingGuard_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard */ "./src/node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard.ts"); +const VariablePreserveTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/VariablePreserveTransformer */ "./src/node-transformers/preparing-transformers/VariablePreserveTransformer.ts"); +exports.preparingTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(CommentsTransformer_1.CommentsTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.CommentsTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(CustomNodesTransformer_1.CustomNodesTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.CustomNodesTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(EvalCallExpressionTransformer_1.EvalCallExpressionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.EvalCallExpressionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(MetadataTransformer_1.MetadataTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.MetadataTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ObfuscatingGuardsTransformer_1.ObfuscatingGuardsTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ObfuscatingGuardsTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ParentificationTransformer_1.ParentificationTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ParentificationTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard) + .to(BlackListObfuscatingGuard_1.BlackListObfuscatingGuard) + .inSingletonScope() + .whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.BlackListObfuscatingGuard); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard) + .to(ConditionalCommentObfuscatingGuard_1.ConditionalCommentObfuscatingGuard) + .inSingletonScope() + .whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.ConditionalCommentObfuscatingGuard); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard) + .to(ReservedStringObfuscatingGuard_1.ReservedStringObfuscatingGuard) + .inSingletonScope() + .whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.ReservedStringObfuscatingGuard); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeGuard) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(VariablePreserveTransformer_1.VariablePreserveTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.VariablePreserveTransformer); +}); + + +/***/ }), + +/***/ "./src/container/modules/options/OptionsModule.ts": +/*!********************************************************!*\ + !*** ./src/container/modules/options/OptionsModule.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const Options_1 = __webpack_require__(/*! ../../../options/Options */ "./src/options/Options.ts"); +const OptionsNormalizer_1 = __webpack_require__(/*! ../../../options/OptionsNormalizer */ "./src/options/OptionsNormalizer.ts"); +exports.optionsModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IOptions) + .to(Options_1.Options) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IOptionsNormalizer) + .to(OptionsNormalizer_1.OptionsNormalizer) + .inSingletonScope(); +}); + + +/***/ }), + +/***/ "./src/container/modules/storages/StoragesModule.ts": +/*!**********************************************************!*\ + !*** ./src/container/modules/storages/StoragesModule.ts ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ControlFlowStorage_1 = __webpack_require__(/*! ../../../storages/control-flow/ControlFlowStorage */ "./src/storages/control-flow/ControlFlowStorage.ts"); +const CustomNodeGroupStorage_1 = __webpack_require__(/*! ../../../storages/custom-node-group/CustomNodeGroupStorage */ "./src/storages/custom-node-group/CustomNodeGroupStorage.ts"); +const StringArrayStorage_1 = __webpack_require__(/*! ../../../storages/string-array/StringArrayStorage */ "./src/storages/string-array/StringArrayStorage.ts"); +exports.storagesModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.TCustomNodeGroupStorage) + .to(CustomNodeGroupStorage_1.CustomNodeGroupStorage) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorage) + .to(StringArrayStorage_1.StringArrayStorage) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__TControlFlowStorage) + .toConstructor(ControlFlowStorage_1.ControlFlowStorage); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__TControlFlowStorage) + .toFactory((context) => { + return () => { + const constructor = context.container + .get(ServiceIdentifiers_1.ServiceIdentifiers.Newable__TControlFlowStorage); + const randomGenerator = context.container + .get(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator); + const options = context.container + .get(ServiceIdentifiers_1.ServiceIdentifiers.IOptions); + const storage = new constructor(randomGenerator, options); + storage.initialize(); + return storage; + }; + }); +}); + + +/***/ }), + +/***/ "./src/container/modules/utils/UtilsModule.ts": +/*!****************************************************!*\ + !*** ./src/container/modules/utils/UtilsModule.ts ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ArrayUtils_1 = __webpack_require__(/*! ../../../utils/ArrayUtils */ "./src/utils/ArrayUtils.ts"); +const CryptUtils_1 = __webpack_require__(/*! ../../../utils/CryptUtils */ "./src/utils/CryptUtils.ts"); +const EscapeSequenceEncoder_1 = __webpack_require__(/*! ../../../utils/EscapeSequenceEncoder */ "./src/utils/EscapeSequenceEncoder.ts"); +const LevelledTopologicalSorter_1 = __webpack_require__(/*! ../../../utils/LevelledTopologicalSorter */ "./src/utils/LevelledTopologicalSorter.ts"); +const NodeTransformerNamesGroupsBuilder_1 = __webpack_require__(/*! ../../../utils/NodeTransformerNamesGroupsBuilder */ "./src/utils/NodeTransformerNamesGroupsBuilder.ts"); +const RandomGenerator_1 = __webpack_require__(/*! ../../../utils/RandomGenerator */ "./src/utils/RandomGenerator.ts"); +exports.utilsModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils) + .to(ArrayUtils_1.ArrayUtils) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator) + .to(RandomGenerator_1.RandomGenerator) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils) + .to(CryptUtils_1.CryptUtils) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder) + .to(EscapeSequenceEncoder_1.EscapeSequenceEncoder) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ILevelledTopologicalSorter) + .to(LevelledTopologicalSorter_1.LevelledTopologicalSorter); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder) + .to(NodeTransformerNamesGroupsBuilder_1.NodeTransformerNamesGroupsBuilder) + .inSingletonScope(); +}); + + +/***/ }), + +/***/ "./src/custom-nodes/AbstractCustomNode.ts": +/*!************************************************!*\ + !*** ./src/custom-nodes/AbstractCustomNode.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var AbstractCustomNode_1, _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const GlobalVariableTemplate1_1 = __webpack_require__(/*! ../templates/GlobalVariableTemplate1 */ "./src/templates/GlobalVariableTemplate1.ts"); +const GlobalVariableTemplate2_1 = __webpack_require__(/*! ../templates/GlobalVariableTemplate2 */ "./src/templates/GlobalVariableTemplate2.ts"); +let AbstractCustomNode = AbstractCustomNode_1 = class AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + this.cachedNode = null; + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + this.customNodeFormatter = customNodeFormatter; + this.randomGenerator = randomGenerator; + this.options = options; + } + getNode() { + if (!this.cachedNode) { + const nodeTemplate = this.getNodeTemplate(); + this.cachedNode = this.customNodeFormatter.formatStructure(this.getNodeStructure(nodeTemplate)); + } + return this.cachedNode; + } + getGlobalVariableTemplate() { + return this.randomGenerator + .getRandomGenerator() + .pickone(AbstractCustomNode_1.globalVariableTemplateFunctions); + } + getNodeTemplate() { + return ''; + } +}; +AbstractCustomNode.globalVariableTemplateFunctions = [ + GlobalVariableTemplate1_1.GlobalVariableTemplate1(), + GlobalVariableTemplate2_1.GlobalVariableTemplate2() +]; +AbstractCustomNode = AbstractCustomNode_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], AbstractCustomNode); +exports.AbstractCustomNode = AbstractCustomNode; + + +/***/ }), + +/***/ "./src/custom-nodes/AbstractCustomNodeGroup.ts": +/*!*****************************************************!*\ + !*** ./src/custom-nodes/AbstractCustomNodeGroup.ts ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let AbstractCustomNodeGroup = class AbstractCustomNodeGroup { + constructor(identifierNamesGeneratorFactory, randomGenerator, options) { + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + this.randomGenerator = randomGenerator; + this.options = options; + } + getAppendEvent() { + return this.appendEvent; + } + getCustomNodes() { + return this.customNodes; + } + appendCustomNodeIfExist(customNodeName, callback) { + const customNode = this.customNodes.get(customNodeName); + if (!customNode) { + return; + } + callback(customNode); + } + getRandomCallsGraphIndex(callsGraphLength) { + return this.randomGenerator.getRandomInteger(0, Math.max(0, Math.round(callsGraphLength - 1))); + } +}; +AbstractCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], AbstractCustomNodeGroup); +exports.AbstractCustomNodeGroup = AbstractCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/CustomNodeFormatter.ts": +/*!*************************************************!*\ + !*** ./src/custom-nodes/CustomNodeFormatter.ts ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const string_template_1 = __importDefault(__webpack_require__(/*! string-template */ "string-template")); +const IPrevailingKindOfVariablesAnalyzer_1 = __webpack_require__(/*! ../interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer */ "./src/interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let CustomNodeFormatter = class CustomNodeFormatter { + constructor(prevailingKindOfVariablesAnalyzer) { + this.prevailingKindOfVariables = prevailingKindOfVariablesAnalyzer.getPrevailingKind(); + } + formatTemplate(template, mapping) { + return string_template_1.default(template, mapping); + } + formatStructure(statements) { + for (const statement of statements) { + estraverse.replace(statement, { + enter: (node) => { + if (!NodeGuards_1.NodeGuards.isVariableDeclarationNode(node)) { + return; + } + if (this.prevailingKindOfVariables === 'var') { + node.kind = 'var'; + } + return node; + } + }); + } + return statements; + } +}; +CustomNodeFormatter = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)), + __metadata("design:paramtypes", [typeof (_a = typeof IPrevailingKindOfVariablesAnalyzer_1.IPrevailingKindOfVariablesAnalyzer !== "undefined" && IPrevailingKindOfVariablesAnalyzer_1.IPrevailingKindOfVariablesAnalyzer) === "function" ? _a : Object]) +], CustomNodeFormatter); +exports.CustomNodeFormatter = CustomNodeFormatter; + + +/***/ }), + +/***/ "./src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.ts": +/*!*************************************************************************************!*\ + !*** ./src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(/*! ../../templates/console-output-nodes/console-output-disable-expression-node/ConsoleOutputDisableExpressionTemplate */ "./src/templates/console-output-nodes/console-output-disable-expression-node/ConsoleOutputDisableExpressionTemplate.ts"); +const GlobalVariableNoEvalTemplate_1 = __webpack_require__(/*! ../../templates/GlobalVariableNoEvalTemplate */ "./src/templates/GlobalVariableNoEvalTemplate.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ConsoleOutputDisableExpressionNode = class ConsoleOutputDisableExpressionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(callsControllerFunctionName) { + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval + ? this.getGlobalVariableTemplate() + : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); + return this.customNodeFormatter.formatTemplate(ConsoleOutputDisableExpressionTemplate_1.ConsoleOutputDisableExpressionTemplate(), { + consoleLogDisableFunctionName: this.identifierNamesGenerator.generate(), + globalVariableTemplate, + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ConsoleOutputDisableExpressionNode.prototype, "callsControllerFunctionName", void 0); +ConsoleOutputDisableExpressionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], ConsoleOutputDisableExpressionNode); +exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup.ts": +/*!*************************************************************************************!*\ + !*** ./src/custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +let ConsoleOutputCustomNodeGroup = class ConsoleOutputCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; + this.customNodeFactory = customNodeFactory; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + const randomCallsGraphIndex = this.getRandomCallsGraphIndex(callsGraphData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode, (customNode) => { + NodeAppender_1.NodeAppender.appendToOptimalBlockScope(callsGraphData, nodeWithStatements, customNode.getNode(), randomCallsGraphIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, (customNode) => { + const targetNodeWithStatements = callsGraphData.length + ? NodeAppender_1.NodeAppender.getOptimalBlockScope(callsGraphData, randomCallsGraphIndex, 1) + : nodeWithStatements; + NodeAppender_1.NodeAppender.prepend(targetNodeWithStatements, customNode.getNode()); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.disableConsoleOutput) { + return; + } + const callsControllerFunctionName = this.identifierNamesGenerator.generate(); + const consoleOutputDisableExpressionNode = this.customNodeFactory(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode); + const nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + consoleOutputDisableExpressionNode.initialize(callsControllerFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode, consoleOutputDisableExpressionNode); + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], ConsoleOutputCustomNodeGroup.prototype, "customNodes", void 0); +ConsoleOutputCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], ConsoleOutputCustomNodeGroup); +exports.ConsoleOutputCustomNodeGroup = ConsoleOutputCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode.ts": +/*!****************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode.ts ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let BinaryExpressionFunctionNode = class BinaryExpressionFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(operator) { + this.operator = operator; + } + getNodeStructure(nodeTemplate) { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.functionExpressionNode([ + NodeFactory_1.NodeFactory.identifierNode('x'), + NodeFactory_1.NodeFactory.identifierNode('y') + ], NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.returnStatementNode(NodeFactory_1.NodeFactory.binaryExpressionNode(this.operator, NodeFactory_1.NodeFactory.identifierNode('x'), NodeFactory_1.NodeFactory.identifierNode('y'))) + ]))); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +BinaryExpressionFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], BinaryExpressionFunctionNode); +exports.BinaryExpressionFunctionNode = BinaryExpressionFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode.ts": +/*!***************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode.ts ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let BlockStatementControlFlowFlatteningNode = class BlockStatementControlFlowFlatteningNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(blockStatementBody, shuffledKeys, originalKeysIndexesInShuffledArray) { + this.blockStatementBody = blockStatementBody; + this.shuffledKeys = shuffledKeys; + this.originalKeysIndexesInShuffledArray = originalKeysIndexesInShuffledArray; + } + getNodeStructure(nodeTemplate) { + const controllerIdentifierName = this.randomGenerator.getRandomString(6); + const indexIdentifierName = this.randomGenerator.getRandomString(6); + const structure = NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.variableDeclarationNode([ + NodeFactory_1.NodeFactory.variableDeclaratorNode(NodeFactory_1.NodeFactory.identifierNode(controllerIdentifierName), NodeFactory_1.NodeFactory.callExpressionNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join('|')), NodeFactory_1.NodeFactory.identifierNode('split')), [ + NodeFactory_1.NodeFactory.literalNode('|') + ])) + ], 'const'), + NodeFactory_1.NodeFactory.variableDeclarationNode([ + NodeFactory_1.NodeFactory.variableDeclaratorNode(NodeFactory_1.NodeFactory.identifierNode(indexIdentifierName), NodeFactory_1.NodeFactory.literalNode(0)) + ], 'let'), + NodeFactory_1.NodeFactory.whileStatementNode(NodeFactory_1.NodeFactory.literalNode(true), NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.switchStatementNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.identifierNode(controllerIdentifierName), NodeFactory_1.NodeFactory.updateExpressionNode('++', NodeFactory_1.NodeFactory.identifierNode(indexIdentifierName)), true), this.shuffledKeys.map((key, index) => { + const statement = this.blockStatementBody[key]; + const consequent = [statement]; + if (!NodeGuards_1.NodeGuards.isReturnStatementNode(statement)) { + consequent.push(NodeFactory_1.NodeFactory.continueStatement()); + } + return NodeFactory_1.NodeFactory.switchCaseNode(NodeFactory_1.NodeFactory.literalNode(String(index)), consequent); + })), + NodeFactory_1.NodeFactory.breakStatement() + ])) + ]); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], BlockStatementControlFlowFlatteningNode.prototype, "blockStatementBody", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], BlockStatementControlFlowFlatteningNode.prototype, "originalKeysIndexesInShuffledArray", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], BlockStatementControlFlowFlatteningNode.prototype, "shuffledKeys", void 0); +BlockStatementControlFlowFlatteningNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], BlockStatementControlFlowFlatteningNode); +exports.BlockStatementControlFlowFlatteningNode = BlockStatementControlFlowFlatteningNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode.ts": +/*!**************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let CallExpressionFunctionNode = class CallExpressionFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(expressionArguments) { + this.expressionArguments = expressionArguments; + } + getNodeStructure(nodeTemplate) { + const calleeIdentifier = NodeFactory_1.NodeFactory.identifierNode('callee'); + const params = []; + const argumentsLength = this.expressionArguments.length; + for (let i = 0; i < argumentsLength; i++) { + params.push(NodeFactory_1.NodeFactory.identifierNode(`param${i + 1}`)); + } + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.functionExpressionNode([ + calleeIdentifier, + ...params + ], NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.returnStatementNode(NodeFactory_1.NodeFactory.callExpressionNode(calleeIdentifier, params)) + ]))); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], CallExpressionFunctionNode.prototype, "expressionArguments", void 0); +CallExpressionFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], CallExpressionFunctionNode); +exports.CallExpressionFunctionNode = CallExpressionFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode.ts": +/*!*****************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode.ts ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let LogicalExpressionFunctionNode = class LogicalExpressionFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(operator) { + this.operator = operator; + } + getNodeStructure(nodeTemplate) { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.functionExpressionNode([ + NodeFactory_1.NodeFactory.identifierNode('x'), + NodeFactory_1.NodeFactory.identifierNode('y') + ], NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.returnStatementNode(NodeFactory_1.NodeFactory.logicalExpressionNode(this.operator, NodeFactory_1.NodeFactory.identifierNode('x'), NodeFactory_1.NodeFactory.identifierNode('y'))) + ]))); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +LogicalExpressionFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], LogicalExpressionFunctionNode); +exports.LogicalExpressionFunctionNode = LogicalExpressionFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/StringLiteralNode.ts": +/*!*****************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/StringLiteralNode.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +let StringLiteralNode = class StringLiteralNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(literalValue) { + this.literalValue = literalValue; + } + getNodeStructure(nodeTemplate) { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.literalNode(this.literalValue)); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringLiteralNode.prototype, "literalValue", void 0); +StringLiteralNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], StringLiteralNode); +exports.StringLiteralNode = StringLiteralNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts": +/*!*******************************************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts ***! + \*******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let CallExpressionControlFlowStorageCallNode = class CallExpressionControlFlowStorageCallNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(controlFlowStorageName, controlFlowStorageKey, callee, expressionArguments) { + this.controlFlowStorageName = controlFlowStorageName; + this.controlFlowStorageKey = controlFlowStorageKey; + this.callee = callee; + this.expressionArguments = expressionArguments; + } + getNodeStructure() { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.callExpressionNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageName), NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageKey)), [ + this.callee, + ...this.expressionArguments + ])); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof ESTree !== "undefined" && ESTree.Expression) === "function" ? _a : Object) +], CallExpressionControlFlowStorageCallNode.prototype, "callee", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], CallExpressionControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], CallExpressionControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], CallExpressionControlFlowStorageCallNode.prototype, "expressionArguments", void 0); +CallExpressionControlFlowStorageCallNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _b : Object, typeof (_c = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], CallExpressionControlFlowStorageCallNode); +exports.CallExpressionControlFlowStorageCallNode = CallExpressionControlFlowStorageCallNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.ts": +/*!*************************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.ts ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowStorage_1 = __webpack_require__(/*! ../../../types/storages/TControlFlowStorage */ "./src/types/storages/TControlFlowStorage.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ControlFlowStorageNode = class ControlFlowStorageNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(controlFlowStorage) { + this.controlFlowStorage = controlFlowStorage; + } + getNodeStructure(nodeTemplate) { + const propertyNodes = Array + .from(this.controlFlowStorage.getStorage()) + .map(([key, value]) => { + const node = value.getNode()[0]; + if (!NodeGuards_1.NodeGuards.isExpressionStatementNode(node)) { + throw new Error('Function node for control flow storage object should be passed inside the `ExpressionStatement` node!'); + } + return NodeFactory_1.NodeFactory.propertyNode(NodeFactory_1.NodeFactory.identifierNode(key), node.expression); + }); + let structure = NodeFactory_1.NodeFactory.variableDeclarationNode([ + NodeFactory_1.NodeFactory.variableDeclaratorNode(NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()), NodeFactory_1.NodeFactory.objectExpressionNode(propertyNodes)) + ], 'const'); + structure = NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof TControlFlowStorage_1.TControlFlowStorage !== "undefined" && TControlFlowStorage_1.TControlFlowStorage) === "function" ? _a : Object) +], ControlFlowStorageNode.prototype, "controlFlowStorage", void 0); +ControlFlowStorageNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _b : Object, typeof (_c = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], ControlFlowStorageNode); +exports.ControlFlowStorageNode = ControlFlowStorageNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode.ts": +/*!***************************************************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode.ts ***! + \***************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ExpressionWithOperatorControlFlowStorageCallNode = class ExpressionWithOperatorControlFlowStorageCallNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(controlFlowStorageName, controlFlowStorageKey, leftValue, rightValue) { + this.controlFlowStorageName = controlFlowStorageName; + this.controlFlowStorageKey = controlFlowStorageKey; + this.leftValue = leftValue; + this.rightValue = rightValue; + } + getNodeStructure() { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.callExpressionNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageName), NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageKey)), [ + this.leftValue, + this.rightValue + ])); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); +ExpressionWithOperatorControlFlowStorageCallNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], ExpressionWithOperatorControlFlowStorageCallNode); +exports.ExpressionWithOperatorControlFlowStorageCallNode = ExpressionWithOperatorControlFlowStorageCallNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode.ts": +/*!******************************************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode.ts ***! + \******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let StringLiteralControlFlowStorageCallNode = class StringLiteralControlFlowStorageCallNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(controlFlowStorageName, controlFlowStorageKey) { + this.controlFlowStorageName = controlFlowStorageName; + this.controlFlowStorageKey = controlFlowStorageKey; + } + getNodeStructure() { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageName), NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageKey))); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringLiteralControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringLiteralControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); +StringLiteralControlFlowStorageCallNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], StringLiteralControlFlowStorageCallNode); +exports.StringLiteralControlFlowStorageCallNode = StringLiteralControlFlowStorageCallNode; + + +/***/ }), + +/***/ "./src/custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode.ts": +/*!*******************************************************************************************!*\ + !*** ./src/custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode.ts ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let BlockStatementDeadCodeInjectionNode = class BlockStatementDeadCodeInjectionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(blockStatementNode, deadCodeInjectionRootAstHostNode) { + this.blockStatementNode = blockStatementNode; + this.deadCodeInjectionRootAstHostNode = deadCodeInjectionRootAstHostNode; + } + getNodeStructure(nodeTemplate) { + const random1 = this.randomGenerator.getMathRandom() > 0.5; + const random2 = this.randomGenerator.getMathRandom() > 0.5; + const operator = random1 ? '===' : '!=='; + const leftString = this.randomGenerator.getRandomString(5); + const rightString = random2 ? leftString : this.randomGenerator.getRandomString(5); + const [consequent, alternate] = random1 === random2 + ? [this.blockStatementNode, this.deadCodeInjectionRootAstHostNode] + : [this.deadCodeInjectionRootAstHostNode, this.blockStatementNode]; + const structure = NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.ifStatementNode(NodeFactory_1.NodeFactory.binaryExpressionNode(operator, NodeFactory_1.NodeFactory.literalNode(leftString), NodeFactory_1.NodeFactory.literalNode(rightString)), consequent, alternate) + ]); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +BlockStatementDeadCodeInjectionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], BlockStatementDeadCodeInjectionNode); +exports.BlockStatementDeadCodeInjectionNode = BlockStatementDeadCodeInjectionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts": +/*!************************************************************************************!*\ + !*** ./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const DebugProtectionFunctionCallTemplate_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-call-node/DebugProtectionFunctionCallTemplate */ "./src/templates/debug-protection-nodes/debug-protection-function-call-node/DebugProtectionFunctionCallTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DebugProtectionFunctionCallNode = class DebugProtectionFunctionCallNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(debugProtectionFunctionName, callsControllerFunctionName) { + this.debugProtectionFunctionName = debugProtectionFunctionName; + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + return this.customNodeFormatter.formatTemplate(DebugProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate(), { + debugProtectionFunctionName: this.debugProtectionFunctionName, + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DebugProtectionFunctionCallNode.prototype, "callsControllerFunctionName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DebugProtectionFunctionCallNode.prototype, "debugProtectionFunctionName", void 0); +DebugProtectionFunctionCallNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], DebugProtectionFunctionCallNode); +exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode; + + +/***/ }), + +/***/ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts": +/*!****************************************************************************************!*\ + !*** ./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate */ "./src/templates/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DebugProtectionFunctionIntervalNode = class DebugProtectionFunctionIntervalNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(debugProtectionFunctionName) { + this.debugProtectionFunctionName = debugProtectionFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + return this.customNodeFormatter.formatTemplate(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate(), { + debugProtectionFunctionName: this.debugProtectionFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DebugProtectionFunctionIntervalNode.prototype, "debugProtectionFunctionName", void 0); +DebugProtectionFunctionIntervalNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], DebugProtectionFunctionIntervalNode); +exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode; + + +/***/ }), + +/***/ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts": +/*!********************************************************************************!*\ + !*** ./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const DebuggerTemplate_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplate */ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplate.ts"); +const DebuggerTemplateNoEval_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplateNoEval */ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplateNoEval.ts"); +const DebugProtectionFunctionTemplate_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate */ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DebugProtectionFunctionNode = class DebugProtectionFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(debugProtectionFunctionName) { + this.debugProtectionFunctionName = debugProtectionFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const debuggerTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval + ? DebuggerTemplate_1.DebuggerTemplate() + : DebuggerTemplateNoEval_1.DebuggerTemplateNoEval(); + return this.customNodeFormatter.formatTemplate(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate(), { + debuggerTemplate, + debugProtectionFunctionName: this.debugProtectionFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DebugProtectionFunctionNode.prototype, "debugProtectionFunctionName", void 0); +DebugProtectionFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], DebugProtectionFunctionNode); +exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup.ts": +/*!*****************************************************************************************!*\ + !*** ./src/custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup.ts ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let DebugProtectionCustomNodeGroup = class DebugProtectionCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; + this.customNodeFactory = customNodeFactory; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + const randomCallsGraphIndex = this.getRandomCallsGraphIndex(callsGraphData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode, (customNode) => { + NodeAppender_1.NodeAppender.appendToOptimalBlockScope(callsGraphData, nodeWithStatements, customNode.getNode(), randomCallsGraphIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionNode, (customNode) => { + NodeAppender_1.NodeAppender.append(nodeWithStatements, customNode.getNode()); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode, (customNode) => { + const programBodyLength = NodeGuards_1.NodeGuards.isSwitchCaseNode(nodeWithStatements) + ? nodeWithStatements.consequent.length + : nodeWithStatements.body.length; + const randomIndex = this.randomGenerator.getRandomInteger(0, programBodyLength); + NodeAppender_1.NodeAppender.insertAtIndex(nodeWithStatements, customNode.getNode(), randomIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, (customNode) => { + const targetNodeWithStatements = callsGraphData.length + ? NodeAppender_1.NodeAppender.getOptimalBlockScope(callsGraphData, randomCallsGraphIndex, 1) + : nodeWithStatements; + NodeAppender_1.NodeAppender.prepend(targetNodeWithStatements, customNode.getNode()); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.debugProtection) { + return; + } + const debugProtectionFunctionName = this.identifierNamesGenerator.generate(); + const callsControllerFunctionName = this.identifierNamesGenerator.generate(); + const debugProtectionFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionNode); + const debugProtectionFunctionCallNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode); + const debugProtectionFunctionIntervalNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode); + const nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + debugProtectionFunctionNode.initialize(debugProtectionFunctionName); + debugProtectionFunctionCallNode.initialize(debugProtectionFunctionName, callsControllerFunctionName); + debugProtectionFunctionIntervalNode.initialize(debugProtectionFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionNode, debugProtectionFunctionNode); + this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode, debugProtectionFunctionCallNode); + if (this.options.debugProtectionInterval) { + this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode, debugProtectionFunctionIntervalNode); + } + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], DebugProtectionCustomNodeGroup.prototype, "customNodes", void 0); +DebugProtectionCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], DebugProtectionCustomNodeGroup); +exports.DebugProtectionCustomNodeGroup = DebugProtectionCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/domain-lock-nodes/DomainLockNode.ts": +/*!**************************************************************!*\ + !*** ./src/custom-nodes/domain-lock-nodes/DomainLockNode.ts ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const ICryptUtils_1 = __webpack_require__(/*! ../../interfaces/utils/ICryptUtils */ "./src/interfaces/utils/ICryptUtils.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const DomainLockNodeTemplate_1 = __webpack_require__(/*! ../../templates/domain-lock-nodes/domain-lock-node/DomainLockNodeTemplate */ "./src/templates/domain-lock-nodes/domain-lock-node/DomainLockNodeTemplate.ts"); +const GlobalVariableNoEvalTemplate_1 = __webpack_require__(/*! ../../templates/GlobalVariableNoEvalTemplate */ "./src/templates/GlobalVariableNoEvalTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DomainLockNode = class DomainLockNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options, cryptUtils) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + this.cryptUtils = cryptUtils; + } + initialize(callsControllerFunctionName) { + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const domainsString = this.options.domainLock.join(';'); + const [hiddenDomainsString, diff] = this.cryptUtils.hideString(domainsString, domainsString.length * 3); + const globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval + ? this.getGlobalVariableTemplate() + : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); + return this.customNodeFormatter.formatTemplate(DomainLockNodeTemplate_1.DomainLockNodeTemplate(), { + domainLockFunctionName: this.identifierNamesGenerator.generate(), + diff, + domains: hiddenDomainsString, + globalVariableTemplate, + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DomainLockNode.prototype, "callsControllerFunctionName", void 0); +DomainLockNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof ICryptUtils_1.ICryptUtils !== "undefined" && ICryptUtils_1.ICryptUtils) === "function" ? _e : Object]) +], DomainLockNode); +exports.DomainLockNode = DomainLockNode; + + +/***/ }), + +/***/ "./src/custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup.ts": +/*!*******************************************************************************!*\ + !*** ./src/custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup.ts ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +let DomainLockCustomNodeGroup = class DomainLockCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; + this.customNodeFactory = customNodeFactory; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + const randomCallsGraphIndex = this.getRandomCallsGraphIndex(callsGraphData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DomainLockNode, (customNode) => { + NodeAppender_1.NodeAppender.appendToOptimalBlockScope(callsGraphData, nodeWithStatements, customNode.getNode(), randomCallsGraphIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, (customNode) => { + const targetNodeWithStatements = callsGraphData.length + ? NodeAppender_1.NodeAppender.getOptimalBlockScope(callsGraphData, randomCallsGraphIndex, 1) + : nodeWithStatements; + NodeAppender_1.NodeAppender.prepend(targetNodeWithStatements, customNode.getNode()); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.domainLock.length) { + return; + } + const callsControllerFunctionName = this.identifierNamesGenerator.generate(); + const domainLockNode = this.customNodeFactory(CustomNode_1.CustomNode.DomainLockNode); + const nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + domainLockNode.initialize(callsControllerFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.DomainLockNode, domainLockNode); + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], DomainLockCustomNodeGroup.prototype, "customNodes", void 0); +DomainLockCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], DomainLockCustomNodeGroup); +exports.DomainLockCustomNodeGroup = DomainLockCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode.ts": +/*!*****************************************************************************************!*\ + !*** ./src/custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode.ts ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const SingleNodeCallControllerTemplate_1 = __webpack_require__(/*! ../../templates/SingleNodeCallControllerTemplate */ "./src/templates/SingleNodeCallControllerTemplate.ts"); +const NoCustomNodes_1 = __webpack_require__(/*! ../../options/presets/NoCustomNodes */ "./src/options/presets/NoCustomNodes.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ../../JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +let NodeCallsControllerFunctionNode = class NodeCallsControllerFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(appendEvent, callsControllerFunctionName) { + this.appendEvent = appendEvent; + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + if (this.appendEvent === ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation) { + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), { + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }), Object.assign(Object.assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET), { identifierNamesGenerator: this.options.identifierNamesGenerator, identifiersDictionary: this.options.identifiersDictionary, seed: this.options.seed })).getObfuscatedCode(); + } + return this.customNodeFormatter.formatTemplate(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), { + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], NodeCallsControllerFunctionNode.prototype, "callsControllerFunctionName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof ObfuscationEvent_1.ObfuscationEvent !== "undefined" && ObfuscationEvent_1.ObfuscationEvent) === "function" ? _a : Object) +], NodeCallsControllerFunctionNode.prototype, "appendEvent", void 0); +NodeCallsControllerFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _b : Object, typeof (_c = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], NodeCallsControllerFunctionNode); +exports.NodeCallsControllerFunctionNode = NodeCallsControllerFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode.ts": +/*!******************************************************************************************************************!*\ + !*** ./src/custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode.ts ***! + \******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +let ObjectExpressionVariableDeclarationHostNode = class ObjectExpressionVariableDeclarationHostNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(properties) { + this.properties = properties; + } + getNodeStructure(nodeTemplate) { + const structure = NodeFactory_1.NodeFactory.variableDeclarationNode([ + NodeFactory_1.NodeFactory.variableDeclaratorNode(NodeFactory_1.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()), NodeFactory_1.NodeFactory.objectExpressionNode(this.properties)) + ], 'const'); + return [structure]; + } +}; +ObjectExpressionVariableDeclarationHostNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], ObjectExpressionVariableDeclarationHostNode); +exports.ObjectExpressionVariableDeclarationHostNode = ObjectExpressionVariableDeclarationHostNode; + + +/***/ }), + +/***/ "./src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts": +/*!***************************************************************************!*\ + !*** ./src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const NoCustomNodes_1 = __webpack_require__(/*! ../../options/presets/NoCustomNodes */ "./src/options/presets/NoCustomNodes.ts"); +const SelfDefendingTemplate_1 = __webpack_require__(/*! ../../templates/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate */ "./src/templates/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ../../JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let SelfDefendingUnicodeNode = class SelfDefendingUnicodeNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options, escapeSequenceEncoder) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + this.escapeSequenceEncoder = escapeSequenceEncoder; + } + initialize(callsControllerFunctionName) { + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(SelfDefendingTemplate_1.SelfDefendingTemplate(this.escapeSequenceEncoder), { + selfDefendingFunctionName: this.identifierNamesGenerator.generate(), + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }), Object.assign(Object.assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET), { identifierNamesGenerator: this.options.identifierNamesGenerator, identifiersDictionary: this.options.identifiersDictionary, seed: this.options.seed, unicodeEscapeSequence: true })).getObfuscatedCode(); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], SelfDefendingUnicodeNode.prototype, "callsControllerFunctionName", void 0); +SelfDefendingUnicodeNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _e : Object]) +], SelfDefendingUnicodeNode); +exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode; + + +/***/ }), + +/***/ "./src/custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup.ts": +/*!*************************************************************************************!*\ + !*** ./src/custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +let SelfDefendingCustomNodeGroup = class SelfDefendingCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation; + this.customNodeFactory = customNodeFactory; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + const randomCallsGraphIndex = this.getRandomCallsGraphIndex(callsGraphData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.SelfDefendingUnicodeNode, (customNode) => { + NodeAppender_1.NodeAppender.appendToOptimalBlockScope(callsGraphData, nodeWithStatements, customNode.getNode(), randomCallsGraphIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, (customNode) => { + const targetNodeWithStatements = callsGraphData.length + ? NodeAppender_1.NodeAppender.getOptimalBlockScope(callsGraphData, randomCallsGraphIndex, 1) + : nodeWithStatements; + NodeAppender_1.NodeAppender.prepend(targetNodeWithStatements, customNode.getNode()); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.selfDefending) { + return; + } + const callsControllerFunctionName = this.identifierNamesGenerator.generate(); + const selfDefendingUnicodeNode = this.customNodeFactory(CustomNode_1.CustomNode.SelfDefendingUnicodeNode); + const nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + selfDefendingUnicodeNode.initialize(callsControllerFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.SelfDefendingUnicodeNode, selfDefendingUnicodeNode); + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], SelfDefendingCustomNodeGroup.prototype, "customNodes", void 0); +SelfDefendingCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], SelfDefendingCustomNodeGroup); +exports.SelfDefendingCustomNodeGroup = SelfDefendingCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts": +/*!************************************************************************!*\ + !*** ./src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const StringArrayEncoding_1 = __webpack_require__(/*! ../../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const NoCustomNodes_1 = __webpack_require__(/*! ../../options/presets/NoCustomNodes */ "./src/options/presets/NoCustomNodes.ts"); +const AtobTemplate_1 = __webpack_require__(/*! ../../templates/AtobTemplate */ "./src/templates/AtobTemplate.ts"); +const GlobalVariableNoEvalTemplate_1 = __webpack_require__(/*! ../../templates/GlobalVariableNoEvalTemplate */ "./src/templates/GlobalVariableNoEvalTemplate.ts"); +const Rc4Template_1 = __webpack_require__(/*! ../../templates/Rc4Template */ "./src/templates/Rc4Template.ts"); +const SelfDefendingTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-calls-wrapper/SelfDefendingTemplate */ "./src/templates/string-array-nodes/string-array-calls-wrapper/SelfDefendingTemplate.ts"); +const StringArrayBase64DecodeNodeTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-calls-wrapper/StringArrayBase64DecodeNodeTemplate */ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayBase64DecodeNodeTemplate.ts"); +const StringArrayCallsWrapperTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-calls-wrapper/StringArrayCallsWrapperTemplate */ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayCallsWrapperTemplate.ts"); +const StringArrayRC4DecodeNodeTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-calls-wrapper/StringArrayRC4DecodeNodeTemplate */ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayRC4DecodeNodeTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ../../JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let StringArrayCallsWrapper = class StringArrayCallsWrapper extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options, escapeSequenceEncoder) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + this.escapeSequenceEncoder = escapeSequenceEncoder; + } + initialize(stringArrayName, stringArrayCallsWrapperName) { + this.stringArrayName = stringArrayName; + this.stringArrayCallsWrapperName = stringArrayCallsWrapperName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const decodeNodeTemplate = this.getDecodeStringArrayTemplate(); + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(StringArrayCallsWrapperTemplate_1.StringArrayCallsWrapperTemplate(), { + decodeNodeTemplate, + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName, + stringArrayName: this.stringArrayName + }), Object.assign(Object.assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET), { identifierNamesGenerator: this.options.identifierNamesGenerator, identifiersDictionary: this.options.identifiersDictionary, seed: this.randomGenerator.getRawSeed() })).getObfuscatedCode(); + } + getDecodeStringArrayTemplate() { + const globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval + ? this.getGlobalVariableTemplate() + : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); + const atobPolyfill = this.customNodeFormatter.formatTemplate(AtobTemplate_1.AtobTemplate(), { globalVariableTemplate }); + let decodeStringArrayTemplate = ''; + let selfDefendingCode = ''; + if (this.options.selfDefending) { + selfDefendingCode = this.customNodeFormatter.formatTemplate(SelfDefendingTemplate_1.SelfDefendingTemplate(this.randomGenerator, this.escapeSequenceEncoder), { + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName, + stringArrayName: this.stringArrayName + }); + } + switch (this.options.stringArrayEncoding) { + case StringArrayEncoding_1.StringArrayEncoding.Rc4: + decodeStringArrayTemplate = this.customNodeFormatter.formatTemplate(StringArrayRC4DecodeNodeTemplate_1.StringArrayRc4DecodeNodeTemplate(this.randomGenerator), { + atobPolyfill, + rc4Polyfill: Rc4Template_1.Rc4Template(), + selfDefendingCode, + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName + }); + break; + case StringArrayEncoding_1.StringArrayEncoding.Base64: + decodeStringArrayTemplate = this.customNodeFormatter.formatTemplate(StringArrayBase64DecodeNodeTemplate_1.StringArrayBase64DecodeNodeTemplate(this.randomGenerator), { + atobPolyfill, + selfDefendingCode, + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName + }); + } + return decodeStringArrayTemplate; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayCallsWrapper.prototype, "stringArrayName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayCallsWrapper.prototype, "stringArrayCallsWrapperName", void 0); +StringArrayCallsWrapper = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _e : Object]) +], StringArrayCallsWrapper); +exports.StringArrayCallsWrapper = StringArrayCallsWrapper; + + +/***/ }), + +/***/ "./src/custom-nodes/string-array-nodes/StringArrayNode.ts": +/*!****************************************************************!*\ + !*** ./src/custom-nodes/string-array-nodes/StringArrayNode.ts ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const IStringArrayStorage_1 = __webpack_require__(/*! ../../interfaces/storages/string-array-storage/IStringArrayStorage */ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const StringArrayTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-node/StringArrayTemplate */ "./src/templates/string-array-nodes/string-array-node/StringArrayTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let StringArrayNode = class StringArrayNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(stringArrayStorage, stringArrayName) { + this.stringArrayStorage = stringArrayStorage; + this.stringArrayName = stringArrayName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + return this.customNodeFormatter.formatTemplate(StringArrayTemplate_1.StringArrayTemplate(), { + stringArrayName: this.stringArrayName, + stringArray: this.stringArrayStorage.toString() + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof IStringArrayStorage_1.IStringArrayStorage !== "undefined" && IStringArrayStorage_1.IStringArrayStorage) === "function" ? _a : Object) +], StringArrayNode.prototype, "stringArrayStorage", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayNode.prototype, "stringArrayName", void 0); +StringArrayNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _b : Object, typeof (_c = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], StringArrayNode); +exports.StringArrayNode = StringArrayNode; + + +/***/ }), + +/***/ "./src/custom-nodes/string-array-nodes/StringArrayRotateFunctionNode.ts": +/*!******************************************************************************!*\ + !*** ./src/custom-nodes/string-array-nodes/StringArrayRotateFunctionNode.ts ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const NoCustomNodes_1 = __webpack_require__(/*! ../../options/presets/NoCustomNodes */ "./src/options/presets/NoCustomNodes.ts"); +const SelfDefendingTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-rotate-function-node/SelfDefendingTemplate */ "./src/templates/string-array-nodes/string-array-rotate-function-node/SelfDefendingTemplate.ts"); +const StringArrayRotateFunctionTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-rotate-function-node/StringArrayRotateFunctionTemplate */ "./src/templates/string-array-nodes/string-array-rotate-function-node/StringArrayRotateFunctionTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ../../JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +const NumberUtils_1 = __webpack_require__(/*! ../../utils/NumberUtils */ "./src/utils/NumberUtils.ts"); +let StringArrayRotateFunctionNode = class StringArrayRotateFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options, escapeSequenceEncoder) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + this.escapeSequenceEncoder = escapeSequenceEncoder; + } + initialize(stringArrayName, stringArrayRotationAmount) { + this.stringArrayName = stringArrayName; + this.stringArrayRotationAmount = stringArrayRotationAmount; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const timesName = this.identifierNamesGenerator.generate(); + const whileFunctionName = this.identifierNamesGenerator.generate(); + let code = ''; + if (this.options.selfDefending) { + code = this.customNodeFormatter.formatTemplate(SelfDefendingTemplate_1.SelfDefendingTemplate(this.escapeSequenceEncoder), { + timesName, + whileFunctionName + }); + } + else { + code = `${whileFunctionName}(++${timesName})`; + } + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(StringArrayRotateFunctionTemplate_1.StringArrayRotateFunctionTemplate(), { + code, + timesName, + stringArrayName: this.stringArrayName, + stringArrayRotationAmount: NumberUtils_1.NumberUtils.toHex(this.stringArrayRotationAmount), + whileFunctionName + }), Object.assign(Object.assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET), { identifierNamesGenerator: this.options.identifierNamesGenerator, identifiersDictionary: this.options.identifiersDictionary, seed: this.randomGenerator.getRawSeed() })).getObfuscatedCode(); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayRotateFunctionNode.prototype, "stringArrayName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Number) +], StringArrayRotateFunctionNode.prototype, "stringArrayRotationAmount", void 0); +StringArrayRotateFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _e : Object]) +], StringArrayRotateFunctionNode); +exports.StringArrayRotateFunctionNode = StringArrayRotateFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup.ts": +/*!*********************************************************************************!*\ + !*** ./src/custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e, _f; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IStringArrayStorage_1 = __webpack_require__(/*! ../../../interfaces/storages/string-array-storage/IStringArrayStorage */ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +let StringArrayCustomNodeGroup = class StringArrayCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, stringArrayStorage, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation; + this.customNodeFactory = customNodeFactory; + this.stringArrayStorage = stringArrayStorage; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + if (!this.stringArrayStorage.getLength()) { + return; + } + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayNode, (customNode) => { + NodeAppender_1.NodeAppender.prepend(nodeWithStatements, customNode.getNode()); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayCallsWrapper, (customNode) => { + NodeAppender_1.NodeAppender.insertAtIndex(nodeWithStatements, customNode.getNode(), 1); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayRotateFunctionNode, (customNode) => { + NodeAppender_1.NodeAppender.insertAtIndex(nodeWithStatements, customNode.getNode(), 1); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.stringArray) { + return; + } + const stringArrayNode = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayNode); + const stringArrayCallsWrapper = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayCallsWrapper); + const stringArrayRotateFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayRotateFunctionNode); + const stringArrayName = this.stringArrayStorage.getStorageName(); + const stringArrayCallsWrapperName = this.stringArrayStorage.getStorageCallsWrapperName(); + const stringArrayRotationAmount = this.stringArrayStorage.getRotationAmount(); + stringArrayNode.initialize(this.stringArrayStorage, stringArrayName); + stringArrayCallsWrapper.initialize(stringArrayName, stringArrayCallsWrapperName); + stringArrayRotateFunctionNode.initialize(stringArrayName, stringArrayRotationAmount); + this.customNodes.set(CustomNode_1.CustomNode.StringArrayNode, stringArrayNode); + this.customNodes.set(CustomNode_1.CustomNode.StringArrayCallsWrapper, stringArrayCallsWrapper); + if (this.options.rotateStringArray) { + this.customNodes.set(CustomNode_1.CustomNode.StringArrayRotateFunctionNode, stringArrayRotateFunctionNode); + } + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], StringArrayCustomNodeGroup.prototype, "customNodes", void 0); +StringArrayCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorage)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof IStringArrayStorage_1.IStringArrayStorage !== "undefined" && IStringArrayStorage_1.IStringArrayStorage) === "function" ? _c : Object, typeof (_d = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _d : Object, typeof (_e = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _e : Object, typeof (_f = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _f : Object]) +], StringArrayCustomNodeGroup); +exports.StringArrayCustomNodeGroup = StringArrayCustomNodeGroup; + + +/***/ }), + +/***/ "./src/decorators/Initializable.ts": +/*!*****************************************!*\ + !*** ./src/decorators/Initializable.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const defaultDescriptor = { + configurable: true, + enumerable: true +}; +const initializedTargetMetadataKey = '_initialized'; +const initializablePropertiesSetMetadataKey = '_initializablePropertiesSet'; +const wrappedMethodsSetMetadataKey = '_wrappedMethodsSet'; +const constructorMethodName = 'constructor'; +function initializable(initializeMethodName = 'initialize') { + const decoratorName = Object.keys(this)[0]; + return (target, propertyKey) => { + const initializeMethod = target[initializeMethodName]; + if (!initializeMethod || typeof initializeMethod !== 'function') { + throw new Error(`\`${initializeMethodName}\` method with initialization logic not ` + + `found. \`@${decoratorName}\` decorator requires \`${initializeMethodName}\` method`); + } + initializeTargetMetadata(initializedTargetMetadataKey, false, target); + initializeTargetMetadata(initializablePropertiesSetMetadataKey, new Set(), target); + initializeTargetMetadata(wrappedMethodsSetMetadataKey, new Set(), target); + wrapTargetMethodsInInitializedCheck(target, initializeMethodName); + wrapInitializeMethodInInitializeCheck(target, initializeMethodName, propertyKey); + return wrapInitializableProperty(target, propertyKey); + }; +} +exports.initializable = initializable; +function initializeTargetMetadata(metadataKey, metadataValue, target) { + const hasInitializedMetadata = Reflect.hasMetadata(metadataKey, target); + if (!hasInitializedMetadata) { + Reflect.defineMetadata(metadataKey, metadataValue, target); + } +} +function wrapTargetMethodsInInitializedCheck(target, initializeMethodName) { + const ownPropertyNames = Object.getOwnPropertyNames(target); + const prohibitedPropertyNames = [initializeMethodName, constructorMethodName]; + ownPropertyNames.forEach((propertyName) => { + var _a; + const initializablePropertiesSet = Reflect + .getMetadata(initializablePropertiesSetMetadataKey, target); + const wrappedMethodsSet = Reflect + .getMetadata(wrappedMethodsSetMetadataKey, target); + const isProhibitedPropertyName = prohibitedPropertyNames.includes(propertyName) + || initializablePropertiesSet.has(propertyName) + || wrappedMethodsSet.has(propertyName); + if (isProhibitedPropertyName) { + return; + } + const targetProperty = target[propertyName]; + if (typeof targetProperty !== 'function') { + return; + } + const methodDescriptor = (_a = Object + .getOwnPropertyDescriptor(target, propertyName)) !== null && _a !== void 0 ? _a : defaultDescriptor; + const originalMethod = methodDescriptor.value; + Object.defineProperty(target, propertyName, Object.assign(Object.assign({}, methodDescriptor), { value() { + if (!Reflect.getMetadata(initializedTargetMetadataKey, this)) { + throw new Error(`Class should be initialized with \`${initializeMethodName}()\` method`); + } + return originalMethod.apply(this, arguments); + } })); + wrappedMethodsSet.add(propertyName); + }); +} +function wrapInitializeMethodInInitializeCheck(target, initializeMethodName, propertyKey) { + var _a; + const methodDescriptor = (_a = Object + .getOwnPropertyDescriptor(target, initializeMethodName)) !== null && _a !== void 0 ? _a : defaultDescriptor; + const originalMethod = methodDescriptor.value; + Object.defineProperty(target, initializeMethodName, Object.assign(Object.assign({}, methodDescriptor), { value: function () { + Reflect.defineMetadata(initializedTargetMetadataKey, true, this); + const result = originalMethod.apply(this, arguments); + if (this[propertyKey]) { } + return result; + } })); +} +function wrapInitializableProperty(target, propertyKey) { + var _a; + const initializablePropertiesSet = Reflect + .getMetadata(initializablePropertiesSetMetadataKey, target); + initializablePropertiesSet.add(propertyKey); + const initializablePropertyMetadataKey = `_${propertyKey.toString()}`; + const propertyDescriptor = (_a = Object + .getOwnPropertyDescriptor(target, initializablePropertyMetadataKey)) !== null && _a !== void 0 ? _a : defaultDescriptor; + Object.defineProperty(target, propertyKey, Object.assign(Object.assign({}, propertyDescriptor), { get: function () { + if (this[initializablePropertyMetadataKey] === undefined) { + throw new Error(`Property \`${propertyKey.toString()}\` is not initialized! Initialize it first!`); + } + return this[initializablePropertyMetadataKey]; + }, set: function (newVal) { + this[initializablePropertyMetadataKey] = newVal; + } })); + return propertyDescriptor; +} + + +/***/ }), + +/***/ "./src/enums/ObfuscationTarget.ts": +/*!****************************************!*\ + !*** ./src/enums/ObfuscationTarget.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +exports.ObfuscationTarget = tsenum_1.MakeEnum({ + Browser: 'browser', + BrowserNoEval: 'browser-no-eval', + Node: 'node' +}); + + +/***/ }), + +/***/ "./src/enums/StringArrayEncoding.ts": +/*!******************************************!*\ + !*** ./src/enums/StringArrayEncoding.ts ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +exports.StringArrayEncoding = tsenum_1.MakeEnum({ + Base64: 'base64', + Rc4: 'rc4' +}); + + +/***/ }), + +/***/ "./src/enums/StringSeparator.ts": +/*!**************************************!*\ + !*** ./src/enums/StringSeparator.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var StringSeparator; +(function (StringSeparator) { + StringSeparator["Dot"] = "."; + StringSeparator["Comma"] = ","; +})(StringSeparator = exports.StringSeparator || (exports.StringSeparator = {})); + + +/***/ }), + +/***/ "./src/enums/analyzers/calls-graph-analyzer/CalleeDataExtractor.ts": +/*!*************************************************************************!*\ + !*** ./src/enums/analyzers/calls-graph-analyzer/CalleeDataExtractor.ts ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var CalleeDataExtractor; +(function (CalleeDataExtractor) { + CalleeDataExtractor["FunctionDeclarationCalleeDataExtractor"] = "FunctionDeclarationCalleeDataExtractor"; + CalleeDataExtractor["FunctionExpressionCalleeDataExtractor"] = "FunctionExpressionCalleeDataExtractor"; + CalleeDataExtractor["ObjectExpressionCalleeDataExtractor"] = "ObjectExpressionCalleeDataExtractor"; +})(CalleeDataExtractor = exports.CalleeDataExtractor || (exports.CalleeDataExtractor = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/ControlFlowCustomNode.ts": +/*!*********************************************************!*\ + !*** ./src/enums/custom-nodes/ControlFlowCustomNode.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ControlFlowCustomNode; +(function (ControlFlowCustomNode) { + ControlFlowCustomNode["BinaryExpressionFunctionNode"] = "BinaryExpressionFunctionNode"; + ControlFlowCustomNode["BlockStatementControlFlowFlatteningNode"] = "BlockStatementControlFlowFlatteningNode"; + ControlFlowCustomNode["CallExpressionControlFlowStorageCallNode"] = "CallExpressionControlFlowStorageCallNode"; + ControlFlowCustomNode["CallExpressionFunctionNode"] = "CallExpressionFunctionNode"; + ControlFlowCustomNode["ControlFlowStorageNode"] = "ControlFlowStorageNode"; + ControlFlowCustomNode["ExpressionWithOperatorControlFlowStorageCallNode"] = "ExpressionWithOperatorControlFlowStorageCallNode"; + ControlFlowCustomNode["LogicalExpressionFunctionNode"] = "LogicalExpressionFunctionNode"; + ControlFlowCustomNode["StringLiteralControlFlowStorageCallNode"] = "StringLiteralControlFlowStorageCallNode"; + ControlFlowCustomNode["StringLiteralNode"] = "StringLiteralNode"; +})(ControlFlowCustomNode = exports.ControlFlowCustomNode || (exports.ControlFlowCustomNode = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/CustomNode.ts": +/*!**********************************************!*\ + !*** ./src/enums/custom-nodes/CustomNode.ts ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var CustomNode; +(function (CustomNode) { + CustomNode["ConsoleOutputDisableExpressionNode"] = "ConsoleOutputDisableExpressionNode"; + CustomNode["DebugProtectionFunctionCallNode"] = "DebugProtectionFunctionCallNode"; + CustomNode["DebugProtectionFunctionIntervalNode"] = "DebugProtectionFunctionIntervalNode"; + CustomNode["DebugProtectionFunctionNode"] = "DebugProtectionFunctionNode"; + CustomNode["DomainLockNode"] = "DomainLockNode"; + CustomNode["NodeCallsControllerFunctionNode"] = "NodeCallsControllerFunctionNode"; + CustomNode["SelfDefendingUnicodeNode"] = "SelfDefendingUnicodeNode"; + CustomNode["StringArrayCallsWrapper"] = "StringArrayCallsWrapper"; + CustomNode["StringArrayNode"] = "StringArrayNode"; + CustomNode["StringArrayRotateFunctionNode"] = "StringArrayRotateFunctionNode"; +})(CustomNode = exports.CustomNode || (exports.CustomNode = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/CustomNodeGroup.ts": +/*!***************************************************!*\ + !*** ./src/enums/custom-nodes/CustomNodeGroup.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var CustomNodeGroup; +(function (CustomNodeGroup) { + CustomNodeGroup["ConsoleOutputCustomNodeGroup"] = "ConsoleOutputCustomNodeGroup"; + CustomNodeGroup["DebugProtectionCustomNodeGroup"] = "DebugProtectionCustomNodeGroup"; + CustomNodeGroup["DomainLockCustomNodeGroup"] = "DomainLockCustomNodeGroup"; + CustomNodeGroup["SelfDefendingCustomNodeGroup"] = "SelfDefendingCustomNodeGroup"; + CustomNodeGroup["StringArrayCustomNodeGroup"] = "StringArrayCustomNodeGroup"; +})(CustomNodeGroup = exports.CustomNodeGroup || (exports.CustomNodeGroup = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/DeadCodeInjectionCustomNode.ts": +/*!***************************************************************!*\ + !*** ./src/enums/custom-nodes/DeadCodeInjectionCustomNode.ts ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var DeadCodeInjectionCustomNode; +(function (DeadCodeInjectionCustomNode) { + DeadCodeInjectionCustomNode["BlockStatementDeadCodeInjectionNode"] = "BlockStatementDeadCodeInjectionNode"; +})(DeadCodeInjectionCustomNode = exports.DeadCodeInjectionCustomNode || (exports.DeadCodeInjectionCustomNode = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode.ts": +/*!*****************************************************************************!*\ + !*** ./src/enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ObjectExpressionKeysTransformerCustomNode; +(function (ObjectExpressionKeysTransformerCustomNode) { + ObjectExpressionKeysTransformerCustomNode["ObjectExpressionVariableDeclarationHostNode"] = "ObjectExpressionVariableDeclarationHostNode"; +})(ObjectExpressionKeysTransformerCustomNode = exports.ObjectExpressionKeysTransformerCustomNode || (exports.ObjectExpressionKeysTransformerCustomNode = {})); + + +/***/ }), + +/***/ "./src/enums/event-emitters/ObfuscationEvent.ts": +/*!******************************************************!*\ + !*** ./src/enums/event-emitters/ObfuscationEvent.ts ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ObfuscationEvent; +(function (ObfuscationEvent) { + ObfuscationEvent["AfterObfuscation"] = "afterObfuscation"; + ObfuscationEvent["BeforeObfuscation"] = "beforeObfuscation"; +})(ObfuscationEvent = exports.ObfuscationEvent || (exports.ObfuscationEvent = {})); + + +/***/ }), + +/***/ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts": +/*!**************************************************************************************!*\ + !*** ./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +exports.IdentifierNamesGenerator = tsenum_1.MakeEnum({ + DictionaryIdentifierNamesGenerator: 'dictionary', + HexadecimalIdentifierNamesGenerator: 'hexadecimal', + MangledIdentifierNamesGenerator: 'mangled' +}); + + +/***/ }), + +/***/ "./src/enums/logger/LoggingMessage.ts": +/*!********************************************!*\ + !*** ./src/enums/logger/LoggingMessage.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LoggingMessage; +(function (LoggingMessage) { + LoggingMessage["EmptySourceCode"] = "Empty source code. Obfuscation canceled..."; + LoggingMessage["ObfuscationCompleted"] = "Obfuscation completed. Total time: %s sec."; + LoggingMessage["ObfuscationStarted"] = "Obfuscation started..."; + LoggingMessage["RandomGeneratorSeed"] = "Random generator seed: %s..."; + LoggingMessage["TransformationStage"] = "Transformation stage: %s..."; + LoggingMessage["Version"] = "Version: %s"; +})(LoggingMessage = exports.LoggingMessage || (exports.LoggingMessage = {})); + + +/***/ }), + +/***/ "./src/enums/logger/LoggingPrefix.ts": +/*!*******************************************!*\ + !*** ./src/enums/logger/LoggingPrefix.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LoggingPrefix; +(function (LoggingPrefix) { + LoggingPrefix["Base"] = "[javascript-obfuscator]"; + LoggingPrefix["CLI"] = "[javascript-obfuscator-cli]"; +})(LoggingPrefix = exports.LoggingPrefix || (exports.LoggingPrefix = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/NodeTransformer.ts": +/*!********************************************************!*\ + !*** ./src/enums/node-transformers/NodeTransformer.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var NodeTransformer; +(function (NodeTransformer) { + NodeTransformer["BlockStatementControlFlowTransformer"] = "BlockStatementControlFlowTransformer"; + NodeTransformer["CommentsTransformer"] = "CommentsTransformer"; + NodeTransformer["CustomNodesTransformer"] = "CustomNodesTransformer"; + NodeTransformer["DeadCodeInjectionTransformer"] = "DeadCodeInjectionTransformer"; + NodeTransformer["EvalCallExpressionTransformer"] = "EvalCallExpressionTransformer"; + NodeTransformer["FunctionControlFlowTransformer"] = "FunctionControlFlowTransformer"; + NodeTransformer["LabeledStatementTransformer"] = "LabeledStatementTransformer"; + NodeTransformer["LiteralTransformer"] = "LiteralTransformer"; + NodeTransformer["MemberExpressionTransformer"] = "MemberExpressionTransformer"; + NodeTransformer["MetadataTransformer"] = "MetadataTransformer"; + NodeTransformer["MethodDefinitionTransformer"] = "MethodDefinitionTransformer"; + NodeTransformer["ObfuscatingGuardsTransformer"] = "ObfuscatingGuardsTransformer"; + NodeTransformer["ObjectExpressionKeysTransformer"] = "ObjectExpressionKeysTransformer"; + NodeTransformer["ObjectExpressionTransformer"] = "ObjectExpressionTransformer"; + NodeTransformer["ParentificationTransformer"] = "ParentificationTransformer"; + NodeTransformer["ScopeIdentifiersTransformer"] = "ScopeIdentifiersTransformer"; + NodeTransformer["SplitStringTransformer"] = "SplitStringTransformer"; + NodeTransformer["TemplateLiteralTransformer"] = "TemplateLiteralTransformer"; + NodeTransformer["VariablePreserveTransformer"] = "VariablePreserveTransformer"; +})(NodeTransformer = exports.NodeTransformer || (exports.NodeTransformer = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/TransformationStage.ts": +/*!************************************************************!*\ + !*** ./src/enums/node-transformers/TransformationStage.ts ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var TransformationStage; +(function (TransformationStage) { + TransformationStage["Initializing"] = "Initializing"; + TransformationStage["Preparing"] = "Preparing"; + TransformationStage["DeadCodeInjection"] = "DeadCodeInjection"; + TransformationStage["ControlFlowFlattening"] = "ControlFlowFlattening"; + TransformationStage["Converting"] = "Converting"; + TransformationStage["Obfuscating"] = "Obfuscating"; + TransformationStage["Finalizing"] = "Finalizing"; +})(TransformationStage = exports.TransformationStage || (exports.TransformationStage = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/VisitorDirection.ts": +/*!*********************************************************!*\ + !*** ./src/enums/node-transformers/VisitorDirection.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var VisitorDirection; +(function (VisitorDirection) { + VisitorDirection["Enter"] = "enter"; + VisitorDirection["Leave"] = "leave"; +})(VisitorDirection = exports.VisitorDirection || (exports.VisitorDirection = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor.ts": +/*!****************************************************************************************************************!*\ + !*** ./src/enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor.ts ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ObjectExpressionExtractor; +(function (ObjectExpressionExtractor) { + ObjectExpressionExtractor["BasePropertiesExtractor"] = "BasePropertiesExtractor"; + ObjectExpressionExtractor["ObjectExpressionToVariableDeclarationExtractor"] = "ObjectExpressionToVariableDeclarationExtractor"; +})(ObjectExpressionExtractor = exports.ObjectExpressionExtractor || (exports.ObjectExpressionExtractor = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer.ts": +/*!***********************************************************************************************************!*\ + !*** ./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer.ts ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ControlFlowReplacer; +(function (ControlFlowReplacer) { + ControlFlowReplacer["BinaryExpressionControlFlowReplacer"] = "BinaryExpressionControlFlowReplacer"; + ControlFlowReplacer["CallExpressionControlFlowReplacer"] = "CallExpressionControlFlowReplacer"; + ControlFlowReplacer["LogicalExpressionControlFlowReplacer"] = "LogicalExpressionControlFlowReplacer"; + ControlFlowReplacer["StringLiteralControlFlowReplacer"] = "StringLiteralControlFlowReplacer"; +})(ControlFlowReplacer = exports.ControlFlowReplacer || (exports.ControlFlowReplacer = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts": +/*!*********************************************************************************************************************!*\ + !*** ./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts ***! + \*********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var IdentifierObfuscatingReplacer; +(function (IdentifierObfuscatingReplacer) { + IdentifierObfuscatingReplacer["BaseIdentifierObfuscatingReplacer"] = "BaseIdentifierObfuscatingReplacer"; +})(IdentifierObfuscatingReplacer = exports.IdentifierObfuscatingReplacer || (exports.IdentifierObfuscatingReplacer = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer.ts": +/*!******************************************************************************************************************!*\ + !*** ./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer.ts ***! + \******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LiteralObfuscatingReplacer; +(function (LiteralObfuscatingReplacer) { + LiteralObfuscatingReplacer["BooleanLiteralObfuscatingReplacer"] = "BooleanLiteralObfuscatingReplacer"; + LiteralObfuscatingReplacer["NumberLiteralObfuscatingReplacer"] = "NumberLiteralObfuscatingReplacer"; + LiteralObfuscatingReplacer["StringLiteralObfuscatingReplacer"] = "StringLiteralObfuscatingReplacer"; +})(LiteralObfuscatingReplacer = exports.LiteralObfuscatingReplacer || (exports.LiteralObfuscatingReplacer = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts": +/*!***************************************************************************************************!*\ + !*** ./src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ObfuscatingGuard; +(function (ObfuscatingGuard) { + ObfuscatingGuard["BlackListObfuscatingGuard"] = "BlackListObfuscatingGuard"; + ObfuscatingGuard["ConditionalCommentObfuscatingGuard"] = "ConditionalCommentObfuscatingGuard"; + ObfuscatingGuard["ReservedStringObfuscatingGuard"] = "ReservedStringObfuscatingGuard"; +})(ObfuscatingGuard = exports.ObfuscatingGuard || (exports.ObfuscatingGuard = {})); + + +/***/ }), + +/***/ "./src/enums/node/NodeType.ts": +/*!************************************!*\ + !*** ./src/enums/node/NodeType.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var NodeType; +(function (NodeType) { + NodeType["ArrayExpression"] = "ArrayExpression"; + NodeType["ArrayPattern"] = "ArrayPattern"; + NodeType["ArrowFunctionExpression"] = "ArrowFunctionExpression"; + NodeType["AssignmentExpression"] = "AssignmentExpression"; + NodeType["AssignmentPattern"] = "AssignmentPattern"; + NodeType["AwaitExpression"] = "AwaitExpression"; + NodeType["BinaryExpression"] = "BinaryExpression"; + NodeType["BlockStatement"] = "BlockStatement"; + NodeType["BreakStatement"] = "BreakStatement"; + NodeType["CallExpression"] = "CallExpression"; + NodeType["CatchClause"] = "CatchClause"; + NodeType["ClassDeclaration"] = "ClassDeclaration"; + NodeType["ConditionalExpression"] = "ConditionalExpression"; + NodeType["ContinueStatement"] = "ContinueStatement"; + NodeType["ExportNamedDeclaration"] = "ExportNamedDeclaration"; + NodeType["ExpressionStatement"] = "ExpressionStatement"; + NodeType["ForStatement"] = "ForStatement"; + NodeType["ForInStatement"] = "ForInStatement"; + NodeType["ForOfStatement"] = "ForOfStatement"; + NodeType["FunctionDeclaration"] = "FunctionDeclaration"; + NodeType["FunctionExpression"] = "FunctionExpression"; + NodeType["Identifier"] = "Identifier"; + NodeType["IfStatement"] = "IfStatement"; + NodeType["ImportDeclaration"] = "ImportDeclaration"; + NodeType["ImportDefaultSpecifier"] = "ImportDefaultSpecifier"; + NodeType["ImportNamespaceSpecifier"] = "ImportNamespaceSpecifier"; + NodeType["ImportSpecifier"] = "ImportSpecifier"; + NodeType["LabeledStatement"] = "LabeledStatement"; + NodeType["Literal"] = "Literal"; + NodeType["LogicalExpression"] = "LogicalExpression"; + NodeType["MemberExpression"] = "MemberExpression"; + NodeType["MethodDefinition"] = "MethodDefinition"; + NodeType["ObjectExpression"] = "ObjectExpression"; + NodeType["ObjectPattern"] = "ObjectPattern"; + NodeType["Program"] = "Program"; + NodeType["Property"] = "Property"; + NodeType["RestElement"] = "RestElement"; + NodeType["ReturnStatement"] = "ReturnStatement"; + NodeType["SequenceExpression"] = "SequenceExpression"; + NodeType["Super"] = "Super"; + NodeType["SwitchCase"] = "SwitchCase"; + NodeType["SwitchStatement"] = "SwitchStatement"; + NodeType["TaggedTemplateExpression"] = "TaggedTemplateExpression"; + NodeType["TemplateLiteral"] = "TemplateLiteral"; + NodeType["TryStatement"] = "TryStatement"; + NodeType["UnaryExpression"] = "UnaryExpression"; + NodeType["UpdateExpression"] = "UpdateExpression"; + NodeType["VariableDeclaration"] = "VariableDeclaration"; + NodeType["VariableDeclarator"] = "VariableDeclarator"; + NodeType["WhileStatement"] = "WhileStatement"; +})(NodeType = exports.NodeType || (exports.NodeType = {})); + + +/***/ }), + +/***/ "./src/enums/source-map/SourceMapMode.ts": +/*!***********************************************!*\ + !*** ./src/enums/source-map/SourceMapMode.ts ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +exports.SourceMapMode = tsenum_1.MakeEnum({ + Inline: 'inline', + Separate: 'separate' +}); + + +/***/ }), + +/***/ "./src/event-emitters/ObfuscationEventEmitter.ts": +/*!*******************************************************!*\ + !*** ./src/event-emitters/ObfuscationEventEmitter.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const eventemitter3_1 = __importDefault(__webpack_require__(/*! eventemitter3 */ "eventemitter3")); +inversify_1.decorate(inversify_1.injectable(), eventemitter3_1.default); +let ObfuscationEventEmitter = class ObfuscationEventEmitter extends eventemitter3_1.default { +}; +ObfuscationEventEmitter = __decorate([ + inversify_1.injectable() +], ObfuscationEventEmitter); +exports.ObfuscationEventEmitter = ObfuscationEventEmitter; + + +/***/ }), + +/***/ "./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts": +/*!****************************************************************************************!*\ + !*** ./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let AbstractIdentifierNamesGenerator = class AbstractIdentifierNamesGenerator { + constructor(randomGenerator, options) { + this.preservedNamesSet = new Set(); + this.randomGenerator = randomGenerator; + this.options = options; + } + preserveName(name) { + this.preservedNamesSet.add(name); + } + isValidIdentifierName(name) { + return this.notReservedName(name) && !this.preservedNamesSet.has(name); + } + notReservedName(name) { + return this.options.reservedNames.length + ? !this.options.reservedNames.some((reservedName) => new RegExp(reservedName, 'g').exec(name) !== null) + : true; + } +}; +AbstractIdentifierNamesGenerator = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], AbstractIdentifierNamesGenerator); +exports.AbstractIdentifierNamesGenerator = AbstractIdentifierNamesGenerator; + + +/***/ }), + +/***/ "./src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts": +/*!******************************************************************************************!*\ + !*** ./src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var DictionaryIdentifierNamesGenerator_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IArrayUtils_1 = __webpack_require__(/*! ../../interfaces/utils/IArrayUtils */ "./src/interfaces/utils/IArrayUtils.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const AbstractIdentifierNamesGenerator_1 = __webpack_require__(/*! ./AbstractIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts"); +let DictionaryIdentifierNamesGenerator = DictionaryIdentifierNamesGenerator_1 = class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator { + constructor(randomGenerator, options, arrayUtils) { + super(randomGenerator, options); + this.arrayUtils = arrayUtils; + this.identifierNamesSet = new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)); + this.identifiersIterator = this.identifierNamesSet.values(); + } + static incrementIdentifierName(identifierName) { + let newIdentifierName = ''; + let isSuccess = false; + for (const character of identifierName) { + if (!isSuccess && character === character.toUpperCase()) { + newIdentifierName += character.toLowerCase(); + } + else if (!isSuccess && character === character.toLowerCase()) { + newIdentifierName += character.toUpperCase(); + isSuccess = true; + } + else { + newIdentifierName += character; + } + } + if (isSuccess) { + return newIdentifierName; + } + return null; + } + generate() { + if (!this.identifierNamesSet.size) { + throw new Error('Too many identifiers in the code, add more words to identifiers dictionary'); + } + const iteratorResult = this.identifiersIterator.next(); + if (!iteratorResult.done) { + return iteratorResult.value; + } + this.identifierNamesSet = new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])); + this.identifiersIterator = this.identifierNamesSet.values(); + return this.generate(); + } + generateWithPrefix() { + const prefix = this.options.identifiersPrefix ? + `${this.options.identifiersPrefix}_` + : ''; + const identifierName = this.generate(); + return `${prefix}${identifierName}`.replace('__', '_'); + } + getInitialIdentifierNames(identifierNames) { + const formattedIdentifierNames = identifierNames + .filter(Boolean) + .map((identifierName) => identifierName.toLowerCase()); + return this.arrayUtils.shuffle(formattedIdentifierNames); + } + getIncrementedIdentifierNames(identifierNames) { + const formattedIdentifierNames = []; + for (const identifierName of identifierNames) { + const newIdentifierName = DictionaryIdentifierNamesGenerator_1 + .incrementIdentifierName(identifierName); + if (newIdentifierName) { + formattedIdentifierNames.push(newIdentifierName); + } + } + return this.arrayUtils.shuffle(formattedIdentifierNames); + } +}; +DictionaryIdentifierNamesGenerator = DictionaryIdentifierNamesGenerator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object, typeof (_c = typeof IArrayUtils_1.IArrayUtils !== "undefined" && IArrayUtils_1.IArrayUtils) === "function" ? _c : Object]) +], DictionaryIdentifierNamesGenerator); +exports.DictionaryIdentifierNamesGenerator = DictionaryIdentifierNamesGenerator; + + +/***/ }), + +/***/ "./src/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.ts": +/*!*******************************************************************************************!*\ + !*** ./src/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.ts ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var HexadecimalIdentifierNamesGenerator_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const AbstractIdentifierNamesGenerator_1 = __webpack_require__(/*! ./AbstractIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts"); +const NumberUtils_1 = __webpack_require__(/*! ../../utils/NumberUtils */ "./src/utils/NumberUtils.ts"); +const Utils_1 = __webpack_require__(/*! ../../utils/Utils */ "./src/utils/Utils.ts"); +let HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator_1 = class HexadecimalIdentifierNamesGenerator extends AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator { + constructor(randomGenerator, options) { + super(randomGenerator, options); + this.randomVariableNameSet = new Set(); + } + generate(nameLength) { + const rangeMinInteger = 10000; + const rangeMaxInteger = 99999999; + const randomInteger = this.randomGenerator.getRandomInteger(rangeMinInteger, rangeMaxInteger); + const hexadecimalNumber = NumberUtils_1.NumberUtils.toHex(randomInteger); + const prefixLength = Utils_1.Utils.hexadecimalPrefix.length + 1; + const baseNameLength = nameLength + ? nameLength - prefixLength + : HexadecimalIdentifierNamesGenerator_1.baseIdentifierNameLength; + const baseIdentifierName = hexadecimalNumber.substr(0, baseNameLength); + const identifierName = `_${Utils_1.Utils.hexadecimalPrefix}${baseIdentifierName}`; + if (this.randomVariableNameSet.has(identifierName)) { + return this.generate(nameLength); + } + this.randomVariableNameSet.add(identifierName); + return identifierName; + } + generateWithPrefix(nameLength) { + const identifierName = this.generate(nameLength); + return `${this.options.identifiersPrefix}${identifierName}`.replace('__', '_'); + } +}; +HexadecimalIdentifierNamesGenerator.baseIdentifierNameLength = 6; +HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], HexadecimalIdentifierNamesGenerator); +exports.HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator; + + +/***/ }), + +/***/ "./src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.ts": +/*!***************************************************************************************!*\ + !*** ./src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.ts ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var MangledIdentifierNamesGenerator_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const AbstractIdentifierNamesGenerator_1 = __webpack_require__(/*! ./AbstractIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts"); +let MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator_1 = class MangledIdentifierNamesGenerator extends AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator { + constructor(randomGenerator, options) { + super(randomGenerator, options); + this.previousMangledName = MangledIdentifierNamesGenerator_1.initMangledNameCharacter; + } + generate(nameLength) { + const identifierName = this.generateNewMangledName(this.previousMangledName); + this.previousMangledName = identifierName; + return identifierName; + } + generateWithPrefix(nameLength) { + const prefix = this.options.identifiersPrefix ? + `${this.options.identifiersPrefix}_` + : ''; + const identifierName = this.generate(nameLength); + return `${prefix}${identifierName}`; + } + isValidIdentifierName(mangledName) { + return super.isValidIdentifierName(mangledName) + && !MangledIdentifierNamesGenerator_1.reservedNamesSet.has(mangledName); + } + generateNewMangledName(previousMangledName) { + const generateNewMangledName = (name) => { + const nameSequence = MangledIdentifierNamesGenerator_1.nameSequence; + const nameSequenceLength = nameSequence.length; + const nameLength = name.length; + const zeroSequence = (num) => { + return '0'.repeat(num); + }; + let index = nameLength - 1; + do { + const character = name[index]; + const indexInSequence = nameSequence.indexOf(character); + const lastNameSequenceIndex = nameSequenceLength - 1; + if (indexInSequence !== lastNameSequenceIndex) { + const previousNamePart = name.substring(0, index); + const nextCharacter = nameSequence[indexInSequence + 1]; + const zeroSequenceLength = nameLength - (index + 1); + const zeroSequenceCharacters = zeroSequence(zeroSequenceLength); + return previousNamePart + nextCharacter + zeroSequenceCharacters; + } + --index; + } while (index >= 0); + return `a${zeroSequence(nameLength)}`; + }; + let newMangledName = generateNewMangledName(previousMangledName); + if (!this.isValidIdentifierName(newMangledName)) { + newMangledName = this.generateNewMangledName(newMangledName); + } + return newMangledName; + } +}; +MangledIdentifierNamesGenerator.initMangledNameCharacter = '9'; +MangledIdentifierNamesGenerator.nameSequence = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); +MangledIdentifierNamesGenerator.reservedNamesSet = new Set([ + 'byte', 'case', 'char', 'do', 'else', 'enum', 'eval', 'for', 'goto', + 'if', 'in', 'int', 'let', 'long', 'new', 'null', 'this', 'true', 'try', + 'var', 'void', 'with' +]); +MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], MangledIdentifierNamesGenerator); +exports.MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator; + + +/***/ }), + +/***/ "./src/interfaces/analyzers/calls-graph-analyzer/ICallsGraphAnalyzer.ts": +/*!******************************************************************************!*\ + !*** ./src/interfaces/analyzers/calls-graph-analyzer/ICallsGraphAnalyzer.ts ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer.ts": +/*!*********************************************************************************************!*\ + !*** ./src/interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer.ts ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/analyzers/scope-analyzer/IScopeAnalyzer.ts": +/*!*******************************************************************!*\ + !*** ./src/interfaces/analyzers/scope-analyzer/IScopeAnalyzer.ts ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer.ts": +/*!***********************************************************************************************!*\ + !*** ./src/interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer.ts ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts": +/*!*************************************************************!*\ + !*** ./src/interfaces/custom-nodes/ICustomNodeFormatter.ts ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/event-emitters/IObfuscationEventEmitter.ts": +/*!*******************************************************************!*\ + !*** ./src/interfaces/event-emitters/IObfuscationEventEmitter.ts ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/logger/ILogger.ts": +/*!******************************************!*\ + !*** ./src/interfaces/logger/ILogger.ts ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/node-transformers/ITransformersRunner.ts": +/*!*****************************************************************!*\ + !*** ./src/interfaces/node-transformers/ITransformersRunner.ts ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/options/IOptions.ts": +/*!********************************************!*\ + !*** ./src/interfaces/options/IOptions.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/options/IOptionsNormalizer.ts": +/*!******************************************************!*\ + !*** ./src/interfaces/options/IOptionsNormalizer.ts ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/source-code/ISourceCode.ts": +/*!***************************************************!*\ + !*** ./src/interfaces/source-code/ISourceCode.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts": +/*!*****************************************************************************!*\ + !*** ./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/IArrayUtils.ts": +/*!*********************************************!*\ + !*** ./src/interfaces/utils/IArrayUtils.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/ICryptUtils.ts": +/*!*********************************************!*\ + !*** ./src/interfaces/utils/ICryptUtils.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/IEscapeSequenceEncoder.ts": +/*!********************************************************!*\ + !*** ./src/interfaces/utils/IEscapeSequenceEncoder.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/ILevelledTopologicalSorter.ts": +/*!************************************************************!*\ + !*** ./src/interfaces/utils/ILevelledTopologicalSorter.ts ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/INodeTransformerNamesGroupsBuilder.ts": +/*!********************************************************************!*\ + !*** ./src/interfaces/utils/INodeTransformerNamesGroupsBuilder.ts ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/IRandomGenerator.ts": +/*!**************************************************!*\ + !*** ./src/interfaces/utils/IRandomGenerator.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/logger/Logger.ts": +/*!******************************!*\ + !*** ./src/logger/Logger.ts ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var Logger_1, _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const chalk_1 = __importDefault(__webpack_require__(/*! chalk */ "chalk")); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const LoggingPrefix_1 = __webpack_require__(/*! ../enums/logger/LoggingPrefix */ "./src/enums/logger/LoggingPrefix.ts"); +let Logger = Logger_1 = class Logger { + constructor(options) { + this.options = options; + } + static log(loggingLevelColor, loggingPrefix, loggingMessage, value) { + const processedMessage = loggingLevelColor(`\n${loggingPrefix} ${loggingMessage}`); + console.log(processedMessage, value !== null && value !== void 0 ? value : ''); + } + info(loggingMessage, value) { + if (!this.options.log) { + return; + } + Logger_1.log(Logger_1.colorInfo, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); + } + success(loggingMessage, value) { + if (!this.options.log) { + return; + } + Logger_1.log(Logger_1.colorSuccess, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); + } + warn(loggingMessage, value) { + if (!this.options.log) { + return; + } + Logger_1.log(Logger_1.colorWarn, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); + } +}; +Logger.colorInfo = chalk_1.default.cyan; +Logger.colorSuccess = chalk_1.default.green; +Logger.colorWarn = chalk_1.default.yellow; +Logger = Logger_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], Logger); +exports.Logger = Logger; + + +/***/ }), + +/***/ "./src/node-transformers/AbstractNodeTransformer.ts": +/*!**********************************************************!*\ + !*** ./src/node-transformers/AbstractNodeTransformer.ts ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let AbstractNodeTransformer = class AbstractNodeTransformer { + constructor(randomGenerator, options) { + this.randomGenerator = randomGenerator; + this.options = options; + } +}; +AbstractNodeTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], AbstractNodeTransformer); +exports.AbstractNodeTransformer = AbstractNodeTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/TransformersRunner.ts": +/*!*****************************************************!*\ + !*** ./src/node-transformers/TransformersRunner.ts ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TNodeTransformerFactory_1 = __webpack_require__(/*! ../types/container/node-transformers/TNodeTransformerFactory */ "./src/types/container/node-transformers/TNodeTransformerFactory.ts"); +const INodeTransformerNamesGroupsBuilder_1 = __webpack_require__(/*! ../interfaces/utils/INodeTransformerNamesGroupsBuilder */ "./src/interfaces/utils/INodeTransformerNamesGroupsBuilder.ts"); +const VisitorDirection_1 = __webpack_require__(/*! ../enums/node-transformers/VisitorDirection */ "./src/enums/node-transformers/VisitorDirection.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +let TransformersRunner = class TransformersRunner { + constructor(nodeTransformerFactory, nodeTransformerNamesGroupsBuilder) { + this.cachedNodeTransformersData = new Map(); + this.nodeTransformerFactory = nodeTransformerFactory; + this.nodeTransformerNamesGroupsBuilder = nodeTransformerNamesGroupsBuilder; + } + transform(astTree, nodeTransformerNames, transformationStage) { + if (!nodeTransformerNames.length) { + return astTree; + } + let normalizedNodeTransformers; + let nodeTransformerNamesGroups; + if (!this.cachedNodeTransformersData.has(nodeTransformerNames)) { + normalizedNodeTransformers = this.buildNormalizedNodeTransformers(nodeTransformerNames); + nodeTransformerNamesGroups = this.nodeTransformerNamesGroupsBuilder.build(normalizedNodeTransformers); + this.cachedNodeTransformersData.set(nodeTransformerNames, [normalizedNodeTransformers, nodeTransformerNamesGroups]); + } + else { + [ + normalizedNodeTransformers, + nodeTransformerNamesGroups + ] = this.cachedNodeTransformersData.get(nodeTransformerNames); + } + for (const nodeTransformerNamesGroup of nodeTransformerNamesGroups) { + const enterVisitors = []; + const leaveVisitors = []; + for (const nodeTransformerName of nodeTransformerNamesGroup) { + const nodeTransformer = normalizedNodeTransformers[nodeTransformerName]; + const visitor = nodeTransformer.getVisitor(transformationStage); + if (!visitor) { + continue; + } + if (visitor.enter) { + enterVisitors.push({ enter: visitor.enter }); + } + if (visitor.leave) { + leaveVisitors.push({ leave: visitor.leave }); + } + } + if (!enterVisitors.length && !leaveVisitors.length) { + continue; + } + estraverse.replace(astTree, { + enter: this.mergeVisitorsForDirection(enterVisitors, VisitorDirection_1.VisitorDirection.Enter), + leave: this.mergeVisitorsForDirection(leaveVisitors, VisitorDirection_1.VisitorDirection.Leave) + }); + } + return astTree; + } + buildNormalizedNodeTransformers(nodeTransformerNames) { + return nodeTransformerNames + .reduce((acc, nodeTransformerName) => (Object.assign(Object.assign({}, acc), { [nodeTransformerName]: this.nodeTransformerFactory(nodeTransformerName) })), {}); + } + mergeVisitorsForDirection(visitors, direction) { + const visitorsLength = visitors.length; + if (!visitorsLength) { + return (node, parentNode) => node; + } + return (node, parentNode) => { + if (NodeMetadata_1.NodeMetadata.isIgnoredNode(node)) { + return estraverse.VisitorOption.Skip; + } + for (let i = 0; i < visitorsLength; i++) { + const visitorFunction = visitors[i][direction]; + if (!visitorFunction) { + continue; + } + const visitorResult = visitorFunction(node, parentNode); + if (!visitorResult || !NodeGuards_1.NodeGuards.isNode(visitorResult)) { + continue; + } + node = visitorResult; + } + return node; + }; + } +}; +TransformersRunner = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeTransformer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)), + __metadata("design:paramtypes", [typeof (_a = typeof TNodeTransformerFactory_1.TNodeTransformerFactory !== "undefined" && TNodeTransformerFactory_1.TNodeTransformerFactory) === "function" ? _a : Object, typeof (_b = typeof INodeTransformerNamesGroupsBuilder_1.INodeTransformerNamesGroupsBuilder !== "undefined" && INodeTransformerNamesGroupsBuilder_1.INodeTransformerNamesGroupsBuilder) === "function" ? _b : Object]) +], TransformersRunner); +exports.TransformersRunner = TransformersRunner; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer.ts": +/*!*************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer.ts ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var BlockStatementControlFlowTransformer_1, _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IArrayUtils_1 = __webpack_require__(/*! ../../interfaces/utils/IArrayUtils */ "./src/interfaces/utils/IArrayUtils.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer_1 = class BlockStatementControlFlowTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(controlFlowCustomNodeFactory, arrayUtils, randomGenerator, options) { + super(randomGenerator, options); + this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; + this.arrayUtils = arrayUtils; + } + static isProhibitedStatementNode(node) { + const isBreakOrContinueStatement = NodeGuards_1.NodeGuards.isBreakStatementNode(node) + || NodeGuards_1.NodeGuards.isContinueStatementNode(node); + const isVariableDeclarationWithLetOrConstKind = NodeGuards_1.NodeGuards.isVariableDeclarationNode(node) + && (node.kind === 'const' || node.kind === 'let'); + const isClassDeclaration = NodeGuards_1.NodeGuards.isClassDeclarationNode(node); + return NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) + || isBreakOrContinueStatement + || isVariableDeclarationWithLetOrConstKind + || isClassDeclaration; + } + static canTransformBlockStatementNode(blockStatementNode) { + let canTransform = true; + estraverse.traverse(blockStatementNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isWhileStatementNode(node)) { + return estraverse.VisitorOption.Skip; + } + if (BlockStatementControlFlowTransformer_1.isProhibitedStatementNode(node)) { + canTransform = false; + } + } + }); + if (blockStatementNode.body.length <= 4) { + canTransform = false; + } + return canTransform; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.ControlFlowFlattening: + return { + leave: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(blockStatementNode, parentNode) { + if (this.randomGenerator.getMathRandom() > this.options.controlFlowFlatteningThreshold || + !BlockStatementControlFlowTransformer_1.canTransformBlockStatementNode(blockStatementNode)) { + return blockStatementNode; + } + const blockStatementBody = blockStatementNode.body; + const originalKeys = this.arrayUtils.createWithRange(blockStatementBody.length); + const shuffledKeys = this.arrayUtils.shuffle(originalKeys); + const originalKeysIndexesInShuffledArray = originalKeys.map((key) => shuffledKeys.indexOf(key)); + const blockStatementControlFlowFlatteningCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode); + blockStatementControlFlowFlatteningCustomNode.initialize(blockStatementBody, shuffledKeys, originalKeysIndexesInShuffledArray); + const newBlockStatementNode = blockStatementControlFlowFlatteningCustomNode.getNode()[0]; + NodeUtils_1.NodeUtils.parentizeNode(newBlockStatementNode, parentNode); + return newBlockStatementNode; + } +}; +BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IArrayUtils_1.IArrayUtils !== "undefined" && IArrayUtils_1.IArrayUtils) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], BlockStatementControlFlowTransformer); +exports.BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.ts": +/*!*******************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.ts ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var FunctionControlFlowTransformer_1, _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const TControlFlowReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TControlFlowReplacerFactory */ "./src/types/container/node-transformers/TControlFlowReplacerFactory.ts"); +const TControlFlowStorageFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TControlFlowStorageFactory */ "./src/types/container/node-transformers/TControlFlowStorageFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const ControlFlowReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer.ts"); +const NodeType_1 = __webpack_require__(/*! ../../enums/node/NodeType */ "./src/enums/node/NodeType.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let FunctionControlFlowTransformer = FunctionControlFlowTransformer_1 = class FunctionControlFlowTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(controlFlowStorageFactory, controlFlowReplacerFactory, controlFlowCustomNodeFactory, randomGenerator, options) { + super(randomGenerator, options); + this.controlFlowData = new Map(); + this.visitedFunctionNodes = new Set(); + this.hostNodesWithControlFlowNode = new Set(); + this.controlFlowStorageFactory = controlFlowStorageFactory; + this.controlFlowReplacerFactory = controlFlowReplacerFactory; + this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.ControlFlowFlattening: + return { + leave: (node, parentNode) => { + if (parentNode && (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || + NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || + NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node))) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(functionNode, parentNode) { + this.visitedFunctionNodes.add(functionNode); + if (!NodeGuards_1.NodeGuards.isBlockStatementNode(functionNode.body)) { + return functionNode; + } + const hostNode = this.getHostNode(functionNode.body); + const controlFlowStorage = this.getControlFlowStorage(hostNode); + this.controlFlowData.set(hostNode, controlFlowStorage); + this.transformFunctionBody(functionNode.body, controlFlowStorage); + if (!controlFlowStorage.getLength()) { + return functionNode; + } + const controlFlowStorageCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.ControlFlowStorageNode); + controlFlowStorageCustomNode.initialize(controlFlowStorage); + NodeAppender_1.NodeAppender.prepend(hostNode, controlFlowStorageCustomNode.getNode()); + this.hostNodesWithControlFlowNode.add(hostNode); + NodeUtils_1.NodeUtils.parentizeAst(functionNode); + return functionNode; + } + getControlFlowStorage(hostNode) { + const controlFlowStorage = this.controlFlowStorageFactory(); + if (this.controlFlowData.has(hostNode)) { + if (this.hostNodesWithControlFlowNode.has(hostNode)) { + if (NodeGuards_1.NodeGuards.isSwitchCaseNode(hostNode)) { + hostNode.consequent.shift(); + } + else { + hostNode.body.shift(); + } + } + const hostControlFlowStorage = this.controlFlowData.get(hostNode); + controlFlowStorage.mergeWith(hostControlFlowStorage, true); + } + return controlFlowStorage; + } + getHostNode(functionNodeBody) { + const blockScopesOfNode = NodeStatementUtils_1.NodeStatementUtils.getParentNodesWithStatements(functionNodeBody); + if (blockScopesOfNode.length === 1) { + return functionNodeBody; + } + else { + blockScopesOfNode.pop(); + } + if (blockScopesOfNode.length > FunctionControlFlowTransformer_1.hostNodeSearchMinDepth) { + blockScopesOfNode.splice(0, FunctionControlFlowTransformer_1.hostNodeSearchMinDepth); + } + if (blockScopesOfNode.length > FunctionControlFlowTransformer_1.hostNodeSearchMaxDepth) { + blockScopesOfNode.length = FunctionControlFlowTransformer_1.hostNodeSearchMaxDepth; + } + return this.randomGenerator.getRandomGenerator().pickone(blockScopesOfNode); + } + isVisitedFunctionNode(node) { + return (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || + NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || + NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node)) && this.visitedFunctionNodes.has(node); + } + transformFunctionBody(functionNodeBody, controlFlowStorage) { + estraverse.replace(functionNodeBody, { + enter: (node, parentNode) => { + if (NodeMetadata_1.NodeMetadata.isIgnoredNode(node)) { + return estraverse.VisitorOption.Skip; + } + if (this.isVisitedFunctionNode(node) || !parentNode) { + return estraverse.VisitorOption.Skip; + } + if (!FunctionControlFlowTransformer_1.controlFlowReplacersMap.has(node.type)) { + return node; + } + if (this.randomGenerator.getMathRandom() > this.options.controlFlowFlatteningThreshold) { + return node; + } + const controlFlowReplacerName = FunctionControlFlowTransformer_1 + .controlFlowReplacersMap.get(node.type); + if (controlFlowReplacerName === undefined) { + return node; + } + return Object.assign(Object.assign({}, this.controlFlowReplacerFactory(controlFlowReplacerName).replace(node, parentNode, controlFlowStorage)), { parentNode }); + } + }); + } +}; +FunctionControlFlowTransformer.controlFlowReplacersMap = new Map([ + [NodeType_1.NodeType.BinaryExpression, ControlFlowReplacer_1.ControlFlowReplacer.BinaryExpressionControlFlowReplacer], + [NodeType_1.NodeType.CallExpression, ControlFlowReplacer_1.ControlFlowReplacer.CallExpressionControlFlowReplacer], + [NodeType_1.NodeType.LogicalExpression, ControlFlowReplacer_1.ControlFlowReplacer.LogicalExpressionControlFlowReplacer], + [NodeType_1.NodeType.Literal, ControlFlowReplacer_1.ControlFlowReplacer.StringLiteralControlFlowReplacer] +]); +FunctionControlFlowTransformer.hostNodeSearchMinDepth = 0; +FunctionControlFlowTransformer.hostNodeSearchMaxDepth = 2; +FunctionControlFlowTransformer = FunctionControlFlowTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__TControlFlowStorage)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowReplacer)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowStorageFactory_1.TControlFlowStorageFactory !== "undefined" && TControlFlowStorageFactory_1.TControlFlowStorageFactory) === "function" ? _a : Object, typeof (_b = typeof TControlFlowReplacerFactory_1.TControlFlowReplacerFactory !== "undefined" && TControlFlowReplacerFactory_1.TControlFlowReplacerFactory) === "function" ? _b : Object, typeof (_c = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], FunctionControlFlowTransformer); +exports.FunctionControlFlowTransformer = FunctionControlFlowTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts": +/*!***************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var AbstractControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let AbstractControlFlowReplacer = AbstractControlFlowReplacer_1 = class AbstractControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + this.replacerDataByControlFlowStorageId = new Map(); + this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; + this.randomGenerator = randomGenerator; + this.options = options; + } + static getStorageKeysByIdForCurrentStorage(identifierDataByControlFlowStorageId, controlFlowStorageId) { + let storageKeysById; + if (identifierDataByControlFlowStorageId.has(controlFlowStorageId)) { + storageKeysById = identifierDataByControlFlowStorageId.get(controlFlowStorageId); + } + else { + storageKeysById = new Map(); + } + return storageKeysById; + } + insertCustomNodeToControlFlowStorage(customNode, controlFlowStorage, replacerId, usingExistingIdentifierChance) { + const controlFlowStorageId = controlFlowStorage.getStorageId(); + const storageKeysById = AbstractControlFlowReplacer_1 + .getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId, controlFlowStorageId); + const storageKeysForCurrentId = storageKeysById.get(replacerId); + if (this.randomGenerator.getMathRandom() < usingExistingIdentifierChance && + storageKeysForCurrentId && + storageKeysForCurrentId.length) { + return this.randomGenerator.getRandomGenerator().pickone(storageKeysForCurrentId); + } + const generateStorageKey = (length) => { + const key = this.randomGenerator.getRandomString(length); + if (controlFlowStorage.getStorage().has(key)) { + return generateStorageKey(length); + } + return key; + }; + const storageKey = generateStorageKey(5); + storageKeysById.set(replacerId, [storageKey]); + this.replacerDataByControlFlowStorageId.set(controlFlowStorageId, storageKeysById); + controlFlowStorage.set(storageKey, customNode); + return storageKey; + } +}; +AbstractControlFlowReplacer = AbstractControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], AbstractControlFlowReplacer); +exports.AbstractControlFlowReplacer = AbstractControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer.ts": +/*!***********************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer.ts ***! + \***********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var BinaryExpressionControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const ExpressionWithOperatorControlFlowReplacer_1 = __webpack_require__(/*! ./ExpressionWithOperatorControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts"); +let BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer_1 = class BinaryExpressionControlFlowReplacer extends ExpressionWithOperatorControlFlowReplacer_1.ExpressionWithOperatorControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + replace(binaryExpressionNode, parentNode, controlFlowStorage) { + const operator = binaryExpressionNode.operator; + const binaryExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.BinaryExpressionFunctionNode); + binaryExpressionFunctionCustomNode.initialize(operator); + const storageKey = this.insertCustomNodeToControlFlowStorage(binaryExpressionFunctionCustomNode, controlFlowStorage, operator, BinaryExpressionControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, binaryExpressionNode.left, binaryExpressionNode.right); + } +}; +BinaryExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; +BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], BinaryExpressionControlFlowReplacer); +exports.BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer.ts": +/*!*********************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer.ts ***! + \*********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var CallExpressionControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const AbstractControlFlowReplacer_1 = __webpack_require__(/*! ./AbstractControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer_1 = class CallExpressionControlFlowReplacer extends AbstractControlFlowReplacer_1.AbstractControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + replace(callExpressionNode, parentNode, controlFlowStorage) { + const callee = callExpressionNode.callee; + if (!NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { + return callExpressionNode; + } + const replacerId = String(callExpressionNode.arguments.length); + const callExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionFunctionNode); + const expressionArguments = callExpressionNode.arguments; + callExpressionFunctionCustomNode.initialize(expressionArguments); + const storageKey = this.insertCustomNodeToControlFlowStorage(callExpressionFunctionCustomNode, controlFlowStorage, replacerId, CallExpressionControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, callee, expressionArguments); + } + getControlFlowStorageCallNode(controlFlowStorageId, storageKey, callee, expressionArguments) { + const controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode); + controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey, callee, expressionArguments); + const statementNode = controlFlowStorageCallCustomNode.getNode()[0]; + if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { + throw new Error('`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node'); + } + return statementNode.expression; + } +}; +CallExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; +CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], CallExpressionControlFlowReplacer); +exports.CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts": +/*!*****************************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts ***! + \*****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const AbstractControlFlowReplacer_1 = __webpack_require__(/*! ./AbstractControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ExpressionWithOperatorControlFlowReplacer = class ExpressionWithOperatorControlFlowReplacer extends AbstractControlFlowReplacer_1.AbstractControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + getControlFlowStorageCallNode(controlFlowStorageId, storageKey, leftExpression, rightExpression) { + const controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode); + controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey, leftExpression, rightExpression); + const statementNode = controlFlowStorageCallCustomNode.getNode()[0]; + if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { + throw new Error('`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node'); + } + return statementNode.expression; + } +}; +ExpressionWithOperatorControlFlowReplacer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], ExpressionWithOperatorControlFlowReplacer); +exports.ExpressionWithOperatorControlFlowReplacer = ExpressionWithOperatorControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.ts": +/*!************************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.ts ***! + \************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var LogicalExpressionControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const ExpressionWithOperatorControlFlowReplacer_1 = __webpack_require__(/*! ./ExpressionWithOperatorControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer_1 = class LogicalExpressionControlFlowReplacer extends ExpressionWithOperatorControlFlowReplacer_1.ExpressionWithOperatorControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + replace(logicalExpressionNode, parentNode, controlFlowStorage) { + if (this.checkForProhibitedExpressions(logicalExpressionNode.left, logicalExpressionNode.right)) { + return logicalExpressionNode; + } + const operator = logicalExpressionNode.operator; + const logicalExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.LogicalExpressionFunctionNode); + logicalExpressionFunctionCustomNode.initialize(operator); + const storageKey = this.insertCustomNodeToControlFlowStorage(logicalExpressionFunctionCustomNode, controlFlowStorage, operator, LogicalExpressionControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, logicalExpressionNode.left, logicalExpressionNode.right); + } + checkForProhibitedExpressions(leftExpression, rightExpression) { + return [leftExpression, rightExpression].some((expressionNode) => { + let nodeForCheck; + if (!NodeGuards_1.NodeGuards.isUnaryExpressionNode(expressionNode)) { + nodeForCheck = expressionNode; + } + else { + nodeForCheck = NodeUtils_1.NodeUtils.getUnaryExpressionArgumentNode(expressionNode); + } + return !NodeGuards_1.NodeGuards.isLiteralNode(nodeForCheck) && + !NodeGuards_1.NodeGuards.isIdentifierNode(nodeForCheck) && + !NodeGuards_1.NodeGuards.isObjectExpressionNode(nodeForCheck) && + !NodeGuards_1.NodeGuards.isExpressionStatementNode(nodeForCheck); + }); + } +}; +LogicalExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; +LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], LogicalExpressionControlFlowReplacer); +exports.LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer.ts": +/*!********************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer.ts ***! + \********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var StringLiteralControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const AbstractControlFlowReplacer_1 = __webpack_require__(/*! ./AbstractControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer_1 = class StringLiteralControlFlowReplacer extends AbstractControlFlowReplacer_1.AbstractControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + replace(literalNode, parentNode, controlFlowStorage) { + if (NodeGuards_1.NodeGuards.isPropertyNode(parentNode) && parentNode.key === literalNode) { + return literalNode; + } + if (typeof literalNode.value !== 'string' || literalNode.value.length < 3) { + return literalNode; + } + const replacerId = String(literalNode.value); + const literalFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralNode); + literalFunctionCustomNode.initialize(literalNode.value); + const storageKey = this.insertCustomNodeToControlFlowStorage(literalFunctionCustomNode, controlFlowStorage, replacerId, StringLiteralControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey); + } + getControlFlowStorageCallNode(controlFlowStorageId, storageKey) { + const controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode); + controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey); + const statementNode = controlFlowStorageCallCustomNode.getNode()[0]; + if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { + throw new Error('`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node'); + } + return statementNode.expression; + } +}; +StringLiteralControlFlowReplacer.usingExistingIdentifierChance = 1; +StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], StringLiteralControlFlowReplacer); +exports.StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/MemberExpressionTransformer.ts": +/*!**************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/MemberExpressionTransformer.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let MemberExpressionTransformer = class MemberExpressionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isMemberExpressionNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(memberExpressionNode, parentNode) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpressionNode.property)) { + if (memberExpressionNode.computed) { + return memberExpressionNode; + } + memberExpressionNode.computed = true; + memberExpressionNode.property = NodeFactory_1.NodeFactory.literalNode(memberExpressionNode.property.name); + } + return memberExpressionNode; + } +}; +MemberExpressionTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], MemberExpressionTransformer); +exports.MemberExpressionTransformer = MemberExpressionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/MethodDefinitionTransformer.ts": +/*!**************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/MethodDefinitionTransformer.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var MethodDefinitionTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let MethodDefinitionTransformer = MethodDefinitionTransformer_1 = class MethodDefinitionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isMethodDefinitionNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(methodDefinitionNode, parentNode) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(methodDefinitionNode.key)) { + return this.replaceIdentifierKey(methodDefinitionNode, methodDefinitionNode.key); + } + if (NodeGuards_1.NodeGuards.isLiteralNode(methodDefinitionNode.key)) { + return this.replaceLiteralKey(methodDefinitionNode, methodDefinitionNode.key); + } + return methodDefinitionNode; + } + replaceIdentifierKey(methodDefinitionNode, keyNode) { + if (!MethodDefinitionTransformer_1.ignoredNames.includes(keyNode.name) + && !methodDefinitionNode.computed) { + methodDefinitionNode.computed = true; + methodDefinitionNode.key = NodeFactory_1.NodeFactory.literalNode(keyNode.name); + } + return methodDefinitionNode; + } + replaceLiteralKey(methodDefinitionNode, keyNode) { + if (typeof keyNode.value === 'string' + && !MethodDefinitionTransformer_1.ignoredNames.includes(keyNode.value) + && !methodDefinitionNode.computed) { + methodDefinitionNode.computed = true; + } + return methodDefinitionNode; + } +}; +MethodDefinitionTransformer.ignoredNames = ['constructor']; +MethodDefinitionTransformer = MethodDefinitionTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], MethodDefinitionTransformer); +exports.MethodDefinitionTransformer = MethodDefinitionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.ts": +/*!******************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.ts ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var ObjectExpressionKeysTransformer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TObjectExpressionExtractorFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TObjectExpressionExtractorFactory */ "./src/types/container/node-transformers/TObjectExpressionExtractorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +const ObjectExpressionExtractor_1 = __webpack_require__(/*! ../../enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor */ "./src/enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor.ts"); +let ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer_1 = class ObjectExpressionKeysTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(objectExpressionExtractorFactory, randomGenerator, options) { + super(randomGenerator, options); + this.objectExpressionExtractorFactory = objectExpressionExtractorFactory; + } + static isProhibitedHostStatement(objectExpressionNode, hostStatement) { + return ObjectExpressionKeysTransformer_1.isReferencedIdentifierName(objectExpressionNode, hostStatement); + } + static isReferencedIdentifierName(objectExpressionNode, hostNode) { + const identifierNamesSet = []; + let isReferencedIdentifierName = false; + let isCurrentNode = false; + estraverse.traverse(hostNode, { + enter: (node) => { + if (node === objectExpressionNode) { + isCurrentNode = true; + } + if (!NodeGuards_1.NodeGuards.isIdentifierNode(node)) { + return; + } + if (!isCurrentNode) { + identifierNamesSet.push(node.name); + return; + } + if (identifierNamesSet.includes(node.name)) { + isReferencedIdentifierName = true; + } + }, + leave: (node) => { + if (node === objectExpressionNode) { + isCurrentNode = false; + return estraverse.VisitorOption.Break; + } + } + }); + return isReferencedIdentifierName; + } + getVisitor(transformationStage) { + if (!this.options.transformObjectKeys) { + return null; + } + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + leave: (node, parentNode) => { + if (parentNode + && NodeGuards_1.NodeGuards.isObjectExpressionNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(objectExpressionNode, parentNode) { + if (!objectExpressionNode.properties.length) { + return objectExpressionNode; + } + const hostStatement = NodeStatementUtils_1.NodeStatementUtils.getRootStatementOfNode(objectExpressionNode); + if (ObjectExpressionKeysTransformer_1.isProhibitedHostStatement(objectExpressionNode, hostStatement)) { + return objectExpressionNode; + } + return this.applyObjectExpressionKeysExtractorsRecursive(ObjectExpressionKeysTransformer_1.objectExpressionExtractorNames, objectExpressionNode, hostStatement); + } + applyObjectExpressionKeysExtractorsRecursive(objectExpressionExtractorNames, objectExpressionNode, hostStatement) { + const newObjectExpressionExtractorNames = [...objectExpressionExtractorNames]; + const objectExpressionExtractor = newObjectExpressionExtractorNames.shift(); + if (!objectExpressionExtractor) { + return objectExpressionNode; + } + const { nodeToReplace, objectExpressionHostStatement: newObjectExpressionHostStatement, objectExpressionNode: newObjectExpressionNode } = this.objectExpressionExtractorFactory(objectExpressionExtractor) + .extract(objectExpressionNode, hostStatement); + this.applyObjectExpressionKeysExtractorsRecursive(newObjectExpressionExtractorNames, newObjectExpressionNode, newObjectExpressionHostStatement); + return nodeToReplace; + } +}; +ObjectExpressionKeysTransformer.objectExpressionExtractorNames = [ + ObjectExpressionExtractor_1.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor, + ObjectExpressionExtractor_1.ObjectExpressionExtractor.BasePropertiesExtractor +]; +ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObjectExpressionExtractor)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TObjectExpressionExtractorFactory_1.TObjectExpressionExtractorFactory !== "undefined" && TObjectExpressionExtractorFactory_1.TObjectExpressionExtractorFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], ObjectExpressionKeysTransformer); +exports.ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/ObjectExpressionTransformer.ts": +/*!**************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/ObjectExpressionTransformer.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ObjectExpressionTransformer = class ObjectExpressionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isObjectExpressionNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(objectExpressionNode, parentNode) { + objectExpressionNode.properties + .forEach((property) => { + if (!property.key) { + return; + } + if (property.computed) { + this.transformComputedProperty(property); + } + else { + this.transformBaseProperty(property); + } + }); + return objectExpressionNode; + } + transformComputedProperty(property) { + if (!NodeGuards_1.NodeGuards.isLiteralNode(property.key) || !(typeof property.key.value === 'string')) { + return; + } + property.key = NodeFactory_1.NodeFactory.literalNode(property.key.value); + } + transformBaseProperty(property) { + if (property.shorthand) { + property.shorthand = false; + } + if (!NodeGuards_1.NodeGuards.isIdentifierNode(property.key)) { + return; + } + property.key = NodeFactory_1.NodeFactory.literalNode(property.key.name); + } +}; +ObjectExpressionTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], ObjectExpressionTransformer); +exports.ObjectExpressionTransformer = ObjectExpressionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/SplitStringTransformer.ts": +/*!*********************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/SplitStringTransformer.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var SplitStringTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeLiteralUtils_1 = __webpack_require__(/*! ../../node/NodeLiteralUtils */ "./src/node/NodeLiteralUtils.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let SplitStringTransformer = SplitStringTransformer_1 = class SplitStringTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + this.runAfter = [ + NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer, + NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer + ]; + } + static chunkString(string, chunkSize) { + const chunksCount = Math.ceil(string.length / chunkSize); + const chunks = []; + let nextChunkStartIndex = 0; + for (let chunkIndex = 0; chunkIndex < chunksCount; ++chunkIndex, nextChunkStartIndex += chunkSize) { + chunks[chunkIndex] = string.substr(nextChunkStartIndex, chunkSize); + } + return chunks; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (!this.options.splitStrings) { + return; + } + if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(literalNode, parentNode) { + if (NodeLiteralUtils_1.NodeLiteralUtils.isProhibitedLiteralNode(literalNode, parentNode)) { + return literalNode; + } + const firstPassChunksNode = this.transformLiteralNodeByChunkLength(literalNode, parentNode, SplitStringTransformer_1.firstPassChunkLength); + const secondPassChunksNode = estraverse.replace(firstPassChunksNode, { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return this.transformLiteralNodeByChunkLength(node, parentNode, this.options.splitStringsChunkLength); + } + } + }); + return secondPassChunksNode; + } + transformLiteralNodeByChunkLength(literalNode, parentNode, chunkLength) { + if (typeof literalNode.value !== 'string') { + return literalNode; + } + if (chunkLength >= literalNode.value.length) { + return literalNode; + } + const stringChunks = SplitStringTransformer_1.chunkString(literalNode.value, chunkLength); + const binaryExpressionNode = this.transformStringChunksToBinaryExpressionNode(stringChunks); + NodeUtils_1.NodeUtils.parentizeAst(binaryExpressionNode); + NodeUtils_1.NodeUtils.parentizeNode(binaryExpressionNode, parentNode); + return binaryExpressionNode; + } + transformStringChunksToBinaryExpressionNode(chunks) { + const firstChunk = chunks.shift(); + const secondChunk = chunks.shift(); + if (!firstChunk || !secondChunk) { + throw new Error('First and second chunks values should not be empty'); + } + const initialBinaryExpressionNode = NodeFactory_1.NodeFactory.binaryExpressionNode('+', NodeFactory_1.NodeFactory.literalNode(firstChunk), NodeFactory_1.NodeFactory.literalNode(secondChunk)); + return chunks.reduce((binaryExpressionNode, chunk) => { + const chunkLiteralNode = NodeFactory_1.NodeFactory.literalNode(chunk); + return NodeFactory_1.NodeFactory.binaryExpressionNode('+', binaryExpressionNode, chunkLiteralNode); + }, initialBinaryExpressionNode); + } +}; +SplitStringTransformer.firstPassChunkLength = 1000; +SplitStringTransformer = SplitStringTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], SplitStringTransformer); +exports.SplitStringTransformer = SplitStringTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/TemplateLiteralTransformer.ts": +/*!*************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/TemplateLiteralTransformer.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var TemplateLiteralTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let TemplateLiteralTransformer = TemplateLiteralTransformer_1 = class TemplateLiteralTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + static isLiteralNodeWithStringValue(node) { + return !!node && NodeGuards_1.NodeGuards.isLiteralNode(node) && typeof node.value === 'string'; + } + static isValidTemplateLiteralNode(node, parentNode) { + return NodeGuards_1.NodeGuards.isTemplateLiteralNode(node) && !NodeGuards_1.NodeGuards.isTaggedTemplateExpressionNode(parentNode); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (parentNode && TemplateLiteralTransformer_1.isValidTemplateLiteralNode(node, parentNode)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(templateLiteralNode, parentNode) { + const templateLiteralExpressions = templateLiteralNode.expressions; + let nodes = []; + templateLiteralNode.quasis.forEach((templateElement) => { + nodes.push(NodeFactory_1.NodeFactory.literalNode(templateElement.value.cooked)); + const expression = templateLiteralExpressions.shift(); + if (!expression) { + return; + } + nodes.push(expression); + }); + nodes = nodes.filter((node) => { + return !(NodeGuards_1.NodeGuards.isLiteralNode(node) && node.value === ''); + }); + if (!TemplateLiteralTransformer_1.isLiteralNodeWithStringValue(nodes[0]) && + !TemplateLiteralTransformer_1.isLiteralNodeWithStringValue(nodes[1])) { + nodes.unshift(NodeFactory_1.NodeFactory.literalNode('')); + } + let transformedNode; + if (nodes.length > 1) { + let root = NodeFactory_1.NodeFactory.binaryExpressionNode('+', nodes.shift(), nodes.shift()); + nodes.forEach((node) => { + root = NodeFactory_1.NodeFactory.binaryExpressionNode('+', root, node); + }); + transformedNode = root; + } + else { + transformedNode = nodes[0]; + } + NodeUtils_1.NodeUtils.parentizeAst(transformedNode); + NodeUtils_1.NodeUtils.parentizeNode(transformedNode, parentNode); + return transformedNode; + } +}; +TemplateLiteralTransformer = TemplateLiteralTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], TemplateLiteralTransformer); +exports.TemplateLiteralTransformer = TemplateLiteralTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/object-expression-extractors/BasePropertiesExtractor.ts": +/*!***************************************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/object-expression-extractors/BasePropertiesExtractor.ts ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var BasePropertiesExtractor_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let BasePropertiesExtractor = BasePropertiesExtractor_1 = class BasePropertiesExtractor { + static getPropertyNodeKeyName(propertyNode) { + const propertyKeyNode = propertyNode.key; + if (NodeGuards_1.NodeGuards.isLiteralNode(propertyKeyNode) + && (typeof propertyKeyNode.value === 'string' + || typeof propertyKeyNode.value === 'number')) { + return propertyKeyNode.value.toString(); + } + if (NodeGuards_1.NodeGuards.isIdentifierNode(propertyKeyNode)) { + return propertyKeyNode.name; + } + return null; + } + static isProhibitedPattern(node) { + return !node + || NodeGuards_1.NodeGuards.isObjectPatternNode(node) + || NodeGuards_1.NodeGuards.isArrayPatternNode(node) + || NodeGuards_1.NodeGuards.isAssignmentPatternNode(node) + || NodeGuards_1.NodeGuards.isRestElementNode(node); + } + extract(objectExpressionNode, hostStatement) { + const hostNode = objectExpressionNode.parentNode; + if (hostNode + && NodeGuards_1.NodeGuards.isVariableDeclaratorNode(hostNode) + && NodeGuards_1.NodeGuards.isIdentifierNode(hostNode.id)) { + return this.transformObjectExpressionNode(objectExpressionNode, hostStatement, hostNode.id); + } + return { + nodeToReplace: objectExpressionNode, + objectExpressionHostStatement: hostStatement, + objectExpressionNode: objectExpressionNode + }; + } + transformObjectExpressionNode(objectExpressionNode, hostStatement, memberExpressionHostNode) { + const properties = objectExpressionNode.properties; + const [expressionStatements, removablePropertyIds] = this + .extractPropertiesToExpressionStatements(properties, hostStatement, memberExpressionHostNode); + const hostNodeWithStatements = NodeStatementUtils_1.NodeStatementUtils.getScopeOfNode(hostStatement); + this.filterExtractedObjectExpressionProperties(objectExpressionNode, removablePropertyIds); + NodeAppender_1.NodeAppender.insertAfter(hostNodeWithStatements, expressionStatements, hostStatement); + return { + nodeToReplace: objectExpressionNode, + objectExpressionHostStatement: hostStatement, + objectExpressionNode: objectExpressionNode + }; + } + extractPropertiesToExpressionStatements(properties, hostStatement, memberExpressionHostNode) { + const propertiesLength = properties.length; + const expressionStatements = []; + const removablePropertyIds = []; + for (let i = 0; i < propertiesLength; i++) { + const property = properties[i]; + const propertyValue = property.value; + if (BasePropertiesExtractor_1.isProhibitedPattern(propertyValue)) { + continue; + } + const propertyKeyName = BasePropertiesExtractor_1.getPropertyNodeKeyName(property); + if (!propertyKeyName) { + continue; + } + const shouldCreateLiteralNode = !property.computed + || (property.computed && !!property.key && NodeGuards_1.NodeGuards.isLiteralNode(property.key)); + const memberExpressionProperty = shouldCreateLiteralNode + ? NodeFactory_1.NodeFactory.literalNode(propertyKeyName) + : NodeFactory_1.NodeFactory.identifierNode(propertyKeyName); + const memberExpressionNode = NodeFactory_1.NodeFactory + .memberExpressionNode(memberExpressionHostNode, memberExpressionProperty, true); + const expressionStatementNode = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.assignmentExpressionNode('=', memberExpressionNode, propertyValue)); + if (NodeGuards_1.NodeGuards.isObjectExpressionNode(property.value)) { + this.transformObjectExpressionNode(property.value, hostStatement, memberExpressionNode); + } + expressionStatements.push(expressionStatementNode); + removablePropertyIds.push(i); + } + return [expressionStatements, removablePropertyIds]; + } + filterExtractedObjectExpressionProperties(objectExpressionNode, removablePropertyIds) { + objectExpressionNode.properties = objectExpressionNode.properties + .filter((property, index) => !removablePropertyIds.includes(index)); + } +}; +BasePropertiesExtractor = BasePropertiesExtractor_1 = __decorate([ + inversify_1.injectable() +], BasePropertiesExtractor); +exports.BasePropertiesExtractor = BasePropertiesExtractor; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor.ts": +/*!**************************************************************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor.ts ***! + \**************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TObjectExpressionKeysTransformerCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TObjectExpressionKeysTransformerCustomNodeFactory */ "./src/types/container/custom-nodes/TObjectExpressionKeysTransformerCustomNodeFactory.ts"); +const ObjectExpressionKeysTransformerCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode */ "./src/enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ObjectExpressionToVariableDeclarationExtractor = class ObjectExpressionToVariableDeclarationExtractor { + constructor(objectExpressionKeysTransformerCustomNodeFactory) { + this.objectExpressionKeysTransformerCustomNodeFactory = objectExpressionKeysTransformerCustomNodeFactory; + } + extract(objectExpressionNode, hostStatement) { + return this.transformObjectExpressionToVariableDeclaration(objectExpressionNode, hostStatement); + } + transformObjectExpressionToVariableDeclaration(objectExpressionNode, hostStatement) { + const properties = objectExpressionNode.properties; + const newObjectExpressionHostStatement = this.getObjectExpressionHostNode(properties); + const newObjectExpressionIdentifier = this.getObjectExpressionIdentifierNode(newObjectExpressionHostStatement); + const newObjectExpressionNode = this.getObjectExpressionNode(newObjectExpressionHostStatement); + const statementsToInsert = [newObjectExpressionHostStatement]; + const hostNodeWithStatements = NodeStatementUtils_1.NodeStatementUtils.getScopeOfNode(hostStatement); + NodeAppender_1.NodeAppender.insertBefore(hostNodeWithStatements, statementsToInsert, hostStatement); + NodeUtils_1.NodeUtils.parentizeAst(newObjectExpressionHostStatement); + NodeUtils_1.NodeUtils.parentizeNode(newObjectExpressionHostStatement, hostNodeWithStatements); + return { + nodeToReplace: newObjectExpressionIdentifier, + objectExpressionHostStatement: newObjectExpressionHostStatement, + objectExpressionNode: newObjectExpressionNode + }; + } + getObjectExpressionHostNode(properties) { + const variableDeclarationHostNodeCustomNode = this.objectExpressionKeysTransformerCustomNodeFactory(ObjectExpressionKeysTransformerCustomNode_1.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode); + variableDeclarationHostNodeCustomNode.initialize(properties); + const statementNode = variableDeclarationHostNodeCustomNode.getNode()[0]; + if (!statementNode + || !NodeGuards_1.NodeGuards.isVariableDeclarationNode(statementNode)) { + throw new Error('`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node'); + } + return statementNode; + } + getObjectExpressionIdentifierNode(objectExpressionHostNode) { + const newObjectExpressionIdentifierNode = objectExpressionHostNode.declarations[0].id; + if (!NodeGuards_1.NodeGuards.isIdentifierNode(newObjectExpressionIdentifierNode)) { + throw new Error('`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property'); + } + return newObjectExpressionIdentifierNode; + } + getObjectExpressionNode(objectExpressionHostNode) { + var _a; + const newObjectExpressionNode = (_a = objectExpressionHostNode.declarations[0].init) !== null && _a !== void 0 ? _a : null; + if (!newObjectExpressionNode || !NodeGuards_1.NodeGuards.isObjectExpressionNode(newObjectExpressionNode)) { + throw new Error('`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property'); + } + return newObjectExpressionNode; + } +}; +ObjectExpressionToVariableDeclarationExtractor = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)), + __metadata("design:paramtypes", [typeof (_a = typeof TObjectExpressionKeysTransformerCustomNodeFactory_1.TObjectExpressionKeysTransformerCustomNodeFactory !== "undefined" && TObjectExpressionKeysTransformerCustomNodeFactory_1.TObjectExpressionKeysTransformerCustomNodeFactory) === "function" ? _a : Object]) +], ObjectExpressionToVariableDeclarationExtractor); +exports.ObjectExpressionToVariableDeclarationExtractor = ObjectExpressionToVariableDeclarationExtractor; + + +/***/ }), + +/***/ "./src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts": +/*!************************************************************************************************!*\ + !*** ./src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var DeadCodeInjectionTransformer_1, _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TDeadNodeInjectionCustomNodeFactory_1 = __webpack_require__(/*! ../../types/container/custom-nodes/TDeadNodeInjectionCustomNodeFactory */ "./src/types/container/custom-nodes/TDeadNodeInjectionCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ITransformersRunner_1 = __webpack_require__(/*! ../../interfaces/node-transformers/ITransformersRunner */ "./src/interfaces/node-transformers/ITransformersRunner.ts"); +const DeadCodeInjectionCustomNode_1 = __webpack_require__(/*! ../../enums/custom-nodes/DeadCodeInjectionCustomNode */ "./src/enums/custom-nodes/DeadCodeInjectionCustomNode.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const NodeType_1 = __webpack_require__(/*! ../../enums/node/NodeType */ "./src/enums/node/NodeType.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DeadCodeInjectionTransformer = DeadCodeInjectionTransformer_1 = class DeadCodeInjectionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(deadCodeInjectionCustomNodeFactory, transformersRunner, randomGenerator, options) { + super(randomGenerator, options); + this.deadCodeInjectionRootAstHostNodeSet = new Set(); + this.collectedBlockStatements = []; + this.collectedBlockStatementsTotalLength = 0; + this.deadCodeInjectionCustomNodeFactory = deadCodeInjectionCustomNodeFactory; + this.transformersRunner = transformersRunner; + } + static isProhibitedNodeInsideCollectedBlockStatement(targetNode) { + return NodeGuards_1.NodeGuards.isBreakStatementNode(targetNode) + || NodeGuards_1.NodeGuards.isContinueStatementNode(targetNode) + || NodeGuards_1.NodeGuards.isAwaitExpressionNode(targetNode) + || NodeGuards_1.NodeGuards.isSuperNode(targetNode); + } + static isScopeHoistingFunctionDeclaration(targetNode) { + if (!NodeGuards_1.NodeGuards.isFunctionDeclarationNode(targetNode)) { + return false; + } + const scopeNode = NodeStatementUtils_1.NodeStatementUtils.getScopeOfNode(targetNode); + const scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) + ? scopeNode.body + : scopeNode.consequent; + const indexInScope = scopeBody.indexOf(targetNode); + if (indexInScope === 0) { + return false; + } + const slicedBody = scopeBody.slice(0, indexInScope); + const hostBlockStatementNode = NodeFactory_1.NodeFactory.blockStatementNode(slicedBody); + const functionDeclarationName = targetNode.id.name; + let isScopeHoistedFunctionDeclaration = false; + estraverse.traverse(hostBlockStatementNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isIdentifierNode(node) && node.name === functionDeclarationName) { + isScopeHoistedFunctionDeclaration = true; + return estraverse.VisitorOption.Break; + } + } + }); + return isScopeHoistedFunctionDeclaration; + } + static isValidCollectedBlockStatementNode(blockStatementNode) { + if (!blockStatementNode.body.length) { + return false; + } + let nestedBlockStatementsCount = 0; + let isValidBlockStatementNode = true; + estraverse.traverse(blockStatementNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + nestedBlockStatementsCount++; + } + if (nestedBlockStatementsCount > DeadCodeInjectionTransformer_1.maxNestedBlockStatementsCount + || DeadCodeInjectionTransformer_1.isProhibitedNodeInsideCollectedBlockStatement(node) + || DeadCodeInjectionTransformer_1.isScopeHoistingFunctionDeclaration(node)) { + isValidBlockStatementNode = false; + return estraverse.VisitorOption.Break; + } + } + }); + return isValidBlockStatementNode; + } + static isValidWrappedBlockStatementNode(blockStatementNode) { + if (!blockStatementNode.body.length) { + return false; + } + let isValidBlockStatementNode = true; + estraverse.traverse(blockStatementNode, { + enter: (node) => { + if (DeadCodeInjectionTransformer_1.isScopeHoistingFunctionDeclaration(node)) { + isValidBlockStatementNode = false; + return estraverse.VisitorOption.Break; + } + } + }); + if (!isValidBlockStatementNode) { + return false; + } + const parentNodeWithStatements = NodeStatementUtils_1.NodeStatementUtils + .getParentNodeWithStatements(blockStatementNode); + return parentNodeWithStatements.type !== NodeType_1.NodeType.Program; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.DeadCodeInjection: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.analyzeNode(node, parentNode); + return node; + } + }, + leave: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + case TransformationStage_1.TransformationStage.Finalizing: + if (!this.deadCodeInjectionRootAstHostNodeSet.size) { + return null; + } + return { + enter: (node, parentNode) => { + if (parentNode && this.isDeadCodeInjectionRootAstHostNode(node)) { + return this.restoreNode(node, parentNode); + } + } + }; + default: + return null; + } + } + analyzeNode(programNode, parentNode) { + estraverse.traverse(programNode, { + enter: (node) => { + if (!NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + return; + } + const clonedBlockStatementNode = NodeUtils_1.NodeUtils.clone(node); + if (!DeadCodeInjectionTransformer_1.isValidCollectedBlockStatementNode(clonedBlockStatementNode)) { + return; + } + const transformedBlockStatementNode = this.makeClonedBlockStatementNodeUnique(clonedBlockStatementNode); + this.collectedBlockStatements.push(transformedBlockStatementNode); + } + }); + this.collectedBlockStatementsTotalLength = this.collectedBlockStatements.length; + } + transformNode(blockStatementNode, parentNode) { + const canBreakTraverse = !this.collectedBlockStatements.length + || this.collectedBlockStatementsTotalLength < DeadCodeInjectionTransformer_1.minCollectedBlockStatementsCount; + if (canBreakTraverse) { + return estraverse.VisitorOption.Break; + } + if (this.randomGenerator.getMathRandom() > this.options.deadCodeInjectionThreshold + || !DeadCodeInjectionTransformer_1.isValidWrappedBlockStatementNode(blockStatementNode)) { + return blockStatementNode; + } + const minInteger = 0; + const maxInteger = this.collectedBlockStatements.length - 1; + const randomIndex = this.randomGenerator.getRandomInteger(minInteger, maxInteger); + const randomBlockStatementNode = this.collectedBlockStatements.splice(randomIndex, 1)[0]; + const isDuplicateBlockStatementNodes = randomBlockStatementNode === blockStatementNode; + if (isDuplicateBlockStatementNodes) { + return blockStatementNode; + } + return this.replaceBlockStatementNode(blockStatementNode, randomBlockStatementNode, parentNode); + } + restoreNode(deadCodeInjectionRootAstHostNode, parentNode) { + const hostNodeFirstStatement = deadCodeInjectionRootAstHostNode.body[0]; + if (!NodeGuards_1.NodeGuards.isFunctionDeclarationNode(hostNodeFirstStatement)) { + throw new Error('Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node'); + } + return hostNodeFirstStatement.body; + } + isDeadCodeInjectionRootAstHostNode(node) { + return NodeGuards_1.NodeGuards.isBlockStatementNode(node) && this.deadCodeInjectionRootAstHostNodeSet.has(node); + } + makeClonedBlockStatementNodeUnique(clonedBlockStatementNode) { + const hostNode = NodeFactory_1.NodeFactory + .functionExpressionNode([], clonedBlockStatementNode); + NodeUtils_1.NodeUtils.parentizeNode(hostNode, hostNode); + NodeUtils_1.NodeUtils.parentizeNode(clonedBlockStatementNode, hostNode); + return this.transformersRunner.transform(hostNode, DeadCodeInjectionTransformer_1.transformersToRenameBlockScopeIdentifiers, TransformationStage_1.TransformationStage.Obfuscating).body; + } + replaceBlockStatementNode(blockStatementNode, randomBlockStatementNode, parentNode) { + const deadCodeInjectionRootAstHostNode = NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.functionDeclarationNode(DeadCodeInjectionTransformer_1.deadCodeInjectionRootAstHostNodeName, [], randomBlockStatementNode) + ]); + this.deadCodeInjectionRootAstHostNodeSet.add(deadCodeInjectionRootAstHostNode); + const blockStatementDeadCodeInjectionCustomNode = this.deadCodeInjectionCustomNodeFactory(DeadCodeInjectionCustomNode_1.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode); + blockStatementDeadCodeInjectionCustomNode.initialize(blockStatementNode, deadCodeInjectionRootAstHostNode); + const newBlockStatementNode = blockStatementDeadCodeInjectionCustomNode.getNode()[0]; + NodeUtils_1.NodeUtils.parentizeNode(newBlockStatementNode, parentNode); + return newBlockStatementNode; + } +}; +DeadCodeInjectionTransformer.deadCodeInjectionRootAstHostNodeName = 'deadCodeInjectionRootAstHostNode'; +DeadCodeInjectionTransformer.maxNestedBlockStatementsCount = 4; +DeadCodeInjectionTransformer.minCollectedBlockStatementsCount = 5; +DeadCodeInjectionTransformer.transformersToRenameBlockScopeIdentifiers = [ + NodeTransformer_1.NodeTransformer.LabeledStatementTransformer, + NodeTransformer_1.NodeTransformer.ScopeIdentifiersTransformer +]; +DeadCodeInjectionTransformer = DeadCodeInjectionTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TDeadNodeInjectionCustomNodeFactory_1.TDeadNodeInjectionCustomNodeFactory !== "undefined" && TDeadNodeInjectionCustomNodeFactory_1.TDeadNodeInjectionCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof ITransformersRunner_1.ITransformersRunner !== "undefined" && ITransformersRunner_1.ITransformersRunner) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], DeadCodeInjectionTransformer); +exports.DeadCodeInjectionTransformer = DeadCodeInjectionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts": +/*!***************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TIdentifierObfuscatingReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TIdentifierObfuscatingReplacerFactory */ "./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeLexicalScopeUtils_1 = __webpack_require__(/*! ../../node/NodeLexicalScopeUtils */ "./src/node/NodeLexicalScopeUtils.ts"); +let LabeledStatementTransformer = class LabeledStatementTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(identifierObfuscatingReplacerFactory, randomGenerator, options) { + super(randomGenerator, options); + this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isLabeledStatementNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(labeledStatementNode, parentNode) { + const lexicalScopeNode = NodeLexicalScopeUtils_1.NodeLexicalScopeUtils.getLexicalScope(labeledStatementNode); + if (!lexicalScopeNode) { + return labeledStatementNode; + } + this.storeLabeledStatementName(labeledStatementNode, lexicalScopeNode); + this.replaceLabeledStatementName(labeledStatementNode, lexicalScopeNode); + return labeledStatementNode; + } + storeLabeledStatementName(labeledStatementNode, lexicalScopeNode) { + this.identifierObfuscatingReplacer.storeLocalName(labeledStatementNode.label, lexicalScopeNode); + } + replaceLabeledStatementName(labeledStatementNode, lexicalScopeNode) { + estraverse.replace(labeledStatementNode, { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isLabelIdentifierNode(node, parentNode)) { + const newIdentifier = this.identifierObfuscatingReplacer + .replace(node, lexicalScopeNode); + node.name = newIdentifier.name; + } + } + }); + } +}; +LabeledStatementTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory !== "undefined" && TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], LabeledStatementTransformer); +exports.LabeledStatementTransformer = LabeledStatementTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/LiteralTransformer.ts": +/*!******************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/LiteralTransformer.ts ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TLiteralObfuscatingReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TLiteralObfuscatingReplacerFactory */ "./src/types/container/node-transformers/TLiteralObfuscatingReplacerFactory.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IStringArrayStorageAnalyzer_1 = __webpack_require__(/*! ../../interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer */ "./src/interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer.ts"); +const LiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeLiteralUtils_1 = __webpack_require__(/*! ../../node/NodeLiteralUtils */ "./src/node/NodeLiteralUtils.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let LiteralTransformer = class LiteralTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(literalObfuscatingReplacerFactory, randomGenerator, options, stringArrayStorageAnalyzer, escapeSequenceEncoder) { + super(randomGenerator, options); + this.literalObfuscatingReplacerFactory = literalObfuscatingReplacerFactory; + this.stringArrayStorageAnalyzer = stringArrayStorageAnalyzer; + this.escapeSequenceEncoder = escapeSequenceEncoder; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.analyzeNode(node); + } + if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node) && !NodeMetadata_1.NodeMetadata.isReplacedLiteral(node)) { + return this.transformNode(node, parentNode); + } + } + }; + case TransformationStage_1.TransformationStage.Finalizing: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return this.encodeLiteralNodeToEscapeSequence(node, parentNode); + } + } + }; + default: + return null; + } + } + analyzeNode(programNode) { + this.stringArrayStorageAnalyzer.analyze(programNode); + } + transformNode(literalNode, parentNode) { + if (NodeLiteralUtils_1.NodeLiteralUtils.isProhibitedLiteralNode(literalNode, parentNode)) { + return literalNode; + } + let newLiteralNode; + switch (typeof literalNode.value) { + case 'boolean': + newLiteralNode = this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(literalNode); + break; + case 'number': + newLiteralNode = this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(literalNode); + break; + case 'string': + newLiteralNode = this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(literalNode); + break; + default: + newLiteralNode = literalNode; + } + NodeUtils_1.NodeUtils.parentizeNode(newLiteralNode, parentNode); + return newLiteralNode; + } + encodeLiteralNodeToEscapeSequence(literalNode, parentNode) { + if (typeof literalNode.value !== 'string') { + return literalNode; + } + return NodeFactory_1.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(literalNode.value, this.options.unicodeEscapeSequence)); + } +}; +LiteralTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatingReplacer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorageAnalyzer)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TLiteralObfuscatingReplacerFactory_1.TLiteralObfuscatingReplacerFactory !== "undefined" && TLiteralObfuscatingReplacerFactory_1.TLiteralObfuscatingReplacerFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object, typeof (_d = typeof IStringArrayStorageAnalyzer_1.IStringArrayStorageAnalyzer !== "undefined" && IStringArrayStorageAnalyzer_1.IStringArrayStorageAnalyzer) === "function" ? _d : Object, typeof (_e = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _e : Object]) +], LiteralTransformer); +exports.LiteralTransformer = LiteralTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer.ts": +/*!***************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer.ts ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var ScopeIdentifiersTransformer_1, _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TIdentifierObfuscatingReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TIdentifierObfuscatingReplacerFactory */ "./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IScopeAnalyzer_1 = __webpack_require__(/*! ../../interfaces/analyzers/scope-analyzer/IScopeAnalyzer */ "./src/interfaces/analyzers/scope-analyzer/IScopeAnalyzer.ts"); +const IdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +let ScopeIdentifiersTransformer = ScopeIdentifiersTransformer_1 = class ScopeIdentifiersTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(identifierObfuscatingReplacerFactory, randomGenerator, options, scopeAnalyzer) { + super(randomGenerator, options); + this.lexicalScopesWithObjectPatternWithoutDeclarationMap = new Map(); + this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + this.scopeAnalyzer = scopeAnalyzer; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.analyzeNode(node, parentNode); + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + analyzeNode(programNode, parentNode) { + this.scopeAnalyzer.analyze(programNode); + } + transformNode(programNode, parentNode) { + const globalScope = this.scopeAnalyzer.acquireScope(programNode); + this.traverseScopeVariables(globalScope); + return programNode; + } + traverseScopeVariables(scope) { + const lexicalScope = scope.variableScope; + const nodeWithLexicalScope = NodeGuards_1.NodeGuards.isNodeWithBlockLexicalScope(lexicalScope.block) + ? lexicalScope.block + : null; + const isGlobalDeclaration = ScopeIdentifiersTransformer_1.globalScopeNames.includes(lexicalScope.type); + if (!nodeWithLexicalScope) { + return; + } + for (const variable of scope.variables) { + if (variable.name === ScopeIdentifiersTransformer_1.argumentsVariableName) { + continue; + } + if (!this.options.renameGlobals && isGlobalDeclaration) { + const isImportBindingOrCatchClauseIdentifier = variable.defs + .every((definition) => definition.type === 'ImportBinding' + || definition.type === 'CatchClause'); + if (!isImportBindingOrCatchClauseIdentifier) { + continue; + } + } + this.transformScopeVariableIdentifiers(variable, nodeWithLexicalScope, isGlobalDeclaration); + } + for (const childScope of scope.childScopes) { + this.traverseScopeVariables(childScope); + } + } + transformScopeVariableIdentifiers(variable, lexicalScopeNode, isGlobalDeclaration) { + for (const identifier of variable.identifiers) { + if (!this.isReplaceableIdentifierNode(identifier, lexicalScopeNode, variable)) { + continue; + } + this.storeIdentifierName(identifier, lexicalScopeNode, isGlobalDeclaration); + this.replaceIdentifierName(identifier, lexicalScopeNode, variable); + } + } + storeIdentifierName(identifierNode, lexicalScopeNode, isGlobalDeclaration) { + if (isGlobalDeclaration) { + this.identifierObfuscatingReplacer.storeGlobalName(identifierNode, lexicalScopeNode); + } + else { + this.identifierObfuscatingReplacer.storeLocalName(identifierNode, lexicalScopeNode); + } + } + replaceIdentifierName(identifierNode, lexicalScopeNode, variable) { + const newIdentifier = this.identifierObfuscatingReplacer + .replace(identifierNode, lexicalScopeNode); + identifierNode.name = newIdentifier.name; + variable.references.forEach((reference) => { + reference.identifier.name = identifierNode.name; + }); + } + isReplaceableIdentifierNode(identifierNode, lexicalScopeNode, variable) { + const parentNode = identifierNode.parentNode; + return !!parentNode + && !NodeMetadata_1.NodeMetadata.isIgnoredNode(identifierNode) + && !this.isProhibitedPropertyNode(identifierNode, parentNode) + && !this.isProhibitedClassDeclarationNameIdentifierNode(variable, identifierNode, parentNode) + && !this.isProhibitedExportNamedClassDeclarationIdentifierNode(identifierNode, parentNode) + && !this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(identifierNode, parentNode) + && !this.isProhibitedExportNamedVariableDeclarationIdentifierNode(identifierNode, parentNode) + && !this.isProhibitedImportSpecifierNode(identifierNode, parentNode) + && !this.isProhibitedVariableNameUsedInObjectPatternNode(variable, identifierNode, lexicalScopeNode) + && !NodeGuards_1.NodeGuards.isLabelIdentifierNode(identifierNode, parentNode); + } + isProhibitedClassDeclarationNameIdentifierNode(variable, identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isClassDeclarationNode(variable.scope.block) + && NodeGuards_1.NodeGuards.isClassDeclarationNode(parentNode) + && parentNode.id === identifierNode; + } + isProhibitedExportNamedClassDeclarationIdentifierNode(identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isClassDeclarationNode(parentNode) + && parentNode.id === identifierNode + && !!parentNode.parentNode + && NodeGuards_1.NodeGuards.isExportNamedDeclarationNode(parentNode.parentNode); + } + isProhibitedExportNamedFunctionDeclarationIdentifierNode(identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isFunctionDeclarationNode(parentNode) + && parentNode.id === identifierNode + && !!parentNode.parentNode + && NodeGuards_1.NodeGuards.isExportNamedDeclarationNode(parentNode.parentNode); + } + isProhibitedExportNamedVariableDeclarationIdentifierNode(identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isVariableDeclaratorNode(parentNode) + && parentNode.id === identifierNode + && !!parentNode.parentNode + && NodeGuards_1.NodeGuards.isVariableDeclarationNode(parentNode.parentNode) + && !!parentNode.parentNode.parentNode + && NodeGuards_1.NodeGuards.isExportNamedDeclarationNode(parentNode.parentNode.parentNode); + } + isProhibitedImportSpecifierNode(identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isImportSpecifierNode(parentNode) + && parentNode.imported.name === parentNode.local.name; + } + isProhibitedPropertyNode(node, parentNode) { + return NodeGuards_1.NodeGuards.isPropertyNode(parentNode) + && !parentNode.computed + && parentNode.key === node; + } + isProhibitedVariableNameUsedInObjectPatternNode(variable, identifierNode, lexicalScopeNode) { + let isLexicalScopeHasObjectPatternWithoutDeclaration = this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(lexicalScopeNode); + if (isLexicalScopeHasObjectPatternWithoutDeclaration === false) { + return false; + } + const hasVarDefinitions = variable.defs.some((definition) => definition.kind === 'var'); + if (!hasVarDefinitions) { + return false; + } + let isProhibitedVariableDeclaration = false; + estraverse.traverse(lexicalScopeNode, { + enter: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isObjectPatternNode(node) + && parentNode + && NodeGuards_1.NodeGuards.isAssignmentExpressionNode(parentNode)) { + isLexicalScopeHasObjectPatternWithoutDeclaration = true; + const properties = node.properties; + for (const property of properties) { + if (property.computed || !property.shorthand) { + continue; + } + if (!NodeGuards_1.NodeGuards.isIdentifierNode(property.key)) { + continue; + } + if (identifierNode.name !== property.key.name) { + continue; + } + isProhibitedVariableDeclaration = true; + return estraverse.VisitorOption.Break; + } + } + } + }); + this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(lexicalScopeNode, isLexicalScopeHasObjectPatternWithoutDeclaration !== null && isLexicalScopeHasObjectPatternWithoutDeclaration !== void 0 ? isLexicalScopeHasObjectPatternWithoutDeclaration : false); + return isProhibitedVariableDeclaration; + } +}; +ScopeIdentifiersTransformer.argumentsVariableName = 'arguments'; +ScopeIdentifiersTransformer.globalScopeNames = [ + 'global', + 'module' +]; +ScopeIdentifiersTransformer = ScopeIdentifiersTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IScopeAnalyzer)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory !== "undefined" && TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object, typeof (_d = typeof IScopeAnalyzer_1.IScopeAnalyzer !== "undefined" && IScopeAnalyzer_1.IScopeAnalyzer) === "function" ? _d : Object]) +], ScopeIdentifiersTransformer); +exports.ScopeIdentifiersTransformer = ScopeIdentifiersTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts": +/*!*************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +let AbstractObfuscatingReplacer = class AbstractObfuscatingReplacer { + constructor(options) { + this.options = options; + } +}; +AbstractObfuscatingReplacer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], AbstractObfuscatingReplacer); +exports.AbstractObfuscatingReplacer = AbstractObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer.ts": +/*!****************************************************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer.ts ***! + \****************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const AbstractObfuscatingReplacer_1 = __webpack_require__(/*! ../AbstractObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +let BaseIdentifierObfuscatingReplacer = class BaseIdentifierObfuscatingReplacer extends AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer { + constructor(identifierNamesGeneratorFactory, options) { + super(options); + this.blockScopesMap = new Map(); + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + } + replace(identifierNode, lexicalScopeNode) { + let identifierName = identifierNode.name; + if (this.blockScopesMap.has(lexicalScopeNode)) { + const namesMap = this.blockScopesMap.get(lexicalScopeNode); + if (namesMap.has(identifierName)) { + identifierName = namesMap.get(identifierName); + } + } + return NodeFactory_1.NodeFactory.identifierNode(identifierName); + } + storeGlobalName(identifierNode, lexicalScopeNode) { + const identifierName = identifierNode.name; + if (this.isReservedName(identifierName)) { + return; + } + const newIdentifierName = this.identifierNamesGenerator.generateWithPrefix(); + if (!this.blockScopesMap.has(lexicalScopeNode)) { + this.blockScopesMap.set(lexicalScopeNode, new Map()); + } + const namesMap = this.blockScopesMap.get(lexicalScopeNode); + namesMap.set(identifierName, newIdentifierName); + } + storeLocalName(identifierNode, lexicalScopeNode) { + const identifierName = identifierNode.name; + if (this.isReservedName(identifierName)) { + return; + } + const newIdentifierName = this.identifierNamesGenerator.generate(); + if (!this.blockScopesMap.has(lexicalScopeNode)) { + this.blockScopesMap.set(lexicalScopeNode, new Map()); + } + const namesMap = this.blockScopesMap.get(lexicalScopeNode); + namesMap.set(identifierName, newIdentifierName); + } + preserveName(name) { + this.identifierNamesGenerator.preserveName(name); + } + isReservedName(name) { + if (!this.options.reservedNames.length) { + return false; + } + return this.options.reservedNames + .some((reservedName) => { + return new RegExp(reservedName, 'g').exec(name) !== null; + }); + } +}; +BaseIdentifierObfuscatingReplacer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], BaseIdentifierObfuscatingReplacer); +exports.BaseIdentifierObfuscatingReplacer = BaseIdentifierObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer.ts": +/*!*************************************************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer.ts ***! + \*************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var BooleanLiteralObfuscatingReplacer_1, _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const AbstractObfuscatingReplacer_1 = __webpack_require__(/*! ../AbstractObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +let BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer_1 = class BooleanLiteralObfuscatingReplacer extends AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer { + constructor(options) { + super(options); + } + static getTrueUnaryExpressionNode() { + return NodeFactory_1.NodeFactory.unaryExpressionNode('!', BooleanLiteralObfuscatingReplacer_1.getFalseUnaryExpressionNode()); + } + static getFalseUnaryExpressionNode() { + return NodeFactory_1.NodeFactory.unaryExpressionNode('!', NodeFactory_1.NodeFactory.arrayExpressionNode()); + } + replace(literalNode) { + const literalValue = literalNode.value; + if (typeof literalValue !== 'boolean') { + throw new Error('`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value'); + } + return literalValue + ? BooleanLiteralObfuscatingReplacer_1.getTrueUnaryExpressionNode() + : BooleanLiteralObfuscatingReplacer_1.getFalseUnaryExpressionNode(); + } +}; +BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], BooleanLiteralObfuscatingReplacer); +exports.BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer.ts": +/*!************************************************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer.ts ***! + \************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const AbstractObfuscatingReplacer_1 = __webpack_require__(/*! ../AbstractObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NumberUtils_1 = __webpack_require__(/*! ../../../../utils/NumberUtils */ "./src/utils/NumberUtils.ts"); +const Utils_1 = __webpack_require__(/*! ../../../../utils/Utils */ "./src/utils/Utils.ts"); +let NumberLiteralObfuscatingReplacer = class NumberLiteralObfuscatingReplacer extends AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer { + constructor(options) { + super(options); + this.numberLiteralCache = new Map(); + } + replace(literalNode) { + const literalValue = literalNode.value; + if (typeof literalValue !== 'number') { + throw new Error('`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value'); + } + let rawValue; + if (this.numberLiteralCache.has(literalValue)) { + rawValue = this.numberLiteralCache.get(literalValue); + } + else { + if (!NumberUtils_1.NumberUtils.isCeil(literalValue)) { + rawValue = String(literalValue); + } + else { + rawValue = `${Utils_1.Utils.hexadecimalPrefix}${NumberUtils_1.NumberUtils.toHex(literalValue)}`; + } + this.numberLiteralCache.set(literalValue, rawValue); + } + return NodeFactory_1.NodeFactory.literalNode(literalValue, rawValue); + } +}; +NumberLiteralObfuscatingReplacer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], NumberLiteralObfuscatingReplacer); +exports.NumberLiteralObfuscatingReplacer = NumberLiteralObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer.ts": +/*!************************************************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer.ts ***! + \************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var StringLiteralObfuscatingReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IStringArrayStorage_1 = __webpack_require__(/*! ../../../../interfaces/storages/string-array-storage/IStringArrayStorage */ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts"); +const IStringArrayStorageAnalyzer_1 = __webpack_require__(/*! ../../../../interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer */ "./src/interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const StringArrayEncoding_1 = __webpack_require__(/*! ../../../../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +const AbstractObfuscatingReplacer_1 = __webpack_require__(/*! ../AbstractObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NumberUtils_1 = __webpack_require__(/*! ../../../../utils/NumberUtils */ "./src/utils/NumberUtils.ts"); +const Utils_1 = __webpack_require__(/*! ../../../../utils/Utils */ "./src/utils/Utils.ts"); +let StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer_1 = class StringLiteralObfuscatingReplacer extends AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer { + constructor(stringArrayStorage, stringArrayStorageAnalyzer, options) { + super(options); + this.nodesCache = new Map(); + this.stringArrayStorage = stringArrayStorage; + this.stringArrayStorageAnalyzer = stringArrayStorageAnalyzer; + } + static getHexadecimalLiteralNode(hexadecimalIndex) { + const hexadecimalLiteralNode = NodeFactory_1.NodeFactory.literalNode(hexadecimalIndex); + NodeMetadata_1.NodeMetadata.set(hexadecimalLiteralNode, { replacedLiteral: true }); + return hexadecimalLiteralNode; + } + static getRc4KeyLiteralNode(literalValue) { + const rc4KeyLiteralNode = NodeFactory_1.NodeFactory.literalNode(literalValue); + NodeMetadata_1.NodeMetadata.set(rc4KeyLiteralNode, { replacedLiteral: true }); + return rc4KeyLiteralNode; + } + initialize() { + this.stringArrayStorageCallsWrapperName = this.stringArrayStorage.getStorageCallsWrapperName(); + if (this.options.shuffleStringArray) { + this.stringArrayStorage.shuffleStorage(); + } + if (this.options.rotateStringArray) { + this.stringArrayStorage.rotateStorage(); + } + } + replace(literalNode) { + const literalValue = literalNode.value; + if (typeof literalValue !== 'string') { + throw new Error('`StringLiteralObfuscatingReplacer` should accept only literals with `string` value'); + } + const stringArrayStorageItemData = this.stringArrayStorageAnalyzer + .getItemDataForLiteralNode(literalNode); + const cacheKey = `${literalValue}-${Boolean(stringArrayStorageItemData)}`; + const useCachedValue = this.nodesCache.has(cacheKey) && this.options.stringArrayEncoding !== StringArrayEncoding_1.StringArrayEncoding.Rc4; + if (useCachedValue) { + return this.nodesCache.get(cacheKey); + } + const resultNode = stringArrayStorageItemData + ? this.replaceWithStringArrayCallNode(stringArrayStorageItemData) + : this.replaceWithLiteralNode(literalValue); + this.nodesCache.set(cacheKey, resultNode); + return resultNode; + } + replaceWithLiteralNode(value) { + return NodeFactory_1.NodeFactory.literalNode(value); + } + replaceWithStringArrayCallNode(stringArrayStorageItemData) { + const { index, decodeKey } = stringArrayStorageItemData; + const hexadecimalIndex = `${Utils_1.Utils.hexadecimalPrefix}${NumberUtils_1.NumberUtils.toHex(index)}`; + const callExpressionArgs = [ + StringLiteralObfuscatingReplacer_1.getHexadecimalLiteralNode(hexadecimalIndex) + ]; + if (decodeKey) { + callExpressionArgs.push(StringLiteralObfuscatingReplacer_1.getRc4KeyLiteralNode(decodeKey)); + } + const stringArrayIdentifierNode = NodeFactory_1.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName); + return NodeFactory_1.NodeFactory.callExpressionNode(stringArrayIdentifierNode, callExpressionArgs); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringLiteralObfuscatingReplacer.prototype, "stringArrayStorageCallsWrapperName", void 0); +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], StringLiteralObfuscatingReplacer.prototype, "initialize", null); +StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorage)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorageAnalyzer)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IStringArrayStorage_1.IStringArrayStorage !== "undefined" && IStringArrayStorage_1.IStringArrayStorage) === "function" ? _a : Object, typeof (_b = typeof IStringArrayStorageAnalyzer_1.IStringArrayStorageAnalyzer !== "undefined" && IStringArrayStorageAnalyzer_1.IStringArrayStorageAnalyzer) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], StringLiteralObfuscatingReplacer); +exports.StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/CommentsTransformer.ts": +/*!*****************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/CommentsTransformer.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var CommentsTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const ConditionalCommentObfuscatingGuard_1 = __webpack_require__(/*! ./obfuscating-guards/ConditionalCommentObfuscatingGuard */ "./src/node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard.ts"); +let CommentsTransformer = CommentsTransformer_1 = class CommentsTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Initializing: + return { + leave: (node) => { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + return this.transformNode(node); + } + } + }; + default: + return null; + } + } + transformNode(rootNode) { + if (!rootNode.comments || !rootNode.comments.length) { + return rootNode; + } + const comments = this.transformComments(rootNode.comments); + if (comments.length === 0) { + return rootNode; + } + if (!rootNode.body.length) { + rootNode.leadingComments = comments; + return rootNode; + } + estraverse.traverse(rootNode, { + enter: (node) => { + if (node === rootNode) { + return; + } + const commentIdx = comments.findIndex((comment) => comment.range && node.range && comment.range[0] < node.range[0]); + if (commentIdx === -1) { + return; + } + node.leadingComments = comments.splice(commentIdx, comments.length - commentIdx).reverse(); + } + }); + if (comments.length > 0) { + rootNode.trailingComments = comments.reverse(); + } + return rootNode; + } + transformComments(comments) { + return comments.filter((comment) => CommentsTransformer_1.preservedWords + .some((preservedWord) => comment.value.includes(preservedWord)) || + ConditionalCommentObfuscatingGuard_1.ConditionalCommentObfuscatingGuard.isConditionalComment(comment)).reverse(); + } +}; +CommentsTransformer.preservedWords = [ + '@license', + '@preserve' +]; +CommentsTransformer = CommentsTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], CommentsTransformer); +exports.CommentsTransformer = CommentsTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/CustomNodesTransformer.ts": +/*!********************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/CustomNodesTransformer.ts ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e, _f; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeGroupStorage_1 = __webpack_require__(/*! ../../types/storages/TCustomNodeGroupStorage */ "./src/types/storages/TCustomNodeGroupStorage.ts"); +const IObfuscationEventEmitter_1 = __webpack_require__(/*! ../../interfaces/event-emitters/IObfuscationEventEmitter */ "./src/interfaces/event-emitters/IObfuscationEventEmitter.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICallsGraphAnalyzer_1 = __webpack_require__(/*! ../../interfaces/analyzers/calls-graph-analyzer/ICallsGraphAnalyzer */ "./src/interfaces/analyzers/calls-graph-analyzer/ICallsGraphAnalyzer.ts"); +const IPrevailingKindOfVariablesAnalyzer_1 = __webpack_require__(/*! ../../interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer */ "./src/interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let CustomNodesTransformer = class CustomNodesTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(callsGraphAnalyzer, prevailingKindOfVariablesAnalyzer, obfuscationEventEmitter, customNodeGroupStorage, randomGenerator, options) { + super(randomGenerator, options); + this.callsGraphData = []; + this.callsGraphAnalyzer = callsGraphAnalyzer; + this.prevailingKindOfVariablesAnalyzer = prevailingKindOfVariablesAnalyzer; + this.obfuscationEventEmitter = obfuscationEventEmitter; + this.customNodeGroupStorage = customNodeGroupStorage; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + leave: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.analyzeNode(node, parentNode); + this.appendCustomNodesBeforeObfuscation(node, parentNode); + return this.transformNode(node, parentNode); + } + } + }; + case TransformationStage_1.TransformationStage.Finalizing: + return { + leave: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.appendCustomNodesAfterObfuscation(node, parentNode); + } + } + }; + default: + return null; + } + } + analyzeNode(node, parentNode) { + this.callsGraphData = this.callsGraphAnalyzer.analyze(node); + this.prevailingKindOfVariablesAnalyzer.analyze(node); + } + transformNode(node, parentNode) { + return node; + } + appendCustomNodesBeforeObfuscation(node, parentNode) { + this.customNodeGroupStorage + .getStorage() + .forEach((customNodeGroup) => { + customNodeGroup.initialize(); + this.obfuscationEventEmitter.once(customNodeGroup.getAppendEvent(), customNodeGroup.appendCustomNodes.bind(customNodeGroup)); + }); + this.obfuscationEventEmitter.emit(ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation, node, this.callsGraphData); + } + appendCustomNodesAfterObfuscation(node, parentNode) { + this.obfuscationEventEmitter.emit(ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation, node, this.callsGraphData); + } +}; +CustomNodesTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICallsGraphAnalyzer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationEventEmitter)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TCustomNodeGroupStorage)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(5, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof ICallsGraphAnalyzer_1.ICallsGraphAnalyzer !== "undefined" && ICallsGraphAnalyzer_1.ICallsGraphAnalyzer) === "function" ? _a : Object, typeof (_b = typeof IPrevailingKindOfVariablesAnalyzer_1.IPrevailingKindOfVariablesAnalyzer !== "undefined" && IPrevailingKindOfVariablesAnalyzer_1.IPrevailingKindOfVariablesAnalyzer) === "function" ? _b : Object, typeof (_c = typeof IObfuscationEventEmitter_1.IObfuscationEventEmitter !== "undefined" && IObfuscationEventEmitter_1.IObfuscationEventEmitter) === "function" ? _c : Object, typeof (_d = typeof TCustomNodeGroupStorage_1.TCustomNodeGroupStorage !== "undefined" && TCustomNodeGroupStorage_1.TCustomNodeGroupStorage) === "function" ? _d : Object, typeof (_e = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _e : Object, typeof (_f = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _f : Object]) +], CustomNodesTransformer); +exports.CustomNodesTransformer = CustomNodesTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/EvalCallExpressionTransformer.ts": +/*!***************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/EvalCallExpressionTransformer.ts ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var EvalCallExpressionTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const js_string_escape_1 = __importDefault(__webpack_require__(/*! js-string-escape */ "js-string-escape")); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let EvalCallExpressionTransformer = EvalCallExpressionTransformer_1 = class EvalCallExpressionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + this.evalRootAstHostNodeSet = new Set(); + } + static extractEvalStringFromCallExpressionArgument(node) { + if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return EvalCallExpressionTransformer_1 + .extractEvalStringFromLiteralNode(node); + } + if (NodeGuards_1.NodeGuards.isTemplateLiteralNode(node)) { + return EvalCallExpressionTransformer_1 + .extractEvalStringFromTemplateLiteralNode(node); + } + return null; + } + static extractEvalStringFromLiteralNode(node) { + return typeof node.value === 'string' ? node.value : null; + } + static extractEvalStringFromTemplateLiteralNode(node) { + const quasis = node.quasis; + const allowedQuasisLength = 1; + if (quasis.length !== allowedQuasisLength || node.expressions.length) { + return null; + } + return quasis[0].value.cooked; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + if (parentNode + && NodeGuards_1.NodeGuards.isCallExpressionNode(node) + && NodeGuards_1.NodeGuards.isIdentifierNode(node.callee) + && node.callee.name === 'eval') { + return this.transformNode(node, parentNode); + } + } + }; + case TransformationStage_1.TransformationStage.Finalizing: + if (!this.evalRootAstHostNodeSet.size) { + return null; + } + return { + leave: (node, parentNode) => { + if (parentNode && this.isEvalRootAstHostNode(node)) { + return this.restoreNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(callExpressionNode, parentNode) { + const callExpressionFirstArgument = callExpressionNode.arguments[0]; + if (!callExpressionFirstArgument) { + return callExpressionNode; + } + const evalString = EvalCallExpressionTransformer_1 + .extractEvalStringFromCallExpressionArgument(callExpressionFirstArgument); + if (!evalString) { + return callExpressionNode; + } + let ast; + try { + ast = NodeUtils_1.NodeUtils.convertCodeToStructure(evalString); + } + catch (_a) { + return callExpressionNode; + } + const evalRootAstHostNode = NodeFactory_1.NodeFactory + .functionExpressionNode([], NodeFactory_1.NodeFactory.blockStatementNode(ast)); + this.evalRootAstHostNodeSet.add(evalRootAstHostNode); + return evalRootAstHostNode; + } + restoreNode(evalRootAstHostNode, parentNode) { + const targetAst = evalRootAstHostNode.body.body; + const obfuscatedCode = NodeUtils_1.NodeUtils.convertStructureToCode(targetAst); + return NodeFactory_1.NodeFactory.callExpressionNode(NodeFactory_1.NodeFactory.identifierNode('eval'), [ + NodeFactory_1.NodeFactory.literalNode(js_string_escape_1.default(obfuscatedCode)) + ]); + } + isEvalRootAstHostNode(node) { + return NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) && this.evalRootAstHostNodeSet.has(node); + } +}; +EvalCallExpressionTransformer = EvalCallExpressionTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], EvalCallExpressionTransformer); +exports.EvalCallExpressionTransformer = EvalCallExpressionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/MetadataTransformer.ts": +/*!*****************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/MetadataTransformer.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +let MetadataTransformer = class MetadataTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + return this.transformNode(node, parentNode); + } + }; + default: + return null; + } + } + transformNode(node, parentNode) { + NodeMetadata_1.NodeMetadata.set(node, { ignoredNode: false }); + if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { + NodeMetadata_1.NodeMetadata.set(node, { replacedLiteral: false }); + } + return node; + } +}; +MetadataTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], MetadataTransformer); +exports.MetadataTransformer = MetadataTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/ObfuscatingGuardsTransformer.ts": +/*!**************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/ObfuscatingGuardsTransformer.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var ObfuscatingGuardsTransformer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TObfuscatingGuardFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TObfuscatingGuardFactory */ "./src/types/container/node-transformers/TObfuscatingGuardFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ObfuscatingGuard_1 = __webpack_require__(/*! ../../enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard */ "./src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +let ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer_1 = class ObfuscatingGuardsTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(obfuscatingGuardFactory, randomGenerator, options) { + super(randomGenerator, options); + this.obfuscatingGuards = ObfuscatingGuardsTransformer_1.obfuscatingGuardsList.map(obfuscatingGuardFactory); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + return this.transformNode(node, parentNode); + } + }; + default: + return null; + } + } + transformNode(node, parentNode) { + const obfuscationAllowed = this.obfuscatingGuards + .every((nodeGuard) => nodeGuard.check(node)); + NodeMetadata_1.NodeMetadata.set(node, { + ignoredNode: !obfuscationAllowed + }); + return node; + } +}; +ObfuscatingGuardsTransformer.obfuscatingGuardsList = [ + ObfuscatingGuard_1.ObfuscatingGuard.BlackListObfuscatingGuard, + ObfuscatingGuard_1.ObfuscatingGuard.ConditionalCommentObfuscatingGuard, + ObfuscatingGuard_1.ObfuscatingGuard.ReservedStringObfuscatingGuard +]; +ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeGuard)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TObfuscatingGuardFactory_1.TObfuscatingGuardFactory !== "undefined" && TObfuscatingGuardFactory_1.TObfuscatingGuardFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], ObfuscatingGuardsTransformer); +exports.ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/ParentificationTransformer.ts": +/*!************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/ParentificationTransformer.ts ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ParentificationTransformer = class ParentificationTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + return this.transformNode(node, parentNode); + } + }; + default: + return null; + } + } + transformNode(node, parentNode) { + return NodeUtils_1.NodeUtils.parentizeNode(node, parentNode); + } +}; +ParentificationTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], ParentificationTransformer); +exports.ParentificationTransformer = ParentificationTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/VariablePreserveTransformer.ts": +/*!*************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/VariablePreserveTransformer.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const TIdentifierObfuscatingReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TIdentifierObfuscatingReplacerFactory */ "./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let VariablePreserveTransformer = class VariablePreserveTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(identifierObfuscatingReplacerFactory, randomGenerator, options) { + super(randomGenerator, options); + this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isIdentifierNode(node) + && parentNode + && (NodeGuards_1.NodeGuards.parentNodeIsPropertyNode(node, parentNode) + || NodeGuards_1.NodeGuards.parentNodeIsMemberExpressionNode(node, parentNode) + || NodeGuards_1.NodeGuards.parentNodeIsMethodDefinitionNode(node, parentNode) + || NodeGuards_1.NodeGuards.isLabelIdentifierNode(node, parentNode))) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(node, parentNode) { + this.identifierObfuscatingReplacer.preserveName(node.name); + return node; + } +}; +VariablePreserveTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory !== "undefined" && TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], VariablePreserveTransformer); +exports.VariablePreserveTransformer = VariablePreserveTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard.ts": +/*!******************************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard.ts ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var BlackListObfuscatingGuard_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let BlackListObfuscatingGuard = BlackListObfuscatingGuard_1 = class BlackListObfuscatingGuard { + constructor() { + this.blackListGuardsLength = BlackListObfuscatingGuard_1.blackListGuards.length; + } + check(node) { + for (let i = 0; i < this.blackListGuardsLength; i++) { + if (BlackListObfuscatingGuard_1.blackListGuards[i](node)) { + return false; + } + } + return true; + } +}; +BlackListObfuscatingGuard.blackListGuards = [ + NodeGuards_1.NodeGuards.isUseStrictOperator +]; +BlackListObfuscatingGuard = BlackListObfuscatingGuard_1 = __decorate([ + inversify_1.injectable(), + __metadata("design:paramtypes", []) +], BlackListObfuscatingGuard); +exports.BlackListObfuscatingGuard = BlackListObfuscatingGuard; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard.ts": +/*!***************************************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard.ts ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var ConditionalCommentObfuscatingGuard_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard_1 = class ConditionalCommentObfuscatingGuard { + constructor() { + this.obfuscationAllowedForCurrentNode = true; + this.obfuscationAllowedForNextNode = null; + } + static isConditionalComment(comment) { + return ConditionalCommentObfuscatingGuard_1.obfuscationEnableCommentRegExp.test(comment.value) || + ConditionalCommentObfuscatingGuard_1.obfuscationDisableCommentRegExp.test(comment.value); + } + check(node) { + if (this.obfuscationAllowedForNextNode) { + this.obfuscationAllowedForCurrentNode = this.obfuscationAllowedForNextNode; + this.obfuscationAllowedForNextNode = null; + } + if (!NodeGuards_1.NodeGuards.isNodeWithComments(node)) { + return this.obfuscationAllowedForCurrentNode; + } + const leadingComments = node.leadingComments; + const trailingComments = node.trailingComments; + if (leadingComments) { + this.obfuscationAllowedForCurrentNode = this.checkComments(leadingComments); + } + if (trailingComments) { + this.obfuscationAllowedForNextNode = this.checkComments(trailingComments); + } + return this.obfuscationAllowedForCurrentNode; + } + checkComments(comments) { + const commentsLength = comments.length; + let obfuscationAllowed = this.obfuscationAllowedForCurrentNode; + for (let i = 0; i < commentsLength; i++) { + const comment = comments[i]; + if (ConditionalCommentObfuscatingGuard_1.obfuscationEnableCommentRegExp.test(comment.value)) { + obfuscationAllowed = true; + continue; + } + if (ConditionalCommentObfuscatingGuard_1.obfuscationDisableCommentRegExp.test(comment.value)) { + obfuscationAllowed = false; + } + } + return obfuscationAllowed; + } +}; +ConditionalCommentObfuscatingGuard.obfuscationEnableCommentRegExp = new RegExp('javascript-obfuscator *: *enable'); +ConditionalCommentObfuscatingGuard.obfuscationDisableCommentRegExp = new RegExp('javascript-obfuscator *: *disable'); +ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard_1 = __decorate([ + inversify_1.injectable() +], ConditionalCommentObfuscatingGuard); +exports.ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard.ts": +/*!***********************************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard.ts ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ReservedStringObfuscatingGuard = class ReservedStringObfuscatingGuard { + constructor(options) { + this.options = options; + } + check(node) { + if (this.options.reservedStrings.length + && NodeGuards_1.NodeGuards.isLiteralNode(node) + && typeof node.value === 'string') { + return !this.isReservedString(node.value); + } + return true; + } + isReservedString(value) { + return this.options.reservedStrings + .some((reservedString) => { + return new RegExp(reservedString, 'g').exec(value) !== null; + }); + } +}; +ReservedStringObfuscatingGuard = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], ReservedStringObfuscatingGuard); +exports.ReservedStringObfuscatingGuard = ReservedStringObfuscatingGuard; + + +/***/ }), + +/***/ "./src/node/NodeAppender.ts": +/*!**********************************!*\ + !*** ./src/node/NodeAppender.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +class NodeAppender { + static append(nodeWithStatements, statements) { + statements = NodeAppender.parentizeScopeStatementsBeforeAppend(nodeWithStatements, statements); + NodeAppender.setScopeStatements(nodeWithStatements, [ + ...NodeAppender.getScopeStatements(nodeWithStatements), + ...statements + ]); + } + static appendToOptimalBlockScope(callsGraphData, nodeWithStatements, bodyStatements, index = 0) { + const targetBlockScope = callsGraphData.length + ? NodeAppender.getOptimalBlockScope(callsGraphData, index) + : nodeWithStatements; + NodeAppender.prepend(targetBlockScope, bodyStatements); + } + static getOptimalBlockScope(callsGraphData, index, deep = Infinity) { + const firstCall = callsGraphData[index]; + if (deep <= 0) { + throw new Error('Invalid `deep` argument value. Value should be bigger then 0.'); + } + if (deep > 1 && firstCall.callsGraph.length) { + return NodeAppender.getOptimalBlockScope(firstCall.callsGraph, 0, --deep); + } + else { + return firstCall.callee; + } + } + static insertBefore(nodeWithStatements, statements, target) { + const indexInScopeStatement = NodeAppender + .getScopeStatements(nodeWithStatements) + .indexOf(target); + NodeAppender.insertAtIndex(nodeWithStatements, statements, indexInScopeStatement); + } + static insertAfter(nodeWithStatements, statements, target) { + const indexInScopeStatement = NodeAppender + .getScopeStatements(nodeWithStatements) + .indexOf(target); + NodeAppender.insertAtIndex(nodeWithStatements, statements, indexInScopeStatement + 1); + } + static insertAtIndex(nodeWithStatements, statements, index) { + statements = NodeAppender.parentizeScopeStatementsBeforeAppend(nodeWithStatements, statements); + NodeAppender.setScopeStatements(nodeWithStatements, [ + ...NodeAppender.getScopeStatements(nodeWithStatements).slice(0, index), + ...statements, + ...NodeAppender.getScopeStatements(nodeWithStatements).slice(index) + ]); + } + static prepend(nodeWithStatements, statements) { + statements = NodeAppender.parentizeScopeStatementsBeforeAppend(nodeWithStatements, statements); + NodeAppender.setScopeStatements(nodeWithStatements, [ + ...statements, + ...NodeAppender.getScopeStatements(nodeWithStatements), + ]); + } + static getScopeStatements(nodeWithStatements) { + if (NodeGuards_1.NodeGuards.isSwitchCaseNode(nodeWithStatements)) { + return nodeWithStatements.consequent; + } + return nodeWithStatements.body; + } + static parentizeScopeStatementsBeforeAppend(nodeWithStatements, statements) { + statements.forEach((statement) => { + statement.parentNode = nodeWithStatements; + }); + return statements; + } + static setScopeStatements(nodeWithStatements, statements) { + if (NodeGuards_1.NodeGuards.isSwitchCaseNode(nodeWithStatements)) { + nodeWithStatements.consequent = statements; + return; + } + nodeWithStatements.body = statements; + } +} +exports.NodeAppender = NodeAppender; + + +/***/ }), + +/***/ "./src/node/NodeFactory.ts": +/*!*********************************!*\ + !*** ./src/node/NodeFactory.ts ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const escodegen = __importStar(__webpack_require__(/*! escodegen */ "escodegen")); +const NodeType_1 = __webpack_require__(/*! ../enums/node/NodeType */ "./src/enums/node/NodeType.ts"); +class NodeFactory { + static programNode(body = []) { + return { + type: NodeType_1.NodeType.Program, + body, + sourceType: 'script', + metadata: { ignoredNode: false } + }; + } + static arrayExpressionNode(elements = []) { + return { + type: NodeType_1.NodeType.ArrayExpression, + elements, + metadata: { ignoredNode: false } + }; + } + static assignmentExpressionNode(operator, left, right) { + return { + type: NodeType_1.NodeType.AssignmentExpression, + operator, + left, + right, + metadata: { ignoredNode: false } + }; + } + static binaryExpressionNode(operator, left, right) { + return { + type: NodeType_1.NodeType.BinaryExpression, + operator, + left, + right, + metadata: { ignoredNode: false } + }; + } + static blockStatementNode(body = []) { + return { + type: NodeType_1.NodeType.BlockStatement, + body, + metadata: { ignoredNode: false } + }; + } + static breakStatement(label) { + return { + type: NodeType_1.NodeType.BreakStatement, + label, + metadata: { ignoredNode: false } + }; + } + static callExpressionNode(callee, args = []) { + return { + type: NodeType_1.NodeType.CallExpression, + callee, + arguments: args, + metadata: { ignoredNode: false } + }; + } + static continueStatement(label) { + return { + type: NodeType_1.NodeType.ContinueStatement, + label, + metadata: { ignoredNode: false } + }; + } + static directiveNode(expression, directive) { + return { + type: NodeType_1.NodeType.ExpressionStatement, + expression, + directive, + metadata: { ignoredNode: false } + }; + } + static expressionStatementNode(expression) { + return { + type: NodeType_1.NodeType.ExpressionStatement, + expression, + metadata: { ignoredNode: false } + }; + } + static functionDeclarationNode(functionName, params, body) { + return { + type: NodeType_1.NodeType.FunctionDeclaration, + id: NodeFactory.identifierNode(functionName), + params, + body, + generator: false, + metadata: { ignoredNode: false } + }; + } + static functionExpressionNode(params, body) { + return { + type: NodeType_1.NodeType.FunctionExpression, + params, + body, + generator: false, + metadata: { ignoredNode: false } + }; + } + static ifStatementNode(test, consequent, alternate) { + return Object.assign(Object.assign({ type: NodeType_1.NodeType.IfStatement, test, + consequent }, alternate && { alternate }), { metadata: { ignoredNode: false } }); + } + static identifierNode(name) { + return { + type: NodeType_1.NodeType.Identifier, + name, + metadata: { ignoredNode: false } + }; + } + static importDeclarationNode(specifiers, source) { + return { + type: NodeType_1.NodeType.ImportDeclaration, + specifiers, + source, + metadata: { ignoredNode: false } + }; + } + static literalNode(value, raw) { + raw = raw !== undefined ? raw : `'${value}'`; + return { + type: NodeType_1.NodeType.Literal, + value, + raw, + 'x-verbatim-property': { + content: raw, + precedence: escodegen.Precedence.Primary + }, + metadata: { ignoredNode: false } + }; + } + static logicalExpressionNode(operator, left, right) { + return { + type: NodeType_1.NodeType.LogicalExpression, + operator, + left, + right, + metadata: { ignoredNode: false } + }; + } + static memberExpressionNode(object, property, computed = false) { + return { + type: NodeType_1.NodeType.MemberExpression, + computed, + object, + property, + metadata: { ignoredNode: false } + }; + } + static methodDefinitionNode(key, value, kind, computed) { + return { + type: NodeType_1.NodeType.MethodDefinition, + key, + value, + kind, + computed, + static: false, + metadata: { ignoredNode: false } + }; + } + static objectExpressionNode(properties) { + return { + type: NodeType_1.NodeType.ObjectExpression, + properties, + metadata: { ignoredNode: false } + }; + } + static propertyNode(key, value, computed = false) { + return { + type: NodeType_1.NodeType.Property, + key, + value, + kind: 'init', + method: false, + shorthand: false, + computed, + metadata: { ignoredNode: false } + }; + } + static returnStatementNode(argument) { + return { + type: NodeType_1.NodeType.ReturnStatement, + argument, + metadata: { ignoredNode: false } + }; + } + static switchStatementNode(discriminant, cases) { + return { + type: NodeType_1.NodeType.SwitchStatement, + discriminant, + cases, + metadata: { ignoredNode: false } + }; + } + static switchCaseNode(test, consequent) { + return { + type: NodeType_1.NodeType.SwitchCase, + test, + consequent, + metadata: { ignoredNode: false } + }; + } + static unaryExpressionNode(operator, argument, prefix = true) { + return { + type: NodeType_1.NodeType.UnaryExpression, + operator, + argument, + prefix, + metadata: { ignoredNode: false } + }; + } + static updateExpressionNode(operator, argumentExpr) { + return { + type: NodeType_1.NodeType.UpdateExpression, + operator, + argument: argumentExpr, + prefix: false, + metadata: { ignoredNode: false } + }; + } + static variableDeclarationNode(declarations = [], kind = 'var') { + return { + type: NodeType_1.NodeType.VariableDeclaration, + declarations, + kind, + metadata: { ignoredNode: false } + }; + } + static variableDeclaratorNode(id, init) { + return { + type: NodeType_1.NodeType.VariableDeclarator, + id, + init, + metadata: { ignoredNode: false } + }; + } + static whileStatementNode(test, body) { + return { + type: NodeType_1.NodeType.WhileStatement, + test, + body, + metadata: { ignoredNode: false } + }; + } +} +exports.NodeFactory = NodeFactory; + + +/***/ }), + +/***/ "./src/node/NodeGuards.ts": +/*!********************************!*\ + !*** ./src/node/NodeGuards.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeType_1 = __webpack_require__(/*! ../enums/node/NodeType */ "./src/enums/node/NodeType.ts"); +class NodeGuards { + static isArrayPatternNode(node) { + return node.type === NodeType_1.NodeType.ArrayPattern; + } + static isArrowFunctionExpressionNode(node) { + return node.type === NodeType_1.NodeType.ArrowFunctionExpression; + } + static isAssignmentExpressionNode(node) { + return node.type === NodeType_1.NodeType.AssignmentExpression; + } + static isAssignmentPatternNode(node) { + return node.type === NodeType_1.NodeType.AssignmentPattern; + } + static isAwaitExpressionNode(node) { + return node.type === NodeType_1.NodeType.AwaitExpression; + } + static isBlockStatementNode(node) { + return node.type === NodeType_1.NodeType.BlockStatement; + } + static isBreakStatementNode(node) { + return node.type === NodeType_1.NodeType.BreakStatement; + } + static isCallExpressionNode(node) { + return node.type === NodeType_1.NodeType.CallExpression; + } + static isClassDeclarationNode(node) { + return node.type === NodeType_1.NodeType.ClassDeclaration && node.id !== null; + } + static isContinueStatementNode(node) { + return node.type === NodeType_1.NodeType.ContinueStatement; + } + static isDirectiveNode(node) { + return node.type === NodeType_1.NodeType.ExpressionStatement + && 'directive' in node; + } + static isExportNamedDeclarationNode(node) { + return node.type === NodeType_1.NodeType.ExportNamedDeclaration; + } + static isExpressionStatementNode(node) { + return node.type === NodeType_1.NodeType.ExpressionStatement + && !('directive' in node); + } + static isFunctionNode(node) { + return NodeGuards.isFunctionDeclarationNode(node) || + NodeGuards.isFunctionExpressionNode(node) || + NodeGuards.isArrowFunctionExpressionNode(node); + } + static isFunctionDeclarationNode(node) { + return node.type === NodeType_1.NodeType.FunctionDeclaration && node.id !== null; + } + static isFunctionExpressionNode(node) { + return node.type === NodeType_1.NodeType.FunctionExpression; + } + static isIdentifierNode(node) { + return node.type === NodeType_1.NodeType.Identifier; + } + static isImportDeclarationNode(node) { + return node.type === NodeType_1.NodeType.ImportDeclaration; + } + static isImportSpecifierNode(node) { + return node.type === NodeType_1.NodeType.ImportSpecifier; + } + static isLabelIdentifierNode(node, parentNode) { + const parentNodeIsLabeledStatementNode = NodeGuards.isLabeledStatementNode(parentNode) && parentNode.label === node; + const parentNodeIsContinueStatementNode = NodeGuards.isContinueStatementNode(parentNode) && parentNode.label === node; + const parentNodeIsBreakStatementNode = NodeGuards.isBreakStatementNode(parentNode) && parentNode.label === node; + return parentNodeIsLabeledStatementNode || parentNodeIsContinueStatementNode || parentNodeIsBreakStatementNode; + } + static isLabeledStatementNode(node) { + return node.type === NodeType_1.NodeType.LabeledStatement; + } + static isLiteralNode(node) { + return node.type === NodeType_1.NodeType.Literal; + } + static isMemberExpressionNode(node) { + return node.type === NodeType_1.NodeType.MemberExpression; + } + static isMethodDefinitionNode(node) { + return node.type === NodeType_1.NodeType.MethodDefinition; + } + static isNode(object) { + return object && !object.type !== undefined; + } + static isNodeWithLexicalScope(node) { + return NodeGuards.isProgramNode(node) || NodeGuards.isFunctionNode(node); + } + static isNodeWithBlockLexicalScope(node) { + return NodeGuards.isNodeWithLexicalScope(node) || NodeGuards.isBlockStatementNode(node); + } + static isNodeWithLexicalScopeStatements(node, parentNode) { + return NodeGuards.isProgramNode(node) + || (NodeGuards.isBlockStatementNode(node) && NodeGuards.nodesWithLexicalStatements.includes(parentNode.type)); + } + static isNodeWithStatements(node) { + return NodeGuards.isProgramNode(node) + || NodeGuards.isBlockStatementNode(node) + || NodeGuards.isSwitchCaseNode(node); + } + static isNodeWithComments(node) { + return Boolean(node.leadingComments) || Boolean(node.trailingComments); + } + static isObjectPatternNode(node) { + return node.type === NodeType_1.NodeType.ObjectPattern; + } + static isObjectExpressionNode(node) { + return node.type === NodeType_1.NodeType.ObjectExpression; + } + static isProgramNode(node) { + return node.type === NodeType_1.NodeType.Program; + } + static isPropertyNode(node) { + return node.type === NodeType_1.NodeType.Property; + } + static parentNodeIsPropertyNode(node, parentNode) { + return NodeGuards.isPropertyNode(parentNode) + && !parentNode.computed + && parentNode.key === node; + } + static parentNodeIsMemberExpressionNode(node, parentNode) { + return (NodeGuards.isMemberExpressionNode(parentNode) + && !parentNode.computed + && parentNode.property === node); + } + static parentNodeIsMethodDefinitionNode(node, parentNode) { + return NodeGuards.isMethodDefinitionNode(parentNode) + && !parentNode.computed; + } + static isRestElementNode(node) { + return node.type === NodeType_1.NodeType.RestElement; + } + static isReturnStatementNode(node) { + return node.type === NodeType_1.NodeType.ReturnStatement; + } + static isSuperNode(node) { + return node.type === NodeType_1.NodeType.Super; + } + static isSwitchCaseNode(node) { + return node.type === NodeType_1.NodeType.SwitchCase; + } + static isTaggedTemplateExpressionNode(node) { + return node.type === NodeType_1.NodeType.TaggedTemplateExpression; + } + static isTemplateLiteralNode(node) { + return node.type === NodeType_1.NodeType.TemplateLiteral; + } + static isUnaryExpressionNode(node) { + return node.type === NodeType_1.NodeType.UnaryExpression; + } + static isUseStrictOperator(node) { + return NodeGuards.isDirectiveNode(node) + && node.directive === 'use strict'; + } + static isVariableDeclarationNode(node) { + return node.type === NodeType_1.NodeType.VariableDeclaration; + } + static isVariableDeclaratorNode(node) { + return node.type === NodeType_1.NodeType.VariableDeclarator; + } + static isWhileStatementNode(node) { + return node.type === NodeType_1.NodeType.WhileStatement; + } +} +exports.NodeGuards = NodeGuards; +NodeGuards.nodesWithLexicalStatements = [ + NodeType_1.NodeType.ArrowFunctionExpression, + NodeType_1.NodeType.FunctionDeclaration, + NodeType_1.NodeType.FunctionExpression, + NodeType_1.NodeType.MethodDefinition, +]; + + +/***/ }), + +/***/ "./src/node/NodeLexicalScopeUtils.ts": +/*!*******************************************!*\ + !*** ./src/node/NodeLexicalScopeUtils.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +class NodeLexicalScopeUtils { + static getLexicalScope(node) { + return NodeLexicalScopeUtils.getLexicalScopesRecursive(node, 1)[0]; + } + static getLexicalScopes(node) { + return NodeLexicalScopeUtils.getLexicalScopesRecursive(node); + } + static getLexicalScopesRecursive(node, maxSize = Infinity, nodesWithLexicalScope = [], depth = 0) { + if (nodesWithLexicalScope.length >= maxSize) { + return nodesWithLexicalScope; + } + const parentNode = node.parentNode; + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + if (NodeGuards_1.NodeGuards.isNodeWithLexicalScope(node)) { + nodesWithLexicalScope.push(node); + } + if (node !== parentNode) { + return NodeLexicalScopeUtils.getLexicalScopesRecursive(parentNode, maxSize, nodesWithLexicalScope, ++depth); + } + return nodesWithLexicalScope; + } +} +exports.NodeLexicalScopeUtils = NodeLexicalScopeUtils; + + +/***/ }), + +/***/ "./src/node/NodeLiteralUtils.ts": +/*!**************************************!*\ + !*** ./src/node/NodeLiteralUtils.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +class NodeLiteralUtils { + static isProhibitedLiteralNode(literalNode, parentNode) { + if (NodeGuards_1.NodeGuards.isPropertyNode(parentNode) && !parentNode.computed && parentNode.key === literalNode) { + return true; + } + if (NodeGuards_1.NodeGuards.isImportDeclarationNode(parentNode)) { + return true; + } + return false; + } +} +exports.NodeLiteralUtils = NodeLiteralUtils; + + +/***/ }), + +/***/ "./src/node/NodeMetadata.ts": +/*!**********************************!*\ + !*** ./src/node/NodeMetadata.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class NodeMetadata { + static set(node, metadata) { + var _a; + node.metadata = Object.assign((_a = node.metadata) !== null && _a !== void 0 ? _a : {}, metadata); + } + static get(node, metadataKey) { + return node.metadata !== undefined + ? node.metadata[metadataKey] + : undefined; + } + static isIgnoredNode(node) { + return NodeMetadata.get(node, 'ignoredNode') === true; + } + static isReplacedLiteral(literalNode) { + return NodeMetadata.get(literalNode, 'replacedLiteral') === true; + } +} +exports.NodeMetadata = NodeMetadata; + + +/***/ }), + +/***/ "./src/node/NodeStatementUtils.ts": +/*!****************************************!*\ + !*** ./src/node/NodeStatementUtils.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +class NodeStatementUtils { + static getParentNodeWithStatements(node) { + return NodeStatementUtils.getParentNodesWithStatementsRecursive(node, 1)[0]; + } + static getParentNodesWithStatements(node) { + return NodeStatementUtils.getParentNodesWithStatementsRecursive(node); + } + static getNextSiblingStatement(statement) { + return NodeStatementUtils.getSiblingStatementByOffset(statement, 1); + } + static getPreviousSiblingStatement(statement) { + return NodeStatementUtils.getSiblingStatementByOffset(statement, -1); + } + static getRootStatementOfNode(node) { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + throw new Error('Unable to find root statement for `Program` node'); + } + const parentNode = node.parentNode; + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + if (!NodeGuards_1.NodeGuards.isNodeWithStatements(parentNode)) { + return NodeStatementUtils.getRootStatementOfNode(parentNode); + } + return node; + } + static getScopeOfNode(node) { + const parentNode = node.parentNode; + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + if (!NodeGuards_1.NodeGuards.isNodeWithStatements(parentNode)) { + return NodeStatementUtils.getScopeOfNode(parentNode); + } + return parentNode; + } + static getParentNodesWithStatementsRecursive(node, maxSize = Infinity, nodesWithStatements = [], depth = 0) { + if (nodesWithStatements.length >= maxSize) { + return nodesWithStatements; + } + const parentNode = node.parentNode; + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + if (NodeGuards_1.NodeGuards.isProgramNode(node) || + (NodeGuards_1.NodeGuards.isNodeWithLexicalScopeStatements(node, parentNode) && depth > 0)) { + nodesWithStatements.push(node); + } + if (node !== parentNode) { + return NodeStatementUtils.getParentNodesWithStatementsRecursive(parentNode, maxSize, nodesWithStatements, ++depth); + } + return nodesWithStatements; + } + static getSiblingStatementByOffset(statement, offset) { + const scopeNode = NodeStatementUtils.getScopeOfNode(statement); + const scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) + ? scopeNode.body + : scopeNode.consequent; + const indexInScope = scopeBody.indexOf(statement); + return scopeBody[indexInScope + offset] || null; + } +} +exports.NodeStatementUtils = NodeStatementUtils; + + +/***/ }), + +/***/ "./src/node/NodeUtils.ts": +/*!*******************************!*\ + !*** ./src/node/NodeUtils.ts ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const escodegen = __importStar(__webpack_require__(/*! escodegen */ "escodegen")); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const EcmaVersion_1 = __webpack_require__(/*! ../constants/EcmaVersion */ "./src/constants/EcmaVersion.ts"); +const ASTParserFacade_1 = __webpack_require__(/*! ../ASTParserFacade */ "./src/ASTParserFacade.ts"); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ./NodeMetadata */ "./src/node/NodeMetadata.ts"); +class NodeUtils { + static addXVerbatimPropertyTo(literalNode) { + literalNode['x-verbatim-property'] = { + content: literalNode.raw, + precedence: escodegen.Precedence.Primary + }; + return literalNode; + } + static clone(astTree) { + return NodeUtils.parentizeAst(NodeUtils.cloneRecursive(astTree)); + } + static convertCodeToStructure(code) { + const structure = ASTParserFacade_1.ASTParserFacade.parse({ sourceCode: code }, { + ecmaVersion: EcmaVersion_1.ecmaVersion, + sourceType: 'script' + }); + estraverse.replace(structure, { + enter: (node, parentNode) => { + NodeUtils.parentizeNode(node, parentNode); + if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { + NodeUtils.addXVerbatimPropertyTo(node); + } + NodeMetadata_1.NodeMetadata.set(node, { ignoredNode: false }); + return node; + } + }); + return structure.body; + } + static convertStructureToCode(structure) { + return structure.reduce((code, node) => { + return code + escodegen.generate(node, { + sourceMapWithCode: true + }).code; + }, ''); + } + static getUnaryExpressionArgumentNode(unaryExpressionNode) { + if (NodeGuards_1.NodeGuards.isUnaryExpressionNode(unaryExpressionNode.argument)) { + return NodeUtils.getUnaryExpressionArgumentNode(unaryExpressionNode.argument); + } + return unaryExpressionNode.argument; + } + static parentizeAst(astTree) { + estraverse.replace(astTree, { + enter: NodeUtils.parentizeNode + }); + return astTree; + } + static parentizeNode(node, parentNode) { + node.parentNode = parentNode !== null && parentNode !== void 0 ? parentNode : node; + return node; + } + static cloneRecursive(node) { + if (node === null) { + return node; + } + const copy = {}; + const nodeKeys = Object.keys(node); + nodeKeys + .forEach((property) => { + if (property === 'parentNode') { + return; + } + const value = node[property]; + let clonedValue; + if (value === null || value instanceof RegExp) { + clonedValue = value; + } + else if (Array.isArray(value)) { + clonedValue = value.map(NodeUtils.cloneRecursive); + } + else if (typeof value === 'object') { + clonedValue = NodeUtils.cloneRecursive(value); + } + else { + clonedValue = value; + } + copy[property] = clonedValue; + }); + return copy; + } +} +exports.NodeUtils = NodeUtils; + + +/***/ }), + +/***/ "./src/options/Options.ts": +/*!********************************!*\ + !*** ./src/options/Options.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var Options_1, _a, _b, _c, _d, _e, _f; +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator"); +const TInputOptions_1 = __webpack_require__(/*! ../types/options/TInputOptions */ "./src/types/options/TInputOptions.ts"); +const TStringArrayEncoding_1 = __webpack_require__(/*! ../types/options/TStringArrayEncoding */ "./src/types/options/TStringArrayEncoding.ts"); +const IOptionsNormalizer_1 = __webpack_require__(/*! ../interfaces/options/IOptionsNormalizer */ "./src/interfaces/options/IOptionsNormalizer.ts"); +const IdentifierNamesGenerator_1 = __webpack_require__(/*! ../enums/generators/identifier-names-generators/IdentifierNamesGenerator */ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const SourceMapMode_1 = __webpack_require__(/*! ../enums/source-map/SourceMapMode */ "./src/enums/source-map/SourceMapMode.ts"); +const StringArrayEncoding_1 = __webpack_require__(/*! ../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +const Default_1 = __webpack_require__(/*! ./presets/Default */ "./src/options/presets/Default.ts"); +const ValidationErrorsFormatter_1 = __webpack_require__(/*! ./ValidationErrorsFormatter */ "./src/options/ValidationErrorsFormatter.ts"); +const IsAllowedForObfuscationTargets_1 = __webpack_require__(/*! ./validators/IsAllowedForObfuscationTargets */ "./src/options/validators/IsAllowedForObfuscationTargets.ts"); +let Options = Options_1 = class Options { + constructor(inputOptions, optionsNormalizer) { + Object.assign(this, Default_1.DEFAULT_PRESET, inputOptions); + const errors = class_validator_1.validateSync(this, Options_1.validatorOptions); + if (errors.length) { + throw new ReferenceError(`Validation failed. errors:\n${ValidationErrorsFormatter_1.ValidationErrorsFormatter.format(errors)}`); + } + Object.assign(this, optionsNormalizer.normalize(this)); + } +}; +Options.validatorOptions = { + validationError: { + target: false + } +}; +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "compact", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "controlFlowFlattening", void 0); +__decorate([ + class_validator_1.IsNumber(), + class_validator_1.Min(0), + class_validator_1.Max(1), + __metadata("design:type", Number) +], Options.prototype, "controlFlowFlatteningThreshold", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "deadCodeInjection", void 0); +__decorate([ + class_validator_1.IsNumber(), + __metadata("design:type", Number) +], Options.prototype, "deadCodeInjectionThreshold", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "debugProtection", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "debugProtectionInterval", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "disableConsoleOutput", void 0); +__decorate([ + class_validator_1.IsArray(), + class_validator_1.ArrayUnique(), + class_validator_1.IsString({ + each: true + }), + IsAllowedForObfuscationTargets_1.IsAllowedForObfuscationTargets([ + ObfuscationTarget_1.ObfuscationTarget.Browser, + ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval, + ]), + __metadata("design:type", Array) +], Options.prototype, "domainLock", void 0); +__decorate([ + class_validator_1.IsIn([ + IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator, + IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, + IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator + ]), + __metadata("design:type", typeof (_a = typeof tsenum_1.TypeFromEnum !== "undefined" && tsenum_1.TypeFromEnum) === "function" ? _a : Object) +], Options.prototype, "identifierNamesGenerator", void 0); +__decorate([ + class_validator_1.IsString(), + __metadata("design:type", String) +], Options.prototype, "identifiersPrefix", void 0); +__decorate([ + class_validator_1.IsArray(), + class_validator_1.ArrayUnique(), + class_validator_1.IsString({ + each: true + }), + class_validator_1.ValidateIf((options) => options.identifierNamesGenerator === IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator), + class_validator_1.ArrayNotEmpty(), + __metadata("design:type", Array) +], Options.prototype, "identifiersDictionary", void 0); +__decorate([ + class_validator_1.IsString(), + __metadata("design:type", String) +], Options.prototype, "inputFileName", void 0); +__decorate([ + class_validator_1.IsString(), + __metadata("design:type", String) +], Options.prototype, "inputFilePath", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "log", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "renameGlobals", void 0); +__decorate([ + class_validator_1.IsArray(), + class_validator_1.ArrayUnique(), + class_validator_1.IsString({ + each: true + }), + __metadata("design:type", Array) +], Options.prototype, "reservedNames", void 0); +__decorate([ + class_validator_1.IsArray(), + class_validator_1.ArrayUnique(), + class_validator_1.IsString({ + each: true + }), + __metadata("design:type", Array) +], Options.prototype, "reservedStrings", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "rotateStringArray", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "selfDefending", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "shuffleStringArray", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "sourceMap", void 0); +__decorate([ + class_validator_1.IsString(), + class_validator_1.ValidateIf((options) => Boolean(options.sourceMapBaseUrl)), + class_validator_1.IsUrl({ + require_protocol: true, + require_tld: false, + require_valid_protocol: true + }), + __metadata("design:type", String) +], Options.prototype, "sourceMapBaseUrl", void 0); +__decorate([ + class_validator_1.IsString(), + __metadata("design:type", String) +], Options.prototype, "sourceMapFileName", void 0); +__decorate([ + class_validator_1.IsIn([SourceMapMode_1.SourceMapMode.Inline, SourceMapMode_1.SourceMapMode.Separate]), + __metadata("design:type", typeof (_b = typeof tsenum_1.TypeFromEnum !== "undefined" && tsenum_1.TypeFromEnum) === "function" ? _b : Object) +], Options.prototype, "sourceMapMode", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "splitStrings", void 0); +__decorate([ + class_validator_1.IsNumber(), + class_validator_1.ValidateIf((options) => Boolean(options.splitStrings)), + class_validator_1.Min(1), + __metadata("design:type", Number) +], Options.prototype, "splitStringsChunkLength", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "stringArray", void 0); +__decorate([ + class_validator_1.IsIn([true, false, StringArrayEncoding_1.StringArrayEncoding.Base64, StringArrayEncoding_1.StringArrayEncoding.Rc4]), + __metadata("design:type", typeof (_c = typeof TStringArrayEncoding_1.TStringArrayEncoding !== "undefined" && TStringArrayEncoding_1.TStringArrayEncoding) === "function" ? _c : Object) +], Options.prototype, "stringArrayEncoding", void 0); +__decorate([ + class_validator_1.IsNumber(), + class_validator_1.Min(0), + class_validator_1.Max(1), + __metadata("design:type", Number) +], Options.prototype, "stringArrayThreshold", void 0); +__decorate([ + class_validator_1.IsIn([ObfuscationTarget_1.ObfuscationTarget.Browser, ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval, ObfuscationTarget_1.ObfuscationTarget.Node]), + __metadata("design:type", typeof (_d = typeof tsenum_1.TypeFromEnum !== "undefined" && tsenum_1.TypeFromEnum) === "function" ? _d : Object) +], Options.prototype, "target", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "transformObjectKeys", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "unicodeEscapeSequence", void 0); +Options = Options_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TInputOptions)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptionsNormalizer)), + __metadata("design:paramtypes", [typeof (_e = typeof TInputOptions_1.TInputOptions !== "undefined" && TInputOptions_1.TInputOptions) === "function" ? _e : Object, typeof (_f = typeof IOptionsNormalizer_1.IOptionsNormalizer !== "undefined" && IOptionsNormalizer_1.IOptionsNormalizer) === "function" ? _f : Object]) +], Options); +exports.Options = Options; + + +/***/ }), + +/***/ "./src/options/OptionsNormalizer.ts": +/*!******************************************!*\ + !*** ./src/options/OptionsNormalizer.ts ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var OptionsNormalizer_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ControlFlowFlatteningThresholdRule_1 = __webpack_require__(/*! ./normalizer-rules/ControlFlowFlatteningThresholdRule */ "./src/options/normalizer-rules/ControlFlowFlatteningThresholdRule.ts"); +const DeadCodeInjectionRule_1 = __webpack_require__(/*! ./normalizer-rules/DeadCodeInjectionRule */ "./src/options/normalizer-rules/DeadCodeInjectionRule.ts"); +const DeadCodeInjectionThresholdRule_1 = __webpack_require__(/*! ./normalizer-rules/DeadCodeInjectionThresholdRule */ "./src/options/normalizer-rules/DeadCodeInjectionThresholdRule.ts"); +const DomainLockRule_1 = __webpack_require__(/*! ./normalizer-rules/DomainLockRule */ "./src/options/normalizer-rules/DomainLockRule.ts"); +const InputFileNameRule_1 = __webpack_require__(/*! ./normalizer-rules/InputFileNameRule */ "./src/options/normalizer-rules/InputFileNameRule.ts"); +const SeedRule_1 = __webpack_require__(/*! ./normalizer-rules/SeedRule */ "./src/options/normalizer-rules/SeedRule.ts"); +const SelfDefendingRule_1 = __webpack_require__(/*! ./normalizer-rules/SelfDefendingRule */ "./src/options/normalizer-rules/SelfDefendingRule.ts"); +const SourceMapBaseUrlRule_1 = __webpack_require__(/*! ./normalizer-rules/SourceMapBaseUrlRule */ "./src/options/normalizer-rules/SourceMapBaseUrlRule.ts"); +const SourceMapFileNameRule_1 = __webpack_require__(/*! ./normalizer-rules/SourceMapFileNameRule */ "./src/options/normalizer-rules/SourceMapFileNameRule.ts"); +const SplitStringsChunkLengthRule_1 = __webpack_require__(/*! ./normalizer-rules/SplitStringsChunkLengthRule */ "./src/options/normalizer-rules/SplitStringsChunkLengthRule.ts"); +const StringArrayRule_1 = __webpack_require__(/*! ./normalizer-rules/StringArrayRule */ "./src/options/normalizer-rules/StringArrayRule.ts"); +const StringArrayEncodingRule_1 = __webpack_require__(/*! ./normalizer-rules/StringArrayEncodingRule */ "./src/options/normalizer-rules/StringArrayEncodingRule.ts"); +const StringArrayThresholdRule_1 = __webpack_require__(/*! ./normalizer-rules/StringArrayThresholdRule */ "./src/options/normalizer-rules/StringArrayThresholdRule.ts"); +let OptionsNormalizer = OptionsNormalizer_1 = class OptionsNormalizer { + normalize(options) { + let normalizedOptions = Object.assign({}, options); + for (const normalizerRule of OptionsNormalizer_1.normalizerRules) { + normalizedOptions = normalizerRule(normalizedOptions); + } + return normalizedOptions; + } +}; +OptionsNormalizer.normalizerRules = [ + ControlFlowFlatteningThresholdRule_1.ControlFlowFlatteningThresholdRule, + DeadCodeInjectionRule_1.DeadCodeInjectionRule, + DeadCodeInjectionThresholdRule_1.DeadCodeInjectionThresholdRule, + DomainLockRule_1.DomainLockRule, + InputFileNameRule_1.InputFileNameRule, + SeedRule_1.SeedRule, + SelfDefendingRule_1.SelfDefendingRule, + SourceMapBaseUrlRule_1.SourceMapBaseUrlRule, + SourceMapFileNameRule_1.SourceMapFileNameRule, + SplitStringsChunkLengthRule_1.SplitStringsChunkLengthRule, + StringArrayRule_1.StringArrayRule, + StringArrayEncodingRule_1.StringArrayEncodingRule, + StringArrayThresholdRule_1.StringArrayThresholdRule, +]; +OptionsNormalizer = OptionsNormalizer_1 = __decorate([ + inversify_1.injectable() +], OptionsNormalizer); +exports.OptionsNormalizer = OptionsNormalizer; + + +/***/ }), + +/***/ "./src/options/ValidationErrorsFormatter.ts": +/*!**************************************************!*\ + !*** ./src/options/ValidationErrorsFormatter.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class ValidationErrorsFormatter { + static format(errors) { + return errors + .reduce((errorMessages, error) => [ + ...errorMessages, + ValidationErrorsFormatter.formatWithNestedConstraints(error) + ], []) + .join('\n'); + } + static formatWithNestedConstraints(error) { + const constraints = error.constraints; + const rootError = `\`${error.property}\` errors:\n`; + const nestedErrors = Object + .keys(constraints) + .map((constraint) => ` - ${constraints[constraint]}\n`) + .join(); + return `${rootError}${nestedErrors}`; + } +} +exports.ValidationErrorsFormatter = ValidationErrorsFormatter; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/ControlFlowFlatteningThresholdRule.ts": +/*!****************************************************************************!*\ + !*** ./src/options/normalizer-rules/ControlFlowFlatteningThresholdRule.ts ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ControlFlowFlatteningThresholdRule = (options) => { + if (options.controlFlowFlatteningThreshold === 0) { + options = Object.assign(Object.assign({}, options), { controlFlowFlattening: false, controlFlowFlatteningThreshold: 0 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/DeadCodeInjectionRule.ts": +/*!***************************************************************!*\ + !*** ./src/options/normalizer-rules/DeadCodeInjectionRule.ts ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const Default_1 = __webpack_require__(/*! ../presets/Default */ "./src/options/presets/Default.ts"); +exports.DeadCodeInjectionRule = (options) => { + if (options.deadCodeInjection) { + options = Object.assign(Object.assign({}, options), { deadCodeInjection: true, stringArray: true }); + if (!options.stringArrayThreshold) { + options = Object.assign(Object.assign({}, options), { stringArray: true, stringArrayThreshold: Default_1.DEFAULT_PRESET.stringArrayThreshold }); + } + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/DeadCodeInjectionThresholdRule.ts": +/*!************************************************************************!*\ + !*** ./src/options/normalizer-rules/DeadCodeInjectionThresholdRule.ts ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeadCodeInjectionThresholdRule = (options) => { + if (options.deadCodeInjectionThreshold === 0) { + options = Object.assign(Object.assign({}, options), { deadCodeInjection: false, deadCodeInjectionThreshold: 0 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/DomainLockRule.ts": +/*!********************************************************!*\ + !*** ./src/options/normalizer-rules/DomainLockRule.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const Utils_1 = __webpack_require__(/*! ../../utils/Utils */ "./src/utils/Utils.ts"); +exports.DomainLockRule = (options) => { + if (options.domainLock.length) { + const normalizedDomains = []; + for (const domain of options.domainLock) { + normalizedDomains.push(Utils_1.Utils.extractDomainFrom(domain)); + } + options = Object.assign(Object.assign({}, options), { domainLock: normalizedDomains }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/InputFileNameRule.ts": +/*!***********************************************************!*\ + !*** ./src/options/normalizer-rules/InputFileNameRule.ts ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const StringSeparator_1 = __webpack_require__(/*! ../../enums/StringSeparator */ "./src/enums/StringSeparator.ts"); +exports.InputFileNameRule = (options) => { + let { inputFileName } = options; + if (inputFileName) { + inputFileName = inputFileName + .replace(/^\/+/, '') + .split(StringSeparator_1.StringSeparator.Dot) + .slice(0, -1) + .join(StringSeparator_1.StringSeparator.Dot) || inputFileName; + options = Object.assign(Object.assign({}, options), { inputFileName: `${inputFileName}.js` }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SeedRule.ts": +/*!**************************************************!*\ + !*** ./src/options/normalizer-rules/SeedRule.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SeedRule = (options) => { + if (options.seed) { + return Object.assign(Object.assign({}, options), { seed: options.seed }); + } + const getRandomInteger = (min, max) => { + return Math.floor(Math.random() * (max - min + 1) + min); + }; + return Object.assign(Object.assign({}, options), { seed: getRandomInteger(0, 999999999) }); +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SelfDefendingRule.ts": +/*!***********************************************************!*\ + !*** ./src/options/normalizer-rules/SelfDefendingRule.ts ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SelfDefendingRule = (options) => { + if (options.selfDefending) { + options = Object.assign(Object.assign({}, options), { compact: true, selfDefending: true }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SourceMapBaseUrlRule.ts": +/*!**************************************************************!*\ + !*** ./src/options/normalizer-rules/SourceMapBaseUrlRule.ts ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SourceMapBaseUrlRule = (options) => { + const { sourceMapBaseUrl } = options; + if (!options.sourceMapFileName) { + options = Object.assign(Object.assign({}, options), { sourceMapBaseUrl: '' }); + return options; + } + if (sourceMapBaseUrl && !sourceMapBaseUrl.endsWith('/')) { + options = Object.assign(Object.assign({}, options), { sourceMapBaseUrl: `${sourceMapBaseUrl}/` }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SourceMapFileNameRule.ts": +/*!***************************************************************!*\ + !*** ./src/options/normalizer-rules/SourceMapFileNameRule.ts ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const StringSeparator_1 = __webpack_require__(/*! ../../enums/StringSeparator */ "./src/enums/StringSeparator.ts"); +exports.SourceMapFileNameRule = (options) => { + let { sourceMapFileName } = options; + if (sourceMapFileName) { + sourceMapFileName = sourceMapFileName + .replace(/^\/+/, '') + .replace(/(?:\.js)?(?:\.map)?$/, ''); + let sourceMapFileNameParts = sourceMapFileName.split(StringSeparator_1.StringSeparator.Dot); + const sourceMapFileNamePartsCount = sourceMapFileNameParts.length; + const lastPart = sourceMapFileNameParts[sourceMapFileNamePartsCount - 1]; + if (sourceMapFileNamePartsCount > 1 && lastPart.length <= 3) { + sourceMapFileNameParts = sourceMapFileNameParts.slice(0, -1); + } + sourceMapFileName = sourceMapFileNameParts.join(StringSeparator_1.StringSeparator.Dot); + options = Object.assign(Object.assign({}, options), { sourceMapFileName: `${sourceMapFileName}.js.map` }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SplitStringsChunkLengthRule.ts": +/*!*********************************************************************!*\ + !*** ./src/options/normalizer-rules/SplitStringsChunkLengthRule.ts ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SplitStringsChunkLengthRule = (options) => { + if (options.splitStringsChunkLength === 0) { + options = Object.assign(Object.assign({}, options), { splitStrings: false, splitStringsChunkLength: 0 }); + } + else { + options = Object.assign(Object.assign({}, options), { splitStringsChunkLength: Math.floor(options.splitStringsChunkLength) }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/StringArrayEncodingRule.ts": +/*!*****************************************************************!*\ + !*** ./src/options/normalizer-rules/StringArrayEncodingRule.ts ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const StringArrayEncoding_1 = __webpack_require__(/*! ../../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +exports.StringArrayEncodingRule = (options) => { + if (options.stringArrayEncoding === true) { + options = Object.assign(Object.assign({}, options), { stringArrayEncoding: StringArrayEncoding_1.StringArrayEncoding.Base64 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/StringArrayRule.ts": +/*!*********************************************************!*\ + !*** ./src/options/normalizer-rules/StringArrayRule.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StringArrayRule = (options) => { + if (!options.stringArray) { + options = Object.assign(Object.assign({}, options), { rotateStringArray: false, shuffleStringArray: false, stringArray: false, stringArrayEncoding: false, stringArrayThreshold: 0 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/StringArrayThresholdRule.ts": +/*!******************************************************************!*\ + !*** ./src/options/normalizer-rules/StringArrayThresholdRule.ts ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StringArrayThresholdRule = (options) => { + if (options.stringArrayThreshold === 0) { + options = Object.assign(Object.assign({}, options), { rotateStringArray: false, stringArray: false, stringArrayEncoding: false, stringArrayThreshold: 0 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/presets/Default.ts": +/*!****************************************!*\ + !*** ./src/options/presets/Default.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const IdentifierNamesGenerator_1 = __webpack_require__(/*! ../../enums/generators/identifier-names-generators/IdentifierNamesGenerator */ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const SourceMapMode_1 = __webpack_require__(/*! ../../enums/source-map/SourceMapMode */ "./src/enums/source-map/SourceMapMode.ts"); +exports.DEFAULT_PRESET = Object.freeze({ + compact: true, + config: '', + controlFlowFlattening: false, + controlFlowFlatteningThreshold: 0.75, + deadCodeInjection: false, + deadCodeInjectionThreshold: 0.4, + debugProtection: false, + debugProtectionInterval: false, + disableConsoleOutput: false, + domainLock: [], + exclude: [], + identifierNamesGenerator: IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, + identifiersPrefix: '', + identifiersDictionary: [], + inputFileName: '', + inputFilePath: '', + log: false, + renameGlobals: false, + reservedNames: [], + reservedStrings: [], + rotateStringArray: true, + seed: 0, + selfDefending: false, + shuffleStringArray: true, + sourceMap: false, + sourceMapBaseUrl: '', + sourceMapFileName: '', + sourceMapMode: SourceMapMode_1.SourceMapMode.Separate, + splitStrings: false, + splitStringsChunkLength: 10, + stringArray: true, + stringArrayEncoding: false, + stringArrayThreshold: 0.75, + target: ObfuscationTarget_1.ObfuscationTarget.Browser, + transformObjectKeys: false, + unicodeEscapeSequence: false +}); + + +/***/ }), + +/***/ "./src/options/presets/NoCustomNodes.ts": +/*!**********************************************!*\ + !*** ./src/options/presets/NoCustomNodes.ts ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const IdentifierNamesGenerator_1 = __webpack_require__(/*! ../../enums/generators/identifier-names-generators/IdentifierNamesGenerator */ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const SourceMapMode_1 = __webpack_require__(/*! ../../enums/source-map/SourceMapMode */ "./src/enums/source-map/SourceMapMode.ts"); +exports.NO_ADDITIONAL_NODES_PRESET = Object.freeze({ + compact: true, + controlFlowFlattening: false, + controlFlowFlatteningThreshold: 0, + deadCodeInjection: false, + deadCodeInjectionThreshold: 0, + debugProtection: false, + debugProtectionInterval: false, + disableConsoleOutput: false, + domainLock: [], + exclude: [], + identifierNamesGenerator: IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, + identifiersPrefix: '', + identifiersDictionary: [], + inputFileName: '', + inputFilePath: '', + log: false, + renameGlobals: false, + reservedNames: [], + reservedStrings: [], + rotateStringArray: false, + seed: 0, + selfDefending: false, + shuffleStringArray: false, + sourceMap: false, + sourceMapBaseUrl: '', + sourceMapFileName: '', + sourceMapMode: SourceMapMode_1.SourceMapMode.Separate, + splitStrings: false, + splitStringsChunkLength: 0, + stringArray: false, + stringArrayEncoding: false, + stringArrayThreshold: 0, + target: ObfuscationTarget_1.ObfuscationTarget.Browser, + transformObjectKeys: false, + unicodeEscapeSequence: false +}); + + +/***/ }), + +/***/ "./src/options/validators/IsAllowedForObfuscationTargets.ts": +/*!******************************************************************!*\ + !*** ./src/options/validators/IsAllowedForObfuscationTargets.ts ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator"); +const fast_deep_equal_1 = __importDefault(__webpack_require__(/*! fast-deep-equal */ "fast-deep-equal")); +const StringSeparator_1 = __webpack_require__(/*! ../../enums/StringSeparator */ "./src/enums/StringSeparator.ts"); +const Default_1 = __webpack_require__(/*! ../presets/Default */ "./src/options/presets/Default.ts"); +function IsAllowedForObfuscationTargets(obfuscationTargets, validationOptions) { + return (optionsObject, propertyName) => { + class_validator_1.registerDecorator({ + propertyName, + constraints: [obfuscationTargets], + name: 'IsAllowedForObfuscationTargets', + options: validationOptions, + target: optionsObject.constructor, + validator: { + validate(value, validationArguments) { + const options = validationArguments.object; + const defaultValue = Default_1.DEFAULT_PRESET[propertyName]; + const isDefaultValue = fast_deep_equal_1.default(value, defaultValue); + return isDefaultValue || obfuscationTargets.includes(options.target); + }, + defaultMessage(validationArguments) { + const requiredObfuscationTargetsString = obfuscationTargets.join(`${StringSeparator_1.StringSeparator.Comma} `); + return `This option allowed only for obfuscation targets: ${requiredObfuscationTargetsString}`; + } + } + }); + }; +} +exports.IsAllowedForObfuscationTargets = IsAllowedForObfuscationTargets; + + +/***/ }), + +/***/ "./src/source-code/ObfuscatedCode.ts": +/*!*******************************************!*\ + !*** ./src/source-code/ObfuscatedCode.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ICryptUtils_1 = __webpack_require__(/*! ../interfaces/utils/ICryptUtils */ "./src/interfaces/utils/ICryptUtils.ts"); +const Initializable_1 = __webpack_require__(/*! ../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const SourceMapMode_1 = __webpack_require__(/*! ../enums/source-map/SourceMapMode */ "./src/enums/source-map/SourceMapMode.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +let ObfuscatedCode = class ObfuscatedCode { + constructor(cryptUtils, options) { + this.cryptUtils = cryptUtils; + this.options = options; + } + initialize(obfuscatedCode, sourceMap) { + this.obfuscatedCode = obfuscatedCode; + this.sourceMap = sourceMap; + } + getObfuscatedCode() { + return this.correctObfuscatedCode(); + } + getSourceMap() { + return this.sourceMap; + } + toString() { + return this.obfuscatedCode; + } + correctObfuscatedCode() { + if (!this.sourceMap) { + return this.obfuscatedCode; + } + const sourceMapUrl = this.options.sourceMapBaseUrl + this.options.sourceMapFileName; + let sourceMappingUrl = '//# sourceMappingURL='; + switch (this.options.sourceMapMode) { + case SourceMapMode_1.SourceMapMode.Inline: + sourceMappingUrl += `data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`; + break; + case SourceMapMode_1.SourceMapMode.Separate: + default: + if (!sourceMapUrl) { + return this.obfuscatedCode; + } + sourceMappingUrl += sourceMapUrl; + } + return `${this.obfuscatedCode}\n${sourceMappingUrl}`; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ObfuscatedCode.prototype, "obfuscatedCode", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ObfuscatedCode.prototype, "sourceMap", void 0); +ObfuscatedCode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof ICryptUtils_1.ICryptUtils !== "undefined" && ICryptUtils_1.ICryptUtils) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], ObfuscatedCode); +exports.ObfuscatedCode = ObfuscatedCode; + + +/***/ }), + +/***/ "./src/source-code/SourceCode.ts": +/*!***************************************!*\ + !*** ./src/source-code/SourceCode.ts ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class SourceCode { + constructor(sourceCode, sourceMap) { + this.sourceCode = sourceCode; + this.sourceMap = sourceMap; + } + getSourceCode() { + return this.sourceCode; + } + getSourceMap() { + return this.sourceMap; + } + toString() { + return this.sourceCode; + } +} +exports.SourceCode = SourceCode; + + +/***/ }), + +/***/ "./src/storages/MapStorage.ts": +/*!************************************!*\ + !*** ./src/storages/MapStorage.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../decorators/Initializable */ "./src/decorators/Initializable.ts"); +let MapStorage = class MapStorage { + constructor(randomGenerator, options) { + this.randomGenerator = randomGenerator; + this.options = options; + } + initialize() { + this.storage = new Map(); + this.storageId = this.randomGenerator.getRandomString(6); + } + get(key) { + return this.storage.get(key); + } + getOrThrow(key) { + const value = this.get(key); + if (!value) { + throw new Error(`No value found in map storage with key \`${key}\``); + } + return value; + } + getKeyOf(value) { + for (const [key, storageValue] of this.storage) { + if (value === storageValue) { + return key; + } + } + return null; + } + getLength() { + return this.storage.size; + } + getStorage() { + return this.storage; + } + getStorageId() { + return this.storageId; + } + has(key) { + return this.storage.has(key); + } + mergeWith(storage, mergeId = false) { + this.storage = new Map([...this.storage, ...storage.getStorage()]); + if (mergeId) { + this.storageId = storage.getStorageId(); + } + } + set(key, value) { + this.storage.set(key, value); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], MapStorage.prototype, "storageId", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], MapStorage.prototype, "storage", void 0); +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], MapStorage.prototype, "initialize", null); +MapStorage = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], MapStorage); +exports.MapStorage = MapStorage; + + +/***/ }), + +/***/ "./src/storages/control-flow/ControlFlowStorage.ts": +/*!*********************************************************!*\ + !*** ./src/storages/control-flow/ControlFlowStorage.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const MapStorage_1 = __webpack_require__(/*! ../MapStorage */ "./src/storages/MapStorage.ts"); +let ControlFlowStorage = class ControlFlowStorage extends MapStorage_1.MapStorage { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } +}; +ControlFlowStorage = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], ControlFlowStorage); +exports.ControlFlowStorage = ControlFlowStorage; + + +/***/ }), + +/***/ "./src/storages/custom-node-group/CustomNodeGroupStorage.ts": +/*!******************************************************************!*\ + !*** ./src/storages/custom-node-group/CustomNodeGroupStorage.ts ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var CustomNodeGroupStorage_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeGroupFactory_1 = __webpack_require__(/*! ../../types/container/custom-nodes/TCustomNodeGroupFactory */ "./src/types/container/custom-nodes/TCustomNodeGroupFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const CustomNodeGroup_1 = __webpack_require__(/*! ../../enums/custom-nodes/CustomNodeGroup */ "./src/enums/custom-nodes/CustomNodeGroup.ts"); +const MapStorage_1 = __webpack_require__(/*! ../MapStorage */ "./src/storages/MapStorage.ts"); +let CustomNodeGroupStorage = CustomNodeGroupStorage_1 = class CustomNodeGroupStorage extends MapStorage_1.MapStorage { + constructor(customNodeGroupFactory, randomGenerator, options) { + super(randomGenerator, options); + this.customNodeGroupFactory = customNodeGroupFactory; + } + initialize() { + super.initialize(); + CustomNodeGroupStorage_1.customNodeGroupsList.forEach((customNodeGroupName) => { + const customNodeGroup = this.customNodeGroupFactory(customNodeGroupName); + this.storage.set(customNodeGroupName, customNodeGroup); + }); + } +}; +CustomNodeGroupStorage.customNodeGroupsList = [ + CustomNodeGroup_1.CustomNodeGroup.ConsoleOutputCustomNodeGroup, + CustomNodeGroup_1.CustomNodeGroup.DebugProtectionCustomNodeGroup, + CustomNodeGroup_1.CustomNodeGroup.DomainLockCustomNodeGroup, + CustomNodeGroup_1.CustomNodeGroup.SelfDefendingCustomNodeGroup, + CustomNodeGroup_1.CustomNodeGroup.StringArrayCustomNodeGroup +]; +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], CustomNodeGroupStorage.prototype, "initialize", null); +CustomNodeGroupStorage = CustomNodeGroupStorage_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNodeGroup)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TCustomNodeGroupFactory_1.TCustomNodeGroupFactory !== "undefined" && TCustomNodeGroupFactory_1.TCustomNodeGroupFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], CustomNodeGroupStorage); +exports.CustomNodeGroupStorage = CustomNodeGroupStorage; + + +/***/ }), + +/***/ "./src/storages/string-array/StringArrayStorage.ts": +/*!*********************************************************!*\ + !*** ./src/storages/string-array/StringArrayStorage.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var StringArrayStorage_1, _a, _b, _c, _d, _e, _f; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IArrayUtils_1 = __webpack_require__(/*! ../../interfaces/utils/IArrayUtils */ "./src/interfaces/utils/IArrayUtils.ts"); +const ICryptUtils_1 = __webpack_require__(/*! ../../interfaces/utils/ICryptUtils */ "./src/interfaces/utils/ICryptUtils.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const StringArrayEncoding_1 = __webpack_require__(/*! ../../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +const MapStorage_1 = __webpack_require__(/*! ../MapStorage */ "./src/storages/MapStorage.ts"); +let StringArrayStorage = StringArrayStorage_1 = class StringArrayStorage extends MapStorage_1.MapStorage { + constructor(identifierNamesGeneratorFactory, arrayUtils, randomGenerator, options, cryptUtils, escapeSequenceEncoder) { + super(randomGenerator, options); + this.rc4EncodedValuesSourcesCache = new Map(); + this.rotationAmount = 0; + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + this.arrayUtils = arrayUtils; + this.cryptUtils = cryptUtils; + this.escapeSequenceEncoder = escapeSequenceEncoder; + this.rc4Keys = this.randomGenerator.getRandomGenerator() + .n(() => this.randomGenerator.getRandomGenerator().string({ + length: StringArrayStorage_1.rc4KeyLength + }), StringArrayStorage_1.rc4KeysCount); + } + initialize() { + super.initialize(); + const baseStringArrayName = this.identifierNamesGenerator + .generate(StringArrayStorage_1.stringArrayNameLength); + const baseStringArrayCallsWrapperName = this.identifierNamesGenerator + .generate(StringArrayStorage_1.stringArrayNameLength); + this.stringArrayStorageName = `${this.options.identifiersPrefix}${baseStringArrayName}`; + this.stringArrayStorageCallsWrapperName = `${this.options.identifiersPrefix}${baseStringArrayCallsWrapperName}`; + this.rotationAmount = this.options.rotateStringArray + ? this.randomGenerator.getRandomInteger(StringArrayStorage_1.minimumRotationAmount, StringArrayStorage_1.maximumRotationAmount) + : 0; + } + get(value) { + return this.getOrSetIfDoesNotExist(value); + } + getRotationAmount() { + return this.rotationAmount; + } + getStorageId() { + return this.stringArrayStorageName; + } + getStorageName() { + return this.getStorageId(); + } + getStorageCallsWrapperName() { + return this.stringArrayStorageCallsWrapperName; + } + rotateStorage() { + if (!this.getLength()) { + return; + } + this.storage = new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()), this.rotationAmount)); + } + shuffleStorage() { + this.storage = new Map(this.arrayUtils + .shuffle(Array.from(this.storage.entries())) + .map(([value, stringArrayStorageItemData], index) => { + stringArrayStorageItemData.index = index; + return [value, stringArrayStorageItemData]; + }) + .sort(([, stringArrayStorageItemDataA], [, stringArrayStorageItemDataB]) => stringArrayStorageItemDataA.index - stringArrayStorageItemDataB.index)); + } + toString() { + return Array + .from(this.storage.values()) + .map((stringArrayStorageItemData) => { + return `'${this.escapeSequenceEncoder.encode(stringArrayStorageItemData.encodedValue, this.options.unicodeEscapeSequence)}'`; + }).toString(); + } + getOrSetIfDoesNotExist(value) { + const { encodedValue, decodeKey } = this.getEncodedValue(value); + const storedStringArrayStorageItemData = this.storage.get(encodedValue); + if (storedStringArrayStorageItemData) { + return storedStringArrayStorageItemData; + } + const stringArrayStorageItemData = { + encodedValue, + decodeKey, + value, + index: this.getLength() + }; + this.storage.set(encodedValue, stringArrayStorageItemData); + return stringArrayStorageItemData; + } + getEncodedValue(value) { + var _a; + switch (this.options.stringArrayEncoding) { + case StringArrayEncoding_1.StringArrayEncoding.Rc4: { + const decodeKey = this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys); + const encodedValue = this.cryptUtils.btoa(this.cryptUtils.rc4(value, decodeKey)); + const encodedValueSources = (_a = this.rc4EncodedValuesSourcesCache.get(encodedValue)) !== null && _a !== void 0 ? _a : []; + let encodedValueSourcesLength = encodedValueSources.length; + const shouldAddValueToSourcesCache = !encodedValueSourcesLength || !encodedValueSources.includes(value); + if (shouldAddValueToSourcesCache) { + encodedValueSources.push(value); + encodedValueSourcesLength++; + } + this.rc4EncodedValuesSourcesCache.set(encodedValue, encodedValueSources); + if (encodedValueSourcesLength > 1) { + return this.getEncodedValue(value); + } + return { encodedValue, decodeKey }; + } + case StringArrayEncoding_1.StringArrayEncoding.Base64: { + const decodeKey = null; + const encodedValue = this.cryptUtils.btoa(value); + return { encodedValue, decodeKey }; + } + default: { + const decodeKey = null; + const encodedValue = value; + return { encodedValue, decodeKey }; + } + } + } +}; +StringArrayStorage.minimumRotationAmount = 100; +StringArrayStorage.maximumRotationAmount = 500; +StringArrayStorage.rc4KeyLength = 4; +StringArrayStorage.rc4KeysCount = 50; +StringArrayStorage.stringArrayNameLength = 7; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayStorage.prototype, "stringArrayStorageName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayStorage.prototype, "stringArrayStorageCallsWrapperName", void 0); +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], StringArrayStorage.prototype, "initialize", null); +StringArrayStorage = StringArrayStorage_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), + __param(5, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof IArrayUtils_1.IArrayUtils !== "undefined" && IArrayUtils_1.IArrayUtils) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof ICryptUtils_1.ICryptUtils !== "undefined" && ICryptUtils_1.ICryptUtils) === "function" ? _e : Object, typeof (_f = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _f : Object]) +], StringArrayStorage); +exports.StringArrayStorage = StringArrayStorage; + + +/***/ }), + +/***/ "./src/templates/AtobTemplate.ts": +/*!***************************************!*\ + !*** ./src/templates/AtobTemplate.ts ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function AtobTemplate() { + return ` + (function () { + {globalVariableTemplate} + + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + that.atob || ( + that.atob = function(input) { + const str = String(input).replace(/=+$/, ''); + let output = ''; + for ( + let bc = 0, bs, buffer, idx = 0; + buffer = str.charAt(idx++); + ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, + bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 + ) { + buffer = chars.indexOf(buffer); + } + return output; + } + ); + })(); + `; +} +exports.AtobTemplate = AtobTemplate; + + +/***/ }), + +/***/ "./src/templates/GlobalVariableNoEvalTemplate.ts": +/*!*******************************************************!*\ + !*** ./src/templates/GlobalVariableNoEvalTemplate.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function GlobalVariableNoEvalTemplate() { + return ` + const that = (typeof window !== 'undefined' + ? window + : (typeof process === 'object' && + typeof require === 'function' && + typeof global === 'object') + ? global + : this); + `; +} +exports.GlobalVariableNoEvalTemplate = GlobalVariableNoEvalTemplate; + + +/***/ }), + +/***/ "./src/templates/GlobalVariableTemplate1.ts": +/*!**************************************************!*\ + !*** ./src/templates/GlobalVariableTemplate1.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function GlobalVariableTemplate1() { + return ` + let that; + + try { + const getGlobal = Function('return (function() ' + '{}.constructor("return this")( )' + ');'); + + that = getGlobal(); + } catch (e) { + that = window; + } + `; +} +exports.GlobalVariableTemplate1 = GlobalVariableTemplate1; + + +/***/ }), + +/***/ "./src/templates/GlobalVariableTemplate2.ts": +/*!**************************************************!*\ + !*** ./src/templates/GlobalVariableTemplate2.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function GlobalVariableTemplate2() { + return ` + const getGlobal = function () { + let globalObject; + + try { + globalObject = Function('return (function() ' + '{}.constructor("return this")( )' + ');')(); + } catch (e) { + globalObject = window; + } + + return globalObject; + }; + const that = getGlobal(); + `; +} +exports.GlobalVariableTemplate2 = GlobalVariableTemplate2; + + +/***/ }), + +/***/ "./src/templates/Rc4Template.ts": +/*!**************************************!*\ + !*** ./src/templates/Rc4Template.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function Rc4Template() { + return ` + const rc4 = function (str, key) { + let s = [], j = 0, x, res = '', newStr = ''; + + str = atob(str); + + for (let k = 0, length = str.length; k < length; k++) { + newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2); + } + + str = decodeURIComponent(newStr); + + let i; + + for (i = 0; i < 256; i++) { + s[i] = i; + } + + for (i = 0; i < 256; i++) { + j = (j + s[i] + key.charCodeAt(i % key.length)) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + } + + i = 0; + j = 0; + + for (let y = 0; y < str.length; y++) { + i = (i + 1) % 256; + j = (j + s[i]) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]); + } + + return res; + } + `; +} +exports.Rc4Template = Rc4Template; + + +/***/ }), + +/***/ "./src/templates/SingleNodeCallControllerTemplate.ts": +/*!***********************************************************!*\ + !*** ./src/templates/SingleNodeCallControllerTemplate.ts ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function SingleNodeCallControllerTemplate() { + return ` + const {singleNodeCallControllerFunctionName} = (function(){ + let firstCall = true; + + return function (context, fn){ + const rfn = firstCall ? function(){ + if(fn){ + const res = fn.apply(context, arguments); + fn = null; + return res; + } + } : function(){} + + firstCall = false; + + return rfn; + } + })(); + `; +} +exports.SingleNodeCallControllerTemplate = SingleNodeCallControllerTemplate; + + +/***/ }), + +/***/ "./src/templates/console-output-nodes/console-output-disable-expression-node/ConsoleOutputDisableExpressionTemplate.ts": +/*!*****************************************************************************************************************************!*\ + !*** ./src/templates/console-output-nodes/console-output-disable-expression-node/ConsoleOutputDisableExpressionTemplate.ts ***! + \*****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function ConsoleOutputDisableExpressionTemplate() { + return ` + const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () { + const func = function () {}; + + {globalVariableTemplate} + + if (!that.console) { + that.console = (function (func){ + const c = {}; + + c.log = func; + c.warn = func; + c.debug = func; + c.info = func; + c.error = func; + c.exception = func; + c.table = func; + c.trace = func; + + return c; + })(func); + } else { + that.console.log = func; + that.console.warn = func; + that.console.debug = func; + that.console.info = func; + that.console.error = func; + that.console.exception = func; + that.console.table = func; + that.console.trace = func; + } + }); + + {consoleLogDisableFunctionName}(); + `; +} +exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-call-node/DebugProtectionFunctionCallTemplate.ts": +/*!*************************************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-call-node/DebugProtectionFunctionCallTemplate.ts ***! + \*************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebugProtectionFunctionCallTemplate() { + return ` + (function () { + {singleNodeCallControllerFunctionName}( + this, + function () { + const regExp1 = new RegExp('function *\\\\( *\\\\)'); + const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i'); + + const result = {debugProtectionFunctionName}('init'); + + if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) { + result('0'); + } else { + {debugProtectionFunctionName}(); + } + } + )(); + })(); + `; +} +exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts": +/*!*********************************************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts ***! + \*********************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebugProtectionFunctionIntervalTemplate() { + return ` + setInterval(function () { + {debugProtectionFunctionName}(); + }, 4000); + `; +} +exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts": +/*!****************************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebugProtectionFunctionTemplate() { + return ` + function {debugProtectionFunctionName} (ret) { + function debuggerProtection (counter) { + + {debuggerTemplate} + + debuggerProtection(++counter); + } + + try { + if (ret) { + return debuggerProtection; + } else { + debuggerProtection(0); + } + } catch (y) {} + } + `; +} +exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplate.ts": +/*!*************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplate.ts ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebuggerTemplate() { + return ` + if (typeof counter === 'string') { + return (function (arg) {}.constructor('while (true) {}').apply('counter')); + } else { + if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) { + (function () {return true;}.constructor('debu' + 'gger').call('action')); + } else { + (function () {return false;}.constructor('debu' + 'gger').apply('stateObject')); + } + + } + `; +} +exports.DebuggerTemplate = DebuggerTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplateNoEval.ts": +/*!*******************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplateNoEval.ts ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebuggerTemplateNoEval() { + return ` + if (typeof counter === 'string') { + const func = function () { + while (true) {} + }; + + return func(); + } else { + if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) { + debugger; + } else { + debugger; + } + + } + `; +} +exports.DebuggerTemplateNoEval = DebuggerTemplateNoEval; + + +/***/ }), + +/***/ "./src/templates/domain-lock-nodes/domain-lock-node/DomainLockNodeTemplate.ts": +/*!************************************************************************************!*\ + !*** ./src/templates/domain-lock-nodes/domain-lock-node/DomainLockNodeTemplate.ts ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DomainLockNodeTemplate() { + return ` + const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () { + + {globalVariableTemplate} + + const func = function () { + return { + key: 'item', + value: 'attribute', + getAttribute: function () { + for (let i = 0; i < 1000; i--) { + const isPositive = i > 0; + + switch (isPositive) { + case true: + return this.item + '_' + this.value + '_' + i; + default: + this.item + '_' + this.value; + } + } + }() + }; + }; + + const regExp = new RegExp("[{diff}]", "g"); + const domains = "{domains}".replace(regExp, "").split(";"); + let document; + let domain; + let location; + let hostname; + + for (let d in that) { + if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) { + document = d; + + break; + } + } + + for (let d1 in that[document]) { + if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) { + domain = d1; + + break; + } + } + + if (!("~" > domain)) { + for (let d2 in that[document]) { + if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) { + location = d2; + + break; + } + } + + for (let d3 in that[document][location]) { + if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) { + hostname = d3; + + break; + } + } + } + + if (!document || !that[document]) { + return; + } + + const documentDomain = that[document][domain]; + const documentLocationHostName = !!that[document][location] && that[document][location][hostname]; + const currentDomain = documentDomain || documentLocationHostName; + + if (!currentDomain) { + return; + } + + let ok = false; + + for (let i = 0; i < domains.length; i++) { + const domain = domains[i]; + const position = currentDomain.length - domain.length; + const lastIndex = currentDomain.indexOf(domain, position); + const endsWith = lastIndex !== -1 && lastIndex === position; + + if (endsWith) { + if (currentDomain.length == domain.length || domain.indexOf(".") === 0) { + ok = true; + } + } + } + + if (!ok) { + data; + } else { + return; + } + + func(); + }); + + {domainLockFunctionName}(); + `; +} +exports.DomainLockNodeTemplate = DomainLockNodeTemplate; + + +/***/ }), + +/***/ "./src/templates/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts": +/*!*************************************************************************************************!*\ + !*** ./src/templates/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function SelfDefendingTemplate(escapeSequenceEncoder) { + return ` + const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () { + const func1 = function(){return 'dev';}, + func2 = function () { + return 'window'; + }; + + const test1 = function () { + const regExp = new RegExp('${escapeSequenceEncoder.encode('\\w+ *\\(\\) *{\\w+ *[\'|"].+[\'|"];? *}', true)}'); + + return !regExp.test(func1.toString()); + }; + + const test2 = function () { + const regExp = new RegExp('${escapeSequenceEncoder.encode('(\\\\[x|u](\\w){2,4})+', true)}'); + + return regExp.test(func2.toString()); + }; + + const recursiveFunc1 = function (string) { + const i = ~-1 >> 1 + 255 % 0; + + if (string.indexOf('i' === i)) { + recursiveFunc2(string) + } + }; + + const recursiveFunc2 = function (string) { + const i = ~-4 >> 1 + 255 % 0; + + if (string.indexOf((true+"")[3]) !== i) { + recursiveFunc1(string) + } + }; + + if (!test1()) { + if (!test2()) { + recursiveFunc1('indеxOf'); + } else { + recursiveFunc1('indexOf'); + } + } else { + recursiveFunc1('indеxOf'); + } + }) + + {selfDefendingFunctionName}(); + `; +} +exports.SelfDefendingTemplate = SelfDefendingTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-calls-wrapper/SelfDefendingTemplate.ts": +/*!**********************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-calls-wrapper/SelfDefendingTemplate.ts ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function SelfDefendingTemplate(randomGenerator, escapeSequenceEncoder) { + const identifierLength = 6; + const rc4BytesIdentifier = randomGenerator.getRandomString(identifierLength); + const statesIdentifier = randomGenerator.getRandomString(identifierLength); + const newStateIdentifier = randomGenerator.getRandomString(identifierLength); + const firstStateIdentifier = randomGenerator.getRandomString(identifierLength); + const secondStateIdentifier = randomGenerator.getRandomString(identifierLength); + const checkStateIdentifier = randomGenerator.getRandomString(identifierLength); + const runStateIdentifier = randomGenerator.getRandomString(identifierLength); + const getStateIdentifier = randomGenerator.getRandomString(identifierLength); + const stateResultIdentifier = randomGenerator.getRandomString(identifierLength); + return ` + const StatesClass = function (${rc4BytesIdentifier}) { + this.${rc4BytesIdentifier} = ${rc4BytesIdentifier}; + this.${statesIdentifier} = [1, 0, 0]; + this.${newStateIdentifier} = function(){return 'newState';}; + this.${firstStateIdentifier} = '${escapeSequenceEncoder.encode('\\w+ *\\(\\) *{\\w+ *', true)}'; + this.${secondStateIdentifier} = '${escapeSequenceEncoder.encode('[\'|"].+[\'|"];? *}', true)}'; + }; + + StatesClass.prototype.${checkStateIdentifier} = function () { + const regExp = new RegExp(this.${firstStateIdentifier} + this.${secondStateIdentifier}); + const expression = regExp.test(this.${newStateIdentifier}.toString()) + ? --this.${statesIdentifier}[1] + : --this.${statesIdentifier}[0]; + + return this.${runStateIdentifier}(expression); + }; + + StatesClass.prototype.${runStateIdentifier} = function (${stateResultIdentifier}) { + if (!Boolean(~${stateResultIdentifier})) { + return ${stateResultIdentifier}; + } + + return this.${getStateIdentifier}(this.${rc4BytesIdentifier}); + }; + + StatesClass.prototype.${getStateIdentifier} = function (${rc4BytesIdentifier}) { + for (let i = 0, len = this.${statesIdentifier}.length; i < len; i++) { + this.${statesIdentifier}.push(Math.round(Math.random())); + len = this.${statesIdentifier}.length; + } + + return ${rc4BytesIdentifier}(this.${statesIdentifier}[0]); + }; + + new StatesClass({stringArrayCallsWrapperName}).${checkStateIdentifier}(); + `; +} +exports.SelfDefendingTemplate = SelfDefendingTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayBase64DecodeNodeTemplate.ts": +/*!************************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayBase64DecodeNodeTemplate.ts ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayBase64DecodeNodeTemplate(randomGenerator) { + const identifierLength = 6; + const initializedIdentifier = randomGenerator.getRandomString(identifierLength); + const base64DecodeFunctionIdentifier = randomGenerator.getRandomString(identifierLength); + const dataIdentifier = randomGenerator.getRandomString(identifierLength); + return ` + if ({stringArrayCallsWrapperName}.${initializedIdentifier} === undefined) { + {atobPolyfill} + + {stringArrayCallsWrapperName}.${base64DecodeFunctionIdentifier} = function (str) { + const string = atob(str); + let newStringChars = []; + + for (let i = 0, length = string.length; i < length; i++) { + newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2); + } + + return decodeURIComponent(newStringChars); + }; + + {stringArrayCallsWrapperName}.${dataIdentifier} = {}; + + {stringArrayCallsWrapperName}.${initializedIdentifier} = true; + } + + const cachedValue = {stringArrayCallsWrapperName}.${dataIdentifier}[index]; + + if (cachedValue === undefined) { + {selfDefendingCode} + + value = {stringArrayCallsWrapperName}.${base64DecodeFunctionIdentifier}(value); + {stringArrayCallsWrapperName}.${dataIdentifier}[index] = value; + } else { + value = cachedValue; + } + `; +} +exports.StringArrayBase64DecodeNodeTemplate = StringArrayBase64DecodeNodeTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayCallsWrapperTemplate.ts": +/*!********************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayCallsWrapperTemplate.ts ***! + \********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayCallsWrapperTemplate() { + return ` + const {stringArrayCallsWrapperName} = function (index, key) { + index = index - 0; + + let value = {stringArrayName}[index]; + + {decodeNodeTemplate} + + return value; + }; + `; +} +exports.StringArrayCallsWrapperTemplate = StringArrayCallsWrapperTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayRC4DecodeNodeTemplate.ts": +/*!*********************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayRC4DecodeNodeTemplate.ts ***! + \*********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayRc4DecodeNodeTemplate(randomGenerator) { + const identifierLength = 6; + const initializedIdentifier = randomGenerator.getRandomString(identifierLength); + const rc4Identifier = randomGenerator.getRandomString(identifierLength); + const dataIdentifier = randomGenerator.getRandomString(identifierLength); + const onceIdentifier = randomGenerator.getRandomString(identifierLength); + return ` + if ({stringArrayCallsWrapperName}.${initializedIdentifier} === undefined) { + {atobPolyfill} + + {rc4Polyfill} + {stringArrayCallsWrapperName}.${rc4Identifier} = rc4; + + {stringArrayCallsWrapperName}.${dataIdentifier} = {}; + + {stringArrayCallsWrapperName}.${initializedIdentifier} = true; + } + + const cachedValue = {stringArrayCallsWrapperName}.${dataIdentifier}[index]; + + if (cachedValue === undefined) { + if ({stringArrayCallsWrapperName}.${onceIdentifier} === undefined) { + {selfDefendingCode} + + {stringArrayCallsWrapperName}.${onceIdentifier} = true; + } + + value = {stringArrayCallsWrapperName}.${rc4Identifier}(value, key); + {stringArrayCallsWrapperName}.${dataIdentifier}[index] = value; + } else { + value = cachedValue; + } + `; +} +exports.StringArrayRc4DecodeNodeTemplate = StringArrayRc4DecodeNodeTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-node/StringArrayTemplate.ts": +/*!***********************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-node/StringArrayTemplate.ts ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayTemplate() { + return ` + const {stringArrayName} = [{stringArray}]; + `; +} +exports.StringArrayTemplate = StringArrayTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-rotate-function-node/SelfDefendingTemplate.ts": +/*!*****************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-rotate-function-node/SelfDefendingTemplate.ts ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function SelfDefendingTemplate(escapeSequenceEncoder) { + return ` + const selfDefendingFunc = function () { + const object = { + data: { + key: 'cookie', + value: 'timeout' + }, + setCookie: function (options, name, value, document) { + document = document || {}; + + let updatedCookie = name + "=" + value; + let i = 0; + + for (let i = 0, len = options.length; i < len; i++) { + const propName = options[i]; + + updatedCookie += "; " + propName; + + const propValue = options[propName]; + + options.push(propValue); + len = options.length; + + if (propValue !== true) { + updatedCookie += "=" + propValue; + } + } + + document['cookie'] = updatedCookie; + }, + removeCookie: function(){return 'dev';}, + getCookie: function (document, name) { + document = document || function (value) { return value }; + const matches = document(new RegExp( + "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" + )); + + const func = function (param1, param2) { + param1(++param2); + }; + + func({whileFunctionName}, {timesName}); + + return matches ? decodeURIComponent(matches[1]) : undefined; + } + }; + + const test1 = function () { + const regExp = new RegExp('${escapeSequenceEncoder.encode('\\w+ *\\(\\) *{\\w+ *[\'|"].+[\'|"];? *}', true)}'); + + return regExp.test(object.removeCookie.toString()); + }; + + object['updateCookie'] = test1; + + let cookie = ''; + const result = object['updateCookie'](); + + if (!result) { + object['setCookie'](['*'], 'counter', 1); + } else if (result) { + cookie = object['getCookie'](null, 'counter'); + } else { + object['removeCookie'](); + } + }; + + selfDefendingFunc(); + `; +} +exports.SelfDefendingTemplate = SelfDefendingTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-rotate-function-node/StringArrayRotateFunctionTemplate.ts": +/*!*****************************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-rotate-function-node/StringArrayRotateFunctionTemplate.ts ***! + \*****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayRotateFunctionTemplate() { + return ` + (function (array, {timesName}) { + const {whileFunctionName} = function (times) { + while (--times) { + array['push'](array['shift']()); + } + }; + + {code} + })({stringArrayName}, 0x{stringArrayRotationAmount}); + `; +} +exports.StringArrayRotateFunctionTemplate = StringArrayRotateFunctionTemplate; + + +/***/ }), + +/***/ "./src/types/container/calls-graph-analyzer/TCalleeDataExtractorFactory.ts": +/*!*********************************************************************************!*\ + !*** ./src/types/container/calls-graph-analyzer/TCalleeDataExtractorFactory.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts": +/*!***************************************************************************!*\ + !*** ./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TCustomNodeFactory.ts": +/*!****************************************************************!*\ + !*** ./src/types/container/custom-nodes/TCustomNodeFactory.ts ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TCustomNodeGroupFactory.ts": +/*!*********************************************************************!*\ + !*** ./src/types/container/custom-nodes/TCustomNodeGroupFactory.ts ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TDeadNodeInjectionCustomNodeFactory.ts": +/*!*********************************************************************************!*\ + !*** ./src/types/container/custom-nodes/TDeadNodeInjectionCustomNodeFactory.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TObjectExpressionKeysTransformerCustomNodeFactory.ts": +/*!***********************************************************************************************!*\ + !*** ./src/types/container/custom-nodes/TObjectExpressionKeysTransformerCustomNodeFactory.ts ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts": +/*!****************************************************************************!*\ + !*** ./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TControlFlowReplacerFactory.ts": +/*!******************************************************************************!*\ + !*** ./src/types/container/node-transformers/TControlFlowReplacerFactory.ts ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TControlFlowStorageFactory.ts": +/*!*****************************************************************************!*\ + !*** ./src/types/container/node-transformers/TControlFlowStorageFactory.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts": +/*!****************************************************************************************!*\ + !*** ./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TLiteralObfuscatingReplacerFactory.ts": +/*!*************************************************************************************!*\ + !*** ./src/types/container/node-transformers/TLiteralObfuscatingReplacerFactory.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TNodeTransformerFactory.ts": +/*!**************************************************************************!*\ + !*** ./src/types/container/node-transformers/TNodeTransformerFactory.ts ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TObfuscatingGuardFactory.ts": +/*!***************************************************************************!*\ + !*** ./src/types/container/node-transformers/TObfuscatingGuardFactory.ts ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TObjectExpressionExtractorFactory.ts": +/*!************************************************************************************!*\ + !*** ./src/types/container/node-transformers/TObjectExpressionExtractorFactory.ts ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/source-code/TObfuscatedCodeFactory.ts": +/*!*******************************************************************!*\ + !*** ./src/types/container/source-code/TObfuscatedCodeFactory.ts ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/options/TInputCLIOptions.ts": +/*!***********************************************!*\ + !*** ./src/types/options/TInputCLIOptions.ts ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/options/TInputOptions.ts": +/*!********************************************!*\ + !*** ./src/types/options/TInputOptions.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/options/TStringArrayEncoding.ts": +/*!***************************************************!*\ + !*** ./src/types/options/TStringArrayEncoding.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/storages/TControlFlowStorage.ts": +/*!***************************************************!*\ + !*** ./src/types/storages/TControlFlowStorage.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/storages/TCustomNodeGroupStorage.ts": +/*!*******************************************************!*\ + !*** ./src/types/storages/TCustomNodeGroupStorage.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/utils/ArrayUtils.ts": +/*!*********************************!*\ + !*** ./src/utils/ArrayUtils.ts ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let ArrayUtils = class ArrayUtils { + constructor(randomGenerator) { + this.randomGenerator = randomGenerator; + } + createWithRange(length) { + const range = []; + for (let i = 0; i < length; i++) { + range.push(i); + } + return range; + } + findMostOccurringElement(array) { + var _a; + const arrayLength = array.length; + if (!arrayLength) { + return null; + } + const elementsMap = {}; + let mostOccurringElement = array[0]; + let mostOccurringElementCount = 1; + for (const element of array) { + const currentElementCount = (_a = elementsMap[element]) !== null && _a !== void 0 ? _a : 0; + const updatedElementCount = currentElementCount + 1; + if (updatedElementCount > mostOccurringElementCount) { + mostOccurringElement = element; + mostOccurringElementCount = updatedElementCount; + } + elementsMap[element] = updatedElementCount; + } + return mostOccurringElement; + } + rotate(array, times) { + if (!array.length) { + throw new ReferenceError('Cannot rotate empty array.'); + } + if (times <= 0) { + return array; + } + const newArray = array; + let temp; + while (times--) { + temp = newArray.pop(); + if (temp) { + newArray.unshift(temp); + } + } + return newArray; + } + shuffle(array) { + const shuffledArray = [...array]; + for (let i = shuffledArray.length; i; i--) { + const j = Math.floor(this.randomGenerator.getMathRandom() * i); + [shuffledArray[i - 1], shuffledArray[j]] = [shuffledArray[j], shuffledArray[i - 1]]; + } + return shuffledArray; + } +}; +ArrayUtils = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object]) +], ArrayUtils); +exports.ArrayUtils = ArrayUtils; + + +/***/ }), + +/***/ "./src/utils/CryptUtils.ts": +/*!*********************************!*\ + !*** ./src/utils/CryptUtils.ts ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const RandomGenerator_1 = __webpack_require__(/*! ./RandomGenerator */ "./src/utils/RandomGenerator.ts"); +const Utils_1 = __webpack_require__(/*! ./Utils */ "./src/utils/Utils.ts"); +let CryptUtils = class CryptUtils { + constructor(randomGenerator) { + this.randomGenerator = randomGenerator; + } + btoa(string) { + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + let output = ''; + string = encodeURIComponent(string).replace(/%([0-9A-F]{2})/g, (match, p1) => { + return String.fromCharCode(parseInt(`${Utils_1.Utils.hexadecimalPrefix}${p1}`, 16)); + }); + for (let block, charCode, idx = 0, map = chars; string.charAt(idx | 0) || (map = '=', idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { + charCode = string.charCodeAt(idx += 3 / 4); + if (charCode > 0xFF) { + throw new Error('\'btoa\' failed: The string to be encoded contains characters outside of the Latin1 range.'); + } + block = block << 8 | charCode; + } + return output; + } + hideString(str, length) { + const escapeRegExp = (s) => s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + const randomMerge = (s1, s2) => { + let i1 = -1; + let i2 = -1; + let result = ''; + while (i1 < s1.length || i2 < s2.length) { + if (this.randomGenerator.getMathRandom() < 0.5 && i2 < s2.length) { + result += s2.charAt(++i2); + } + else { + result += s1.charAt(++i1); + } + } + return result; + }; + const randomString = this.randomGenerator.getRandomGenerator().string({ + length: length, + pool: RandomGenerator_1.RandomGenerator.randomGeneratorPool + }); + let randomStringDiff = randomString.replace(new RegExp(`[${escapeRegExp(str)}]`, 'g'), ''); + const randomStringDiffArray = randomStringDiff.split(''); + this.randomGenerator.getRandomGenerator().shuffle(randomStringDiffArray); + randomStringDiff = randomStringDiffArray.join(''); + return [randomMerge(str, randomStringDiff), randomStringDiff]; + } + rc4(string, key) { + const s = []; + let j = 0; + let x; + let result = ''; + for (var i = 0; i < 256; i++) { + s[i] = i; + } + for (i = 0; i < 256; i++) { + j = (j + s[i] + key.charCodeAt(i % key.length)) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + } + i = 0; + j = 0; + for (let y = 0; y < string.length; y++) { + i = (i + 1) % 256; + j = (j + s[i]) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + result += String.fromCharCode(string.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]); + } + return result; + } +}; +CryptUtils = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object]) +], CryptUtils); +exports.CryptUtils = CryptUtils; + + +/***/ }), + +/***/ "./src/utils/EscapeSequenceEncoder.ts": +/*!********************************************!*\ + !*** ./src/utils/EscapeSequenceEncoder.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +let EscapeSequenceEncoder = class EscapeSequenceEncoder { + constructor() { + this.stringsCache = new Map(); + } + encode(string, encodeAllSymbols) { + const cacheKey = `${string}-${String(encodeAllSymbols)}`; + if (this.stringsCache.has(cacheKey)) { + return this.stringsCache.get(cacheKey); + } + const radix = 16; + const replaceRegExp = new RegExp('[\\s\\S]', 'g'); + const escapeSequenceRegExp = new RegExp('[\'\"\\\\\\s]'); + const regExp = new RegExp('[\\x00-\\x7F]'); + let prefix; + let template; + const result = string.replace(replaceRegExp, (character) => { + if (!encodeAllSymbols && !escapeSequenceRegExp.exec(character)) { + return character; + } + if (regExp.exec(character)) { + prefix = '\\x'; + template = '00'; + } + else { + prefix = '\\u'; + template = '0000'; + } + return `${prefix}${(template + character.charCodeAt(0).toString(radix)).slice(-template.length)}`; + }); + this.stringsCache.set(cacheKey, result); + this.stringsCache.set(`${result}-${String(encodeAllSymbols)}`, result); + return result; + } +}; +EscapeSequenceEncoder = __decorate([ + inversify_1.injectable() +], EscapeSequenceEncoder); +exports.EscapeSequenceEncoder = EscapeSequenceEncoder; + + +/***/ }), + +/***/ "./src/utils/LevelledTopologicalSorter.ts": +/*!************************************************!*\ + !*** ./src/utils/LevelledTopologicalSorter.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +let LevelledTopologicalSorter = class LevelledTopologicalSorter { + constructor() { + this.graph = new Map(); + } + add(precedent, consequent = null) { + if (consequent !== null) { + return this.link(precedent, consequent); + } + return this.register(precedent); + } + sort() { + const consequents = Array.from(this.graph.keys()); + const results = []; + const marks = {}; + for (const consequent of consequents) { + if (marks[consequent] !== undefined) { + continue; + } + this.visit(results, marks, consequent); + } + return results; + } + sortByGroups() { + this.sort(); + const resultItemsGroups = []; + while (this.hasNodes()) { + const rootNodes = this.findRootNodes(); + resultItemsGroups.push(rootNodes); + for (const rootNode of rootNodes) { + this.delete(rootNode); + } + } + return resultItemsGroups; + } + delete(consequent) { + const precedents = this.getPrecedents(consequent); + if (precedents.length) { + throw new Error(`Unable to remove non-root node: ${consequent}`); + } + this.graph.delete(consequent); + const precedentsGroups = Array.from(this.graph.values()); + for (const precedentsGroup of precedentsGroups) { + const precedentsCount = precedentsGroup.length - 1; + for (let index = precedentsCount; index >= 0; index = index - 1) { + if (precedentsGroup[index] !== consequent) { + continue; + } + precedentsGroup.splice(index, 1); + } + } + } + findRootNodes() { + const consequents = Array.from(this.graph.keys()); + const rootNodes = []; + for (const consequent of consequents) { + if (!this.hasPrecedents(consequent)) { + rootNodes.push(consequent); + } + } + return rootNodes; + } + getPrecedents(consequent) { + const precedents = this.graph.get(consequent); + if (!precedents) { + throw new Error(`Unknown node: ${consequent}`); + } + return precedents; + } + hasNodes() { + return this.graph.size > 0; + } + hasPrecedents(consequent) { + return this.getPrecedents(consequent).length > 0; + } + link(precedent, consequent) { + this.register(precedent); + this.register(consequent); + const target = this.graph.get(consequent); + if (target && !target.includes(precedent)) { + target.push(precedent); + } + return this; + } + register(name) { + if (!this.graph.has(name)) { + this.graph.set(name, []); + } + return this; + } + visit(results, marks, name) { + const mark = marks[name]; + if (mark === 'visiting') { + throw new Error(`Detected cycle involving node: ${name}`); + } + if (mark) { + return; + } + marks[name] = 'visiting'; + const precedents = this.getPrecedents(name); + for (const precedent of precedents) { + this.visit(results, marks, precedent); + } + marks[name] = 'ok'; + results.push(name); + return; + } +}; +LevelledTopologicalSorter = __decorate([ + inversify_1.injectable() +], LevelledTopologicalSorter); +exports.LevelledTopologicalSorter = LevelledTopologicalSorter; + + +/***/ }), + +/***/ "./src/utils/NodeTransformerNamesGroupsBuilder.ts": +/*!********************************************************!*\ + !*** ./src/utils/NodeTransformerNamesGroupsBuilder.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ILevelledTopologicalSorter_1 = __webpack_require__(/*! ../interfaces/utils/ILevelledTopologicalSorter */ "./src/interfaces/utils/ILevelledTopologicalSorter.ts"); +let NodeTransformerNamesGroupsBuilder = class NodeTransformerNamesGroupsBuilder { + constructor(levelledTopologicalSorter) { + this.levelledTopologicalSorter = levelledTopologicalSorter; + } + build(normalizedNodeTransformers) { + const nodeTransformerNames = Object.keys(normalizedNodeTransformers); + const relationEdges = this.buildNodeTransformersRelationEdges(nodeTransformerNames, normalizedNodeTransformers); + for (const [precedent, consequent] of relationEdges) { + this.levelledTopologicalSorter.add(precedent, consequent); + } + return this.levelledTopologicalSorter.sortByGroups(); + } + buildNodeTransformersRelationEdges(nodeTransformerNames, normalizedNodeTransformers) { + const relationEdges = []; + for (const nodeTransformerName of nodeTransformerNames) { + const nodeTransformer = normalizedNodeTransformers[nodeTransformerName]; + const runAfterRelations = nodeTransformer.runAfter; + if (!runAfterRelations || !runAfterRelations.length) { + relationEdges.push([nodeTransformerName, null]); + continue; + } + for (const runAfterRelation of runAfterRelations) { + const isUnknownRelation = normalizedNodeTransformers[runAfterRelation] === undefined; + if (isUnknownRelation) { + relationEdges.push([nodeTransformerName, null]); + continue; + } + relationEdges.push([runAfterRelation, nodeTransformerName]); + } + } + return relationEdges; + } +}; +NodeTransformerNamesGroupsBuilder = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ILevelledTopologicalSorter)), + __metadata("design:paramtypes", [typeof (_a = typeof ILevelledTopologicalSorter_1.ILevelledTopologicalSorter !== "undefined" && ILevelledTopologicalSorter_1.ILevelledTopologicalSorter) === "function" ? _a : Object]) +], NodeTransformerNamesGroupsBuilder); +exports.NodeTransformerNamesGroupsBuilder = NodeTransformerNamesGroupsBuilder; + + +/***/ }), + +/***/ "./src/utils/NumberUtils.ts": +/*!**********************************!*\ + !*** ./src/utils/NumberUtils.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class NumberUtils { + static toHex(dec) { + const radix = 16; + return dec.toString(radix); + } + static isCeil(number) { + return number % 1 === 0; + } +} +exports.NumberUtils = NumberUtils; + + +/***/ }), + +/***/ "./src/utils/RandomGenerator.ts": +/*!**************************************!*\ + !*** ./src/utils/RandomGenerator.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var RandomGenerator_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const md5_1 = __importDefault(__webpack_require__(/*! md5 */ "md5")); +const chance_1 = __webpack_require__(/*! chance */ "chance"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const ISourceCode_1 = __webpack_require__(/*! ../interfaces/source-code/ISourceCode */ "./src/interfaces/source-code/ISourceCode.ts"); +const Initializable_1 = __webpack_require__(/*! ../decorators/Initializable */ "./src/decorators/Initializable.ts"); +let RandomGenerator = RandomGenerator_1 = class RandomGenerator { + constructor(sourceCode, options) { + this.sourceCode = sourceCode; + this.options = options; + } + initialize() { + this.randomGenerator = new chance_1.Chance(this.getRawSeed()); + } + getMathRandom() { + return this.getRandomInteger(0, 99999) / 100000; + } + getRandomGenerator() { + return this.randomGenerator; + } + getRandomInteger(min, max) { + return this.getRandomGenerator().integer({ + min: min, + max: max + }); + } + getRandomString(length, pool = RandomGenerator_1.randomGeneratorPool) { + return this.getRandomGenerator().string({ length, pool }); + } + getInputSeed() { + return this.options.seed.toString(); + } + getRawSeed() { + const inputSeed = this.getInputSeed(); + const inputSeedParts = `${inputSeed}`.split('|'); + if (inputSeedParts.length > 1) { + return inputSeed; + } + const sourceCodeMD5Hash = md5_1.default(this.sourceCode.getSourceCode()); + return `${inputSeed}|${sourceCodeMD5Hash}`; + } +}; +RandomGenerator.randomGeneratorPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof chance_1.Chance !== "undefined" && chance_1.Chance.Chance) === "function" ? _a : Object) +], RandomGenerator.prototype, "randomGenerator", void 0); +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], RandomGenerator.prototype, "initialize", null); +RandomGenerator = RandomGenerator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ISourceCode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof ISourceCode_1.ISourceCode !== "undefined" && ISourceCode_1.ISourceCode) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], RandomGenerator); +exports.RandomGenerator = RandomGenerator; + + +/***/ }), + +/***/ "./src/utils/Utils.ts": +/*!****************************!*\ + !*** ./src/utils/Utils.ts ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class Utils { + static extractDomainFrom(url) { + let domain; + if (url.includes('://') || url.indexOf('//') === 0) { + domain = url.split('/')[2]; + } + else { + domain = url.split('/')[0]; + } + domain = domain.split(':')[0]; + return domain; + } +} +exports.Utils = Utils; +Utils.hexadecimalPrefix = '0x'; + + +/***/ }), + +/***/ "@gradecam/tsenum": +/*!***********************************!*\ + !*** external "@gradecam/tsenum" ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("@gradecam/tsenum"); + +/***/ }), + +/***/ "acorn": +/*!************************!*\ + !*** external "acorn" ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("acorn"); + +/***/ }), + +/***/ "acorn-import-meta": +/*!************************************!*\ + !*** external "acorn-import-meta" ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("acorn-import-meta"); + +/***/ }), + +/***/ "chalk": +/*!************************!*\ + !*** external "chalk" ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("chalk"); + +/***/ }), + +/***/ "chance": +/*!*************************!*\ + !*** external "chance" ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("chance"); + +/***/ }), + +/***/ "class-validator": +/*!**********************************!*\ + !*** external "class-validator" ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("class-validator"); + +/***/ }), + +/***/ "commander": +/*!****************************!*\ + !*** external "commander" ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("commander"); + +/***/ }), + +/***/ "escodegen": +/*!****************************!*\ + !*** external "escodegen" ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("escodegen"); + +/***/ }), + +/***/ "eslint-scope": +/*!*******************************!*\ + !*** external "eslint-scope" ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("eslint-scope"); + +/***/ }), + +/***/ "estraverse": +/*!*****************************!*\ + !*** external "estraverse" ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("estraverse"); + +/***/ }), + +/***/ "eventemitter3": +/*!********************************!*\ + !*** external "eventemitter3" ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("eventemitter3"); + +/***/ }), + +/***/ "fast-deep-equal": +/*!**********************************!*\ + !*** external "fast-deep-equal" ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("fast-deep-equal"); + +/***/ }), + +/***/ "fs": +/*!*********************!*\ + !*** external "fs" ***! + \*********************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("fs"); + +/***/ }), + +/***/ "inversify": +/*!****************************!*\ + !*** external "inversify" ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("inversify"); + +/***/ }), + +/***/ "js-string-escape": +/*!***********************************!*\ + !*** external "js-string-escape" ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("js-string-escape"); + +/***/ }), + +/***/ "md5": +/*!**********************!*\ + !*** external "md5" ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("md5"); + +/***/ }), + +/***/ "mkdirp": +/*!*************************!*\ + !*** external "mkdirp" ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("mkdirp"); + +/***/ }), + +/***/ "multimatch": +/*!*****************************!*\ + !*** external "multimatch" ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("multimatch"); + +/***/ }), + +/***/ "path": +/*!***********************!*\ + !*** external "path" ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("path"); + +/***/ }), + +/***/ "reflect-metadata": +/*!***********************************!*\ + !*** external "reflect-metadata" ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("reflect-metadata"); + +/***/ }), + +/***/ "string-template": +/*!**********************************!*\ + !*** external "string-template" ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("string-template"); + +/***/ }) + +/******/ }); //# sourceMappingURL=index.cli.js.map \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 7d2c9712..d602f8f1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -21,5 +21,13122 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -require("source-map-support").install(),module.exports=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=240)}([function(e,t){e.exports=require("inversify")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(33);class n{static isArrayPatternNode(e){return e.type===o.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===o.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===o.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===o.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===o.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===o.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===o.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===o.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===o.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===o.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===o.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===o.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===o.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return n.isFunctionDeclarationNode(e)||n.isFunctionExpressionNode(e)||n.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===o.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===o.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===o.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===o.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===o.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const r=n.isLabeledStatementNode(t)&&t.label===e,o=n.isContinueStatementNode(t)&&t.label===e,i=n.isBreakStatementNode(t)&&t.label===e;return r||o||i}static isLabeledStatementNode(e){return e.type===o.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===o.NodeType.Literal}static isMemberExpressionNode(e){return e.type===o.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===o.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return n.isProgramNode(e)||n.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return n.isNodeWithLexicalScope(e)||n.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return n.isProgramNode(e)||n.isBlockStatementNode(e)&&n.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return n.isProgramNode(e)||n.isBlockStatementNode(e)||n.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===o.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===o.NodeType.ObjectExpression}static isProgramNode(e){return e.type===o.NodeType.Program}static isPropertyNode(e){return e.type===o.NodeType.Property}static parentNodeIsPropertyNode(e,t){return n.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return n.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return n.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===o.NodeType.RestElement}static isReturnStatementNode(e){return e.type===o.NodeType.ReturnStatement}static isSuperNode(e){return e.type===o.NodeType.Super}static isSwitchCaseNode(e){return e.type===o.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===o.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===o.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===o.NodeType.UnaryExpression}static isUseStrictOperator(e){return n.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===o.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===o.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===o.NodeType.WhileStatement}}t.NodeGuards=n,n.nodesWithLexicalStatements=[o.NodeType.ArrowFunctionExpression,o.NodeType.FunctionDeclaration,o.NodeType.FunctionExpression,o.NodeType.MethodDefinition]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(46)),i=o(r(13)),a=r(43),s=r(55),c=r(4),d=r(15);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:n.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),c.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+n.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return c.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(r=>{if("parentNode"===r)return;const o=e[r];let n;n=null===o||o instanceof RegExp?o:Array.isArray(o)?o.map(l.cloneRecursive):"object"==typeof o?l.cloneRecursive(o):o,t[r]=n}),t}}t.NodeUtils=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o={configurable:!0,enumerable:!0};function n(e,t,r){Reflect.hasMetadata(e,r)||Reflect.defineMetadata(e,t,r)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(r,i)=>{const a=r[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return n("_initialized",!1,r),n("_initializablePropertiesSet",new Set,r),n("_wrappedMethodsSet",new Set,r),function(e,t){const r=Object.getOwnPropertyNames(e),n=[t,"constructor"];r.forEach(r=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(n.includes(r)||a.has(r)||s.has(r))return;if("function"!=typeof e[r])return;const c=null!==(i=Object.getOwnPropertyDescriptor(e,r))&&void 0!==i?i:o,d=c.value;Object.defineProperty(e,r,Object.assign(Object.assign({},c),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(r)})}(r,e),function(e,t,r){var n;const i=null!==(n=Object.getOwnPropertyDescriptor(e,t))&&void 0!==n?n:o,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[r],e}}))}(r,e,i),function(e,t){var r;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const n=`_${t.toString()}`,i=null!==(r=Object.getOwnPropertyDescriptor(e,n))&&void 0!==r?r:o;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[n])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[n]},set:function(e){this[n]=e}})),i}(r,i)}}},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(46)),i=r(33);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,r){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,r){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,r){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:r,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,r){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},r&&{alternate:r}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:n.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,r){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,r=!1){return{type:i.NodeType.MemberExpression,computed:r,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,r,o){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:r,computed:o,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,r=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:r,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,r=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:r,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),N=r(113),h=r(114);let b=o=class{constructor(e,t,r,o){this.cachedNode=null,this.identifierNamesGenerator=e(o),this.customNodeFormatter=t,this.randomGenerator=r,this.options=o}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(o.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};b.globalVariableTemplateFunctions=[N.GlobalVariableTemplate1(),h.GlobalVariableTemplate2()],b=o=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],b),t.AbstractCustomNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3);let f=class{constructor(e,t){this.randomGenerator=e,this.options=t}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractNodeTransformer=f},function(e,t){e.exports=require("estraverse")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static getParentNodeWithStatements(e){return n.getParentNodesWithStatementsRecursive(e,1)[0]}static getParentNodesWithStatements(e){return n.getParentNodesWithStatementsRecursive(e)}static getNextSiblingStatement(e){return n.getSiblingStatementByOffset(e,1)}static getPreviousSiblingStatement(e){return n.getSiblingStatementByOffset(e,-1)}static getRootStatementOfNode(e){if(o.NodeGuards.isProgramNode(e))throw new Error("Unable to find root statement for `Program` node");const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithStatements(t)?e:n.getRootStatementOfNode(t)}static getScopeOfNode(e){const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithStatements(t)?t:n.getScopeOfNode(t)}static getParentNodesWithStatementsRecursive(e,t=1/0,r=[],i=0){if(r.length>=t)return r;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(o.NodeGuards.isProgramNode(e)||o.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&r.push(e),e!==a?n.getParentNodesWithStatementsRecursive(a,t,r,++i):r}static getSiblingStatementByOffset(e,t){const r=n.getScopeOfNode(e),i=o.NodeGuards.isSwitchCaseNode(r)?r.consequent:r.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static set(e,t){var r;e.metadata=Object.assign(null!==(r=e.metadata)&&void 0!==r?r:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===o.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===o.get(e,"replacedLiteral")}}t.NodeMetadata=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(72),a=r(82),s=r(95),c=r(106),d=r(156),l=r(157),u=r(161),f=r(162),p=r(173),m=r(195),g=r(210),y=r(215),N=r(225),h=r(70),b=r(229),I=r(231),v=r(232),S=r(233);t.InversifyContainerFacade=class{constructor(){this.container=new o.Container}static getFactory(e){return t=>r=>t.container.getNamed(e,r)}static getCacheFactory(e){return t=>{const r=new Map;return o=>{if(r.has(o))return r.get(o);const n=t.container.getNamed(e,o);return r.set(o,n),n}}}static getConstructorFactory(e,...t){return r=>{const o=new Map,n=[];return i=>{if(t.forEach((e,t)=>{n[t]||(n[t]=r.container.get(e))}),o.has(i))return new(o.get(i))(...n);const a=r.container.getNamed(e,i);return o.set(i,a),new a(...n)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,r){this.container.bind(n.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new v.SourceCode(e,t)).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>r).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ILogger).to(h.Logger).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IJavaScriptObfuscator).to(N.JavaScriptObfuscator).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ITransformersRunner).to(S.TransformersRunner).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IObfuscatedCode).to(I.ObfuscatedCode),this.container.bind(n.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,r)=>{const o=e.container.get(n.ServiceIdentifiers.IObfuscatedCode);return o.initialize(t,r),o}),this.container.bind(n.ServiceIdentifiers.IObfuscationEventEmitter).to(b.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(c.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(u.nodeTransformersModule),this.container.load(f.obfuscatingTransformersModule),this.container.load(p.optionsModule),this.container.load(m.preparingTransformersModule),this.container.load(g.storagesModule),this.container.load(y.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static append(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e),...t])}static appendToOptimalBlockScope(e,t,r,o=0){const i=e.length?n.getOptimalBlockScope(e,o):t;n.prepend(i,r)}static getOptimalBlockScope(e,t,r=1/0){const o=e[t];if(r<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return r>1&&o.callsGraph.length?n.getOptimalBlockScope(o.callsGraph,0,--r):o.callee}static insertBefore(e,t,r){const o=n.getScopeStatements(e).indexOf(r);n.insertAtIndex(e,t,o)}static insertAfter(e,t,r){const o=n.getScopeStatements(e).indexOf(r);n.insertAtIndex(e,t,o+1)}static insertAtIndex(e,t,r){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e).slice(0,r),...t,...n.getScopeStatements(e).slice(r)])}static prepend(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...t,...n.getScopeStatements(e)])}static getScopeStatements(e){return o.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){o.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.ObfuscationTarget=o.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.StringArrayEncoding=o.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(69);const o=r(1),n=r(16);class i{static obfuscate(e,t={}){const r=new n.InversifyContainerFacade;r.load(e,"",t);const i=r.get(o.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return r.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.4"?"0.24.4":"unknown"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(5),f=r(2),p=r(3);let m=class{constructor(e,t,r){this.identifierNamesGenerator=e(r),this.randomGenerator=t,this.options=r}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const r=this.customNodes.get(e);r&&t(r)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==u.TIdentifierNamesGeneratorFactory&&u.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],m),t.AbstractCustomNodeGroup=m},function(e,t){e.exports=require("@gradecam/tsenum")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=o,o.hexadecimalPrefix="0x"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.IdentifierNamesGenerator=o.MakeEnum({DictionaryIdentifierNamesGenerator:"dictionary",HexadecimalIdentifierNamesGenerator:"hexadecimal",MangledIdentifierNamesGenerator:"mangled"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.SourceMapMode=o.MakeEnum({Inline:"inline",Separate:"separate"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(31),n=r(20),i=r(32);t.NO_ADDITIONAL_NODES_PRESET=Object.freeze({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!1,seed:0,selfDefending:!1,shuffleStringArray:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:0,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NumberUtils=class{static toHex(e){return e.toString(16)}static isCeil(e){return e%1==0}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(2);let l=class{constructor(e){this.options=e}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IOptions&&d.IOptions)?o:Object])],l),t.AbstractObfuscatingReplacer=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(31),n=r(20),i=r(32);t.DEFAULT_PRESET=Object.freeze({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!0,seed:0,selfDefending:!1,shuffleStringArray:!0,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:10,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Dot=".",e.Comma=","}(t.StringSeparator||(t.StringSeparator={}))},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{};n=o([r(0).injectable()],n),t.AbstractCalleeDataExtractor=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecmaVersion=11},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);t.NodeLiteralUtils=class{static isProhibitedLiteralNode(e,t){return!(!o.NodeGuards.isPropertyNode(t)||t.computed||t.key!==e)||!!o.NodeGuards.isImportDeclarationNode(t)}}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3);let g=o=class{constructor(e,t,r){this.replacerDataByControlFlowStorageId=new Map,this.controlFlowCustomNodeFactory=e,this.randomGenerator=t,this.options=r}static getStorageKeysByIdForCurrentStorage(e,t){let r;return r=e.has(t)?e.get(t):new Map,r}insertCustomNodeToControlFlowStorage(e,t,r,n){const i=t.getStorageId(),a=o.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,i),s=a.get(r);if(this.randomGenerator.getMathRandom(){const r=this.randomGenerator.getRandomString(e);return t.getStorage().has(r)?c(e):r},d=c(5);return a.set(r,[d]),this.replacerDataByControlFlowStorageId.set(i,a),t.set(d,e),d}};g=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],g),t.AbstractControlFlowReplacer=g},function(e,t){e.exports=require("escodegen")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n const that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3);let f=class{constructor(e,t){this.preservedNamesSet=new Set,this.randomGenerator=e,this.options=t}preserveName(e){this.preservedNamesSet.add(e)}isValidIdentifierName(e){return this.notReservedName(e)&&!this.preservedNamesSet.has(e)}notReservedName(e){return!this.options.reservedNames.length||!this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractIdentifierNamesGenerator=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(7);let m=class{constructor(e,t){this.randomGenerator=e,this.options=t}initialize(){this.storage=new Map,this.storageId=this.randomGenerator.getRandomString(6)}get(e){return this.storage.get(e)}getOrThrow(e){const t=this.get(e);if(!t)throw new Error(`No value found in map storage with key \`${e}\``);return t}getKeyOf(e){for(const[t,r]of this.storage)if(e===r)return t;return null}getLength(){return this.storage.size}getStorage(){return this.storage}getStorageId(){return this.storageId}has(e){return this.storage.has(e)}mergeWith(e,t=!1){this.storage=new Map([...this.storage,...e.getStorage()]),t&&(this.storageId=e.getStorageId())}set(e,t){this.storage.set(e,t)}};a([p.initializable(),s("design:type",String)],m.prototype,"storageId",void 0),a([p.initializable(),s("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],m.prototype,"storage",void 0),a([d.postConstruct(),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],m.prototype,"initialize",null),m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MapStorage=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(17),f=r(2),p=r(3),m=r(18),g=r(45),y=r(4);let N=class extends g.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}getControlFlowStorageCallNode(e,t,r,o){const n=this.controlFlowCustomNodeFactory(m.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);n.initialize(e,t,r,o);const i=n.getNode()[0];if(!i||!y.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};N=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==u.TControlFlowCustomNodeFactory&&u.TControlFlowCustomNodeFactory)?o:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],N),t.ExpressionWithOperatorControlFlowReplacer=N},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(r(85)),a=n(r(86)),s=n(r(56));class c{static parse(e,t){const r=c.sourceTypes.length;for(let o=0;o"),u=`...${i.substring(s,d).replace(/^\s+/,"")}...`;throw new Error(`ERROR in ${a}line ${r.line}: ${t}\n${l} ${u}`)}}t.ASTParserFacade=c,c.colorError=s.default.red,c.nearestSymbolsCount=15,c.sourceTypes=["script","module"]},function(e,t){e.exports=require("chalk")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BasePropertiesExtractor="BasePropertiesExtractor",e.ObjectExpressionToVariableDeclarationExtractor="ObjectExpressionToVariableDeclarationExtractor"}(t.ObjectExpressionExtractor||(t.ObjectExpressionExtractor={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ObjectExpressionVariableDeclarationHostNode="ObjectExpressionVariableDeclarationHostNode"}(t.ObjectExpressionKeysTransformerCustomNode||(t.ObjectExpressionKeysTransformerCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t){e.exports=require("class-validator")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListObfuscatingGuard="BlackListObfuscatingGuard",e.ConditionalCommentObfuscatingGuard="ConditionalCommentObfuscatingGuard",e.ReservedStringObfuscatingGuard="ReservedStringObfuscatingGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(4);let s=o=class{constructor(){this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}static isConditionalComment(e){return o.obfuscationEnableCommentRegExp.test(e.value)||o.obfuscationDisableCommentRegExp.test(e.value)}check(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!a.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;const t=e.leadingComments,r=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),r&&(this.obfuscationAllowedForNextNode=this.checkComments(r)),this.obfuscationAllowedForCurrentNode}checkComments(e){const t=e.length;let r=this.obfuscationAllowedForCurrentNode;for(let n=0;n=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(218)),m=r(219),g=r(2),y=r(220),N=r(7);let h=o=class{constructor(e,t){this.sourceCode=e,this.options=t}initialize(){this.randomGenerator=new m.Chance(this.getRawSeed())}getMathRandom(){return this.getRandomInteger(0,99999)/1e5}getRandomGenerator(){return this.randomGenerator}getRandomInteger(e,t){return this.getRandomGenerator().integer({min:e,max:t})}getRandomString(e,t=o.randomGeneratorPool){return this.getRandomGenerator().string({length:e,pool:t})}getInputSeed(){return this.options.seed.toString()}getRawSeed(){const e=this.getInputSeed();return`${e}`.split("|").length>1?e:`${e}|${p.default(this.sourceCode.getSourceCode())}`}};h.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s([N.initializable(),c("design:type","function"==typeof(n=void 0!==m.Chance&&m.Chance.Chance)?n:Object)],h.prototype,"randomGenerator",void 0),s([u.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],h.prototype,"initialize",null),h=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.ISourceCode)),d(1,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(i=void 0!==y.ISourceCode&&y.ISourceCode)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],h),t.RandomGenerator=h},function(e,t){e.exports=require("reflect-metadata")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(56)),f=r(2),p=r(71);let m=o=class{constructor(e){this.options=e}static log(e,t,r,o){const n=e(`\n${t} ${r}`);console.log(n,null!=o?o:"")}info(e,t){this.options.log&&o.log(o.colorInfo,p.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&o.log(o.colorSuccess,p.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&o.log(o.colorWarn,p.LoggingPrefix.Base,e,t)}};m.colorInfo=u.default.cyan,m.colorSuccess=u.default.green,m.colorWarn=u.default.yellow,m=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IOptions&&f.IOptions)?n:Object])],m),t.Logger=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(52),s=r(73),c=r(75),d=r(76),l=r(77),u=r(78),f=r(79),p=r(81);t.analyzersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICallsGraphAnalyzer).to(s.CallsGraphAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer).to(u.PrevailingKindOfVariablesAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IScopeAnalyzer).to(f.ScopeAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IStringArrayStorageAnalyzer).to(p.StringArrayStorageAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(d.FunctionExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(l.ObjectExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(74),p=r(52),m=r(4),g=r(14);let y=o=class{constructor(e){this.calleeDataExtractorFactory=e}static getLimitIndex(e){const t=e-1,r=o.limitThresholdActivationLength-1;let n=t;return t>r&&(n=Math.round(r+t*o.limitThreshold),n>t&&(n=t)),n}analyze(e){return this.analyzeRecursive(e.body)}analyzeRecursive(e){const t=o.getLimitIndex(e.length),r=[],n=e.length;for(let o=0;ot);o++){const t=e[o];u.traverse(t,{enter:o=>{if(m.NodeGuards.isCallExpressionNode(o))return t.parentNode!==g.NodeStatementUtils.getParentNodeWithStatements(o)?u.VisitorOption.Skip:void this.analyzeCallExpressionNode(r,e,o)}})}return r}analyzeCallExpressionNode(e,t,r){o.calleeDataExtractorsList.forEach(o=>{const n=this.calleeDataExtractorFactory(o).extract(t,r.callee);n&&e.push(Object.assign(Object.assign({},n),{callsGraph:this.analyzeRecursive(n.callee.body)}))})}};y.calleeDataExtractorsList=[p.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,p.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,p.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],y.limitThresholdActivationLength=25,y.limitThreshold=.002,y=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__ICalleeDataExtractor)),a("design:paramtypes",["function"==typeof(n=void 0!==f.TCalleeDataExtractorFactory&&f.TCalleeDataExtractorFactory)?n:Object])],y),t.CallsGraphAnalyzer=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(13)),s=r(42),c=r(4),d=r(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){if(!c.NodeGuards.isIdentifierNode(t))return null;const r=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name);return r?{callee:r,name:t.name}:null}getCalleeBlockStatement(e,t){let r=null;return a.traverse(e,{enter:e=>{if(c.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return r=e.body,a.VisitorOption.Break}}),r}};l=o([i.injectable()],l),t.FunctionDeclarationCalleeDataExtractor=l},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(13)),s=r(42),c=r(4),d=r(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){var r;let o=null;return c.NodeGuards.isIdentifierNode(t)&&(o=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name)),c.NodeGuards.isFunctionExpressionNode(t)&&(o=t.body),o?{callee:o,name:null!==(r=t.name)&&void 0!==r?r:null}:null}getCalleeBlockStatement(e,t){let r=null;return a.traverse(e,{enter:(e,o)=>{if(c.NodeGuards.isFunctionExpressionNode(e)&&o&&c.NodeGuards.isVariableDeclaratorNode(o)&&c.NodeGuards.isIdentifierNode(o.id)&&o.id.name===t)return r=e.body,a.VisitorOption.Break}}),r}};l=o([i.injectable()],l),t.FunctionExpressionCalleeDataExtractor=l},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=i(r(13)),c=r(42),d=r(4),l=r(14);let u=o=class extends c.AbstractCalleeDataExtractor{static isValidTargetPropertyNode(e,t){if(!e.key)return!1;const r=d.NodeGuards.isIdentifierNode(e.key)&&e.key.name===t,o=d.NodeGuards.isLiteralNode(e.key)&&Boolean(e.key.value)&&e.key.value===t;return r||o}extract(e,t){if(!d.NodeGuards.isMemberExpressionNode(t))return null;const r=this.createObjectMembersCallsChain([],t);if(!r.length)return null;const o=r[r.length-1],n=this.getCalleeBlockStatement(l.NodeStatementUtils.getParentNodeWithStatements(e[0]),r);return n?{callee:n,name:o}:null}createObjectMembersCallsChain(e,t){if(d.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!d.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return d.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(d.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}getCalleeBlockStatement(e,t){const r=t.shift();if(!r)return null;let o=null;return s.traverse(e,{enter:e=>{if(d.NodeGuards.isVariableDeclaratorNode(e)&&d.NodeGuards.isIdentifierNode(e.id)&&e.init&&d.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===r)return o=this.findCalleeBlockStatement(e.init.properties,t),s.VisitorOption.Break}}),o}findCalleeBlockStatement(e,t){const r=t.shift();if(!r)return null;for(const n of e)if(o.isValidTargetPropertyNode(n,r)){if(d.NodeGuards.isObjectExpressionNode(n.value))return this.findCalleeBlockStatement(n.value.properties,t);if(d.NodeGuards.isFunctionExpressionNode(n.value))return n.value.body}return null}};u=o=n([a.injectable()],u),t.ObjectExpressionCalleeDataExtractor=u},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(34),p=r(4);let m=o=class{constructor(e){this.prevailingKindOfVariables=o.defaultKindOfVariables,this.arrayUtils=e}analyze(e){var t;const r=[];u.traverse(e,{enter:e=>{p.NodeGuards.isVariableDeclarationNode(e)&&r.push(e.kind)}}),this.prevailingKindOfVariables=null!==(t=this.arrayUtils.findMostOccurringElement(r))&&void 0!==t?t:o.defaultKindOfVariables}getPrevailingKind(){return this.prevailingKindOfVariables}};m.defaultKindOfVariables="var",m=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IArrayUtils)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IArrayUtils&&f.IArrayUtils)?n:Object])],m),t.PrevailingKindOfVariablesAnalyzer=m},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=i(r(80)),c=i(r(13)),d=r(43),l=r(4);let u=o=class{constructor(){this.scopeManager=null}static attachMissingRanges(e){c.replace(e,{enter:e=>(e.range||(e.range=[o.emptyRangeValue,o.emptyRangeValue]),e)})}static isRootNode(e){return l.NodeGuards.isProgramNode(e)||e.parentNode===e}analyze(e){const t=o.sourceTypes.length;o.attachMissingRanges(e);for(let r=0;r{if("class"===e.type&&e.upper){if(!e.variables.length)return;const t=e.variables[0],r=e.upper.variables.find(e=>t.defs.some(e=>"ClassName"===e.type)&&e.name===t.name);null==r||r.references.push(...e.variables[0].references)}});for(const t of e.childScopes)this.sanitizeScopes(t)}};u.eslintScopeOptions={ecmaVersion:d.ecmaVersion,optimistic:!0},u.sourceTypes=["script","module"],u.emptyRangeValue=0,u=o=n([a.injectable()],u),t.ScopeAnalyzer=u},function(e,t){e.exports=require("eslint-scope")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(13)),m=r(2),g=r(3),y=r(35),N=r(4),h=r(15),b=r(44);let I=o=class{constructor(e,t,r){this.stringArrayStorageData=new Map,this.stringArrayStorage=e,this.randomGenerator=t,this.options=r}analyze(e){this.options.stringArray&&p.traverse(e,{enter:(e,t)=>{if(t)return h.NodeMetadata.isIgnoredNode(e)?p.VisitorOption.Skip:void(N.NodeGuards.isLiteralNode(e)&&this.analyzeLiteralNode(e,t))}})}getItemDataForLiteralNode(e){return this.stringArrayStorageData.get(e)}analyzeLiteralNode(e,t){"string"==typeof e.value&&(b.NodeLiteralUtils.isProhibitedLiteralNode(e,t)||this.shouldAddValueToStringArray(e.value)&&this.stringArrayStorageData.set(e,this.stringArrayStorage.getOrThrow(e.value)))}shouldAddValueToStringArray(e){return e.length>=o.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}};I.minimumLengthForStringArray=3,I=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.IStringArrayStorage)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==y.IStringArrayStorage&&y.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==m.IOptions&&m.IOptions)?a:Object])],I),t.StringArrayStorageAnalyzer=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(53),s=r(21),c=r(83),d=r(84),l=r(87),u=r(88),f=r(90),p=r(93),m=r(94);t.controlFlowTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(l.CallExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(i.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(54);let N=o=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.BinaryExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}};N.usingExistingIdentifierChance=.5,N=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.BinaryExpressionControlFlowReplacer=N},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(17),y=r(34),N=r(2),h=r(3),b=r(18),I=r(11),v=r(12),S=r(4),O=r(6);let j=o=class extends v.AbstractNodeTransformer{constructor(e,t,r,o){super(r,o),this.controlFlowCustomNodeFactory=e,this.arrayUtils=t}static isProhibitedStatementNode(e){const t=S.NodeGuards.isBreakStatementNode(e)||S.NodeGuards.isContinueStatementNode(e),r=S.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),o=S.NodeGuards.isClassDeclarationNode(e);return S.NodeGuards.isFunctionDeclarationNode(e)||t||r||o}static canTransformBlockStatementNode(e){let t=!0;return m.traverse(e,{enter:e=>{if(S.NodeGuards.isWhileStatementNode(e))return m.VisitorOption.Skip;o.isProhibitedStatementNode(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}getVisitor(e){switch(e){case I.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&S.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!o.canTransformBlockStatementNode(e))return e;const r=e.body,n=this.arrayUtils.createWithRange(r.length),i=this.arrayUtils.shuffle(n),a=n.map(e=>i.indexOf(e)),s=this.controlFlowCustomNodeFactory(b.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);s.initialize(r,i,a);const c=s.getNode()[0];return O.NodeUtils.parentizeNode(c,t),c}};j=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IControlFlowCustomNode)),l(1,f.inject(p.ServiceIdentifiers.IArrayUtils)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TControlFlowCustomNodeFactory&&g.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==N.IOptions&&N.IOptions)?s:Object])],j),t.BlockStatementControlFlowTransformer=j},function(e,t){e.exports=require("acorn")},function(e,t){e.exports=require("acorn-import-meta")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(45),N=r(4);let h=o=class extends y.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){const n=e.callee;if(!N.NodeGuards.isIdentifierNode(n))return e;const i=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionFunctionNode),s=e.arguments;a.initialize(s);const c=this.insertCustomNodeToControlFlowStorage(a,r,i,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),c,n,s)}getControlFlowStorageCallNode(e,t,r,o){const n=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);n.initialize(e,t,r,o);const i=n.getNode()[0];if(!i||!N.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};h.usingExistingIdentifierChance=.5,h=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.CallExpressionControlFlowReplacer=h},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(89),y=r(2),N=r(3),h=r(57),b=r(58),I=r(21),v=r(33),S=r(11),O=r(12),j=r(8),_=r(4),C=r(14),R=r(6);let F=o=class extends O.AbstractNodeTransformer{constructor(e,t,r,o){super(r,o),this.deadCodeInjectionRootAstHostNodeSet=new Set,this.collectedBlockStatements=[],this.collectedBlockStatementsTotalLength=0,this.deadCodeInjectionCustomNodeFactory=e,this.transformersRunner=t}static isProhibitedNodeInsideCollectedBlockStatement(e){return _.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e)||_.NodeGuards.isAwaitExpressionNode(e)||_.NodeGuards.isSuperNode(e)}static isScopeHoistingFunctionDeclaration(e){if(!_.NodeGuards.isFunctionDeclarationNode(e))return!1;const t=C.NodeStatementUtils.getScopeOfNode(e),r=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,o=r.indexOf(e);if(0===o)return!1;const n=r.slice(0,o),i=j.NodeFactory.blockStatementNode(n),a=e.id.name;let s=!1;return m.traverse(i,{enter:e=>{if(_.NodeGuards.isIdentifierNode(e)&&e.name===a)return s=!0,m.VisitorOption.Break}}),s}static isValidCollectedBlockStatementNode(e){if(!e.body.length)return!1;let t=0,r=!0;return m.traverse(e,{enter:e=>{if(_.NodeGuards.isBlockStatementNode(e)&&t++,t>o.maxNestedBlockStatementsCount||o.isProhibitedNodeInsideCollectedBlockStatement(e)||o.isScopeHoistingFunctionDeclaration(e))return r=!1,m.VisitorOption.Break}}),r}static isValidWrappedBlockStatementNode(e){if(!e.body.length)return!1;let t=!0;if(m.traverse(e,{enter:e=>{if(o.isScopeHoistingFunctionDeclaration(e))return t=!1,m.VisitorOption.Break}}),!t)return!1;return C.NodeStatementUtils.getParentNodeWithStatements(e).type!==v.NodeType.Program}getVisitor(e){switch(e){case S.TransformationStage.DeadCodeInjection:return{enter:(e,t)=>{if(t&&_.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),e},leave:(e,t)=>{if(t&&_.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};case S.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:(e,t)=>{if(t&&this.isDeadCodeInjectionRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}analyzeNode(e,t){m.traverse(e,{enter:e=>{if(!_.NodeGuards.isBlockStatementNode(e))return;const t=R.NodeUtils.clone(e);if(!o.isValidCollectedBlockStatementNode(t))return;const r=this.makeClonedBlockStatementNodeUnique(t);this.collectedBlockStatements.push(r)}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}transformNode(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!o.isValidWrappedBlockStatementNode(e))return e;const r=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,r),i=this.collectedBlockStatements.splice(n,1)[0];return i===e?e:this.replaceBlockStatementNode(e,i,t)}restoreNode(e,t){const r=e.body[0];if(!_.NodeGuards.isFunctionDeclarationNode(r))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return r.body}isDeadCodeInjectionRootAstHostNode(e){return _.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}makeClonedBlockStatementNodeUnique(e){const t=j.NodeFactory.functionExpressionNode([],e);return R.NodeUtils.parentizeNode(t,t),R.NodeUtils.parentizeNode(e,t),this.transformersRunner.transform(t,o.transformersToRenameBlockScopeIdentifiers,S.TransformationStage.Obfuscating).body}replaceBlockStatementNode(e,t,r){const n=j.NodeFactory.blockStatementNode([j.NodeFactory.functionDeclarationNode(o.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);const i=this.deadCodeInjectionCustomNodeFactory(b.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);i.initialize(e,n);const a=i.getNode()[0];return R.NodeUtils.parentizeNode(a,r),a}};F.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",F.maxNestedBlockStatementsCount=4,F.minCollectedBlockStatementsCount=5,F.transformersToRenameBlockScopeIdentifiers=[I.NodeTransformer.LabeledStatementTransformer,I.NodeTransformer.ScopeIdentifiersTransformer],F=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),l(1,f.inject(p.ServiceIdentifiers.ITransformersRunner)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TDeadNodeInjectionCustomNodeFactory&&g.TDeadNodeInjectionCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==h.ITransformersRunner&&h.ITransformersRunner)?i:Object,"function"==typeof(a=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==y.IOptions&&y.IOptions)?s:Object])],F),t.DeadCodeInjectionTransformer=F},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=f(r(13)),y=r(17),N=r(91),h=r(92),b=r(2),I=r(3),v=r(18),S=r(53),O=r(33),j=r(11),_=r(12),C=r(19),R=r(4),F=r(15),T=r(14),x=r(6);let G=o=class extends _.AbstractNodeTransformer{constructor(e,t,r,o,n){super(o,n),this.controlFlowData=new Map,this.visitedFunctionNodes=new Set,this.hostNodesWithControlFlowNode=new Set,this.controlFlowStorageFactory=e,this.controlFlowReplacerFactory=t,this.controlFlowCustomNodeFactory=r}getVisitor(e){switch(e){case j.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.visitedFunctionNodes.add(e),!R.NodeGuards.isBlockStatementNode(e.body))return e;const r=this.getHostNode(e.body),o=this.getControlFlowStorage(r);if(this.controlFlowData.set(r,o),this.transformFunctionBody(e.body,o),!o.getLength())return e;const n=this.controlFlowCustomNodeFactory(v.ControlFlowCustomNode.ControlFlowStorageNode);return n.initialize(o),C.NodeAppender.prepend(r,n.getNode()),this.hostNodesWithControlFlowNode.add(r),x.NodeUtils.parentizeAst(e),e}getControlFlowStorage(e){const t=this.controlFlowStorageFactory();if(this.controlFlowData.has(e)){this.hostNodesWithControlFlowNode.has(e)&&(R.NodeGuards.isSwitchCaseNode(e)?e.consequent.shift():e.body.shift());const r=this.controlFlowData.get(e);t.mergeWith(r,!0)}return t}getHostNode(e){const t=T.NodeStatementUtils.getParentNodesWithStatements(e);return 1===t.length?e:(t.pop(),t.length>o.hostNodeSearchMinDepth&&t.splice(0,o.hostNodeSearchMinDepth),t.length>o.hostNodeSearchMaxDepth&&(t.length=o.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}isVisitedFunctionNode(e){return(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}transformFunctionBody(e,t){g.replace(e,{enter:(e,r)=>{if(F.NodeMetadata.isIgnoredNode(e))return g.VisitorOption.Skip;if(this.isVisitedFunctionNode(e)||!r)return g.VisitorOption.Skip;if(!o.controlFlowReplacersMap.has(e.type))return e;if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold)return e;const n=o.controlFlowReplacersMap.get(e.type);return void 0===n?e:Object.assign(Object.assign({},this.controlFlowReplacerFactory(n).replace(e,r,t)),{parentNode:r})}})}};G.controlFlowReplacersMap=new Map([[O.NodeType.BinaryExpression,S.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[O.NodeType.CallExpression,S.ControlFlowReplacer.CallExpressionControlFlowReplacer],[O.NodeType.LogicalExpression,S.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[O.NodeType.Literal,S.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),G.hostNodeSearchMinDepth=0,G.hostNodeSearchMaxDepth=2,G=o=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),u(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),u(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==h.TControlFlowStorageFactory&&h.TControlFlowStorageFactory)?n:Object,"function"==typeof(i=void 0!==N.TControlFlowReplacerFactory&&N.TControlFlowReplacerFactory)?i:Object,"function"==typeof(a=void 0!==y.TControlFlowCustomNodeFactory&&y.TControlFlowCustomNodeFactory)?a:Object,"function"==typeof(s=void 0!==I.IRandomGenerator&&I.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==b.IOptions&&b.IOptions)?c:Object])],G),t.FunctionControlFlowTransformer=G},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(54),N=r(4),h=r(6);let b=o=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){if(this.checkForProhibitedExpressions(e.left,e.right))return e;const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.LogicalExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}checkForProhibitedExpressions(e,t){return[e,t].some(e=>{let t;return t=N.NodeGuards.isUnaryExpressionNode(e)?h.NodeUtils.getUnaryExpressionArgumentNode(e):e,!(N.NodeGuards.isLiteralNode(t)||N.NodeGuards.isIdentifierNode(t)||N.NodeGuards.isObjectExpressionNode(t)||N.NodeGuards.isExpressionStatementNode(t))})}};b.usingExistingIdentifierChance=.5,b=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionControlFlowReplacer=b},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(45),N=r(4);let h=o=class extends y.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){if(N.NodeGuards.isPropertyNode(t)&&t.key===e)return e;if("string"!=typeof e.value||e.value.length<3)return e;const n=String(e.value),i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralNode);i.initialize(e.value);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a)}getControlFlowStorageCallNode(e,t){const r=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode);r.initialize(e,t);const o=r.getNode()[0];if(!o||!N.NodeGuards.isExpressionStatementNode(o))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return o.expression}};h.usingExistingIdentifierChance=1,h=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.StringLiteralControlFlowReplacer=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(16),i=r(1),a=r(21),s=r(59),c=r(96),d=r(98),l=r(99),u=r(100),f=r(102),p=r(103),m=r(104),g=r(105);t.convertingTransformersModule=new o.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.MemberExpressionTransformer).whenTargetNamed(a.NodeTransformer.MemberExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(l.MethodDefinitionTransformer).whenTargetNamed(a.NodeTransformer.MethodDefinitionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.ObjectExpressionKeysTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionKeysTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.ObjectExpressionTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.SplitStringTransformer).whenTargetNamed(a.NodeTransformer.SplitStringTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.TemplateLiteralTransformer).whenTargetNamed(a.NodeTransformer.TemplateLiteralTransformer),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(c.ObjectExpressionToVariableDeclarationExtractor).whenTargetNamed(s.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(g.BasePropertiesExtractor).whenTargetNamed(s.ObjectExpressionExtractor.BasePropertiesExtractor),e(i.ServiceIdentifiers.Factory__IObjectExpressionExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObjectExpressionExtractor))})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(97),l=r(60),u=r(19),f=r(4),p=r(14),m=r(6);let g=class{constructor(e){this.objectExpressionKeysTransformerCustomNodeFactory=e}extract(e,t){return this.transformObjectExpressionToVariableDeclaration(e,t)}transformObjectExpressionToVariableDeclaration(e,t){const r=e.properties,o=this.getObjectExpressionHostNode(r),n=this.getObjectExpressionIdentifierNode(o),i=this.getObjectExpressionNode(o),a=[o],s=p.NodeStatementUtils.getScopeOfNode(t);return u.NodeAppender.insertBefore(s,a,t),m.NodeUtils.parentizeAst(o),m.NodeUtils.parentizeNode(o,s),{nodeToReplace:n,objectExpressionHostStatement:o,objectExpressionNode:i}}getObjectExpressionHostNode(e){const t=this.objectExpressionKeysTransformerCustomNodeFactory(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode);t.initialize(e);const r=t.getNode()[0];if(!r||!f.NodeGuards.isVariableDeclarationNode(r))throw new Error("`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node");return r}getObjectExpressionIdentifierNode(e){const t=e.declarations[0].id;if(!f.NodeGuards.isIdentifierNode(t))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property");return t}getObjectExpressionNode(e){var t;const r=null!==(t=e.declarations[0].init)&&void 0!==t?t:null;if(!r||!f.NodeGuards.isObjectExpressionNode(r))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property");return r}};g=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)),i("design:paramtypes",["function"==typeof(o=void 0!==d.TObjectExpressionKeysTransformerCustomNodeFactory&&d.TObjectExpressionKeysTransformerCustomNodeFactory)?o:Object])],g),t.ObjectExpressionToVariableDeclarationExtractor=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(8),g=r(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isMemberExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(g.NodeGuards.isIdentifierNode(e.property)){if(e.computed)return e;e.computed=!0,e.property=m.NodeFactory.literalNode(e.property.name)}return e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MemberExpressionTransformer=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(11),m=r(12),g=r(8),y=r(4);let N=o=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&y.NodeGuards.isMethodDefinitionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return y.NodeGuards.isIdentifierNode(e.key)?this.replaceIdentifierKey(e,e.key):y.NodeGuards.isLiteralNode(e.key)?this.replaceLiteralKey(e,e.key):e}replaceIdentifierKey(e,t){return o.ignoredNames.includes(t.name)||e.computed||(e.computed=!0,e.key=g.NodeFactory.literalNode(t.name)),e}replaceLiteralKey(e,t){return"string"!=typeof t.value||o.ignoredNames.includes(t.value)||e.computed||(e.computed=!0),e}};N.ignoredNames=["constructor"],N=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.MethodDefinitionTransformer=N},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(13)),m=r(101),g=r(2),y=r(3),N=r(11),h=r(12),b=r(4),I=r(14),v=r(59);let S=o=class extends h.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.objectExpressionExtractorFactory=e}static isProhibitedHostStatement(e,t){return o.isReferencedIdentifierName(e,t)}static isReferencedIdentifierName(e,t){const r=[];let o=!1,n=!1;return p.traverse(t,{enter:t=>{t===e&&(n=!0),b.NodeGuards.isIdentifierNode(t)&&(n?r.includes(t.name)&&(o=!0):r.push(t.name))},leave:t=>{if(t===e)return n=!1,p.VisitorOption.Break}}),o}getVisitor(e){if(!this.options.transformObjectKeys)return null;switch(e){case N.TransformationStage.Converting:return{leave:(e,t)=>{if(t&&b.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(!e.properties.length)return e;const r=I.NodeStatementUtils.getRootStatementOfNode(e);return o.isProhibitedHostStatement(e,r)?e:this.applyObjectExpressionKeysExtractorsRecursive(o.objectExpressionExtractorNames,e,r)}applyObjectExpressionKeysExtractorsRecursive(e,t,r){const o=[...e],n=o.shift();if(!n)return t;const{nodeToReplace:i,objectExpressionHostStatement:a,objectExpressionNode:s}=this.objectExpressionExtractorFactory(n).extract(t,r);return this.applyObjectExpressionKeysExtractorsRecursive(o,s,a),i}};S.objectExpressionExtractorNames=[v.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor,v.ObjectExpressionExtractor.BasePropertiesExtractor],S=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.Factory__IObjectExpressionExtractor)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==m.TObjectExpressionExtractorFactory&&m.TObjectExpressionExtractorFactory)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],S),t.ObjectExpressionKeysTransformer=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(8),g=r(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return e.properties.forEach(e=>{e.key&&(e.computed?this.transformComputedProperty(e):this.transformBaseProperty(e))}),e}transformComputedProperty(e){g.NodeGuards.isLiteralNode(e.key)&&"string"==typeof e.key.value&&(e.key=m.NodeFactory.literalNode(e.key.value))}transformBaseProperty(e){e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=m.NodeFactory.literalNode(e.key.name))}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.ObjectExpressionTransformer=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(2),m=r(3),g=r(21),y=r(11),N=r(12),h=r(8),b=r(4),I=r(44),v=r(6);let S=o=class extends N.AbstractNodeTransformer{constructor(e,t){super(e,t),this.runAfter=[g.NodeTransformer.ObjectExpressionKeysTransformer,g.NodeTransformer.TemplateLiteralTransformer]}static chunkString(e,t){const r=Math.ceil(e.length/t),o=[];let n=0;for(let i=0;i{if(this.options.splitStrings)return t&&b.NodeGuards.isLiteralNode(e)?this.transformNode(e,t):void 0}};default:return null}}transformNode(e,t){if(I.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;const r=this.transformLiteralNodeByChunkLength(e,t,o.firstPassChunkLength);return f.replace(r,{enter:(e,t)=>{if(t&&b.NodeGuards.isLiteralNode(e))return this.transformLiteralNodeByChunkLength(e,t,this.options.splitStringsChunkLength)}})}transformLiteralNodeByChunkLength(e,t,r){if("string"!=typeof e.value)return e;if(r>=e.value.length)return e;const n=o.chunkString(e.value,r),i=this.transformStringChunksToBinaryExpressionNode(n);return v.NodeUtils.parentizeAst(i),v.NodeUtils.parentizeNode(i,t),i}transformStringChunksToBinaryExpressionNode(e){const t=e.shift(),r=e.shift();if(!t||!r)throw new Error("First and second chunks values should not be empty");const o=h.NodeFactory.binaryExpressionNode("+",h.NodeFactory.literalNode(t),h.NodeFactory.literalNode(r));return e.reduce((e,t)=>{const r=h.NodeFactory.literalNode(t);return h.NodeFactory.binaryExpressionNode("+",e,r)},o)}};S.firstPassChunkLength=1e3,S=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],S),t.SplitStringTransformer=S},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(11),m=r(12),g=r(8),y=r(4),N=r(6);let h=o=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}static isLiteralNodeWithStringValue(e){return!!e&&y.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}static isValidTemplateLiteralNode(e,t){return y.NodeGuards.isTemplateLiteralNode(e)&&!y.NodeGuards.isTaggedTemplateExpressionNode(t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&o.isValidTemplateLiteralNode(e,t))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const r=e.expressions;let n,i=[];if(e.quasis.forEach(e=>{i.push(g.NodeFactory.literalNode(e.value.cooked));const t=r.shift();t&&i.push(t)}),i=i.filter(e=>!(y.NodeGuards.isLiteralNode(e)&&""===e.value)),o.isLiteralNodeWithStringValue(i[0])||o.isLiteralNodeWithStringValue(i[1])||i.unshift(g.NodeFactory.literalNode("")),i.length>1){let e=g.NodeFactory.binaryExpressionNode("+",i.shift(),i.shift());i.forEach(t=>{e=g.NodeFactory.binaryExpressionNode("+",e,t)}),n=e}else n=i[0];return N.NodeUtils.parentizeAst(n),N.NodeUtils.parentizeNode(n,t),n}};h=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.TemplateLiteralTransformer=h},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(19),s=r(8),c=r(4),d=r(14);let l=o=class{static getPropertyNodeKeyName(e){const t=e.key;return!c.NodeGuards.isLiteralNode(t)||"string"!=typeof t.value&&"number"!=typeof t.value?c.NodeGuards.isIdentifierNode(t)?t.name:null:t.value.toString()}static isProhibitedPattern(e){return!e||c.NodeGuards.isObjectPatternNode(e)||c.NodeGuards.isArrayPatternNode(e)||c.NodeGuards.isAssignmentPatternNode(e)||c.NodeGuards.isRestElementNode(e)}extract(e,t){const r=e.parentNode;return r&&c.NodeGuards.isVariableDeclaratorNode(r)&&c.NodeGuards.isIdentifierNode(r.id)?this.transformObjectExpressionNode(e,t,r.id):{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}transformObjectExpressionNode(e,t,r){const o=e.properties,[n,i]=this.extractPropertiesToExpressionStatements(o,t,r),s=d.NodeStatementUtils.getScopeOfNode(t);return this.filterExtractedObjectExpressionProperties(e,i),a.NodeAppender.insertAfter(s,n,t),{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}extractPropertiesToExpressionStatements(e,t,r){const n=e.length,i=[],a=[];for(let d=0;d!t.includes(r))}};l=o=n([i.injectable()],l),t.BasePropertiesExtractor=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(18),s=r(23),c=r(61),d=r(58),l=r(60),u=r(107),f=r(108),p=r(109),m=r(110),g=r(111),y=r(112),N=r(115),h=r(116),b=r(117),I=r(118),v=r(119),S=r(120),O=r(122),j=r(124),_=r(126),C=r(128),R=r(130),F=r(134),T=r(136),x=r(137),G=r(138),E=r(140),w=r(142),P=r(149),A=r(151),M=r(154),D=r(155);t.customNodesModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICustomNode).to(O.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(i.ServiceIdentifiers.ICustomNode).to(_.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(i.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(i.ServiceIdentifiers.ICustomNode).to(R.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(F.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(i.ServiceIdentifiers.ICustomNode).to(G.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(E.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(i.ServiceIdentifiers.ICustomNode).to(w.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(i.ServiceIdentifiers.ICustomNode).to(P.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(i.ServiceIdentifiers.ICustomNode).to(A.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BinaryExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.BlockStatementControlFlowFlatteningNode).whenTargetNamed(a.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(I.CallExpressionControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(S.ControlFlowStorageNode).whenTargetNamed(a.ControlFlowCustomNode.ControlFlowStorageNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(T.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(x.LogicalExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(D.StringLiteralNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(M.StringLiteralControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(b.BlockStatementDeadCodeInjectionNode).whenTargetNamed(d.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.ObjectExpressionVariableDeclarationHostNode).whenTargetNamed(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode),e(i.ServiceIdentifiers.ICustomNodeGroup).to(u.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(f.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(p.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(m.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(g.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(i.ServiceIdentifiers.Factory__ICustomNode).toFactory(o.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNode)),e(i.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions)),e(i.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(o.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNodeGroup)),e(i.ServiceIdentifiers.ICustomNodeFormatter).to(j.CustomNodeFormatter).inSingletonScope()})},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19);let S=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.ConsoleOutputDisableExpressionNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.disableConsoleOutput)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(h.CustomNode.ConsoleOutputDisableExpressionNode),r=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(h.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,r)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.ConsoleOutputCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19),S=r(4);let O=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.DebugProtectionFunctionCallNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.DebugProtectionFunctionNode,t=>{v.NodeAppender.append(e,t.getNode())}),this.appendCustomNodeIfExist(h.CustomNode.DebugProtectionFunctionIntervalNode,t=>{const r=S.NodeGuards.isSwitchCaseNode(e)?e.consequent.length:e.body.length,o=this.randomGenerator.getRandomInteger(0,r);v.NodeAppender.insertAtIndex(e,t.getNode(),o)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.debugProtection)return;const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r=this.customNodeFactory(h.CustomNode.DebugProtectionFunctionNode),o=this.customNodeFactory(h.CustomNode.DebugProtectionFunctionCallNode),n=this.customNodeFactory(h.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);r.initialize(e),o.initialize(e,t),n.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(h.CustomNode.DebugProtectionFunctionNode,r),this.customNodes.set(h.CustomNode.DebugProtectionFunctionCallNode,o),this.options.debugProtectionInterval&&this.customNodes.set(h.CustomNode.DebugProtectionFunctionIntervalNode,n),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,i)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],O.prototype,"customNodes",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.DebugProtectionCustomNodeGroup=O},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19);let S=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.DomainLockNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.domainLock.length)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(h.CustomNode.DomainLockNode),r=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(h.CustomNode.DomainLockNode,t),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,r)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.DomainLockCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19);let S=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.SelfDefendingUnicodeNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.selfDefending)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(h.CustomNode.SelfDefendingUnicodeNode),r=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(h.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,r)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.SelfDefendingCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=r(26),g=r(5),y=r(2),N=r(3),h=r(35),b=r(7),I=r(23),v=r(22),S=r(27),O=r(19);let j=class extends S.AbstractCustomNodeGroup{constructor(e,t,r,o,n){super(r,o,n),this.appendEvent=v.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e,this.stringArrayStorage=t}appendCustomNodes(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(I.CustomNode.StringArrayNode,t=>{O.NodeAppender.prepend(e,t.getNode())}),this.appendCustomNodeIfExist(I.CustomNode.StringArrayCallsWrapper,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(I.CustomNode.StringArrayRotateFunctionNode,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}))}initialize(){if(this.customNodes=new Map,!this.options.stringArray)return;const e=this.customNodeFactory(I.CustomNode.StringArrayNode),t=this.customNodeFactory(I.CustomNode.StringArrayCallsWrapper),r=this.customNodeFactory(I.CustomNode.StringArrayRotateFunctionNode),o=this.stringArrayStorage.getStorageName(),n=this.stringArrayStorage.getStorageCallsWrapperName(),i=this.stringArrayStorage.getRotationAmount();e.initialize(this.stringArrayStorage,o),t.initialize(o,n),r.initialize(o,i),this.customNodes.set(I.CustomNode.StringArrayNode,e),this.customNodes.set(I.CustomNode.StringArrayCallsWrapper,t),this.options.rotateStringArray&&this.customNodes.set(I.CustomNode.StringArrayRotateFunctionNode,r)}};d([b.initializable(),l("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],j.prototype,"customNodes",void 0),j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.Factory__ICustomNode)),u(1,f.inject(p.ServiceIdentifiers.IStringArrayStorage)),u(2,f.inject(p.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u(3,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(4,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==m.TCustomNodeFactory&&m.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==h.IStringArrayStorage&&h.IStringArrayStorage)?i:Object,"function"==typeof(a=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?a:Object,"function"==typeof(s=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.StringArrayCustomNodeGroup=j},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8);let h=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.properties=e}getNodeStructure(e){return[N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()),N.NodeFactory.objectExpressionNode(this.properties))],"const")]}};h=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.ObjectExpressionVariableDeclarationHostNode=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n let that;\n \n try {\n const getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n const getGlobal = function () {\n let globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n const that = getGlobal();\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8),h=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.operator=e}getNodeStructure(e){const t=N.NodeFactory.expressionStatementNode(N.NodeFactory.functionExpressionNode([N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")],N.NodeFactory.blockStatementNode([N.NodeFactory.returnStatementNode(N.NodeFactory.binaryExpressionNode(this.operator,N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")))])));return h.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BinaryExpressionFunctionNode=b},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(4),I=r(6);let v=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=r}getNodeStructure(e){const t=this.randomGenerator.getRandomString(6),r=this.randomGenerator.getRandomString(6),o=h.NodeFactory.blockStatementNode([h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(t),h.NodeFactory.callExpressionNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join("|")),h.NodeFactory.identifierNode("split")),[h.NodeFactory.literalNode("|")]))],"const"),h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(r),h.NodeFactory.literalNode(0))],"let"),h.NodeFactory.whileStatementNode(h.NodeFactory.literalNode(!0),h.NodeFactory.blockStatementNode([h.NodeFactory.switchStatementNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.identifierNode(t),h.NodeFactory.updateExpressionNode("++",h.NodeFactory.identifierNode(r)),!0),this.shuffledKeys.map((e,t)=>{const r=this.blockStatementBody[e],o=[r];return b.NodeGuards.isReturnStatementNode(r)||o.push(h.NodeFactory.continueStatement()),h.NodeFactory.switchCaseNode(h.NodeFactory.literalNode(String(t)),o)})),h.NodeFactory.breakStatement()]))]);return I.NodeUtils.parentizeAst(o),[o]}};s([y.initializable(),c("design:type",Array)],v.prototype,"blockStatementBody",void 0),s([y.initializable(),c("design:type",Array)],v.prototype,"originalKeysIndexesInShuffledArray",void 0),s([y.initializable(),c("design:type",Array)],v.prototype,"shuffledKeys",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.BlockStatementControlFlowFlatteningNode=v},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8),h=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.blockStatementNode=e,this.deadCodeInjectionRootAstHostNode=t}getNodeStructure(e){const t=this.randomGenerator.getMathRandom()>.5,r=this.randomGenerator.getMathRandom()>.5,o=t?"===":"!==",n=this.randomGenerator.getRandomString(5),i=r?n:this.randomGenerator.getRandomString(5),[a,s]=t===r?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],c=N.NodeFactory.blockStatementNode([N.NodeFactory.ifStatementNode(N.NodeFactory.binaryExpressionNode(o,N.NodeFactory.literalNode(n),N.NodeFactory.literalNode(i)),a,s)]);return h.NodeUtils.parentizeAst(c),[c]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BlockStatementDeadCodeInjectionNode=b},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),N=r(7),h=r(10),b=r(8),I=r(6);let v=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r,o){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.callee=r,this.expressionArguments=o}getNodeStructure(){const e=b.NodeFactory.expressionStatementNode(b.NodeFactory.callExpressionNode(b.NodeFactory.memberExpressionNode(b.NodeFactory.identifierNode(this.controlFlowStorageName),b.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.callee,...this.expressionArguments]));return I.NodeUtils.parentizeAst(e),[e]}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof ESTree&&ESTree.Expression)?o:Object)],v.prototype,"callee",void 0),c([N.initializable(),d("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),c([N.initializable(),d("design:type",String)],v.prototype,"controlFlowStorageName",void 0),c([N.initializable(),d("design:type",Array)],v.prototype,"expressionArguments",void 0),v=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],v),t.CallExpressionControlFlowStorageCallNode=v},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.expressionArguments=e}getNodeStructure(e){const t=h.NodeFactory.identifierNode("callee"),r=[],o=this.expressionArguments.length;for(let e=0;e=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(121),m=r(5),g=r(2),y=r(3),N=r(9),h=r(7),b=r(10),I=r(8),v=r(4),S=r(6);let O=class extends b.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.controlFlowStorage=e}getNodeStructure(e){const t=Array.from(this.controlFlowStorage.getStorage()).map(([e,t])=>{const r=t.getNode()[0];if(!v.NodeGuards.isExpressionStatementNode(r))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return I.NodeFactory.propertyNode(I.NodeFactory.identifierNode(e),r.expression)});let r=I.NodeFactory.variableDeclarationNode([I.NodeFactory.variableDeclaratorNode(I.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()),I.NodeFactory.objectExpressionNode(t))],"const");return r=S.NodeUtils.parentizeAst(r),[r]}};c([h.initializable(),d("design:type","function"==typeof(o=void 0!==p.TControlFlowStorage&&p.TControlFlowStorage)?o:Object)],O.prototype,"controlFlowStorage",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.ControlFlowStorageNode=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(20),N=r(123),h=r(47),b=r(7),I=r(10),v=r(6);let S=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return v.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():h.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(N.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([b.initializable(),c("design:type",String)],S.prototype,"callsControllerFunctionName",void 0),S=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],S),t.ConsoleOutputDisableExpressionNode=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n const c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.table = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.table = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=s(r(13)),f=c(r(125)),p=r(62),m=r(4);let g=class{constructor(e){this.prevailingKindOfVariables=e.getPrevailingKind()}formatTemplate(e,t){return f.default(e,t)}formatStructure(e){for(const t of e)u.replace(t,{enter:e=>{if(m.NodeGuards.isVariableDeclarationNode(e))return"var"===this.prevailingKindOfVariables&&(e.kind="var"),e}});return e}};g=n([d.injectable(),a(0,d.inject(l.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),i("design:paramtypes",["function"==typeof(o=void 0!==p.IPrevailingKindOfVariablesAnalyzer&&p.IPrevailingKindOfVariablesAnalyzer)?o:Object])],g),t.CustomNodeFormatter=g},function(e,t){e.exports=require("string-template")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(127),h=r(10),b=r(6);let I=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(N.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([y.initializable(),c("design:type",String)],I.prototype,"callsControllerFunctionName",void 0),s([y.initializable(),c("design:type",String)],I.prototype,"debugProtectionFunctionName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.DebugProtectionFunctionCallNode=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(\n this,\n function () {\n const regExp1 = new RegExp('function *\\\\( *\\\\)');\n const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');\n \n const result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n }\n )();\n })();\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(129),h=r(10),b=r(6);let I=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(N.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([y.initializable(),c("design:type",String)],I.prototype,"debugProtectionFunctionName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.DebugProtectionFunctionIntervalNode=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(20),N=r(7),h=r(131),b=r(132),I=r(133),v=r(10),S=r(6);let O=class extends v.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?h.DebuggerTemplate():b.DebuggerTemplateNoEval();return this.customNodeFormatter.formatTemplate(I.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([N.initializable(),c("design:type",String)],O.prototype,"debugProtectionFunctionName",void 0),O=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],O),t.DebugProtectionFunctionNode=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n const func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(48),g=r(2),y=r(3),N=r(9),h=r(20),b=r(7),I=r(135),v=r(47),S=r(10),O=r(6);let j=class extends S.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.cryptUtils=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.domainLock.join(";"),[t,r]=this.cryptUtils.hideString(e,3*e.length),o=this.options.target!==h.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():v.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(I.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:r,domains:t,globalVariableTemplate:o,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([b.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.ICryptUtils)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.ICryptUtils&&m.ICryptUtils)?s:Object])],j),t.DomainLockNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n const func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (let i = 0; i < 1000; i--) {\n const isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n const regExp = new RegExp("[{diff}]", "g");\n const domains = "{domains}".replace(regExp, "").split(";");\n let document;\n let domain;\n let location;\n let hostname;\n\n for (let d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (let d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n\n if (!("~" > domain)) {\n for (let d2 in that[document]) {\n if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) {\n location = d2;\n \n break;\n }\n }\n\n for (let d3 in that[document][location]) {\n if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) {\n hostname = d3;\n \n break;\n }\n }\n }\n \n if (!document || !that[document]) {\n return;\n }\n \n const documentDomain = that[document][domain];\n const documentLocationHostName = !!that[document][location] && that[document][location][hostname];\n const currentDomain = documentDomain || documentLocationHostName;\n \n if (!currentDomain) {\n return;\n }\n \n let ok = false;\n \n for (let i = 0; i < domains.length; i++) {\n const domain = domains[i];\n const position = currentDomain.length - domain.length;\n const lastIndex = currentDomain.indexOf(domain, position);\n const endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r,o){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=r,this.rightValue=o}getNodeStructure(){const e=h.NodeFactory.expressionStatementNode(h.NodeFactory.callExpressionNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.identifierNode(this.controlFlowStorageName),h.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.ExpressionWithOperatorControlFlowStorageCallNode=I},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8),h=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.operator=e}getNodeStructure(e){const t=N.NodeFactory.expressionStatementNode(N.NodeFactory.functionExpressionNode([N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")],N.NodeFactory.blockStatementNode([N.NodeFactory.returnStatementNode(N.NodeFactory.logicalExpressionNode(this.operator,N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")))])));return h.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionFunctionNode=b},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(22),N=r(7),h=r(139),b=r(36),I=r(10),v=r(25),S=r(6),O=r(9);let j=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.appendEvent===y.ObfuscationEvent.AfterObfuscation?v.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(h.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed})).getObfuscatedCode():this.customNodeFormatter.formatTemplate(h.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([N.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),c([N.initializable(),d("design:type","function"==typeof(o=void 0!==y.ObfuscationEvent&&y.ObfuscationEvent)?o:Object)],j.prototype,"appendEvent",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==O.ICustomNodeFormatter&&O.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],j),t.NodeCallsControllerFunctionNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n const {singleNodeCallControllerFunctionName} = (function(){\n let firstCall = true;\n \n return function (context, fn){\n const rfn = firstCall ? function(){\n if(fn){\n const res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),N=r(9),h=r(7),b=r(36),I=r(141),v=r(10),S=r(25),O=r(6);let j=class extends v.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return S.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(I.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}};c([h.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],j),t.SelfDefendingUnicodeNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return !regExp.test(func1.toString());\n };\n \n const test2 = function () {\n const regExp = new RegExp('${e.encode("(\\\\[x|u](\\w){2,4})+",!0)}');\n \n return regExp.test(func2.toString());\n };\n \n const recursiveFunc1 = function (string) {\n const i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n const recursiveFunc2 = function (string) {\n const i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+"")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n `}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),N=r(9),h=r(20),b=r(24),I=r(7),v=r(36),S=r(143),O=r(47),j=r(144),_=r(145),C=r(146),R=r(147),F=r(148),T=r(10),x=r(25),G=r(6);let E=class extends T.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}getNodeStructure(e){return G.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.getDecodeStringArrayTemplate();return x.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(R.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),Object.assign(Object.assign({},v.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}getDecodeStringArrayTemplate(){const e=this.options.target!==h.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():O.GlobalVariableNoEvalTemplate(),t=this.customNodeFormatter.formatTemplate(S.AtobTemplate(),{globalVariableTemplate:e});let r="",o="";switch(this.options.selfDefending&&(o=this.customNodeFormatter.formatTemplate(_.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case b.StringArrayEncoding.Rc4:r=this.customNodeFormatter.formatTemplate(F.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:j.Rc4Template(),selfDefendingCode:o,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case b.StringArrayEncoding.Base64:r=this.customNodeFormatter.formatTemplate(C.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:o,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return r}};c([I.initializable(),d("design:type",String)],E.prototype,"stringArrayName",void 0),c([I.initializable(),d("design:type",String)],E.prototype,"stringArrayCallsWrapperName",void 0),E=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],E),t.StringArrayCallsWrapper=E},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n const str = String(input).replace(/=+$/, '');\n let output = '';\n for (\n let bc = 0, bs, buffer, idx = 0;\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n }\n );\n })();\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n const rc4 = function (str, key) {\n let s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (let k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n let i;\n \t \n\t for (i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (let y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){const r=e.getRandomString(6),o=e.getRandomString(6),n=e.getRandomString(6),i=e.getRandomString(6),a=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),d=e.getRandomString(6),l=e.getRandomString(6);return`\n const StatesClass = function (${r}) {\n this.${r} = ${r};\n this.${o} = [1, 0, 0];\n this.${n} = function(){return 'newState';};\n this.${i} = '${t.encode("\\w+ *\\(\\) *{\\w+ *",!0)}';\n this.${a} = '${t.encode("['|\"].+['|\"];? *}",!0)}';\n };\n \n StatesClass.prototype.${s} = function () {\n const regExp = new RegExp(this.${i} + this.${a});\n const expression = regExp.test(this.${n}.toString())\n ? --this.${o}[1]\n : --this.${o}[0];\n \n return this.${c}(expression);\n };\n \n StatesClass.prototype.${c} = function (${l}) {\n if (!Boolean(~${l})) {\n return ${l};\n }\n \n return this.${d}(this.${r});\n };\n\n StatesClass.prototype.${d} = function (${r}) {\n for (let i = 0, len = this.${o}.length; i < len; i++) {\n this.${o}.push(Math.round(Math.random()));\n len = this.${o}.length;\n }\n \n return ${r}(this.${o}[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).${s}();\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){const t=e.getRandomString(6),r=e.getRandomString(6),o=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.${r} = function (str) {\n const string = atob(str);\n let newStringChars = [];\n \n for (let i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.${o} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${o}[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.${r}(value);\n {stringArrayCallsWrapperName}.${o}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n const {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n let value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){const t=e.getRandomString(6),r=e.getRandomString(6),o=e.getRandomString(6),n=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.${r} = rc4;\n \n {stringArrayCallsWrapperName}.${o} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${o}[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.${n} === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.${n} = true;\n }\n \n value = {stringArrayCallsWrapperName}.${r}(value, key);\n {stringArrayCallsWrapperName}.${o}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),N=r(35),h=r(7),b=r(150),I=r(10),v=r(6);let S=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.stringArrayStorage=e,this.stringArrayName=t}getNodeStructure(e){return v.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(b.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}};c([h.initializable(),d("design:type","function"==typeof(o=void 0!==N.IStringArrayStorage&&N.IStringArrayStorage)?o:Object)],S.prototype,"stringArrayStorage",void 0),c([h.initializable(),d("design:type",String)],S.prototype,"stringArrayName",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],S),t.StringArrayNode=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n const {stringArrayName} = [{stringArray}];\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),N=r(9),h=r(7),b=r(36),I=r(152),v=r(153),S=r(10),O=r(25),j=r(6),_=r(37);let C=class extends S.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayRotationAmount=t}getNodeStructure(e){return j.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate();let r="";return r=this.options.selfDefending?this.customNodeFormatter.formatTemplate(I.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):`${t}(++${e})`,O.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(v.StringArrayRotateFunctionTemplate(),{code:r,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotationAmount:_.NumberUtils.toHex(this.stringArrayRotationAmount),whileFunctionName:t}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}};c([h.initializable(),d("design:type",String)],C.prototype,"stringArrayName",void 0),c([h.initializable(),d("design:type",Number)],C.prototype,"stringArrayRotationAmount",void 0),C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.StringArrayRotateFunctionNode=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const selfDefendingFunc = function () {\n const object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n let updatedCookie = name + "=" + value;\n let i = 0;\n \n for (let i = 0, len = options.length; i < len; i++) {\n const propName = options[i];\n \n updatedCookie += "; " + propName;\n \n const propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += "=" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n const matches = document(new RegExp(\n "(?:^|; )" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + "=([^;]*)"\n ));\n \n const func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n let cookie = '';\n const result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n const {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotationAmount});\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}getNodeStructure(){const e=h.NodeFactory.expressionStatementNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.identifierNode(this.controlFlowStorageName),h.NodeFactory.identifierNode(this.controlFlowStorageKey)));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.StringLiteralControlFlowStorageCallNode=I},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8);let b=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.literalValue=e}getNodeStructure(e){return[h.NodeFactory.expressionStatementNode(h.NodeFactory.literalNode(this.literalValue))]}};s([y.initializable(),c("design:type",String)],b.prototype,"literalValue",void 0),b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.StringLiteralNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0);t.finalizingTransformersModule=new o.ContainerModule(e=>{})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(31),a=r(158),s=r(159),c=r(160);t.generatorsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(a.DictionaryIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(c.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(n.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(){let e=null;return t=>r=>{if(e)return e;let o;switch(r.identifierNamesGenerator){case i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return e=o,o}}())})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(34),p=r(2),m=r(3),g=r(49);let y=o=class extends g.AbstractIdentifierNamesGenerator{constructor(e,t,r){super(e,t),this.arrayUtils=r,this.identifierNamesSet=new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)),this.identifiersIterator=this.identifierNamesSet.values()}static incrementIdentifierName(e){let t="",r=!1;for(const o of e)r||o!==o.toUpperCase()?r||o!==o.toLowerCase()?t+=o:(t+=o.toUpperCase(),r=!0):t+=o.toLowerCase();return r?t:null}generate(){if(!this.identifierNamesSet.size)throw new Error("Too many identifiers in the code, add more words to identifiers dictionary");const e=this.identifiersIterator.next();return e.done?(this.identifierNamesSet=new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])),this.identifiersIterator=this.identifierNamesSet.values(),this.generate()):e.value}generateWithPrefix(){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate()}`.replace("__","_")}getInitialIdentifierNames(e){const t=e.filter(Boolean).map(e=>e.toLowerCase());return this.arrayUtils.shuffle(t)}getIncrementedIdentifierNames(e){const t=[];for(const r of e){const e=o.incrementIdentifierName(r);e&&t.push(e)}return this.arrayUtils.shuffle(t)}};y=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(1,l.inject(u.ServiceIdentifiers.IOptions)),d(2,l.inject(u.ServiceIdentifiers.IArrayUtils)),c("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object,"function"==typeof(a=void 0!==f.IArrayUtils&&f.IArrayUtils)?a:Object])],y),t.DictionaryIdentifierNamesGenerator=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(49),m=r(37),g=r(30);let y=o=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.randomVariableNameSet=new Set}generate(e){const t=this.randomGenerator.getRandomInteger(1e4,99999999),r=m.NumberUtils.toHex(t),n=g.Utils.hexadecimalPrefix.length+1,i=e?e-n:o.baseIdentifierNameLength,a=r.substr(0,i),s=`_${g.Utils.hexadecimalPrefix}${a}`;return this.randomVariableNameSet.has(s)?this.generate(e):(this.randomVariableNameSet.add(s),s)}generateWithPrefix(e){const t=this.generate(e);return`${this.options.identifiersPrefix}${t}`.replace("__","_")}};y.baseIdentifierNameLength=6,y=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],y),t.HexadecimalIdentifierNamesGenerator=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(49);let m=o=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.previousMangledName=o.initMangledNameCharacter}generate(e){const t=this.generateNewMangledName(this.previousMangledName);return this.previousMangledName=t,t}generateWithPrefix(e){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate(e)}`}isValidIdentifierName(e){return super.isValidIdentifierName(e)&&!o.reservedNamesSet.has(e)}generateNewMangledName(e){let t=(e=>{const t=o.nameSequence,r=t.length,n=e.length,i=e=>"0".repeat(e);let a=n-1;do{const o=e[a],s=t.indexOf(o);if(s!==r-1){return e.substring(0,a)+t[s+1]+i(n-(a+1))}--a}while(a>=0);return`a${i(n)}`})(e);return this.isValidIdentifierName(t)||(t=this.generateNewMangledName(t)),t}};m.initMangledNameCharacter="9",m.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),m.reservedNamesSet=new Set(["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"]),m=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MangledIdentifierNamesGenerator=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1);t.nodeTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.Factory__INodeTransformer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeTransformer))})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(38),s=r(63),c=r(21),d=r(163),l=r(164),u=r(165),f=r(167),p=r(169),m=r(170),g=r(171);t.obfuscatingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(u.LabeledStatementTransformer).whenTargetNamed(c.NodeTransformer.LabeledStatementTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.LiteralTransformer).whenTargetNamed(c.NodeTransformer.LiteralTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ScopeIdentifiersTransformer).whenTargetNamed(c.NodeTransformer.ScopeIdentifiersTransformer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(l.BooleanLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(p.NumberLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(m.StringLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(d.BaseIdentifierObfuscatingReplacer).whenTargetNamed(a.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),e(i.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObfuscatingReplacer)),e(i.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer))})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(5),u=r(2),f=r(39),p=r(8);let m=class extends f.AbstractObfuscatingReplacer{constructor(e,t){super(t),this.blockScopesMap=new Map,this.identifierNamesGenerator=e(t)}replace(e,t){let r=e.name;if(this.blockScopesMap.has(t)){const e=this.blockScopesMap.get(t);e.has(r)&&(r=e.get(r))}return p.NodeFactory.identifierNode(r)}storeGlobalName(e,t){const r=e.name;if(this.isReservedName(r))return;const o=this.identifierNamesGenerator.generateWithPrefix();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(r,o)}storeLocalName(e,t){const r=e.name;if(this.isReservedName(r))return;const o=this.identifierNamesGenerator.generate();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(r,o)}preserveName(e){this.identifierNamesGenerator.preserveName(e)}isReservedName(e){return!!this.options.reservedNames.length&&this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==l.TIdentifierNamesGeneratorFactory&&l.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==u.IOptions&&u.IOptions)?n:Object])],m),t.BaseIdentifierObfuscatingReplacer=m},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(39),f=r(8);let p=o=class extends u.AbstractObfuscatingReplacer{constructor(e){super(e)}static getTrueUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",o.getFalseUnaryExpressionNode())}static getFalseUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",f.NodeFactory.arrayExpressionNode())}replace(e){const t=e.value;if("boolean"!=typeof t)throw new Error("`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value");return t?o.getTrueUnaryExpressionNode():o.getFalseUnaryExpressionNode()}};p=o=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.BooleanLiteralObfuscatingReplacer=p},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(50),m=r(2),g=r(3),y=r(38),N=r(11),h=r(12),b=r(4),I=r(166);let v=class extends h.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.identifierObfuscatingReplacer=e(y.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case N.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&b.NodeGuards.isLabeledStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const r=I.NodeLexicalScopeUtils.getLexicalScope(e);return r?(this.storeLabeledStatementName(e,r),this.replaceLabeledStatementName(e,r),e):e}storeLabeledStatementName(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label,t)}replaceLabeledStatementName(e,t){f.replace(e,{enter:(e,r)=>{if(r&&b.NodeGuards.isLabelIdentifierNode(e,r)){const r=this.identifierObfuscatingReplacer.replace(e,t);e.name=r.name}}})}};v=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(2,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierObfuscatingReplacerFactory&&p.TIdentifierObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==m.IOptions&&m.IOptions)?i:Object])],v),t.LabeledStatementTransformer=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static getLexicalScope(e){return n.getLexicalScopesRecursive(e,1)[0]}static getLexicalScopes(e){return n.getLexicalScopesRecursive(e)}static getLexicalScopesRecursive(e,t=1/0,r=[],i=0){if(r.length>=t)return r;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithLexicalScope(e)&&r.push(e),e!==a?n.getLexicalScopesRecursive(a,t,r,++i):r}}t.NodeLexicalScopeUtils=n},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(168),m=r(29),g=r(2),y=r(3),N=r(64),h=r(63),b=r(11),I=r(12),v=r(8),S=r(4),O=r(44),j=r(15),_=r(6);let C=class extends I.AbstractNodeTransformer{constructor(e,t,r,o,n){super(t,r),this.literalObfuscatingReplacerFactory=e,this.stringArrayStorageAnalyzer=o,this.escapeSequenceEncoder=n}getVisitor(e){switch(e){case b.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(S.NodeGuards.isProgramNode(e)&&this.analyzeNode(e),t&&S.NodeGuards.isLiteralNode(e)&&!j.NodeMetadata.isReplacedLiteral(e))return this.transformNode(e,t)}};case b.TransformationStage.Finalizing:return{enter:(e,t)=>{if(t&&S.NodeGuards.isLiteralNode(e))return this.encodeLiteralNodeToEscapeSequence(e,t)}};default:return null}}analyzeNode(e){this.stringArrayStorageAnalyzer.analyze(e)}transformNode(e,t){if(O.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;let r;switch(typeof e.value){case"boolean":r=this.literalObfuscatingReplacerFactory(h.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e);break;case"number":r=this.literalObfuscatingReplacerFactory(h.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e);break;case"string":r=this.literalObfuscatingReplacerFactory(h.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e);break;default:r=e}return _.NodeUtils.parentizeNode(r,t),r}encodeLiteralNodeToEscapeSequence(e,t){return"string"!=typeof e.value?e:v.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(e.value,this.options.unicodeEscapeSequence))}};C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IObfuscatingReplacer)),l(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(2,u.inject(f.ServiceIdentifiers.IOptions)),l(3,u.inject(f.ServiceIdentifiers.IStringArrayStorageAnalyzer)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TLiteralObfuscatingReplacerFactory&&p.TLiteralObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==g.IOptions&&g.IOptions)?i:Object,"function"==typeof(a=void 0!==N.IStringArrayStorageAnalyzer&&N.IStringArrayStorageAnalyzer)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.LiteralTransformer=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(2),l=r(39),u=r(8),f=r(37),p=r(30);let m=class extends l.AbstractObfuscatingReplacer{constructor(e){super(e),this.numberLiteralCache=new Map}replace(e){const t=e.value;if("number"!=typeof t)throw new Error("`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value");let r;return this.numberLiteralCache.has(t)?r=this.numberLiteralCache.get(t):(r=f.NumberUtils.isCeil(t)?`${p.Utils.hexadecimalPrefix}${f.NumberUtils.toHex(t)}`:String(t),this.numberLiteralCache.set(t,r)),u.NodeFactory.literalNode(t,r)}};m=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IOptions&&d.IOptions)?o:Object])],m),t.NumberLiteralObfuscatingReplacer=m},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(2),p=r(35),m=r(64),g=r(7),y=r(24),N=r(39),h=r(15),b=r(8),I=r(37),v=r(30);let S=o=class extends N.AbstractObfuscatingReplacer{constructor(e,t,r){super(r),this.nodesCache=new Map,this.stringArrayStorage=e,this.stringArrayStorageAnalyzer=t}static getHexadecimalLiteralNode(e){const t=b.NodeFactory.literalNode(e);return h.NodeMetadata.set(t,{replacedLiteral:!0}),t}static getRc4KeyLiteralNode(e){const t=b.NodeFactory.literalNode(e);return h.NodeMetadata.set(t,{replacedLiteral:!0}),t}initialize(){this.stringArrayStorageCallsWrapperName=this.stringArrayStorage.getStorageCallsWrapperName(),this.options.shuffleStringArray&&this.stringArrayStorage.shuffleStorage(),this.options.rotateStringArray&&this.stringArrayStorage.rotateStorage()}replace(e){const t=e.value;if("string"!=typeof t)throw new Error("`StringLiteralObfuscatingReplacer` should accept only literals with `string` value");const r=this.stringArrayStorageAnalyzer.getItemDataForLiteralNode(e),o=`${t}-${Boolean(r)}`;if(this.nodesCache.has(o)&&this.options.stringArrayEncoding!==y.StringArrayEncoding.Rc4)return this.nodesCache.get(o);const n=r?this.replaceWithStringArrayCallNode(r):this.replaceWithLiteralNode(t);return this.nodesCache.set(o,n),n}replaceWithLiteralNode(e){return b.NodeFactory.literalNode(e)}replaceWithStringArrayCallNode(e){const{index:t,decodeKey:r}=e,n=`${v.Utils.hexadecimalPrefix}${I.NumberUtils.toHex(t)}`,i=[o.getHexadecimalLiteralNode(n)];r&&i.push(o.getRc4KeyLiteralNode(r));const a=b.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName);return b.NodeFactory.callExpressionNode(a,i)}};s([g.initializable(),c("design:type",String)],S.prototype,"stringArrayStorageCallsWrapperName",void 0),s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],S.prototype,"initialize",null),S=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IStringArrayStorage)),d(1,l.inject(u.ServiceIdentifiers.IStringArrayStorageAnalyzer)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==p.IStringArrayStorage&&p.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==m.IStringArrayStorageAnalyzer&&m.IStringArrayStorageAnalyzer)?i:Object,"function"==typeof(a=void 0!==f.IOptions&&f.IOptions)?a:Object])],S),t.StringLiteralObfuscatingReplacer=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(50),y=r(2),N=r(3),h=r(172),b=r(38),I=r(11),v=r(12),S=r(4),O=r(15);let j=o=class extends v.AbstractNodeTransformer{constructor(e,t,r,o){super(t,r),this.lexicalScopesWithObjectPatternWithoutDeclarationMap=new Map,this.identifierObfuscatingReplacer=e(b.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),this.scopeAnalyzer=o}getVisitor(e){switch(e){case I.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&S.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.transformNode(e,t)}};default:return null}}analyzeNode(e,t){this.scopeAnalyzer.analyze(e)}transformNode(e,t){const r=this.scopeAnalyzer.acquireScope(e);return this.traverseScopeVariables(r),e}traverseScopeVariables(e){const t=e.variableScope,r=S.NodeGuards.isNodeWithBlockLexicalScope(t.block)?t.block:null,n=o.globalScopeNames.includes(t.type);if(r){for(const t of e.variables)if(t.name!==o.argumentsVariableName){if(!this.options.renameGlobals&&n){if(!t.defs.every(e=>"ImportBinding"===e.type||"CatchClause"===e.type))continue}this.transformScopeVariableIdentifiers(t,r,n)}for(const t of e.childScopes)this.traverseScopeVariables(t)}}transformScopeVariableIdentifiers(e,t,r){for(const o of e.identifiers)this.isReplaceableIdentifierNode(o,t,e)&&(this.storeIdentifierName(o,t,r),this.replaceIdentifierName(o,t,e))}storeIdentifierName(e,t,r){r?this.identifierObfuscatingReplacer.storeGlobalName(e,t):this.identifierObfuscatingReplacer.storeLocalName(e,t)}replaceIdentifierName(e,t,r){const o=this.identifierObfuscatingReplacer.replace(e,t);e.name=o.name,r.references.forEach(t=>{t.identifier.name=e.name})}isReplaceableIdentifierNode(e,t,r){const o=e.parentNode;return!(!o||O.NodeMetadata.isIgnoredNode(e)||this.isProhibitedPropertyNode(e,o)||this.isProhibitedClassDeclarationNameIdentifierNode(r,e,o)||this.isProhibitedExportNamedClassDeclarationIdentifierNode(e,o)||this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,o)||this.isProhibitedExportNamedVariableDeclarationIdentifierNode(e,o)||this.isProhibitedImportSpecifierNode(e,o)||this.isProhibitedVariableNameUsedInObjectPatternNode(r,e,t)||S.NodeGuards.isLabelIdentifierNode(e,o))}isProhibitedClassDeclarationNameIdentifierNode(e,t,r){return S.NodeGuards.isClassDeclarationNode(e.scope.block)&&S.NodeGuards.isClassDeclarationNode(r)&&r.id===t}isProhibitedExportNamedClassDeclarationIdentifierNode(e,t){return S.NodeGuards.isClassDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,t){return S.NodeGuards.isFunctionDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedVariableDeclarationIdentifierNode(e,t){return S.NodeGuards.isVariableDeclaratorNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isVariableDeclarationNode(t.parentNode)&&!!t.parentNode.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode.parentNode)}isProhibitedImportSpecifierNode(e,t){return S.NodeGuards.isImportSpecifierNode(t)&&t.imported.name===t.local.name}isProhibitedPropertyNode(e,t){return S.NodeGuards.isPropertyNode(t)&&!t.computed&&t.key===e}isProhibitedVariableNameUsedInObjectPatternNode(e,t,r){let o=this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(r);if(!1===o)return!1;if(!e.defs.some(e=>"var"===e.kind))return!1;let n=!1;return m.traverse(r,{enter:(e,r)=>{if(S.NodeGuards.isObjectPatternNode(e)&&r&&S.NodeGuards.isAssignmentExpressionNode(r)){o=!0;const r=e.properties;for(const e of r)if(!e.computed&&e.shorthand&&S.NodeGuards.isIdentifierNode(e.key)&&t.name===e.key.name)return n=!0,m.VisitorOption.Break}}}),this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(r,null!=o&&o),n}};j.argumentsVariableName="arguments",j.globalScopeNames=["global","module"],j=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),l(1,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(2,f.inject(p.ServiceIdentifiers.IOptions)),l(3,f.inject(p.ServiceIdentifiers.IScopeAnalyzer)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierObfuscatingReplacerFactory&&g.TIdentifierObfuscatingReplacerFactory)?n:Object,"function"==typeof(i=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.IOptions&&y.IOptions)?a:Object,"function"==typeof(s=void 0!==h.IScopeAnalyzer&&h.IScopeAnalyzer)?s:Object])],j),t.ScopeIdentifiersTransformer=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(174),a=r(181);t.optionsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IOptions).to(i.Options).inSingletonScope(),e(n.ServiceIdentifiers.IOptionsNormalizer).to(a.OptionsNormalizer).inSingletonScope()})},function(e,t,r){"use strict";var o,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=r(28),m=r(0),g=r(1),y=r(65),N=r(175),h=r(176),b=r(177),I=r(31),v=r(20),S=r(32),O=r(24),j=r(40),_=r(178),C=r(179);let R=o=class{constructor(e,t){Object.assign(this,j.DEFAULT_PRESET,e);const r=y.validateSync(this,o.validatorOptions);if(r.length)throw new ReferenceError(`Validation failed. errors:\n${_.ValidationErrorsFormatter.format(r)}`);Object.assign(this,t.normalize(this))}};R.validatorOptions={validationError:{target:!1}},l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"compact",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"controlFlowFlattening",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"controlFlowFlatteningThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"deadCodeInjection",void 0),l([y.IsNumber(),u("design:type",Number)],R.prototype,"deadCodeInjectionThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtection",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtectionInterval",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"disableConsoleOutput",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),C.IsAllowedForObfuscationTargets([v.ObfuscationTarget.Browser,v.ObfuscationTarget.BrowserNoEval]),u("design:type",Array)],R.prototype,"domainLock",void 0),l([y.IsIn([I.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,I.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,I.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]),u("design:type","function"==typeof(n=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?n:Object)],R.prototype,"identifierNamesGenerator",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"identifiersPrefix",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),y.ValidateIf(e=>e.identifierNamesGenerator===I.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),y.ArrayNotEmpty(),u("design:type",Array)],R.prototype,"identifiersDictionary",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFileName",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFilePath",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"log",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"renameGlobals",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedNames",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedStrings",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"rotateStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"selfDefending",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"shuffleStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"sourceMap",void 0),l([y.IsString(),y.ValidateIf(e=>Boolean(e.sourceMapBaseUrl)),y.IsUrl({require_protocol:!0,require_tld:!1,require_valid_protocol:!0}),u("design:type",String)],R.prototype,"sourceMapBaseUrl",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"sourceMapFileName",void 0),l([y.IsIn([S.SourceMapMode.Inline,S.SourceMapMode.Separate]),u("design:type","function"==typeof(i=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?i:Object)],R.prototype,"sourceMapMode",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"splitStrings",void 0),l([y.IsNumber(),y.ValidateIf(e=>Boolean(e.splitStrings)),y.Min(1),u("design:type",Number)],R.prototype,"splitStringsChunkLength",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"stringArray",void 0),l([y.IsIn([!0,!1,O.StringArrayEncoding.Base64,O.StringArrayEncoding.Rc4]),u("design:type","function"==typeof(a=void 0!==h.TStringArrayEncoding&&h.TStringArrayEncoding)?a:Object)],R.prototype,"stringArrayEncoding",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"stringArrayThreshold",void 0),l([y.IsIn([v.ObfuscationTarget.Browser,v.ObfuscationTarget.BrowserNoEval,v.ObfuscationTarget.Node]),u("design:type","function"==typeof(s=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?s:Object)],R.prototype,"target",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"transformObjectKeys",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"unicodeEscapeSequence",void 0),R=o=l([m.injectable(),f(0,m.inject(g.ServiceIdentifiers.TInputOptions)),f(1,m.inject(g.ServiceIdentifiers.IOptionsNormalizer)),u("design:paramtypes",["function"==typeof(c=void 0!==N.TInputOptions&&N.TInputOptions)?c:Object,"function"==typeof(d=void 0!==b.IOptionsNormalizer&&b.IOptionsNormalizer)?d:Object])],R),t.Options=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static format(e){return e.reduce((e,t)=>[...e,o.formatWithNestedConstraints(t)],[]).join("\n")}static formatWithNestedConstraints(e){const t=e.constraints;return`${`\`${e.property}\` errors:\n`}${Object.keys(t).map(e=>` - ${t[e]}\n`).join()}`}}t.ValidationErrorsFormatter=o},function(e,t,r){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(65),i=o(r(180)),a=r(41),s=r(40);t.IsAllowedForObfuscationTargets=function(e,t){return(r,o)=>{n.registerDecorator({propertyName:o,constraints:[e],name:"IsAllowedForObfuscationTargets",options:t,target:r.constructor,validator:{validate(t,r){const n=r.object,a=s.DEFAULT_PRESET[o];return i.default(t,a)||e.includes(n.target)},defaultMessage:t=>`This option allowed only for obfuscation targets: ${e.join(`${a.StringSeparator.Comma} `)}`}})}}},function(e,t){e.exports=require("fast-deep-equal")},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(182),s=r(183),c=r(184),d=r(185),l=r(186),u=r(187),f=r(188),p=r(189),m=r(190),g=r(191),y=r(192),N=r(193),h=r(194);let b=o=class{normalize(e){let t=Object.assign({},e);for(const e of o.normalizerRules)t=e(t);return t}};b.normalizerRules=[a.ControlFlowFlatteningThresholdRule,s.DeadCodeInjectionRule,c.DeadCodeInjectionThresholdRule,d.DomainLockRule,l.InputFileNameRule,u.SeedRule,f.SelfDefendingRule,p.SourceMapBaseUrlRule,m.SourceMapFileNameRule,g.SplitStringsChunkLengthRule,y.StringArrayRule,N.StringArrayEncodingRule,h.StringArrayThresholdRule],b=o=n([i.injectable()],b),t.OptionsNormalizer=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControlFlowFlatteningThresholdRule=e=>(0===e.controlFlowFlatteningThreshold&&(e=Object.assign(Object.assign({},e),{controlFlowFlattening:!1,controlFlowFlatteningThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(40);t.DeadCodeInjectionRule=e=>(e.deadCodeInjection&&((e=Object.assign(Object.assign({},e),{deadCodeInjection:!0,stringArray:!0})).stringArrayThreshold||(e=Object.assign(Object.assign({},e),{stringArray:!0,stringArrayThreshold:o.DEFAULT_PRESET.stringArrayThreshold}))),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeadCodeInjectionThresholdRule=e=>(0===e.deadCodeInjectionThreshold&&(e=Object.assign(Object.assign({},e),{deadCodeInjection:!1,deadCodeInjectionThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(30);t.DomainLockRule=e=>{if(e.domainLock.length){const t=[];for(const r of e.domainLock)t.push(o.Utils.extractDomainFrom(r));e=Object.assign(Object.assign({},e),{domainLock:t})}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(41);t.InputFileNameRule=e=>{let{inputFileName:t}=e;return t&&(t=t.replace(/^\/+/,"").split(o.StringSeparator.Dot).slice(0,-1).join(o.StringSeparator.Dot)||t,e=Object.assign(Object.assign({},e),{inputFileName:`${t}.js`})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeedRule=e=>{if(e.seed)return Object.assign(Object.assign({},e),{seed:e.seed});return Object.assign(Object.assign({},e),{seed:(t=0,r=999999999,Math.floor(Math.random()*(r-t+1)+t))});var t,r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingRule=e=>(e.selfDefending&&(e=Object.assign(Object.assign({},e),{compact:!0,selfDefending:!0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapBaseUrlRule=e=>{const{sourceMapBaseUrl:t}=e;return e.sourceMapFileName?(t&&!t.endsWith("/")&&(e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:`${t}/`})),e):e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:""})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(41);t.SourceMapFileNameRule=e=>{let{sourceMapFileName:t}=e;if(t){t=t.replace(/^\/+/,"").replace(/(?:\.js)?(?:\.map)?$/,"");let r=t.split(o.StringSeparator.Dot);const n=r.length,i=r[n-1];n>1&&i.length<=3&&(r=r.slice(0,-1)),t=r.join(o.StringSeparator.Dot),e=Object.assign(Object.assign({},e),{sourceMapFileName:`${t}.js.map`})}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SplitStringsChunkLengthRule=e=>e=0===e.splitStringsChunkLength?Object.assign(Object.assign({},e),{splitStrings:!1,splitStringsChunkLength:0}):Object.assign(Object.assign({},e),{splitStringsChunkLength:Math.floor(e.splitStringsChunkLength)})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRule=e=>(e.stringArray||(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,shuffleStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(24);t.StringArrayEncodingRule=e=>(!0===e.stringArrayEncoding&&(e=Object.assign(Object.assign({},e),{stringArrayEncoding:o.StringArrayEncoding.Base64})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayThresholdRule=e=>(0===e.stringArrayThreshold&&(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(21),s=r(66),c=r(196),d=r(197),l=r(67),u=r(198),f=r(202),p=r(204),m=r(205),g=r(207),y=r(208),N=r(209);t.preparingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.CommentsTransformer).whenTargetNamed(a.NodeTransformer.CommentsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.CustomNodesTransformer).whenTargetNamed(a.NodeTransformer.CustomNodesTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.EvalCallExpressionTransformer).whenTargetNamed(a.NodeTransformer.EvalCallExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.MetadataTransformer).whenTargetNamed(a.NodeTransformer.MetadataTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.ObfuscatingGuardsTransformer).whenTargetNamed(a.NodeTransformer.ObfuscatingGuardsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ParentificationTransformer).whenTargetNamed(a.NodeTransformer.ParentificationTransformer),e(i.ServiceIdentifiers.INodeGuard).to(c.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.BlackListObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(l.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ConditionalCommentObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(y.ReservedStringObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ReservedStringObfuscatingGuard),e(i.ServiceIdentifiers.Factory__INodeGuard).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeGuard)),e(i.ServiceIdentifiers.INodeTransformer).to(N.VariablePreserveTransformer).whenTargetNamed(a.NodeTransformer.VariablePreserveTransformer)})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=r(4);let c=o=class{constructor(){this.blackListGuardsLength=o.blackListGuards.length}check(e){for(let t=0;t=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(2),m=r(3),g=r(11),y=r(12),N=r(4),h=r(67);let b=o=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case g.TransformationStage.Initializing:return{leave:e=>{if(N.NodeGuards.isProgramNode(e))return this.transformNode(e)}};default:return null}}transformNode(e){if(!e.comments||!e.comments.length)return e;const t=this.transformComments(e.comments);return 0===t.length?e:e.body.length?(f.traverse(e,{enter:r=>{if(r===e)return;const o=t.findIndex(e=>e.range&&r.range&&e.range[0]0&&(e.trailingComments=t.reverse()),e):(e.leadingComments=t,e)}transformComments(e){return e.filter(e=>o.preservedWords.some(t=>e.value.includes(t))||h.ConditionalCommentObfuscatingGuard.isConditionalComment(e)).reverse()}};b.preservedWords=["@license","@preserve"],b=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],b),t.CommentsTransformer=b},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=r(199),g=r(200),y=r(2),N=r(3),h=r(201),b=r(62),I=r(22),v=r(11),S=r(12),O=r(4);let j=class extends S.AbstractNodeTransformer{constructor(e,t,r,o,n,i){super(n,i),this.callsGraphData=[],this.callsGraphAnalyzer=e,this.prevailingKindOfVariablesAnalyzer=t,this.obfuscationEventEmitter=r,this.customNodeGroupStorage=o}getVisitor(e){switch(e){case v.TransformationStage.Preparing:return{leave:(e,t)=>{if(O.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.appendCustomNodesBeforeObfuscation(e,t),this.transformNode(e,t)}};case v.TransformationStage.Finalizing:return{leave:(e,t)=>{O.NodeGuards.isProgramNode(e)&&this.appendCustomNodesAfterObfuscation(e,t)}};default:return null}}analyzeNode(e,t){this.callsGraphData=this.callsGraphAnalyzer.analyze(e),this.prevailingKindOfVariablesAnalyzer.analyze(e)}transformNode(e,t){return e}appendCustomNodesBeforeObfuscation(e,t){this.customNodeGroupStorage.getStorage().forEach(e=>{e.initialize(),this.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(I.ObfuscationEvent.BeforeObfuscation,e,this.callsGraphData)}appendCustomNodesAfterObfuscation(e,t){this.obfuscationEventEmitter.emit(I.ObfuscationEvent.AfterObfuscation,e,this.callsGraphData)}};j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.ICallsGraphAnalyzer)),u(1,f.inject(p.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),u(2,f.inject(p.ServiceIdentifiers.IObfuscationEventEmitter)),u(3,f.inject(p.ServiceIdentifiers.TCustomNodeGroupStorage)),u(4,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(5,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(o=void 0!==h.ICallsGraphAnalyzer&&h.ICallsGraphAnalyzer)?o:Object,"function"==typeof(n=void 0!==b.IPrevailingKindOfVariablesAnalyzer&&b.IPrevailingKindOfVariablesAnalyzer)?n:Object,"function"==typeof(i=void 0!==g.IObfuscationEventEmitter&&g.IObfuscationEventEmitter)?i:Object,"function"==typeof(a=void 0!==m.TCustomNodeGroupStorage&&m.TCustomNodeGroupStorage)?a:Object,"function"==typeof(s=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.CustomNodesTransformer=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(203)),p=r(2),m=r(3),g=r(11),y=r(12),N=r(8),h=r(4),b=r(6);let I=o=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t),this.evalRootAstHostNodeSet=new Set}static extractEvalStringFromCallExpressionArgument(e){return h.NodeGuards.isLiteralNode(e)?o.extractEvalStringFromLiteralNode(e):h.NodeGuards.isTemplateLiteralNode(e)?o.extractEvalStringFromTemplateLiteralNode(e):null}static extractEvalStringFromLiteralNode(e){return"string"==typeof e.value?e.value:null}static extractEvalStringFromTemplateLiteralNode(e){const t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(t&&h.NodeGuards.isCallExpressionNode(e)&&h.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return this.transformNode(e,t)}};case g.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:(e,t)=>{if(t&&this.isEvalRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}transformNode(e,t){const r=e.arguments[0];if(!r)return e;const n=o.extractEvalStringFromCallExpressionArgument(r);if(!n)return e;let i;try{i=b.NodeUtils.convertCodeToStructure(n)}catch(t){return e}const a=N.NodeFactory.functionExpressionNode([],N.NodeFactory.blockStatementNode(i));return this.evalRootAstHostNodeSet.add(a),a}restoreNode(e,t){const r=e.body.body,o=b.NodeUtils.convertStructureToCode(r);return N.NodeFactory.callExpressionNode(N.NodeFactory.identifierNode("eval"),[N.NodeFactory.literalNode(f.default(o))])}isEvalRootAstHostNode(e){return h.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}};I=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],I),t.EvalCallExpressionTransformer=I},function(e,t){e.exports=require("js-string-escape")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(4),g=r(15);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return g.NodeMetadata.set(e,{ignoredNode:!1}),m.NodeGuards.isLiteralNode(e)&&g.NodeMetadata.set(e,{replacedLiteral:!1}),e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MetadataTransformer=y},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(206),p=r(2),m=r(3),g=r(66),y=r(11),N=r(12),h=r(15);let b=o=class extends N.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.obfuscatingGuards=o.obfuscatingGuardsList.map(e)}getVisitor(e){switch(e){case y.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){const r=this.obfuscatingGuards.every(t=>t.check(e));return h.NodeMetadata.set(e,{ignoredNode:!r}),e}};b.obfuscatingGuardsList=[g.ObfuscatingGuard.BlackListObfuscatingGuard,g.ObfuscatingGuard.ConditionalCommentObfuscatingGuard,g.ObfuscatingGuard.ReservedStringObfuscatingGuard],b=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__INodeGuard)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TObfuscatingGuardFactory&&f.TObfuscatingGuardFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.ObfuscatingGuardsTransformer=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(6);let g=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return m.NodeUtils.parentizeNode(e,t)}};g=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],g),t.ParentificationTransformer=g},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(2),d=r(1),l=r(4);let u=class{constructor(e){this.options=e}check(e){return!this.options.reservedStrings.length||!l.NodeGuards.isLiteralNode(e)||"string"!=typeof e.value||!this.isReservedString(e.value)}isReservedString(e){return this.options.reservedStrings.some(t=>null!==new RegExp(t,"g").exec(e))}};u=n([s.injectable(),a(0,s.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==c.IOptions&&c.IOptions)?o:Object])],u),t.ReservedStringObfuscatingGuard=u},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(50),u=r(2),f=r(3),p=r(38),m=r(1),g=r(11),y=r(12),N=r(4);let h=class extends y.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(N.NodeGuards.isIdentifierNode(e)&&t&&(N.NodeGuards.parentNodeIsPropertyNode(e,t)||N.NodeGuards.parentNodeIsMemberExpressionNode(e,t)||N.NodeGuards.parentNodeIsMethodDefinitionNode(e,t)||N.NodeGuards.isLabelIdentifierNode(e,t)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return this.identifierObfuscatingReplacer.preserveName(e.name),e}};h=a([d.injectable(),c(0,d.inject(m.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,d.inject(m.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(m.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==l.TIdentifierObfuscatingReplacerFactory&&l.TIdentifierObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.VariablePreserveTransformer=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(211),a=r(212),s=r(214);t.storagesModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.TCustomNodeGroupStorage).to(a.CustomNodeGroupStorage).inSingletonScope(),e(n.ServiceIdentifiers.IStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(n.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(i.ControlFlowStorage),e(n.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(e=>()=>{const t=new(e.container.get(n.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(n.ServiceIdentifiers.IRandomGenerator),e.container.get(n.ServiceIdentifiers.IOptions));return t.initialize(),t})})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(51);let p=class extends f.MapStorage{constructor(e,t){super(e,t)}};p=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.ControlFlowStorage=p},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(213),p=r(2),m=r(3),g=r(61),y=r(51);let N=o=class extends y.MapStorage{constructor(e,t,r){super(t,r),this.customNodeGroupFactory=e}initialize(){super.initialize(),o.customNodeGroupsList.forEach(e=>{const t=this.customNodeGroupFactory(e);this.storage.set(e,t)})}};N.customNodeGroupsList=[g.CustomNodeGroup.ConsoleOutputCustomNodeGroup,g.CustomNodeGroup.DebugProtectionCustomNodeGroup,g.CustomNodeGroup.DomainLockCustomNodeGroup,g.CustomNodeGroup.SelfDefendingCustomNodeGroup,g.CustomNodeGroup.StringArrayCustomNodeGroup],s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],N.prototype,"initialize",null),N=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__ICustomNodeGroup)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TCustomNodeGroupFactory&&f.TCustomNodeGroupFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.CustomNodeGroupStorage=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=r(5),y=r(34),N=r(48),h=r(29),b=r(2),I=r(3),v=r(7),S=r(24),O=r(51);let j=o=class extends O.MapStorage{constructor(e,t,r,n,i,a){super(r,n),this.rc4EncodedValuesSourcesCache=new Map,this.rotationAmount=0,this.identifierNamesGenerator=e(n),this.arrayUtils=t,this.cryptUtils=i,this.escapeSequenceEncoder=a,this.rc4Keys=this.randomGenerator.getRandomGenerator().n(()=>this.randomGenerator.getRandomGenerator().string({length:o.rc4KeyLength}),o.rc4KeysCount)}initialize(){super.initialize();const e=this.identifierNamesGenerator.generate(o.stringArrayNameLength),t=this.identifierNamesGenerator.generate(o.stringArrayNameLength);this.stringArrayStorageName=`${this.options.identifiersPrefix}${e}`,this.stringArrayStorageCallsWrapperName=`${this.options.identifiersPrefix}${t}`,this.rotationAmount=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(o.minimumRotationAmount,o.maximumRotationAmount):0}get(e){return this.getOrSetIfDoesNotExist(e)}getRotationAmount(){return this.rotationAmount}getStorageId(){return this.stringArrayStorageName}getStorageName(){return this.getStorageId()}getStorageCallsWrapperName(){return this.stringArrayStorageCallsWrapperName}rotateStorage(){this.getLength()&&(this.storage=new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()),this.rotationAmount)))}shuffleStorage(){this.storage=new Map(this.arrayUtils.shuffle(Array.from(this.storage.entries())).map(([e,t],r)=>(t.index=r,[e,t])).sort(([,e],[,t])=>e.index-t.index))}toString(){return Array.from(this.storage.values()).map(e=>`'${this.escapeSequenceEncoder.encode(e.encodedValue,this.options.unicodeEscapeSequence)}'`).toString()}getOrSetIfDoesNotExist(e){const{encodedValue:t,decodeKey:r}=this.getEncodedValue(e),o=this.storage.get(t);if(o)return o;const n={encodedValue:t,decodeKey:r,value:e,index:this.getLength()};return this.storage.set(t,n),n}getEncodedValue(e){var t;switch(this.options.stringArrayEncoding){case S.StringArrayEncoding.Rc4:{const r=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),o=this.cryptUtils.btoa(this.cryptUtils.rc4(e,r)),n=null!==(t=this.rc4EncodedValuesSourcesCache.get(o))&&void 0!==t?t:[];let i=n.length;return(!i||!n.includes(e))&&(n.push(e),i++),this.rc4EncodedValuesSourcesCache.set(o,n),i>1?this.getEncodedValue(e):{encodedValue:o,decodeKey:r}}case S.StringArrayEncoding.Base64:{const t=null;return{encodedValue:this.cryptUtils.btoa(e),decodeKey:t}}default:return{encodedValue:e,decodeKey:null}}}};j.minimumRotationAmount=100,j.maximumRotationAmount=500,j.rc4KeyLength=4,j.rc4KeysCount=50,j.stringArrayNameLength=7,l([v.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageName",void 0),l([v.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageCallsWrapperName",void 0),l([p.postConstruct(),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],j.prototype,"initialize",null),j=o=l([p.injectable(),f(0,p.inject(m.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),f(1,p.inject(m.ServiceIdentifiers.IArrayUtils)),f(2,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f(3,p.inject(m.ServiceIdentifiers.IOptions)),f(4,p.inject(m.ServiceIdentifiers.ICryptUtils)),f(5,p.inject(m.ServiceIdentifiers.IEscapeSequenceEncoder)),u("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==I.IRandomGenerator&&I.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==b.IOptions&&b.IOptions)?s:Object,"function"==typeof(c=void 0!==N.ICryptUtils&&N.ICryptUtils)?c:Object,"function"==typeof(d=void 0!==h.IEscapeSequenceEncoder&&h.IEscapeSequenceEncoder)?d:Object])],j),t.StringArrayStorage=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(216),a=r(217),s=r(221),c=r(222),d=r(223),l=r(68);t.utilsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IArrayUtils).to(i.ArrayUtils).inSingletonScope(),e(n.ServiceIdentifiers.IRandomGenerator).to(l.RandomGenerator).inSingletonScope(),e(n.ServiceIdentifiers.ICryptUtils).to(a.CryptUtils).inSingletonScope(),e(n.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope(),e(n.ServiceIdentifiers.ILevelledTopologicalSorter).to(c.LevelledTopologicalSorter),e(n.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder).to(d.NodeTransformerNamesGroupsBuilder).inSingletonScope()})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(3);let l=class{constructor(e){this.randomGenerator=e}createWithRange(e){const t=[];for(let r=0;rn&&(o=i,n=e),r[i]=e}return o}rotate(e,t){if(!e.length)throw new ReferenceError("Cannot rotate empty array.");if(t<=0)return e;const r=e;let o;for(;t--;)o=r.pop(),o&&r.unshift(o);return r}shuffle(e){const t=[...e];for(let e=t.length;e;e--){const r=Math.floor(this.randomGenerator.getMathRandom()*e);[t[e-1],t[r]]=[t[r],t[e-1]]}return t}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IRandomGenerator&&d.IRandomGenerator)?o:Object])],l),t.ArrayUtils=l},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(3),l=r(68),u=r(30);let f=class{constructor(e){this.randomGenerator=e}btoa(e){let t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(`${u.Utils.hexadecimalPrefix}${t}`,16)));for(let r,o,n=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|n)||(i="=",n%1);t+=i.charAt(63&r>>8-n%1*8)){if(o=e.charCodeAt(n+=.75),o>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|o}return t}hideString(e,t){let r=this.randomGenerator.getRandomGenerator().string({length:t,pool:l.RandomGenerator.randomGeneratorPool}).replace(new RegExp(`[${o=e,o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}]`,"g"),"");var o;const n=r.split("");return this.randomGenerator.getRandomGenerator().shuffle(n),r=n.join(""),[((e,t)=>{let r=-1,o=-1,n="";for(;r=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.stringsCache=new Map}encode(e,t){const r=`${e}-${String(t)}`;if(this.stringsCache.has(r))return this.stringsCache.get(r);const o=new RegExp("[\\s\\S]","g"),n=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const c=e.replace(o,e=>t||n.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(r,c),this.stringsCache.set(`${c}-${String(t)}`,c),c}};n=o([r(0).injectable()],n),t.EscapeSequenceEncoder=n},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],r={};for(const o of e)void 0===r[o]&&this.visit(t,r,o);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const r of t){for(let t=r.length-1;t>=0;t-=1)r[t]===e&&r.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const r of e)this.hasPrecedents(r)||t.push(r);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const r=this.graph.get(t);return r&&!r.includes(e)&&r.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,r){const o=t[r];if("visiting"===o)throw new Error(`Detected cycle involving node: ${r}`);if(o)return;t[r]="visiting";const n=this.getPrecedents(r);for(const r of n)this.visit(e,t,r);t[r]="ok",e.push(r)}};n=o([r(0).injectable()],n),t.LevelledTopologicalSorter=n},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(224);let l=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),r=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of r)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const r=[];for(const o of e){const e=t[o].runAfter;if(e&&e.length)for(const n of e){void 0===t[n]?r.push([o,null]):r.push([n,o])}else r.push([o,null])}return r}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.ILevelledTopologicalSorter)),i("design:paramtypes",["function"==typeof(o=void 0!==d.ILevelledTopologicalSorter&&d.ILevelledTopologicalSorter)?o:Object])],l),t.NodeTransformerNamesGroupsBuilder=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=f(r(46)),y=r(226),N=r(227),h=r(2),b=r(3),I=r(57),v=r(228),S=r(21),O=r(11),j=r(43),_=r(55),C=r(4);let R=o=class{constructor(e,t,r,o,n){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=r,this.logger=o,this.options=n}obfuscate(e){const t=Date.now();this.logger.info(v.LoggingMessage.Version,"0.24.4"),this.logger.info(v.LoggingMessage.ObfuscationStarted),this.logger.info(v.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const r=this.parseCode(e),o=this.transformAstTree(r),n=this.generateCode(e,o),i=(Date.now()-t)/1e3;return this.logger.success(v.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(n)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return _.ASTParserFacade.parse(t,o.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,O.TransformationStage.Initializing),!C.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,O.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,O.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,O.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,O.TransformationStage.Converting),e=this.runTransformationStage(e,O.TransformationStage.Obfuscating),e=this.runTransformationStage(e,O.TransformationStage.Finalizing)):(this.logger.warn(v.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const r=Object.assign({},o.escodegenParams);this.options.sourceMap&&(r.sourceMap=this.options.inputFileName||"sourceMap",r.sourceContent=e);const n=g.generate(t,Object.assign(Object.assign({},r),{format:{compact:this.options.compact}}));return n.map=n.map?n.map.toString():"",n}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(v.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,o.transformersList,t)}};R.parseOptions={ecmaVersion:j.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},R.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},R.transformersList=[S.NodeTransformer.BlockStatementControlFlowTransformer,S.NodeTransformer.CommentsTransformer,S.NodeTransformer.CustomNodesTransformer,S.NodeTransformer.DeadCodeInjectionTransformer,S.NodeTransformer.EvalCallExpressionTransformer,S.NodeTransformer.FunctionControlFlowTransformer,S.NodeTransformer.LabeledStatementTransformer,S.NodeTransformer.LiteralTransformer,S.NodeTransformer.MemberExpressionTransformer,S.NodeTransformer.MetadataTransformer,S.NodeTransformer.MethodDefinitionTransformer,S.NodeTransformer.ObfuscatingGuardsTransformer,S.NodeTransformer.ObjectExpressionKeysTransformer,S.NodeTransformer.ObjectExpressionTransformer,S.NodeTransformer.ParentificationTransformer,S.NodeTransformer.ScopeIdentifiersTransformer,S.NodeTransformer.SplitStringTransformer,S.NodeTransformer.TemplateLiteralTransformer,S.NodeTransformer.VariablePreserveTransformer],R=o=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.ITransformersRunner)),u(1,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(2,p.inject(m.ServiceIdentifiers.Factory__IObfuscatedCode)),u(3,p.inject(m.ServiceIdentifiers.ILogger)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==I.ITransformersRunner&&I.ITransformersRunner)?n:Object,"function"==typeof(i=void 0!==b.IRandomGenerator&&b.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.TObfuscatedCodeFactory&&y.TObfuscatedCodeFactory)?a:Object,"function"==typeof(s=void 0!==N.ILogger&&N.ILogger)?s:Object,"function"==typeof(c=void 0!==h.IOptions&&h.IOptions)?c:Object])],R),t.JavaScriptObfuscator=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(230));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=o([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t){e.exports=require("eventemitter3")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(48),u=r(7),f=r(32),p=r(2);let m=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case f.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case f.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};i([u.initializable(),a("design:type",String)],m.prototype,"obfuscatedCode",void 0),i([u.initializable(),a("design:type",String)],m.prototype,"sourceMap",void 0),m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.ICryptUtils)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==l.ICryptUtils&&l.ICryptUtils)?o:Object,"function"==typeof(n=void 0!==p.IOptions&&p.IOptions)?n:Object])],m),t.ObfuscatedCode=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(234),p=r(235),m=r(236),g=r(4),y=r(15);let N=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,r){if(!t.length)return e;let o,n;this.cachedNodeTransformersData.has(t)?[o,n]=this.cachedNodeTransformersData.get(t):(o=this.buildNormalizedNodeTransformers(t),n=this.nodeTransformerNamesGroupsBuilder.build(o),this.cachedNodeTransformersData.set(t,[o,n]));for(const t of n){const n=[],i=[];for(const e of t){const t=o[e].getVisitor(r);t&&(t.enter&&n.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(n.length||i.length)&&u.replace(e,{enter:this.mergeVisitorsForDirection(n,m.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,m.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const r=e.length;return r?(o,n)=>{if(y.NodeMetadata.isIgnoredNode(o))return u.VisitorOption.Skip;for(let i=0;ie}};N=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__INodeTransformer)),s(1,d.inject(l.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),a("design:paramtypes",["function"==typeof(o=void 0!==f.TNodeTransformerFactory&&f.TNodeTransformerFactory)?o:Object,"function"==typeof(n=void 0!==p.INodeTransformerNamesGroupsBuilder&&p.INodeTransformerNamesGroupsBuilder)?n:Object])],N),t.TransformersRunner=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(25);e.exports=o.JavaScriptObfuscator}]); + +require("source-map-support").install(); + + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./index.ts": +/*!******************!*\ + !*** ./index.ts ***! + \******************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ./src/JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +module.exports = JavaScriptObfuscatorFacade_1.JavaScriptObfuscator; + + +/***/ }), + +/***/ "./src/ASTParserFacade.ts": +/*!********************************!*\ + !*** ./src/ASTParserFacade.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const acorn = __importStar(__webpack_require__(/*! acorn */ "acorn")); +const acorn_import_meta_1 = __importDefault(__webpack_require__(/*! acorn-import-meta */ "acorn-import-meta")); +const chalk_1 = __importDefault(__webpack_require__(/*! chalk */ "chalk")); +class ASTParserFacade { + static parse(inputData, config) { + const sourceTypeLength = ASTParserFacade.sourceTypes.length; + for (let i = 0; i < sourceTypeLength; i++) { + try { + return ASTParserFacade.parseType(inputData, config, ASTParserFacade.sourceTypes[i]); + } + catch (error) { + if (i < sourceTypeLength - 1) { + continue; + } + throw new Error(ASTParserFacade.processParsingError(inputData, error.message, error.loc)); + } + } + throw new Error('Acorn parsing error'); + } + static parseType(inputData, inputConfig, sourceType) { + const { sourceCode } = inputData; + const comments = []; + const config = Object.assign(Object.assign({}, inputConfig), { onComment: comments, sourceType }); + const program = acorn + .Parser.extend(acorn_import_meta_1.default) + .parse(sourceCode, config); + if (comments.length) { + program.comments = comments; + } + return program; + } + static processParsingError(inputData, errorMessage, position) { + if (!position || !position.line || !position.column) { + throw new Error(errorMessage); + } + const { sourceCode, inputFilePath } = inputData; + const sourceCodeLines = sourceCode.split(/\r?\n/); + const errorLine = sourceCodeLines[position.line - 1]; + if (!errorLine) { + throw new Error(errorMessage); + } + const formattedInputFilePath = inputFilePath + ? `${inputFilePath}, ` + : ''; + const startErrorIndex = Math.max(0, position.column - ASTParserFacade.nearestSymbolsCount); + const endErrorIndex = Math.min(errorLine.length, position.column + ASTParserFacade.nearestSymbolsCount); + const formattedPointer = ASTParserFacade.colorError('>'); + const formattedCodeSlice = `...${errorLine.substring(startErrorIndex, endErrorIndex).replace(/^\s+/, '')}...`; + throw new Error(`ERROR in ${formattedInputFilePath}line ${position.line}: ${errorMessage}\n${formattedPointer} ${formattedCodeSlice}`); + } +} +exports.ASTParserFacade = ASTParserFacade; +ASTParserFacade.colorError = chalk_1.default.red; +ASTParserFacade.nearestSymbolsCount = 15; +ASTParserFacade.sourceTypes = [ + 'script', + 'module' +]; + + +/***/ }), + +/***/ "./src/JavaScriptObfuscator.ts": +/*!*************************************!*\ + !*** ./src/JavaScriptObfuscator.ts ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var JavaScriptObfuscator_1, _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ./container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const escodegen = __importStar(__webpack_require__(/*! escodegen */ "escodegen")); +const TObfuscatedCodeFactory_1 = __webpack_require__(/*! ./types/container/source-code/TObfuscatedCodeFactory */ "./src/types/container/source-code/TObfuscatedCodeFactory.ts"); +const ILogger_1 = __webpack_require__(/*! ./interfaces/logger/ILogger */ "./src/interfaces/logger/ILogger.ts"); +const IOptions_1 = __webpack_require__(/*! ./interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ./interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ITransformersRunner_1 = __webpack_require__(/*! ./interfaces/node-transformers/ITransformersRunner */ "./src/interfaces/node-transformers/ITransformersRunner.ts"); +const LoggingMessage_1 = __webpack_require__(/*! ./enums/logger/LoggingMessage */ "./src/enums/logger/LoggingMessage.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ./enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ./enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const EcmaVersion_1 = __webpack_require__(/*! ./constants/EcmaVersion */ "./src/constants/EcmaVersion.ts"); +const ASTParserFacade_1 = __webpack_require__(/*! ./ASTParserFacade */ "./src/ASTParserFacade.ts"); +const NodeGuards_1 = __webpack_require__(/*! ./node/NodeGuards */ "./src/node/NodeGuards.ts"); +let JavaScriptObfuscator = JavaScriptObfuscator_1 = class JavaScriptObfuscator { + constructor(transformersRunner, randomGenerator, obfuscatedCodeFactory, logger, options) { + this.transformersRunner = transformersRunner; + this.randomGenerator = randomGenerator; + this.obfuscatedCodeFactory = obfuscatedCodeFactory; + this.logger = logger; + this.options = options; + } + obfuscate(sourceCode) { + const timeStart = Date.now(); + this.logger.info(LoggingMessage_1.LoggingMessage.Version, "0.24.4"); + this.logger.info(LoggingMessage_1.LoggingMessage.ObfuscationStarted); + this.logger.info(LoggingMessage_1.LoggingMessage.RandomGeneratorSeed, this.randomGenerator.getInputSeed()); + const astTree = this.parseCode(sourceCode); + const obfuscatedAstTree = this.transformAstTree(astTree); + const generatorOutput = this.generateCode(sourceCode, obfuscatedAstTree); + const obfuscationTime = (Date.now() - timeStart) / 1000; + this.logger.success(LoggingMessage_1.LoggingMessage.ObfuscationCompleted, obfuscationTime); + return this.getObfuscatedCode(generatorOutput); + } + parseCode(sourceCode) { + const inputData = { + sourceCode, + inputFilePath: this.options.inputFilePath + }; + return ASTParserFacade_1.ASTParserFacade.parse(inputData, JavaScriptObfuscator_1.parseOptions); + } + transformAstTree(astTree) { + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Initializing); + const isEmptyAstTree = NodeGuards_1.NodeGuards.isProgramNode(astTree) + && !astTree.body.length + && !astTree.leadingComments + && !astTree.trailingComments; + if (isEmptyAstTree) { + this.logger.warn(LoggingMessage_1.LoggingMessage.EmptySourceCode); + return astTree; + } + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Preparing); + if (this.options.deadCodeInjection) { + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.DeadCodeInjection); + } + if (this.options.controlFlowFlattening) { + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.ControlFlowFlattening); + } + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Converting); + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Obfuscating); + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Finalizing); + return astTree; + } + generateCode(sourceCode, astTree) { + const escodegenParams = Object.assign({}, JavaScriptObfuscator_1.escodegenParams); + if (this.options.sourceMap) { + escodegenParams.sourceMap = this.options.inputFileName || 'sourceMap'; + escodegenParams.sourceContent = sourceCode; + } + const generatorOutput = escodegen.generate(astTree, Object.assign(Object.assign({}, escodegenParams), { format: { + compact: this.options.compact + } })); + generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : ''; + return generatorOutput; + } + getObfuscatedCode(generatorOutput) { + return this.obfuscatedCodeFactory(generatorOutput.code, generatorOutput.map); + } + runTransformationStage(astTree, transformationStage) { + this.logger.info(LoggingMessage_1.LoggingMessage.TransformationStage, transformationStage); + return this.transformersRunner.transform(astTree, JavaScriptObfuscator_1.transformersList, transformationStage); + } +}; +JavaScriptObfuscator.parseOptions = { + ecmaVersion: EcmaVersion_1.ecmaVersion, + allowHashBang: true, + allowImportExportEverywhere: true, + allowReturnOutsideFunction: true, + locations: true, + ranges: true +}; +JavaScriptObfuscator.escodegenParams = { + comment: true, + verbatim: 'x-verbatim-property', + sourceMapWithCode: true +}; +JavaScriptObfuscator.transformersList = [ + NodeTransformer_1.NodeTransformer.BlockStatementControlFlowTransformer, + NodeTransformer_1.NodeTransformer.CommentsTransformer, + NodeTransformer_1.NodeTransformer.CustomNodesTransformer, + NodeTransformer_1.NodeTransformer.DeadCodeInjectionTransformer, + NodeTransformer_1.NodeTransformer.EvalCallExpressionTransformer, + NodeTransformer_1.NodeTransformer.FunctionControlFlowTransformer, + NodeTransformer_1.NodeTransformer.LabeledStatementTransformer, + NodeTransformer_1.NodeTransformer.LiteralTransformer, + NodeTransformer_1.NodeTransformer.MemberExpressionTransformer, + NodeTransformer_1.NodeTransformer.MetadataTransformer, + NodeTransformer_1.NodeTransformer.MethodDefinitionTransformer, + NodeTransformer_1.NodeTransformer.ObfuscatingGuardsTransformer, + NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer, + NodeTransformer_1.NodeTransformer.ObjectExpressionTransformer, + NodeTransformer_1.NodeTransformer.ParentificationTransformer, + NodeTransformer_1.NodeTransformer.ScopeIdentifiersTransformer, + NodeTransformer_1.NodeTransformer.SplitStringTransformer, + NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer, + NodeTransformer_1.NodeTransformer.VariablePreserveTransformer +]; +JavaScriptObfuscator = JavaScriptObfuscator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatedCode)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ILogger)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof ITransformersRunner_1.ITransformersRunner !== "undefined" && ITransformersRunner_1.ITransformersRunner) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof TObfuscatedCodeFactory_1.TObfuscatedCodeFactory !== "undefined" && TObfuscatedCodeFactory_1.TObfuscatedCodeFactory) === "function" ? _c : Object, typeof (_d = typeof ILogger_1.ILogger !== "undefined" && ILogger_1.ILogger) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], JavaScriptObfuscator); +exports.JavaScriptObfuscator = JavaScriptObfuscator; + + +/***/ }), + +/***/ "./src/JavaScriptObfuscatorFacade.ts": +/*!*******************************************!*\ + !*** ./src/JavaScriptObfuscatorFacade.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +__webpack_require__(/*! reflect-metadata */ "reflect-metadata"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ./container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const InversifyContainerFacade_1 = __webpack_require__(/*! ./container/InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +class JavaScriptObfuscatorFacade { + static obfuscate(sourceCode, inputOptions = {}) { + const inversifyContainerFacade = new InversifyContainerFacade_1.InversifyContainerFacade(); + inversifyContainerFacade.load(sourceCode, '', inputOptions); + const javaScriptObfuscator = inversifyContainerFacade + .get(ServiceIdentifiers_1.ServiceIdentifiers.IJavaScriptObfuscator); + const obfuscatedCode = javaScriptObfuscator.obfuscate(sourceCode); + inversifyContainerFacade.unload(); + return obfuscatedCode; + } +} +exports.JavaScriptObfuscator = JavaScriptObfuscatorFacade; +JavaScriptObfuscatorFacade.version = (_a = "0.24.4") !== null && _a !== void 0 ? _a : 'unknown'; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/CallsGraphAnalyzer.ts": +/*!******************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/CallsGraphAnalyzer.ts ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var CallsGraphAnalyzer_1, _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TCalleeDataExtractorFactory_1 = __webpack_require__(/*! ../../types/container/calls-graph-analyzer/TCalleeDataExtractorFactory */ "./src/types/container/calls-graph-analyzer/TCalleeDataExtractorFactory.ts"); +const CalleeDataExtractor_1 = __webpack_require__(/*! ../../enums/analyzers/calls-graph-analyzer/CalleeDataExtractor */ "./src/enums/analyzers/calls-graph-analyzer/CalleeDataExtractor.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let CallsGraphAnalyzer = CallsGraphAnalyzer_1 = class CallsGraphAnalyzer { + constructor(calleeDataExtractorFactory) { + this.calleeDataExtractorFactory = calleeDataExtractorFactory; + } + static getLimitIndex(blockScopeBodyLength) { + const lastIndex = blockScopeBodyLength - 1; + const limitThresholdActivationIndex = CallsGraphAnalyzer_1.limitThresholdActivationLength - 1; + let limitIndex = lastIndex; + if (lastIndex > limitThresholdActivationIndex) { + limitIndex = Math.round(limitThresholdActivationIndex + (lastIndex * CallsGraphAnalyzer_1.limitThreshold)); + if (limitIndex > lastIndex) { + limitIndex = lastIndex; + } + } + return limitIndex; + } + analyze(astTree) { + return this.analyzeRecursive(astTree.body); + } + analyzeRecursive(blockScopeBody) { + const limitIndex = CallsGraphAnalyzer_1.getLimitIndex(blockScopeBody.length); + const callsGraphData = []; + const blockScopeBodyLength = blockScopeBody.length; + for (let index = 0; index < blockScopeBodyLength; index++) { + if (index > limitIndex) { + break; + } + const blockScopeBodyNode = blockScopeBody[index]; + estraverse.traverse(blockScopeBodyNode, { + enter: (node) => { + if (!NodeGuards_1.NodeGuards.isCallExpressionNode(node)) { + return; + } + if (blockScopeBodyNode.parentNode !== NodeStatementUtils_1.NodeStatementUtils.getParentNodeWithStatements(node)) { + return estraverse.VisitorOption.Skip; + } + this.analyzeCallExpressionNode(callsGraphData, blockScopeBody, node); + } + }); + } + return callsGraphData; + } + analyzeCallExpressionNode(callsGraphData, blockScopeBody, callExpressionNode) { + CallsGraphAnalyzer_1.calleeDataExtractorsList.forEach((calleeDataExtractorName) => { + const calleeData = this.calleeDataExtractorFactory(calleeDataExtractorName) + .extract(blockScopeBody, callExpressionNode.callee); + if (!calleeData) { + return; + } + callsGraphData.push(Object.assign(Object.assign({}, calleeData), { callsGraph: this.analyzeRecursive(calleeData.callee.body) })); + }); + } +}; +CallsGraphAnalyzer.calleeDataExtractorsList = [ + CalleeDataExtractor_1.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor, + CalleeDataExtractor_1.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor, + CalleeDataExtractor_1.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor +]; +CallsGraphAnalyzer.limitThresholdActivationLength = 25; +CallsGraphAnalyzer.limitThreshold = 0.002; +CallsGraphAnalyzer = CallsGraphAnalyzer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICalleeDataExtractor)), + __metadata("design:paramtypes", [typeof (_a = typeof TCalleeDataExtractorFactory_1.TCalleeDataExtractorFactory !== "undefined" && TCalleeDataExtractorFactory_1.TCalleeDataExtractorFactory) === "function" ? _a : Object]) +], CallsGraphAnalyzer); +exports.CallsGraphAnalyzer = CallsGraphAnalyzer; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts": +/*!**************************************************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +let AbstractCalleeDataExtractor = class AbstractCalleeDataExtractor { +}; +AbstractCalleeDataExtractor = __decorate([ + inversify_1.injectable() +], AbstractCalleeDataExtractor); +exports.AbstractCalleeDataExtractor = AbstractCalleeDataExtractor; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts": +/*!*************************************************************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const AbstractCalleeDataExtractor_1 = __webpack_require__(/*! ./AbstractCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let FunctionDeclarationCalleeDataExtractor = class FunctionDeclarationCalleeDataExtractor extends AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor { + extract(blockScopeBody, callee) { + if (!NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { + return null; + } + const calleeBlockStatement = this.getCalleeBlockStatement(NodeStatementUtils_1.NodeStatementUtils.getParentNodeWithStatements(blockScopeBody[0]), callee.name); + if (!calleeBlockStatement) { + return null; + } + return { + callee: calleeBlockStatement, + name: callee.name + }; + } + getCalleeBlockStatement(targetNode, name) { + let calleeBlockStatement = null; + estraverse.traverse(targetNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) && node.id.name === name) { + calleeBlockStatement = node.body; + return estraverse.VisitorOption.Break; + } + } + }); + return calleeBlockStatement; + } +}; +FunctionDeclarationCalleeDataExtractor = __decorate([ + inversify_1.injectable() +], FunctionDeclarationCalleeDataExtractor); +exports.FunctionDeclarationCalleeDataExtractor = FunctionDeclarationCalleeDataExtractor; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts": +/*!************************************************************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const AbstractCalleeDataExtractor_1 = __webpack_require__(/*! ./AbstractCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let FunctionExpressionCalleeDataExtractor = class FunctionExpressionCalleeDataExtractor extends AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor { + extract(blockScopeBody, callee) { + var _a; + let calleeBlockStatement = null; + if (NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { + calleeBlockStatement = this.getCalleeBlockStatement(NodeStatementUtils_1.NodeStatementUtils.getParentNodeWithStatements(blockScopeBody[0]), callee.name); + } + if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(callee)) { + calleeBlockStatement = callee.body; + } + if (!calleeBlockStatement) { + return null; + } + return { + callee: calleeBlockStatement, + name: (_a = callee.name) !== null && _a !== void 0 ? _a : null + }; + } + getCalleeBlockStatement(targetNode, name) { + let calleeBlockStatement = null; + estraverse.traverse(targetNode, { + enter: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) && + parentNode && + NodeGuards_1.NodeGuards.isVariableDeclaratorNode(parentNode) && + NodeGuards_1.NodeGuards.isIdentifierNode(parentNode.id) && + parentNode.id.name === name) { + calleeBlockStatement = node.body; + return estraverse.VisitorOption.Break; + } + } + }); + return calleeBlockStatement; + } +}; +FunctionExpressionCalleeDataExtractor = __decorate([ + inversify_1.injectable() +], FunctionExpressionCalleeDataExtractor); +exports.FunctionExpressionCalleeDataExtractor = FunctionExpressionCalleeDataExtractor; + + +/***/ }), + +/***/ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts": +/*!**********************************************************************************************************!*\ + !*** ./src/analyzers/calls-graph-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var ObjectExpressionCalleeDataExtractor_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const AbstractCalleeDataExtractor_1 = __webpack_require__(/*! ./AbstractCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor_1 = class ObjectExpressionCalleeDataExtractor extends AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor { + static isValidTargetPropertyNode(propertyNode, nextItemInCallsChain) { + if (!propertyNode.key) { + return false; + } + const isTargetPropertyNodeWithIdentifierKey = NodeGuards_1.NodeGuards.isIdentifierNode(propertyNode.key) && propertyNode.key.name === nextItemInCallsChain; + const isTargetPropertyNodeWithLiteralKey = NodeGuards_1.NodeGuards.isLiteralNode(propertyNode.key) && + Boolean(propertyNode.key.value) && + propertyNode.key.value === nextItemInCallsChain; + return isTargetPropertyNodeWithIdentifierKey || isTargetPropertyNodeWithLiteralKey; + } + extract(blockScopeBody, callee) { + if (!NodeGuards_1.NodeGuards.isMemberExpressionNode(callee)) { + return null; + } + const objectMembersCallsChain = this.createObjectMembersCallsChain([], callee); + if (!objectMembersCallsChain.length) { + return null; + } + const functionExpressionName = objectMembersCallsChain[objectMembersCallsChain.length - 1]; + const calleeBlockStatement = this.getCalleeBlockStatement(NodeStatementUtils_1.NodeStatementUtils.getParentNodeWithStatements(blockScopeBody[0]), objectMembersCallsChain); + if (!calleeBlockStatement) { + return null; + } + return { + callee: calleeBlockStatement, + name: functionExpressionName + }; + } + createObjectMembersCallsChain(currentChain, memberExpression) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpression.property) && memberExpression.computed === false) { + currentChain.unshift(memberExpression.property.name); + } + else if (NodeGuards_1.NodeGuards.isLiteralNode(memberExpression.property) && + (typeof memberExpression.property.value === 'string' || + typeof memberExpression.property.value === 'number')) { + currentChain.unshift(memberExpression.property.value); + } + else { + return currentChain; + } + if (NodeGuards_1.NodeGuards.isMemberExpressionNode(memberExpression.object)) { + return this.createObjectMembersCallsChain(currentChain, memberExpression.object); + } + else if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpression.object)) { + currentChain.unshift(memberExpression.object.name); + } + return currentChain; + } + getCalleeBlockStatement(targetNode, objectMembersCallsChain) { + const objectName = objectMembersCallsChain.shift(); + if (!objectName) { + return null; + } + let calleeBlockStatement = null; + estraverse.traverse(targetNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isVariableDeclaratorNode(node) && + NodeGuards_1.NodeGuards.isIdentifierNode(node.id) && + node.init && + NodeGuards_1.NodeGuards.isObjectExpressionNode(node.init) && + node.id.name === objectName) { + calleeBlockStatement = this.findCalleeBlockStatement(node.init.properties, objectMembersCallsChain); + return estraverse.VisitorOption.Break; + } + } + }); + return calleeBlockStatement; + } + findCalleeBlockStatement(objectExpressionProperties, objectMembersCallsChain) { + const nextItemInCallsChain = objectMembersCallsChain.shift(); + if (!nextItemInCallsChain) { + return null; + } + for (const propertyNode of objectExpressionProperties) { + if (!ObjectExpressionCalleeDataExtractor_1.isValidTargetPropertyNode(propertyNode, nextItemInCallsChain)) { + continue; + } + if (NodeGuards_1.NodeGuards.isObjectExpressionNode(propertyNode.value)) { + return this.findCalleeBlockStatement(propertyNode.value.properties, objectMembersCallsChain); + } + if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(propertyNode.value)) { + return propertyNode.value.body; + } + } + return null; + } +}; +ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor_1 = __decorate([ + inversify_1.injectable() +], ObjectExpressionCalleeDataExtractor); +exports.ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor; + + +/***/ }), + +/***/ "./src/analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer.ts": +/*!**************************************************************************************************!*\ + !*** ./src/analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer.ts ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var PrevailingKindOfVariablesAnalyzer_1, _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const IArrayUtils_1 = __webpack_require__(/*! ../../interfaces/utils/IArrayUtils */ "./src/interfaces/utils/IArrayUtils.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let PrevailingKindOfVariablesAnalyzer = PrevailingKindOfVariablesAnalyzer_1 = class PrevailingKindOfVariablesAnalyzer { + constructor(arrayUtils) { + this.prevailingKindOfVariables = PrevailingKindOfVariablesAnalyzer_1.defaultKindOfVariables; + this.arrayUtils = arrayUtils; + } + analyze(astTree) { + var _a; + const variableKinds = []; + estraverse.traverse(astTree, { + enter: (node) => { + if (!NodeGuards_1.NodeGuards.isVariableDeclarationNode(node)) { + return; + } + variableKinds.push(node.kind); + } + }); + this.prevailingKindOfVariables = (_a = this.arrayUtils.findMostOccurringElement(variableKinds)) !== null && _a !== void 0 ? _a : PrevailingKindOfVariablesAnalyzer_1.defaultKindOfVariables; + } + getPrevailingKind() { + return this.prevailingKindOfVariables; + } +}; +PrevailingKindOfVariablesAnalyzer.defaultKindOfVariables = 'var'; +PrevailingKindOfVariablesAnalyzer = PrevailingKindOfVariablesAnalyzer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), + __metadata("design:paramtypes", [typeof (_a = typeof IArrayUtils_1.IArrayUtils !== "undefined" && IArrayUtils_1.IArrayUtils) === "function" ? _a : Object]) +], PrevailingKindOfVariablesAnalyzer); +exports.PrevailingKindOfVariablesAnalyzer = PrevailingKindOfVariablesAnalyzer; + + +/***/ }), + +/***/ "./src/analyzers/scope-analyzer/ScopeAnalyzer.ts": +/*!*******************************************************!*\ + !*** ./src/analyzers/scope-analyzer/ScopeAnalyzer.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var ScopeAnalyzer_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const eslintScope = __importStar(__webpack_require__(/*! eslint-scope */ "eslint-scope")); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const EcmaVersion_1 = __webpack_require__(/*! ../../constants/EcmaVersion */ "./src/constants/EcmaVersion.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ScopeAnalyzer = ScopeAnalyzer_1 = class ScopeAnalyzer { + constructor() { + this.scopeManager = null; + } + static attachMissingRanges(astTree) { + estraverse.replace(astTree, { + enter: (node) => { + if (!node.range) { + node.range = [ + ScopeAnalyzer_1.emptyRangeValue, + ScopeAnalyzer_1.emptyRangeValue + ]; + } + return node; + } + }); + } + static isRootNode(node) { + return NodeGuards_1.NodeGuards.isProgramNode(node) || node.parentNode === node; + } + analyze(astTree) { + const sourceTypeLength = ScopeAnalyzer_1.sourceTypes.length; + ScopeAnalyzer_1.attachMissingRanges(astTree); + for (let i = 0; i < sourceTypeLength; i++) { + try { + this.scopeManager = eslintScope.analyze(astTree, Object.assign(Object.assign({}, ScopeAnalyzer_1.eslintScopeOptions), { sourceType: ScopeAnalyzer_1.sourceTypes[i] })); + return; + } + catch (error) { + if (i < sourceTypeLength - 1) { + continue; + } + throw new Error(error); + } + } + throw new Error('Scope analyzing error'); + } + acquireScope(node) { + if (!this.scopeManager) { + throw new Error('Scope manager is not defined'); + } + const scope = this.scopeManager.acquire(node, ScopeAnalyzer_1.isRootNode(node)); + if (!scope) { + throw new Error('Cannot acquire scope for node'); + } + this.sanitizeScopes(scope); + return scope; + } + sanitizeScopes(scope) { + scope.childScopes.forEach((childScope) => { + if (childScope.type === 'class' && childScope.upper) { + if (!childScope.variables.length) { + return; + } + const classNameVariable = childScope.variables[0]; + const upperVariable = childScope.upper.variables + .find((variable) => { + const isValidClassNameVariable = classNameVariable.defs + .some((definition) => definition.type === 'ClassName'); + return isValidClassNameVariable && variable.name === classNameVariable.name; + }); + upperVariable === null || upperVariable === void 0 ? void 0 : upperVariable.references.push(...childScope.variables[0].references); + } + }); + for (const childScope of scope.childScopes) { + this.sanitizeScopes(childScope); + } + } +}; +ScopeAnalyzer.eslintScopeOptions = { + ecmaVersion: EcmaVersion_1.ecmaVersion, + optimistic: true +}; +ScopeAnalyzer.sourceTypes = [ + 'script', + 'module' +]; +ScopeAnalyzer.emptyRangeValue = 0; +ScopeAnalyzer = ScopeAnalyzer_1 = __decorate([ + inversify_1.injectable() +], ScopeAnalyzer); +exports.ScopeAnalyzer = ScopeAnalyzer; + + +/***/ }), + +/***/ "./src/analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer.ts": +/*!***********************************************************************************!*\ + !*** ./src/analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer.ts ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var StringArrayStorageAnalyzer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IStringArrayStorage_1 = __webpack_require__(/*! ../../interfaces/storages/string-array-storage/IStringArrayStorage */ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +const NodeLiteralUtils_1 = __webpack_require__(/*! ../../node/NodeLiteralUtils */ "./src/node/NodeLiteralUtils.ts"); +let StringArrayStorageAnalyzer = StringArrayStorageAnalyzer_1 = class StringArrayStorageAnalyzer { + constructor(stringArrayStorage, randomGenerator, options) { + this.stringArrayStorageData = new Map(); + this.stringArrayStorage = stringArrayStorage; + this.randomGenerator = randomGenerator; + this.options = options; + } + analyze(astTree) { + if (!this.options.stringArray) { + return; + } + estraverse.traverse(astTree, { + enter: (node, parentNode) => { + if (!parentNode) { + return; + } + if (NodeMetadata_1.NodeMetadata.isIgnoredNode(node)) { + return estraverse.VisitorOption.Skip; + } + if (!NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return; + } + this.analyzeLiteralNode(node, parentNode); + } + }); + } + getItemDataForLiteralNode(literalNode) { + return this.stringArrayStorageData.get(literalNode); + } + analyzeLiteralNode(literalNode, parentNode) { + if (typeof literalNode.value !== 'string') { + return; + } + if (NodeLiteralUtils_1.NodeLiteralUtils.isProhibitedLiteralNode(literalNode, parentNode)) { + return; + } + if (!this.shouldAddValueToStringArray(literalNode.value)) { + return; + } + this.stringArrayStorageData.set(literalNode, this.stringArrayStorage.getOrThrow(literalNode.value)); + } + shouldAddValueToStringArray(value) { + return value.length >= StringArrayStorageAnalyzer_1.minimumLengthForStringArray + && this.randomGenerator.getMathRandom() <= this.options.stringArrayThreshold; + } +}; +StringArrayStorageAnalyzer.minimumLengthForStringArray = 3; +StringArrayStorageAnalyzer = StringArrayStorageAnalyzer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorage)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IStringArrayStorage_1.IStringArrayStorage !== "undefined" && IStringArrayStorage_1.IStringArrayStorage) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], StringArrayStorageAnalyzer); +exports.StringArrayStorageAnalyzer = StringArrayStorageAnalyzer; + + +/***/ }), + +/***/ "./src/constants/EcmaVersion.ts": +/*!**************************************!*\ + !*** ./src/constants/EcmaVersion.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ecmaVersion = 11; + + +/***/ }), + +/***/ "./src/container/InversifyContainerFacade.ts": +/*!***************************************************!*\ + !*** ./src/container/InversifyContainerFacade.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ./ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const AnalyzersModule_1 = __webpack_require__(/*! ./modules/analyzers/AnalyzersModule */ "./src/container/modules/analyzers/AnalyzersModule.ts"); +const ControlFlowTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/ControlFlowTransformersModule */ "./src/container/modules/node-transformers/ControlFlowTransformersModule.ts"); +const ConvertingTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/ConvertingTransformersModule */ "./src/container/modules/node-transformers/ConvertingTransformersModule.ts"); +const CustomNodesModule_1 = __webpack_require__(/*! ./modules/custom-nodes/CustomNodesModule */ "./src/container/modules/custom-nodes/CustomNodesModule.ts"); +const FinalizingTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/FinalizingTransformersModule */ "./src/container/modules/node-transformers/FinalizingTransformersModule.ts"); +const GeneratorsModule_1 = __webpack_require__(/*! ./modules/generators/GeneratorsModule */ "./src/container/modules/generators/GeneratorsModule.ts"); +const NodeTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/NodeTransformersModule */ "./src/container/modules/node-transformers/NodeTransformersModule.ts"); +const ObfuscatingTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/ObfuscatingTransformersModule */ "./src/container/modules/node-transformers/ObfuscatingTransformersModule.ts"); +const OptionsModule_1 = __webpack_require__(/*! ./modules/options/OptionsModule */ "./src/container/modules/options/OptionsModule.ts"); +const PreparingTransformersModule_1 = __webpack_require__(/*! ./modules/node-transformers/PreparingTransformersModule */ "./src/container/modules/node-transformers/PreparingTransformersModule.ts"); +const StoragesModule_1 = __webpack_require__(/*! ./modules/storages/StoragesModule */ "./src/container/modules/storages/StoragesModule.ts"); +const UtilsModule_1 = __webpack_require__(/*! ./modules/utils/UtilsModule */ "./src/container/modules/utils/UtilsModule.ts"); +const JavaScriptObfuscator_1 = __webpack_require__(/*! ../JavaScriptObfuscator */ "./src/JavaScriptObfuscator.ts"); +const Logger_1 = __webpack_require__(/*! ../logger/Logger */ "./src/logger/Logger.ts"); +const ObfuscationEventEmitter_1 = __webpack_require__(/*! ../event-emitters/ObfuscationEventEmitter */ "./src/event-emitters/ObfuscationEventEmitter.ts"); +const ObfuscatedCode_1 = __webpack_require__(/*! ../source-code/ObfuscatedCode */ "./src/source-code/ObfuscatedCode.ts"); +const SourceCode_1 = __webpack_require__(/*! ../source-code/SourceCode */ "./src/source-code/SourceCode.ts"); +const TransformersRunner_1 = __webpack_require__(/*! ../node-transformers/TransformersRunner */ "./src/node-transformers/TransformersRunner.ts"); +class InversifyContainerFacade { + constructor() { + this.container = new inversify_1.Container(); + } + static getFactory(serviceIdentifier) { + return (context) => { + return (bindingName) => { + return context.container.getNamed(serviceIdentifier, bindingName); + }; + }; + } + static getCacheFactory(serviceIdentifier) { + return (context) => { + const cache = new Map(); + return (bindingName) => { + if (cache.has(bindingName)) { + return cache.get(bindingName); + } + const object = context.container.getNamed(serviceIdentifier, bindingName); + cache.set(bindingName, object); + return object; + }; + }; + } + static getConstructorFactory(serviceIdentifier, ...dependencies) { + return (context) => { + const cache = new Map(); + const cachedDependencies = []; + return (bindingName) => { + dependencies.forEach((dependency, index) => { + if (!cachedDependencies[index]) { + cachedDependencies[index] = context.container.get(dependency); + } + }); + if (cache.has(bindingName)) { + return new (cache.get(bindingName))(...cachedDependencies); + } + const constructor = context.container + .getNamed(serviceIdentifier, bindingName); + cache.set(bindingName, constructor); + return new constructor(...cachedDependencies); + }; + }; + } + get(serviceIdentifier) { + return this.container.get(serviceIdentifier); + } + getNamed(serviceIdentifier, named) { + return this.container.getNamed(serviceIdentifier, named); + } + load(sourceCode, sourceMap, options) { + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.ISourceCode) + .toDynamicValue(() => new SourceCode_1.SourceCode(sourceCode, sourceMap)) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.TInputOptions) + .toDynamicValue(() => options) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.ILogger) + .to(Logger_1.Logger) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.IJavaScriptObfuscator) + .to(JavaScriptObfuscator_1.JavaScriptObfuscator) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner) + .to(TransformersRunner_1.TransformersRunner) + .inSingletonScope(); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatedCode) + .to(ObfuscatedCode_1.ObfuscatedCode); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatedCode) + .toFactory((context) => { + return (obfuscatedCodeAsString, sourceMapAsString) => { + const obfuscatedCode = context.container + .get(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatedCode); + obfuscatedCode.initialize(obfuscatedCodeAsString, sourceMapAsString); + return obfuscatedCode; + }; + }); + this.container + .bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationEventEmitter) + .to(ObfuscationEventEmitter_1.ObfuscationEventEmitter) + .inSingletonScope(); + this.container.load(AnalyzersModule_1.analyzersModule); + this.container.load(ControlFlowTransformersModule_1.controlFlowTransformersModule); + this.container.load(ConvertingTransformersModule_1.convertingTransformersModule); + this.container.load(CustomNodesModule_1.customNodesModule); + this.container.load(FinalizingTransformersModule_1.finalizingTransformersModule); + this.container.load(GeneratorsModule_1.generatorsModule); + this.container.load(NodeTransformersModule_1.nodeTransformersModule); + this.container.load(ObfuscatingTransformersModule_1.obfuscatingTransformersModule); + this.container.load(OptionsModule_1.optionsModule); + this.container.load(PreparingTransformersModule_1.preparingTransformersModule); + this.container.load(StoragesModule_1.storagesModule); + this.container.load(UtilsModule_1.utilsModule); + } + unload() { + this.container.unbindAll(); + } +} +exports.InversifyContainerFacade = InversifyContainerFacade; + + +/***/ }), + +/***/ "./src/container/ServiceIdentifiers.ts": +/*!*********************************************!*\ + !*** ./src/container/ServiceIdentifiers.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ServiceIdentifiers; +(function (ServiceIdentifiers) { + ServiceIdentifiers["Factory__ICalleeDataExtractor"] = "Factory"; + ServiceIdentifiers["Factory__IControlFlowCustomNode"] = "Factory"; + ServiceIdentifiers["Factory__IControlFlowReplacer"] = "Factory"; + ServiceIdentifiers["Factory__ICustomNode"] = "Factory"; + ServiceIdentifiers["Factory__ICustomNodeGroup"] = "Factory"; + ServiceIdentifiers["Factory__IDeadCodeInjectionCustomNode"] = "Factory"; + ServiceIdentifiers["Factory__IIdentifierNamesGenerator"] = "Factory"; + ServiceIdentifiers["Factory__IIdentifierObfuscatingReplacer"] = "Factory"; + ServiceIdentifiers["Factory__INodeGuard"] = "Factory"; + ServiceIdentifiers["Factory__INodeTransformer"] = "Factory"; + ServiceIdentifiers["Factory__IObfuscatedCode"] = "Factory"; + ServiceIdentifiers["Factory__IObfuscatingReplacer"] = "Factory"; + ServiceIdentifiers["Factory__IObjectExpressionKeysTransformerCustomNode"] = "Factory"; + ServiceIdentifiers["Factory__IObjectExpressionExtractor"] = "Factory"; + ServiceIdentifiers["Factory__TControlFlowStorage"] = "Factory"; + ServiceIdentifiers["IArrayUtils"] = "IArrayUtils"; + ServiceIdentifiers["ICalleeDataExtractor"] = "ICalleeDataExtractor"; + ServiceIdentifiers["ICallsGraphAnalyzer"] = "ICallsGraphAnalyzer"; + ServiceIdentifiers["ICryptUtils"] = "ICryptUtils"; + ServiceIdentifiers["ICustomNode"] = "ICustomNode"; + ServiceIdentifiers["ICustomNodeGroup"] = "ICustomNodeGroup"; + ServiceIdentifiers["IControlFlowReplacer"] = "IControlFlowReplacer"; + ServiceIdentifiers["ICustomNodeFormatter"] = "ICustomNodeFormatter"; + ServiceIdentifiers["IEscapeSequenceEncoder"] = "IEscapeSequenceEncoder"; + ServiceIdentifiers["IIdentifierNamesGenerator"] = "IIdentifierNamesGenerator"; + ServiceIdentifiers["IIdentifierObfuscatingReplacer"] = "IIdentifierObfuscatingReplacer"; + ServiceIdentifiers["IJavaScriptObfuscator"] = "IJavaScriptObfuscator"; + ServiceIdentifiers["ILevelledTopologicalSorter"] = "ILevelledTopologicalSorter"; + ServiceIdentifiers["ILogger"] = "ILogger"; + ServiceIdentifiers["INodeGuard"] = "INodeGuard"; + ServiceIdentifiers["INodeTransformer"] = "INodeTransformer"; + ServiceIdentifiers["INodeTransformerNamesGroupsBuilder"] = "INodeTransformerNamesGroupsBuilder"; + ServiceIdentifiers["IObfuscationEventEmitter"] = "IObfuscationEventEmitter"; + ServiceIdentifiers["IObfuscatedCode"] = "IObfuscatedCode"; + ServiceIdentifiers["IOptions"] = "IOptions"; + ServiceIdentifiers["IOptionsNormalizer"] = "IOptionsNormalizer"; + ServiceIdentifiers["IObfuscatingReplacer"] = "IObfuscatingReplacer"; + ServiceIdentifiers["IPrevailingKindOfVariablesAnalyzer"] = "IPrevailingKindOfVariablesAnalyzer"; + ServiceIdentifiers["IObjectExpressionExtractor"] = "IObjectExpressionExtractor"; + ServiceIdentifiers["IRandomGenerator"] = "IRandomGenerator"; + ServiceIdentifiers["ISourceCode"] = "ISourceCode"; + ServiceIdentifiers["ISourceMapCorrector"] = "ISourceMapCorrector"; + ServiceIdentifiers["IScopeAnalyzer"] = "IScopeAnalyzer"; + ServiceIdentifiers["IStringArrayStorage"] = "IStringArrayStorage"; + ServiceIdentifiers["IStringArrayStorageAnalyzer"] = "IStringArrayStorageAnalyzer"; + ServiceIdentifiers["ITransformersRunner"] = "ITransformersRunner"; + ServiceIdentifiers["Newable__ICustomNode"] = "Newable"; + ServiceIdentifiers["Newable__TControlFlowStorage"] = "Newable"; + ServiceIdentifiers["TCustomNodeGroupStorage"] = "TCustomNodeGroupStorage"; + ServiceIdentifiers["TInputOptions"] = "TInputOptions"; +})(ServiceIdentifiers = exports.ServiceIdentifiers || (exports.ServiceIdentifiers = {})); + + +/***/ }), + +/***/ "./src/container/modules/analyzers/AnalyzersModule.ts": +/*!************************************************************!*\ + !*** ./src/container/modules/analyzers/AnalyzersModule.ts ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const CalleeDataExtractor_1 = __webpack_require__(/*! ../../../enums/analyzers/calls-graph-analyzer/CalleeDataExtractor */ "./src/enums/analyzers/calls-graph-analyzer/CalleeDataExtractor.ts"); +const CallsGraphAnalyzer_1 = __webpack_require__(/*! ../../../analyzers/calls-graph-analyzer/CallsGraphAnalyzer */ "./src/analyzers/calls-graph-analyzer/CallsGraphAnalyzer.ts"); +const FunctionDeclarationCalleeDataExtractor_1 = __webpack_require__(/*! ../../../analyzers/calls-graph-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts"); +const FunctionExpressionCalleeDataExtractor_1 = __webpack_require__(/*! ../../../analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts"); +const ObjectExpressionCalleeDataExtractor_1 = __webpack_require__(/*! ../../../analyzers/calls-graph-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor */ "./src/analyzers/calls-graph-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts"); +const PrevailingKindOfVariablesAnalyzer_1 = __webpack_require__(/*! ../../../analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer */ "./src/analyzers/prevailing-kind-of-variables-analyzer/PrevailingKindOfVariablesAnalyzer.ts"); +const ScopeAnalyzer_1 = __webpack_require__(/*! ../../../analyzers/scope-analyzer/ScopeAnalyzer */ "./src/analyzers/scope-analyzer/ScopeAnalyzer.ts"); +const StringArrayStorageAnalyzer_1 = __webpack_require__(/*! ../../../analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer */ "./src/analyzers/string-array-storage-analyzer/StringArrayStorageAnalyzer.ts"); +exports.analyzersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICallsGraphAnalyzer) + .to(CallsGraphAnalyzer_1.CallsGraphAnalyzer) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer) + .to(PrevailingKindOfVariablesAnalyzer_1.PrevailingKindOfVariablesAnalyzer) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IScopeAnalyzer) + .to(ScopeAnalyzer_1.ScopeAnalyzer) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorageAnalyzer) + .to(StringArrayStorageAnalyzer_1.StringArrayStorageAnalyzer) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor) + .to(FunctionDeclarationCalleeDataExtractor_1.FunctionDeclarationCalleeDataExtractor) + .whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor) + .to(FunctionExpressionCalleeDataExtractor_1.FunctionExpressionCalleeDataExtractor) + .whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor) + .to(ObjectExpressionCalleeDataExtractor_1.ObjectExpressionCalleeDataExtractor) + .whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICalleeDataExtractor) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor)); +}); + + +/***/ }), + +/***/ "./src/container/modules/custom-nodes/CustomNodesModule.ts": +/*!*****************************************************************!*\ + !*** ./src/container/modules/custom-nodes/CustomNodesModule.ts ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const CustomNodeGroup_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNodeGroup */ "./src/enums/custom-nodes/CustomNodeGroup.ts"); +const DeadCodeInjectionCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/DeadCodeInjectionCustomNode */ "./src/enums/custom-nodes/DeadCodeInjectionCustomNode.ts"); +const ObjectExpressionKeysTransformerCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode */ "./src/enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode.ts"); +const ConsoleOutputCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup */ "./src/custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup.ts"); +const DebugProtectionCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup */ "./src/custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup.ts"); +const DomainLockCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup */ "./src/custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup.ts"); +const SelfDefendingCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup */ "./src/custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup.ts"); +const StringArrayCustomNodeGroup_1 = __webpack_require__(/*! ../../../custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup */ "./src/custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup.ts"); +const ObjectExpressionVariableDeclarationHostNode_1 = __webpack_require__(/*! ../../../custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode */ "./src/custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode.ts"); +const BinaryExpressionFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode */ "./src/custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode.ts"); +const BlockStatementControlFlowFlatteningNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode */ "./src/custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode.ts"); +const BlockStatementDeadCodeInjectionNode_1 = __webpack_require__(/*! ../../../custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode */ "./src/custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode.ts"); +const CallExpressionControlFlowStorageCallNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode */ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts"); +const CallExpressionFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode */ "./src/custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode.ts"); +const ControlFlowStorageNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode */ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.ts"); +const ConsoleOutputDisableExpressionNode_1 = __webpack_require__(/*! ../../../custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode */ "./src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.ts"); +const CustomNodeFormatter_1 = __webpack_require__(/*! ../../../custom-nodes/CustomNodeFormatter */ "./src/custom-nodes/CustomNodeFormatter.ts"); +const DebugProtectionFunctionCallNode_1 = __webpack_require__(/*! ../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode */ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts"); +const DebugProtectionFunctionIntervalNode_1 = __webpack_require__(/*! ../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode */ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts"); +const DebugProtectionFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode */ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts"); +const DomainLockNode_1 = __webpack_require__(/*! ../../../custom-nodes/domain-lock-nodes/DomainLockNode */ "./src/custom-nodes/domain-lock-nodes/DomainLockNode.ts"); +const ExpressionWithOperatorControlFlowStorageCallNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode */ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode.ts"); +const LogicalExpressionFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode */ "./src/custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode.ts"); +const NodeCallsControllerFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode */ "./src/custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode.ts"); +const SelfDefendingUnicodeNode_1 = __webpack_require__(/*! ../../../custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode */ "./src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts"); +const StringArrayCallsWrapper_1 = __webpack_require__(/*! ../../../custom-nodes/string-array-nodes/StringArrayCallsWrapper */ "./src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts"); +const StringArrayNode_1 = __webpack_require__(/*! ../../../custom-nodes/string-array-nodes/StringArrayNode */ "./src/custom-nodes/string-array-nodes/StringArrayNode.ts"); +const StringArrayRotateFunctionNode_1 = __webpack_require__(/*! ../../../custom-nodes/string-array-nodes/StringArrayRotateFunctionNode */ "./src/custom-nodes/string-array-nodes/StringArrayRotateFunctionNode.ts"); +const StringLiteralControlFlowStorageCallNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode */ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode.ts"); +const StringLiteralNode_1 = __webpack_require__(/*! ../../../custom-nodes/control-flow-flattening-nodes/StringLiteralNode */ "./src/custom-nodes/control-flow-flattening-nodes/StringLiteralNode.ts"); +exports.customNodesModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode) + .whenTargetNamed(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode) + .whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode) + .whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(DebugProtectionFunctionNode_1.DebugProtectionFunctionNode) + .whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(DomainLockNode_1.DomainLockNode) + .whenTargetNamed(CustomNode_1.CustomNode.DomainLockNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode) + .whenTargetNamed(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode) + .whenTargetNamed(CustomNode_1.CustomNode.SelfDefendingUnicodeNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(StringArrayCallsWrapper_1.StringArrayCallsWrapper) + .whenTargetNamed(CustomNode_1.CustomNode.StringArrayCallsWrapper); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(StringArrayNode_1.StringArrayNode) + .whenTargetNamed(CustomNode_1.CustomNode.StringArrayNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode) + .to(StringArrayRotateFunctionNode_1.StringArrayRotateFunctionNode) + .whenTargetNamed(CustomNode_1.CustomNode.StringArrayRotateFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(BinaryExpressionFunctionNode_1.BinaryExpressionFunctionNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.BinaryExpressionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(BlockStatementControlFlowFlatteningNode_1.BlockStatementControlFlowFlatteningNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(CallExpressionControlFlowStorageCallNode_1.CallExpressionControlFlowStorageCallNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(CallExpressionFunctionNode_1.CallExpressionFunctionNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(ControlFlowStorageNode_1.ControlFlowStorageNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.ControlFlowStorageNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(ExpressionWithOperatorControlFlowStorageCallNode_1.ExpressionWithOperatorControlFlowStorageCallNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(LogicalExpressionFunctionNode_1.LogicalExpressionFunctionNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.LogicalExpressionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(StringLiteralNode_1.StringLiteralNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(StringLiteralControlFlowStorageCallNode_1.StringLiteralControlFlowStorageCallNode) + .whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(BlockStatementDeadCodeInjectionNode_1.BlockStatementDeadCodeInjectionNode) + .whenTargetNamed(DeadCodeInjectionCustomNode_1.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode) + .toConstructor(ObjectExpressionVariableDeclarationHostNode_1.ObjectExpressionVariableDeclarationHostNode) + .whenTargetNamed(ObjectExpressionKeysTransformerCustomNode_1.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(ConsoleOutputCustomNodeGroup_1.ConsoleOutputCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.ConsoleOutputCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(DebugProtectionCustomNodeGroup_1.DebugProtectionCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.DebugProtectionCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(DomainLockCustomNodeGroup_1.DomainLockCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.DomainLockCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(SelfDefendingCustomNodeGroup_1.SelfDefendingCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.SelfDefendingCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup) + .to(StringArrayCustomNodeGroup_1.StringArrayCustomNodeGroup) + .whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.StringArrayCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions, ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions, ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNodeGroup) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter) + .to(CustomNodeFormatter_1.CustomNodeFormatter) + .inSingletonScope(); +}); + + +/***/ }), + +/***/ "./src/container/modules/generators/GeneratorsModule.ts": +/*!**************************************************************!*\ + !*** ./src/container/modules/generators/GeneratorsModule.ts ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IdentifierNamesGenerator_1 = __webpack_require__(/*! ../../../enums/generators/identifier-names-generators/IdentifierNamesGenerator */ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts"); +const DictionaryIdentifierNamesGenerator_1 = __webpack_require__(/*! ../../../generators/identifier-names-generators/DictionaryIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts"); +const HexadecimalIdentifierNamesGenerator_1 = __webpack_require__(/*! ../../../generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.ts"); +const MangledIdentifierNamesGenerator_1 = __webpack_require__(/*! ../../../generators/identifier-names-generators/MangledIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.ts"); +exports.generatorsModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator) + .to(DictionaryIdentifierNamesGenerator_1.DictionaryIdentifierNamesGenerator) + .inSingletonScope() + .whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator) + .to(HexadecimalIdentifierNamesGenerator_1.HexadecimalIdentifierNamesGenerator) + .inSingletonScope() + .whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator) + .to(MangledIdentifierNamesGenerator_1.MangledIdentifierNamesGenerator) + .inSingletonScope() + .whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator); + function identifierNameGeneratorFactory() { + let cachedIdentifierNamesGenerator = null; + return (context) => (options) => { + if (cachedIdentifierNamesGenerator) { + return cachedIdentifierNamesGenerator; + } + let identifierNamesGenerator; + switch (options.identifierNamesGenerator) { + case IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator: + identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator); + break; + case IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator: + identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator); + break; + case IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator: + default: + identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator); + } + cachedIdentifierNamesGenerator = identifierNamesGenerator; + return identifierNamesGenerator; + }; + } + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator) + .toFactory(identifierNameGeneratorFactory()); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/ControlFlowTransformersModule.ts": +/*!**********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/ControlFlowTransformersModule.ts ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ControlFlowReplacer_1 = __webpack_require__(/*! ../../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const BinaryExpressionControlFlowReplacer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer.ts"); +const BlockStatementControlFlowTransformer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer */ "./src/node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer.ts"); +const CallExpressionControlFlowReplacer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer.ts"); +const DeadCodeInjectionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer */ "./src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts"); +const FunctionControlFlowTransformer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/FunctionControlFlowTransformer */ "./src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.ts"); +const LogicalExpressionControlFlowReplacer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.ts"); +const StringLiteralControlFlowReplacer_1 = __webpack_require__(/*! ../../../node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer.ts"); +exports.controlFlowTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(BlockStatementControlFlowTransformer_1.BlockStatementControlFlowTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.BlockStatementControlFlowTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(DeadCodeInjectionTransformer_1.DeadCodeInjectionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.DeadCodeInjectionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(FunctionControlFlowTransformer_1.FunctionControlFlowTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.FunctionControlFlowTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer) + .to(BinaryExpressionControlFlowReplacer_1.BinaryExpressionControlFlowReplacer) + .whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.BinaryExpressionControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer) + .to(CallExpressionControlFlowReplacer_1.CallExpressionControlFlowReplacer) + .whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.CallExpressionControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer) + .to(LogicalExpressionControlFlowReplacer_1.LogicalExpressionControlFlowReplacer) + .whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.LogicalExpressionControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer) + .to(StringLiteralControlFlowReplacer_1.StringLiteralControlFlowReplacer) + .whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.StringLiteralControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowReplacer) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer)); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/ConvertingTransformersModule.ts": +/*!*********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/ConvertingTransformersModule.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const ObjectExpressionExtractor_1 = __webpack_require__(/*! ../../../enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor */ "./src/enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor.ts"); +const ObjectExpressionToVariableDeclarationExtractor_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor */ "./src/node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor.ts"); +const MemberExpressionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/MemberExpressionTransformer */ "./src/node-transformers/converting-transformers/MemberExpressionTransformer.ts"); +const MethodDefinitionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/MethodDefinitionTransformer */ "./src/node-transformers/converting-transformers/MethodDefinitionTransformer.ts"); +const ObjectExpressionKeysTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/ObjectExpressionKeysTransformer */ "./src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.ts"); +const ObjectExpressionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/ObjectExpressionTransformer */ "./src/node-transformers/converting-transformers/ObjectExpressionTransformer.ts"); +const SplitStringTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/SplitStringTransformer */ "./src/node-transformers/converting-transformers/SplitStringTransformer.ts"); +const TemplateLiteralTransformer_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/TemplateLiteralTransformer */ "./src/node-transformers/converting-transformers/TemplateLiteralTransformer.ts"); +const BasePropertiesExtractor_1 = __webpack_require__(/*! ../../../node-transformers/converting-transformers/object-expression-extractors/BasePropertiesExtractor */ "./src/node-transformers/converting-transformers/object-expression-extractors/BasePropertiesExtractor.ts"); +exports.convertingTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(MemberExpressionTransformer_1.MemberExpressionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.MemberExpressionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(MethodDefinitionTransformer_1.MethodDefinitionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.MethodDefinitionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ObjectExpressionKeysTransformer_1.ObjectExpressionKeysTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ObjectExpressionTransformer_1.ObjectExpressionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ObjectExpressionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(SplitStringTransformer_1.SplitStringTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.SplitStringTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(TemplateLiteralTransformer_1.TemplateLiteralTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObjectExpressionExtractor) + .to(ObjectExpressionToVariableDeclarationExtractor_1.ObjectExpressionToVariableDeclarationExtractor) + .whenTargetNamed(ObjectExpressionExtractor_1.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObjectExpressionExtractor) + .to(BasePropertiesExtractor_1.BasePropertiesExtractor) + .whenTargetNamed(ObjectExpressionExtractor_1.ObjectExpressionExtractor.BasePropertiesExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObjectExpressionExtractor) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IObjectExpressionExtractor)); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/FinalizingTransformersModule.ts": +/*!*********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/FinalizingTransformersModule.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +exports.finalizingTransformersModule = new inversify_1.ContainerModule((bind) => { +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/NodeTransformersModule.ts": +/*!***************************************************************************!*\ + !*** ./src/container/modules/node-transformers/NodeTransformersModule.ts ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +exports.nodeTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeTransformer) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer)); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/ObfuscatingTransformersModule.ts": +/*!**********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/ObfuscatingTransformersModule.ts ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts"); +const LiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const BaseIdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer.ts"); +const BooleanLiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer.ts"); +const LabeledStatementTransformer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/LabeledStatementTransformer */ "./src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts"); +const LiteralTransformer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/LiteralTransformer */ "./src/node-transformers/obfuscating-transformers/LiteralTransformer.ts"); +const NumberLiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer.ts"); +const StringLiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer.ts"); +const ScopeIdentifiersTransformer_1 = __webpack_require__(/*! ../../../node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer */ "./src/node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer.ts"); +exports.obfuscatingTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(LabeledStatementTransformer_1.LabeledStatementTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.LabeledStatementTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(LiteralTransformer_1.LiteralTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.LiteralTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ScopeIdentifiersTransformer_1.ScopeIdentifiersTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ScopeIdentifiersTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer) + .to(BooleanLiteralObfuscatingReplacer_1.BooleanLiteralObfuscatingReplacer) + .whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer) + .to(NumberLiteralObfuscatingReplacer_1.NumberLiteralObfuscatingReplacer) + .whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer) + .to(StringLiteralObfuscatingReplacer_1.StringLiteralObfuscatingReplacer) + .whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierObfuscatingReplacer) + .to(BaseIdentifierObfuscatingReplacer_1.BaseIdentifierObfuscatingReplacer) + .whenTargetNamed(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatingReplacer) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierObfuscatingReplacer)); +}); + + +/***/ }), + +/***/ "./src/container/modules/node-transformers/PreparingTransformersModule.ts": +/*!********************************************************************************!*\ + !*** ./src/container/modules/node-transformers/PreparingTransformersModule.ts ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const InversifyContainerFacade_1 = __webpack_require__(/*! ../../InversifyContainerFacade */ "./src/container/InversifyContainerFacade.ts"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const ObfuscatingGuard_1 = __webpack_require__(/*! ../../../enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard */ "./src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts"); +const BlackListObfuscatingGuard_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard */ "./src/node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard.ts"); +const CommentsTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/CommentsTransformer */ "./src/node-transformers/preparing-transformers/CommentsTransformer.ts"); +const ConditionalCommentObfuscatingGuard_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard */ "./src/node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard.ts"); +const CustomNodesTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/CustomNodesTransformer */ "./src/node-transformers/preparing-transformers/CustomNodesTransformer.ts"); +const EvalCallExpressionTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/EvalCallExpressionTransformer */ "./src/node-transformers/preparing-transformers/EvalCallExpressionTransformer.ts"); +const MetadataTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/MetadataTransformer */ "./src/node-transformers/preparing-transformers/MetadataTransformer.ts"); +const ObfuscatingGuardsTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/ObfuscatingGuardsTransformer */ "./src/node-transformers/preparing-transformers/ObfuscatingGuardsTransformer.ts"); +const ParentificationTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/ParentificationTransformer */ "./src/node-transformers/preparing-transformers/ParentificationTransformer.ts"); +const ReservedStringObfuscatingGuard_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard */ "./src/node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard.ts"); +const VariablePreserveTransformer_1 = __webpack_require__(/*! ../../../node-transformers/preparing-transformers/VariablePreserveTransformer */ "./src/node-transformers/preparing-transformers/VariablePreserveTransformer.ts"); +exports.preparingTransformersModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(CommentsTransformer_1.CommentsTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.CommentsTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(CustomNodesTransformer_1.CustomNodesTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.CustomNodesTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(EvalCallExpressionTransformer_1.EvalCallExpressionTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.EvalCallExpressionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(MetadataTransformer_1.MetadataTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.MetadataTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ObfuscatingGuardsTransformer_1.ObfuscatingGuardsTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ObfuscatingGuardsTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(ParentificationTransformer_1.ParentificationTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.ParentificationTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard) + .to(BlackListObfuscatingGuard_1.BlackListObfuscatingGuard) + .inSingletonScope() + .whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.BlackListObfuscatingGuard); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard) + .to(ConditionalCommentObfuscatingGuard_1.ConditionalCommentObfuscatingGuard) + .inSingletonScope() + .whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.ConditionalCommentObfuscatingGuard); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard) + .to(ReservedStringObfuscatingGuard_1.ReservedStringObfuscatingGuard) + .inSingletonScope() + .whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.ReservedStringObfuscatingGuard); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeGuard) + .toFactory(InversifyContainerFacade_1.InversifyContainerFacade + .getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer) + .to(VariablePreserveTransformer_1.VariablePreserveTransformer) + .whenTargetNamed(NodeTransformer_1.NodeTransformer.VariablePreserveTransformer); +}); + + +/***/ }), + +/***/ "./src/container/modules/options/OptionsModule.ts": +/*!********************************************************!*\ + !*** ./src/container/modules/options/OptionsModule.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const Options_1 = __webpack_require__(/*! ../../../options/Options */ "./src/options/Options.ts"); +const OptionsNormalizer_1 = __webpack_require__(/*! ../../../options/OptionsNormalizer */ "./src/options/OptionsNormalizer.ts"); +exports.optionsModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IOptions) + .to(Options_1.Options) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IOptionsNormalizer) + .to(OptionsNormalizer_1.OptionsNormalizer) + .inSingletonScope(); +}); + + +/***/ }), + +/***/ "./src/container/modules/storages/StoragesModule.ts": +/*!**********************************************************!*\ + !*** ./src/container/modules/storages/StoragesModule.ts ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ControlFlowStorage_1 = __webpack_require__(/*! ../../../storages/control-flow/ControlFlowStorage */ "./src/storages/control-flow/ControlFlowStorage.ts"); +const CustomNodeGroupStorage_1 = __webpack_require__(/*! ../../../storages/custom-node-group/CustomNodeGroupStorage */ "./src/storages/custom-node-group/CustomNodeGroupStorage.ts"); +const StringArrayStorage_1 = __webpack_require__(/*! ../../../storages/string-array/StringArrayStorage */ "./src/storages/string-array/StringArrayStorage.ts"); +exports.storagesModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.TCustomNodeGroupStorage) + .to(CustomNodeGroupStorage_1.CustomNodeGroupStorage) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorage) + .to(StringArrayStorage_1.StringArrayStorage) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__TControlFlowStorage) + .toConstructor(ControlFlowStorage_1.ControlFlowStorage); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__TControlFlowStorage) + .toFactory((context) => { + return () => { + const constructor = context.container + .get(ServiceIdentifiers_1.ServiceIdentifiers.Newable__TControlFlowStorage); + const randomGenerator = context.container + .get(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator); + const options = context.container + .get(ServiceIdentifiers_1.ServiceIdentifiers.IOptions); + const storage = new constructor(randomGenerator, options); + storage.initialize(); + return storage; + }; + }); +}); + + +/***/ }), + +/***/ "./src/container/modules/utils/UtilsModule.ts": +/*!****************************************************!*\ + !*** ./src/container/modules/utils/UtilsModule.ts ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ArrayUtils_1 = __webpack_require__(/*! ../../../utils/ArrayUtils */ "./src/utils/ArrayUtils.ts"); +const CryptUtils_1 = __webpack_require__(/*! ../../../utils/CryptUtils */ "./src/utils/CryptUtils.ts"); +const EscapeSequenceEncoder_1 = __webpack_require__(/*! ../../../utils/EscapeSequenceEncoder */ "./src/utils/EscapeSequenceEncoder.ts"); +const LevelledTopologicalSorter_1 = __webpack_require__(/*! ../../../utils/LevelledTopologicalSorter */ "./src/utils/LevelledTopologicalSorter.ts"); +const NodeTransformerNamesGroupsBuilder_1 = __webpack_require__(/*! ../../../utils/NodeTransformerNamesGroupsBuilder */ "./src/utils/NodeTransformerNamesGroupsBuilder.ts"); +const RandomGenerator_1 = __webpack_require__(/*! ../../../utils/RandomGenerator */ "./src/utils/RandomGenerator.ts"); +exports.utilsModule = new inversify_1.ContainerModule((bind) => { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils) + .to(ArrayUtils_1.ArrayUtils) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator) + .to(RandomGenerator_1.RandomGenerator) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils) + .to(CryptUtils_1.CryptUtils) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder) + .to(EscapeSequenceEncoder_1.EscapeSequenceEncoder) + .inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ILevelledTopologicalSorter) + .to(LevelledTopologicalSorter_1.LevelledTopologicalSorter); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder) + .to(NodeTransformerNamesGroupsBuilder_1.NodeTransformerNamesGroupsBuilder) + .inSingletonScope(); +}); + + +/***/ }), + +/***/ "./src/custom-nodes/AbstractCustomNode.ts": +/*!************************************************!*\ + !*** ./src/custom-nodes/AbstractCustomNode.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var AbstractCustomNode_1, _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const GlobalVariableTemplate1_1 = __webpack_require__(/*! ../templates/GlobalVariableTemplate1 */ "./src/templates/GlobalVariableTemplate1.ts"); +const GlobalVariableTemplate2_1 = __webpack_require__(/*! ../templates/GlobalVariableTemplate2 */ "./src/templates/GlobalVariableTemplate2.ts"); +let AbstractCustomNode = AbstractCustomNode_1 = class AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + this.cachedNode = null; + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + this.customNodeFormatter = customNodeFormatter; + this.randomGenerator = randomGenerator; + this.options = options; + } + getNode() { + if (!this.cachedNode) { + const nodeTemplate = this.getNodeTemplate(); + this.cachedNode = this.customNodeFormatter.formatStructure(this.getNodeStructure(nodeTemplate)); + } + return this.cachedNode; + } + getGlobalVariableTemplate() { + return this.randomGenerator + .getRandomGenerator() + .pickone(AbstractCustomNode_1.globalVariableTemplateFunctions); + } + getNodeTemplate() { + return ''; + } +}; +AbstractCustomNode.globalVariableTemplateFunctions = [ + GlobalVariableTemplate1_1.GlobalVariableTemplate1(), + GlobalVariableTemplate2_1.GlobalVariableTemplate2() +]; +AbstractCustomNode = AbstractCustomNode_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], AbstractCustomNode); +exports.AbstractCustomNode = AbstractCustomNode; + + +/***/ }), + +/***/ "./src/custom-nodes/AbstractCustomNodeGroup.ts": +/*!*****************************************************!*\ + !*** ./src/custom-nodes/AbstractCustomNodeGroup.ts ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let AbstractCustomNodeGroup = class AbstractCustomNodeGroup { + constructor(identifierNamesGeneratorFactory, randomGenerator, options) { + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + this.randomGenerator = randomGenerator; + this.options = options; + } + getAppendEvent() { + return this.appendEvent; + } + getCustomNodes() { + return this.customNodes; + } + appendCustomNodeIfExist(customNodeName, callback) { + const customNode = this.customNodes.get(customNodeName); + if (!customNode) { + return; + } + callback(customNode); + } + getRandomCallsGraphIndex(callsGraphLength) { + return this.randomGenerator.getRandomInteger(0, Math.max(0, Math.round(callsGraphLength - 1))); + } +}; +AbstractCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], AbstractCustomNodeGroup); +exports.AbstractCustomNodeGroup = AbstractCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/CustomNodeFormatter.ts": +/*!*************************************************!*\ + !*** ./src/custom-nodes/CustomNodeFormatter.ts ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const string_template_1 = __importDefault(__webpack_require__(/*! string-template */ "string-template")); +const IPrevailingKindOfVariablesAnalyzer_1 = __webpack_require__(/*! ../interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer */ "./src/interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let CustomNodeFormatter = class CustomNodeFormatter { + constructor(prevailingKindOfVariablesAnalyzer) { + this.prevailingKindOfVariables = prevailingKindOfVariablesAnalyzer.getPrevailingKind(); + } + formatTemplate(template, mapping) { + return string_template_1.default(template, mapping); + } + formatStructure(statements) { + for (const statement of statements) { + estraverse.replace(statement, { + enter: (node) => { + if (!NodeGuards_1.NodeGuards.isVariableDeclarationNode(node)) { + return; + } + if (this.prevailingKindOfVariables === 'var') { + node.kind = 'var'; + } + return node; + } + }); + } + return statements; + } +}; +CustomNodeFormatter = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)), + __metadata("design:paramtypes", [typeof (_a = typeof IPrevailingKindOfVariablesAnalyzer_1.IPrevailingKindOfVariablesAnalyzer !== "undefined" && IPrevailingKindOfVariablesAnalyzer_1.IPrevailingKindOfVariablesAnalyzer) === "function" ? _a : Object]) +], CustomNodeFormatter); +exports.CustomNodeFormatter = CustomNodeFormatter; + + +/***/ }), + +/***/ "./src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.ts": +/*!*************************************************************************************!*\ + !*** ./src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(/*! ../../templates/console-output-nodes/console-output-disable-expression-node/ConsoleOutputDisableExpressionTemplate */ "./src/templates/console-output-nodes/console-output-disable-expression-node/ConsoleOutputDisableExpressionTemplate.ts"); +const GlobalVariableNoEvalTemplate_1 = __webpack_require__(/*! ../../templates/GlobalVariableNoEvalTemplate */ "./src/templates/GlobalVariableNoEvalTemplate.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ConsoleOutputDisableExpressionNode = class ConsoleOutputDisableExpressionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(callsControllerFunctionName) { + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval + ? this.getGlobalVariableTemplate() + : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); + return this.customNodeFormatter.formatTemplate(ConsoleOutputDisableExpressionTemplate_1.ConsoleOutputDisableExpressionTemplate(), { + consoleLogDisableFunctionName: this.identifierNamesGenerator.generate(), + globalVariableTemplate, + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ConsoleOutputDisableExpressionNode.prototype, "callsControllerFunctionName", void 0); +ConsoleOutputDisableExpressionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], ConsoleOutputDisableExpressionNode); +exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup.ts": +/*!*************************************************************************************!*\ + !*** ./src/custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +let ConsoleOutputCustomNodeGroup = class ConsoleOutputCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; + this.customNodeFactory = customNodeFactory; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + const randomCallsGraphIndex = this.getRandomCallsGraphIndex(callsGraphData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode, (customNode) => { + NodeAppender_1.NodeAppender.appendToOptimalBlockScope(callsGraphData, nodeWithStatements, customNode.getNode(), randomCallsGraphIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, (customNode) => { + const targetNodeWithStatements = callsGraphData.length + ? NodeAppender_1.NodeAppender.getOptimalBlockScope(callsGraphData, randomCallsGraphIndex, 1) + : nodeWithStatements; + NodeAppender_1.NodeAppender.prepend(targetNodeWithStatements, customNode.getNode()); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.disableConsoleOutput) { + return; + } + const callsControllerFunctionName = this.identifierNamesGenerator.generate(); + const consoleOutputDisableExpressionNode = this.customNodeFactory(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode); + const nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + consoleOutputDisableExpressionNode.initialize(callsControllerFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode, consoleOutputDisableExpressionNode); + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], ConsoleOutputCustomNodeGroup.prototype, "customNodes", void 0); +ConsoleOutputCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], ConsoleOutputCustomNodeGroup); +exports.ConsoleOutputCustomNodeGroup = ConsoleOutputCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode.ts": +/*!****************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode.ts ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let BinaryExpressionFunctionNode = class BinaryExpressionFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(operator) { + this.operator = operator; + } + getNodeStructure(nodeTemplate) { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.functionExpressionNode([ + NodeFactory_1.NodeFactory.identifierNode('x'), + NodeFactory_1.NodeFactory.identifierNode('y') + ], NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.returnStatementNode(NodeFactory_1.NodeFactory.binaryExpressionNode(this.operator, NodeFactory_1.NodeFactory.identifierNode('x'), NodeFactory_1.NodeFactory.identifierNode('y'))) + ]))); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +BinaryExpressionFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], BinaryExpressionFunctionNode); +exports.BinaryExpressionFunctionNode = BinaryExpressionFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode.ts": +/*!***************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode.ts ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let BlockStatementControlFlowFlatteningNode = class BlockStatementControlFlowFlatteningNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(blockStatementBody, shuffledKeys, originalKeysIndexesInShuffledArray) { + this.blockStatementBody = blockStatementBody; + this.shuffledKeys = shuffledKeys; + this.originalKeysIndexesInShuffledArray = originalKeysIndexesInShuffledArray; + } + getNodeStructure(nodeTemplate) { + const controllerIdentifierName = this.randomGenerator.getRandomString(6); + const indexIdentifierName = this.randomGenerator.getRandomString(6); + const structure = NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.variableDeclarationNode([ + NodeFactory_1.NodeFactory.variableDeclaratorNode(NodeFactory_1.NodeFactory.identifierNode(controllerIdentifierName), NodeFactory_1.NodeFactory.callExpressionNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join('|')), NodeFactory_1.NodeFactory.identifierNode('split')), [ + NodeFactory_1.NodeFactory.literalNode('|') + ])) + ], 'const'), + NodeFactory_1.NodeFactory.variableDeclarationNode([ + NodeFactory_1.NodeFactory.variableDeclaratorNode(NodeFactory_1.NodeFactory.identifierNode(indexIdentifierName), NodeFactory_1.NodeFactory.literalNode(0)) + ], 'let'), + NodeFactory_1.NodeFactory.whileStatementNode(NodeFactory_1.NodeFactory.literalNode(true), NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.switchStatementNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.identifierNode(controllerIdentifierName), NodeFactory_1.NodeFactory.updateExpressionNode('++', NodeFactory_1.NodeFactory.identifierNode(indexIdentifierName)), true), this.shuffledKeys.map((key, index) => { + const statement = this.blockStatementBody[key]; + const consequent = [statement]; + if (!NodeGuards_1.NodeGuards.isReturnStatementNode(statement)) { + consequent.push(NodeFactory_1.NodeFactory.continueStatement()); + } + return NodeFactory_1.NodeFactory.switchCaseNode(NodeFactory_1.NodeFactory.literalNode(String(index)), consequent); + })), + NodeFactory_1.NodeFactory.breakStatement() + ])) + ]); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], BlockStatementControlFlowFlatteningNode.prototype, "blockStatementBody", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], BlockStatementControlFlowFlatteningNode.prototype, "originalKeysIndexesInShuffledArray", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], BlockStatementControlFlowFlatteningNode.prototype, "shuffledKeys", void 0); +BlockStatementControlFlowFlatteningNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], BlockStatementControlFlowFlatteningNode); +exports.BlockStatementControlFlowFlatteningNode = BlockStatementControlFlowFlatteningNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode.ts": +/*!**************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let CallExpressionFunctionNode = class CallExpressionFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(expressionArguments) { + this.expressionArguments = expressionArguments; + } + getNodeStructure(nodeTemplate) { + const calleeIdentifier = NodeFactory_1.NodeFactory.identifierNode('callee'); + const params = []; + const argumentsLength = this.expressionArguments.length; + for (let i = 0; i < argumentsLength; i++) { + params.push(NodeFactory_1.NodeFactory.identifierNode(`param${i + 1}`)); + } + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.functionExpressionNode([ + calleeIdentifier, + ...params + ], NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.returnStatementNode(NodeFactory_1.NodeFactory.callExpressionNode(calleeIdentifier, params)) + ]))); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], CallExpressionFunctionNode.prototype, "expressionArguments", void 0); +CallExpressionFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], CallExpressionFunctionNode); +exports.CallExpressionFunctionNode = CallExpressionFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode.ts": +/*!*****************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode.ts ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let LogicalExpressionFunctionNode = class LogicalExpressionFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(operator) { + this.operator = operator; + } + getNodeStructure(nodeTemplate) { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.functionExpressionNode([ + NodeFactory_1.NodeFactory.identifierNode('x'), + NodeFactory_1.NodeFactory.identifierNode('y') + ], NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.returnStatementNode(NodeFactory_1.NodeFactory.logicalExpressionNode(this.operator, NodeFactory_1.NodeFactory.identifierNode('x'), NodeFactory_1.NodeFactory.identifierNode('y'))) + ]))); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +LogicalExpressionFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], LogicalExpressionFunctionNode); +exports.LogicalExpressionFunctionNode = LogicalExpressionFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/StringLiteralNode.ts": +/*!*****************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/StringLiteralNode.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +let StringLiteralNode = class StringLiteralNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(literalValue) { + this.literalValue = literalValue; + } + getNodeStructure(nodeTemplate) { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.literalNode(this.literalValue)); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringLiteralNode.prototype, "literalValue", void 0); +StringLiteralNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], StringLiteralNode); +exports.StringLiteralNode = StringLiteralNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts": +/*!*******************************************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts ***! + \*******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let CallExpressionControlFlowStorageCallNode = class CallExpressionControlFlowStorageCallNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(controlFlowStorageName, controlFlowStorageKey, callee, expressionArguments) { + this.controlFlowStorageName = controlFlowStorageName; + this.controlFlowStorageKey = controlFlowStorageKey; + this.callee = callee; + this.expressionArguments = expressionArguments; + } + getNodeStructure() { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.callExpressionNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageName), NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageKey)), [ + this.callee, + ...this.expressionArguments + ])); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof ESTree !== "undefined" && ESTree.Expression) === "function" ? _a : Object) +], CallExpressionControlFlowStorageCallNode.prototype, "callee", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], CallExpressionControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], CallExpressionControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Array) +], CallExpressionControlFlowStorageCallNode.prototype, "expressionArguments", void 0); +CallExpressionControlFlowStorageCallNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _b : Object, typeof (_c = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], CallExpressionControlFlowStorageCallNode); +exports.CallExpressionControlFlowStorageCallNode = CallExpressionControlFlowStorageCallNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.ts": +/*!*************************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode.ts ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowStorage_1 = __webpack_require__(/*! ../../../types/storages/TControlFlowStorage */ "./src/types/storages/TControlFlowStorage.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ControlFlowStorageNode = class ControlFlowStorageNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(controlFlowStorage) { + this.controlFlowStorage = controlFlowStorage; + } + getNodeStructure(nodeTemplate) { + const propertyNodes = Array + .from(this.controlFlowStorage.getStorage()) + .map(([key, value]) => { + const node = value.getNode()[0]; + if (!NodeGuards_1.NodeGuards.isExpressionStatementNode(node)) { + throw new Error('Function node for control flow storage object should be passed inside the `ExpressionStatement` node!'); + } + return NodeFactory_1.NodeFactory.propertyNode(NodeFactory_1.NodeFactory.identifierNode(key), node.expression); + }); + let structure = NodeFactory_1.NodeFactory.variableDeclarationNode([ + NodeFactory_1.NodeFactory.variableDeclaratorNode(NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()), NodeFactory_1.NodeFactory.objectExpressionNode(propertyNodes)) + ], 'const'); + structure = NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof TControlFlowStorage_1.TControlFlowStorage !== "undefined" && TControlFlowStorage_1.TControlFlowStorage) === "function" ? _a : Object) +], ControlFlowStorageNode.prototype, "controlFlowStorage", void 0); +ControlFlowStorageNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _b : Object, typeof (_c = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], ControlFlowStorageNode); +exports.ControlFlowStorageNode = ControlFlowStorageNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode.ts": +/*!***************************************************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode.ts ***! + \***************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ExpressionWithOperatorControlFlowStorageCallNode = class ExpressionWithOperatorControlFlowStorageCallNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(controlFlowStorageName, controlFlowStorageKey, leftValue, rightValue) { + this.controlFlowStorageName = controlFlowStorageName; + this.controlFlowStorageKey = controlFlowStorageKey; + this.leftValue = leftValue; + this.rightValue = rightValue; + } + getNodeStructure() { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.callExpressionNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageName), NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageKey)), [ + this.leftValue, + this.rightValue + ])); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); +ExpressionWithOperatorControlFlowStorageCallNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], ExpressionWithOperatorControlFlowStorageCallNode); +exports.ExpressionWithOperatorControlFlowStorageCallNode = ExpressionWithOperatorControlFlowStorageCallNode; + + +/***/ }), + +/***/ "./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode.ts": +/*!******************************************************************************************************************************!*\ + !*** ./src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode.ts ***! + \******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let StringLiteralControlFlowStorageCallNode = class StringLiteralControlFlowStorageCallNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(controlFlowStorageName, controlFlowStorageKey) { + this.controlFlowStorageName = controlFlowStorageName; + this.controlFlowStorageKey = controlFlowStorageKey; + } + getNodeStructure() { + const structure = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.memberExpressionNode(NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageName), NodeFactory_1.NodeFactory.identifierNode(this.controlFlowStorageKey))); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringLiteralControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringLiteralControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); +StringLiteralControlFlowStorageCallNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], StringLiteralControlFlowStorageCallNode); +exports.StringLiteralControlFlowStorageCallNode = StringLiteralControlFlowStorageCallNode; + + +/***/ }), + +/***/ "./src/custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode.ts": +/*!*******************************************************************************************!*\ + !*** ./src/custom-nodes/dead-code-injection-nodes/BlockStatementDeadCodeInjectionNode.ts ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let BlockStatementDeadCodeInjectionNode = class BlockStatementDeadCodeInjectionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(blockStatementNode, deadCodeInjectionRootAstHostNode) { + this.blockStatementNode = blockStatementNode; + this.deadCodeInjectionRootAstHostNode = deadCodeInjectionRootAstHostNode; + } + getNodeStructure(nodeTemplate) { + const random1 = this.randomGenerator.getMathRandom() > 0.5; + const random2 = this.randomGenerator.getMathRandom() > 0.5; + const operator = random1 ? '===' : '!=='; + const leftString = this.randomGenerator.getRandomString(5); + const rightString = random2 ? leftString : this.randomGenerator.getRandomString(5); + const [consequent, alternate] = random1 === random2 + ? [this.blockStatementNode, this.deadCodeInjectionRootAstHostNode] + : [this.deadCodeInjectionRootAstHostNode, this.blockStatementNode]; + const structure = NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.ifStatementNode(NodeFactory_1.NodeFactory.binaryExpressionNode(operator, NodeFactory_1.NodeFactory.literalNode(leftString), NodeFactory_1.NodeFactory.literalNode(rightString)), consequent, alternate) + ]); + NodeUtils_1.NodeUtils.parentizeAst(structure); + return [structure]; + } +}; +BlockStatementDeadCodeInjectionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], BlockStatementDeadCodeInjectionNode); +exports.BlockStatementDeadCodeInjectionNode = BlockStatementDeadCodeInjectionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts": +/*!************************************************************************************!*\ + !*** ./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const DebugProtectionFunctionCallTemplate_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-call-node/DebugProtectionFunctionCallTemplate */ "./src/templates/debug-protection-nodes/debug-protection-function-call-node/DebugProtectionFunctionCallTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DebugProtectionFunctionCallNode = class DebugProtectionFunctionCallNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(debugProtectionFunctionName, callsControllerFunctionName) { + this.debugProtectionFunctionName = debugProtectionFunctionName; + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + return this.customNodeFormatter.formatTemplate(DebugProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate(), { + debugProtectionFunctionName: this.debugProtectionFunctionName, + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DebugProtectionFunctionCallNode.prototype, "callsControllerFunctionName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DebugProtectionFunctionCallNode.prototype, "debugProtectionFunctionName", void 0); +DebugProtectionFunctionCallNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], DebugProtectionFunctionCallNode); +exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode; + + +/***/ }), + +/***/ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts": +/*!****************************************************************************************!*\ + !*** ./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate */ "./src/templates/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DebugProtectionFunctionIntervalNode = class DebugProtectionFunctionIntervalNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(debugProtectionFunctionName) { + this.debugProtectionFunctionName = debugProtectionFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + return this.customNodeFormatter.formatTemplate(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate(), { + debugProtectionFunctionName: this.debugProtectionFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DebugProtectionFunctionIntervalNode.prototype, "debugProtectionFunctionName", void 0); +DebugProtectionFunctionIntervalNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], DebugProtectionFunctionIntervalNode); +exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode; + + +/***/ }), + +/***/ "./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts": +/*!********************************************************************************!*\ + !*** ./src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const DebuggerTemplate_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplate */ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplate.ts"); +const DebuggerTemplateNoEval_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplateNoEval */ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplateNoEval.ts"); +const DebugProtectionFunctionTemplate_1 = __webpack_require__(/*! ../../templates/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate */ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DebugProtectionFunctionNode = class DebugProtectionFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(debugProtectionFunctionName) { + this.debugProtectionFunctionName = debugProtectionFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const debuggerTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval + ? DebuggerTemplate_1.DebuggerTemplate() + : DebuggerTemplateNoEval_1.DebuggerTemplateNoEval(); + return this.customNodeFormatter.formatTemplate(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate(), { + debuggerTemplate, + debugProtectionFunctionName: this.debugProtectionFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DebugProtectionFunctionNode.prototype, "debugProtectionFunctionName", void 0); +DebugProtectionFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], DebugProtectionFunctionNode); +exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup.ts": +/*!*****************************************************************************************!*\ + !*** ./src/custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup.ts ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let DebugProtectionCustomNodeGroup = class DebugProtectionCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; + this.customNodeFactory = customNodeFactory; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + const randomCallsGraphIndex = this.getRandomCallsGraphIndex(callsGraphData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode, (customNode) => { + NodeAppender_1.NodeAppender.appendToOptimalBlockScope(callsGraphData, nodeWithStatements, customNode.getNode(), randomCallsGraphIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionNode, (customNode) => { + NodeAppender_1.NodeAppender.append(nodeWithStatements, customNode.getNode()); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode, (customNode) => { + const programBodyLength = NodeGuards_1.NodeGuards.isSwitchCaseNode(nodeWithStatements) + ? nodeWithStatements.consequent.length + : nodeWithStatements.body.length; + const randomIndex = this.randomGenerator.getRandomInteger(0, programBodyLength); + NodeAppender_1.NodeAppender.insertAtIndex(nodeWithStatements, customNode.getNode(), randomIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, (customNode) => { + const targetNodeWithStatements = callsGraphData.length + ? NodeAppender_1.NodeAppender.getOptimalBlockScope(callsGraphData, randomCallsGraphIndex, 1) + : nodeWithStatements; + NodeAppender_1.NodeAppender.prepend(targetNodeWithStatements, customNode.getNode()); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.debugProtection) { + return; + } + const debugProtectionFunctionName = this.identifierNamesGenerator.generate(); + const callsControllerFunctionName = this.identifierNamesGenerator.generate(); + const debugProtectionFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionNode); + const debugProtectionFunctionCallNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode); + const debugProtectionFunctionIntervalNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode); + const nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + debugProtectionFunctionNode.initialize(debugProtectionFunctionName); + debugProtectionFunctionCallNode.initialize(debugProtectionFunctionName, callsControllerFunctionName); + debugProtectionFunctionIntervalNode.initialize(debugProtectionFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionNode, debugProtectionFunctionNode); + this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode, debugProtectionFunctionCallNode); + if (this.options.debugProtectionInterval) { + this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode, debugProtectionFunctionIntervalNode); + } + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], DebugProtectionCustomNodeGroup.prototype, "customNodes", void 0); +DebugProtectionCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], DebugProtectionCustomNodeGroup); +exports.DebugProtectionCustomNodeGroup = DebugProtectionCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/domain-lock-nodes/DomainLockNode.ts": +/*!**************************************************************!*\ + !*** ./src/custom-nodes/domain-lock-nodes/DomainLockNode.ts ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const ICryptUtils_1 = __webpack_require__(/*! ../../interfaces/utils/ICryptUtils */ "./src/interfaces/utils/ICryptUtils.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const DomainLockNodeTemplate_1 = __webpack_require__(/*! ../../templates/domain-lock-nodes/domain-lock-node/DomainLockNodeTemplate */ "./src/templates/domain-lock-nodes/domain-lock-node/DomainLockNodeTemplate.ts"); +const GlobalVariableNoEvalTemplate_1 = __webpack_require__(/*! ../../templates/GlobalVariableNoEvalTemplate */ "./src/templates/GlobalVariableNoEvalTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DomainLockNode = class DomainLockNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options, cryptUtils) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + this.cryptUtils = cryptUtils; + } + initialize(callsControllerFunctionName) { + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const domainsString = this.options.domainLock.join(';'); + const [hiddenDomainsString, diff] = this.cryptUtils.hideString(domainsString, domainsString.length * 3); + const globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval + ? this.getGlobalVariableTemplate() + : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); + return this.customNodeFormatter.formatTemplate(DomainLockNodeTemplate_1.DomainLockNodeTemplate(), { + domainLockFunctionName: this.identifierNamesGenerator.generate(), + diff, + domains: hiddenDomainsString, + globalVariableTemplate, + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], DomainLockNode.prototype, "callsControllerFunctionName", void 0); +DomainLockNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof ICryptUtils_1.ICryptUtils !== "undefined" && ICryptUtils_1.ICryptUtils) === "function" ? _e : Object]) +], DomainLockNode); +exports.DomainLockNode = DomainLockNode; + + +/***/ }), + +/***/ "./src/custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup.ts": +/*!*******************************************************************************!*\ + !*** ./src/custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup.ts ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +let DomainLockCustomNodeGroup = class DomainLockCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; + this.customNodeFactory = customNodeFactory; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + const randomCallsGraphIndex = this.getRandomCallsGraphIndex(callsGraphData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DomainLockNode, (customNode) => { + NodeAppender_1.NodeAppender.appendToOptimalBlockScope(callsGraphData, nodeWithStatements, customNode.getNode(), randomCallsGraphIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, (customNode) => { + const targetNodeWithStatements = callsGraphData.length + ? NodeAppender_1.NodeAppender.getOptimalBlockScope(callsGraphData, randomCallsGraphIndex, 1) + : nodeWithStatements; + NodeAppender_1.NodeAppender.prepend(targetNodeWithStatements, customNode.getNode()); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.domainLock.length) { + return; + } + const callsControllerFunctionName = this.identifierNamesGenerator.generate(); + const domainLockNode = this.customNodeFactory(CustomNode_1.CustomNode.DomainLockNode); + const nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + domainLockNode.initialize(callsControllerFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.DomainLockNode, domainLockNode); + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], DomainLockCustomNodeGroup.prototype, "customNodes", void 0); +DomainLockCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], DomainLockCustomNodeGroup); +exports.DomainLockCustomNodeGroup = DomainLockCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode.ts": +/*!*****************************************************************************************!*\ + !*** ./src/custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode.ts ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const SingleNodeCallControllerTemplate_1 = __webpack_require__(/*! ../../templates/SingleNodeCallControllerTemplate */ "./src/templates/SingleNodeCallControllerTemplate.ts"); +const NoCustomNodes_1 = __webpack_require__(/*! ../../options/presets/NoCustomNodes */ "./src/options/presets/NoCustomNodes.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ../../JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +let NodeCallsControllerFunctionNode = class NodeCallsControllerFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(appendEvent, callsControllerFunctionName) { + this.appendEvent = appendEvent; + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + if (this.appendEvent === ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation) { + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), { + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }), Object.assign(Object.assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET), { identifierNamesGenerator: this.options.identifierNamesGenerator, identifiersDictionary: this.options.identifiersDictionary, seed: this.options.seed })).getObfuscatedCode(); + } + return this.customNodeFormatter.formatTemplate(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), { + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], NodeCallsControllerFunctionNode.prototype, "callsControllerFunctionName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof ObfuscationEvent_1.ObfuscationEvent !== "undefined" && ObfuscationEvent_1.ObfuscationEvent) === "function" ? _a : Object) +], NodeCallsControllerFunctionNode.prototype, "appendEvent", void 0); +NodeCallsControllerFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _b : Object, typeof (_c = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], NodeCallsControllerFunctionNode); +exports.NodeCallsControllerFunctionNode = NodeCallsControllerFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode.ts": +/*!******************************************************************************************************************!*\ + !*** ./src/custom-nodes/object-expression-keys-transformer-nodes/ObjectExpressionVariableDeclarationHostNode.ts ***! + \******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +let ObjectExpressionVariableDeclarationHostNode = class ObjectExpressionVariableDeclarationHostNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(properties) { + this.properties = properties; + } + getNodeStructure(nodeTemplate) { + const structure = NodeFactory_1.NodeFactory.variableDeclarationNode([ + NodeFactory_1.NodeFactory.variableDeclaratorNode(NodeFactory_1.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()), NodeFactory_1.NodeFactory.objectExpressionNode(this.properties)) + ], 'const'); + return [structure]; + } +}; +ObjectExpressionVariableDeclarationHostNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], ObjectExpressionVariableDeclarationHostNode); +exports.ObjectExpressionVariableDeclarationHostNode = ObjectExpressionVariableDeclarationHostNode; + + +/***/ }), + +/***/ "./src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts": +/*!***************************************************************************!*\ + !*** ./src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const NoCustomNodes_1 = __webpack_require__(/*! ../../options/presets/NoCustomNodes */ "./src/options/presets/NoCustomNodes.ts"); +const SelfDefendingTemplate_1 = __webpack_require__(/*! ../../templates/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate */ "./src/templates/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ../../JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let SelfDefendingUnicodeNode = class SelfDefendingUnicodeNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options, escapeSequenceEncoder) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + this.escapeSequenceEncoder = escapeSequenceEncoder; + } + initialize(callsControllerFunctionName) { + this.callsControllerFunctionName = callsControllerFunctionName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(SelfDefendingTemplate_1.SelfDefendingTemplate(this.escapeSequenceEncoder), { + selfDefendingFunctionName: this.identifierNamesGenerator.generate(), + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }), Object.assign(Object.assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET), { identifierNamesGenerator: this.options.identifierNamesGenerator, identifiersDictionary: this.options.identifiersDictionary, seed: this.options.seed, unicodeEscapeSequence: true })).getObfuscatedCode(); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], SelfDefendingUnicodeNode.prototype, "callsControllerFunctionName", void 0); +SelfDefendingUnicodeNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _e : Object]) +], SelfDefendingUnicodeNode); +exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode; + + +/***/ }), + +/***/ "./src/custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup.ts": +/*!*************************************************************************************!*\ + !*** ./src/custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +let SelfDefendingCustomNodeGroup = class SelfDefendingCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation; + this.customNodeFactory = customNodeFactory; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + const randomCallsGraphIndex = this.getRandomCallsGraphIndex(callsGraphData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.SelfDefendingUnicodeNode, (customNode) => { + NodeAppender_1.NodeAppender.appendToOptimalBlockScope(callsGraphData, nodeWithStatements, customNode.getNode(), randomCallsGraphIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, (customNode) => { + const targetNodeWithStatements = callsGraphData.length + ? NodeAppender_1.NodeAppender.getOptimalBlockScope(callsGraphData, randomCallsGraphIndex, 1) + : nodeWithStatements; + NodeAppender_1.NodeAppender.prepend(targetNodeWithStatements, customNode.getNode()); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.selfDefending) { + return; + } + const callsControllerFunctionName = this.identifierNamesGenerator.generate(); + const selfDefendingUnicodeNode = this.customNodeFactory(CustomNode_1.CustomNode.SelfDefendingUnicodeNode); + const nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + selfDefendingUnicodeNode.initialize(callsControllerFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.SelfDefendingUnicodeNode, selfDefendingUnicodeNode); + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], SelfDefendingCustomNodeGroup.prototype, "customNodes", void 0); +SelfDefendingCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], SelfDefendingCustomNodeGroup); +exports.SelfDefendingCustomNodeGroup = SelfDefendingCustomNodeGroup; + + +/***/ }), + +/***/ "./src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts": +/*!************************************************************************!*\ + !*** ./src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const StringArrayEncoding_1 = __webpack_require__(/*! ../../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const NoCustomNodes_1 = __webpack_require__(/*! ../../options/presets/NoCustomNodes */ "./src/options/presets/NoCustomNodes.ts"); +const AtobTemplate_1 = __webpack_require__(/*! ../../templates/AtobTemplate */ "./src/templates/AtobTemplate.ts"); +const GlobalVariableNoEvalTemplate_1 = __webpack_require__(/*! ../../templates/GlobalVariableNoEvalTemplate */ "./src/templates/GlobalVariableNoEvalTemplate.ts"); +const Rc4Template_1 = __webpack_require__(/*! ../../templates/Rc4Template */ "./src/templates/Rc4Template.ts"); +const SelfDefendingTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-calls-wrapper/SelfDefendingTemplate */ "./src/templates/string-array-nodes/string-array-calls-wrapper/SelfDefendingTemplate.ts"); +const StringArrayBase64DecodeNodeTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-calls-wrapper/StringArrayBase64DecodeNodeTemplate */ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayBase64DecodeNodeTemplate.ts"); +const StringArrayCallsWrapperTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-calls-wrapper/StringArrayCallsWrapperTemplate */ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayCallsWrapperTemplate.ts"); +const StringArrayRC4DecodeNodeTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-calls-wrapper/StringArrayRC4DecodeNodeTemplate */ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayRC4DecodeNodeTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ../../JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let StringArrayCallsWrapper = class StringArrayCallsWrapper extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options, escapeSequenceEncoder) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + this.escapeSequenceEncoder = escapeSequenceEncoder; + } + initialize(stringArrayName, stringArrayCallsWrapperName) { + this.stringArrayName = stringArrayName; + this.stringArrayCallsWrapperName = stringArrayCallsWrapperName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const decodeNodeTemplate = this.getDecodeStringArrayTemplate(); + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(StringArrayCallsWrapperTemplate_1.StringArrayCallsWrapperTemplate(), { + decodeNodeTemplate, + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName, + stringArrayName: this.stringArrayName + }), Object.assign(Object.assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET), { identifierNamesGenerator: this.options.identifierNamesGenerator, identifiersDictionary: this.options.identifiersDictionary, seed: this.randomGenerator.getRawSeed() })).getObfuscatedCode(); + } + getDecodeStringArrayTemplate() { + const globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval + ? this.getGlobalVariableTemplate() + : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); + const atobPolyfill = this.customNodeFormatter.formatTemplate(AtobTemplate_1.AtobTemplate(), { globalVariableTemplate }); + let decodeStringArrayTemplate = ''; + let selfDefendingCode = ''; + if (this.options.selfDefending) { + selfDefendingCode = this.customNodeFormatter.formatTemplate(SelfDefendingTemplate_1.SelfDefendingTemplate(this.randomGenerator, this.escapeSequenceEncoder), { + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName, + stringArrayName: this.stringArrayName + }); + } + switch (this.options.stringArrayEncoding) { + case StringArrayEncoding_1.StringArrayEncoding.Rc4: + decodeStringArrayTemplate = this.customNodeFormatter.formatTemplate(StringArrayRC4DecodeNodeTemplate_1.StringArrayRc4DecodeNodeTemplate(this.randomGenerator), { + atobPolyfill, + rc4Polyfill: Rc4Template_1.Rc4Template(), + selfDefendingCode, + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName + }); + break; + case StringArrayEncoding_1.StringArrayEncoding.Base64: + decodeStringArrayTemplate = this.customNodeFormatter.formatTemplate(StringArrayBase64DecodeNodeTemplate_1.StringArrayBase64DecodeNodeTemplate(this.randomGenerator), { + atobPolyfill, + selfDefendingCode, + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName + }); + } + return decodeStringArrayTemplate; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayCallsWrapper.prototype, "stringArrayName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayCallsWrapper.prototype, "stringArrayCallsWrapperName", void 0); +StringArrayCallsWrapper = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _e : Object]) +], StringArrayCallsWrapper); +exports.StringArrayCallsWrapper = StringArrayCallsWrapper; + + +/***/ }), + +/***/ "./src/custom-nodes/string-array-nodes/StringArrayNode.ts": +/*!****************************************************************!*\ + !*** ./src/custom-nodes/string-array-nodes/StringArrayNode.ts ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const IStringArrayStorage_1 = __webpack_require__(/*! ../../interfaces/storages/string-array-storage/IStringArrayStorage */ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const StringArrayTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-node/StringArrayTemplate */ "./src/templates/string-array-nodes/string-array-node/StringArrayTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let StringArrayNode = class StringArrayNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + } + initialize(stringArrayStorage, stringArrayName) { + this.stringArrayStorage = stringArrayStorage; + this.stringArrayName = stringArrayName; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + return this.customNodeFormatter.formatTemplate(StringArrayTemplate_1.StringArrayTemplate(), { + stringArrayName: this.stringArrayName, + stringArray: this.stringArrayStorage.toString() + }); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof IStringArrayStorage_1.IStringArrayStorage !== "undefined" && IStringArrayStorage_1.IStringArrayStorage) === "function" ? _a : Object) +], StringArrayNode.prototype, "stringArrayStorage", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayNode.prototype, "stringArrayName", void 0); +StringArrayNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _b : Object, typeof (_c = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], StringArrayNode); +exports.StringArrayNode = StringArrayNode; + + +/***/ }), + +/***/ "./src/custom-nodes/string-array-nodes/StringArrayRotateFunctionNode.ts": +/*!******************************************************************************!*\ + !*** ./src/custom-nodes/string-array-nodes/StringArrayRotateFunctionNode.ts ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICustomNodeFormatter_1 = __webpack_require__(/*! ../../interfaces/custom-nodes/ICustomNodeFormatter */ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const NoCustomNodes_1 = __webpack_require__(/*! ../../options/presets/NoCustomNodes */ "./src/options/presets/NoCustomNodes.ts"); +const SelfDefendingTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-rotate-function-node/SelfDefendingTemplate */ "./src/templates/string-array-nodes/string-array-rotate-function-node/SelfDefendingTemplate.ts"); +const StringArrayRotateFunctionTemplate_1 = __webpack_require__(/*! ../../templates/string-array-nodes/string-array-rotate-function-node/StringArrayRotateFunctionTemplate */ "./src/templates/string-array-nodes/string-array-rotate-function-node/StringArrayRotateFunctionTemplate.ts"); +const AbstractCustomNode_1 = __webpack_require__(/*! ../AbstractCustomNode */ "./src/custom-nodes/AbstractCustomNode.ts"); +const JavaScriptObfuscatorFacade_1 = __webpack_require__(/*! ../../JavaScriptObfuscatorFacade */ "./src/JavaScriptObfuscatorFacade.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +const NumberUtils_1 = __webpack_require__(/*! ../../utils/NumberUtils */ "./src/utils/NumberUtils.ts"); +let StringArrayRotateFunctionNode = class StringArrayRotateFunctionNode extends AbstractCustomNode_1.AbstractCustomNode { + constructor(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options, escapeSequenceEncoder) { + super(identifierNamesGeneratorFactory, customNodeFormatter, randomGenerator, options); + this.escapeSequenceEncoder = escapeSequenceEncoder; + } + initialize(stringArrayName, stringArrayRotationAmount) { + this.stringArrayName = stringArrayName; + this.stringArrayRotationAmount = stringArrayRotationAmount; + } + getNodeStructure(nodeTemplate) { + return NodeUtils_1.NodeUtils.convertCodeToStructure(nodeTemplate); + } + getNodeTemplate() { + const timesName = this.identifierNamesGenerator.generate(); + const whileFunctionName = this.identifierNamesGenerator.generate(); + let code = ''; + if (this.options.selfDefending) { + code = this.customNodeFormatter.formatTemplate(SelfDefendingTemplate_1.SelfDefendingTemplate(this.escapeSequenceEncoder), { + timesName, + whileFunctionName + }); + } + else { + code = `${whileFunctionName}(++${timesName})`; + } + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(StringArrayRotateFunctionTemplate_1.StringArrayRotateFunctionTemplate(), { + code, + timesName, + stringArrayName: this.stringArrayName, + stringArrayRotationAmount: NumberUtils_1.NumberUtils.toHex(this.stringArrayRotationAmount), + whileFunctionName + }), Object.assign(Object.assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET), { identifierNamesGenerator: this.options.identifierNamesGenerator, identifiersDictionary: this.options.identifiersDictionary, seed: this.randomGenerator.getRawSeed() })).getObfuscatedCode(); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayRotateFunctionNode.prototype, "stringArrayName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", Number) +], StringArrayRotateFunctionNode.prototype, "stringArrayRotationAmount", void 0); +StringArrayRotateFunctionNode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeFormatter)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof ICustomNodeFormatter_1.ICustomNodeFormatter !== "undefined" && ICustomNodeFormatter_1.ICustomNodeFormatter) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _e : Object]) +], StringArrayRotateFunctionNode); +exports.StringArrayRotateFunctionNode = StringArrayRotateFunctionNode; + + +/***/ }), + +/***/ "./src/custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup.ts": +/*!*********************************************************************************!*\ + !*** ./src/custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e, _f; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TCustomNodeFactory */ "./src/types/container/custom-nodes/TCustomNodeFactory.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IStringArrayStorage_1 = __webpack_require__(/*! ../../../interfaces/storages/string-array-storage/IStringArrayStorage */ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const CustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/CustomNode */ "./src/enums/custom-nodes/CustomNode.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const AbstractCustomNodeGroup_1 = __webpack_require__(/*! ../../AbstractCustomNodeGroup */ "./src/custom-nodes/AbstractCustomNodeGroup.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +let StringArrayCustomNodeGroup = class StringArrayCustomNodeGroup extends AbstractCustomNodeGroup_1.AbstractCustomNodeGroup { + constructor(customNodeFactory, stringArrayStorage, identifierNamesGeneratorFactory, randomGenerator, options) { + super(identifierNamesGeneratorFactory, randomGenerator, options); + this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation; + this.customNodeFactory = customNodeFactory; + this.stringArrayStorage = stringArrayStorage; + } + appendCustomNodes(nodeWithStatements, callsGraphData) { + if (!this.stringArrayStorage.getLength()) { + return; + } + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayNode, (customNode) => { + NodeAppender_1.NodeAppender.prepend(nodeWithStatements, customNode.getNode()); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayCallsWrapper, (customNode) => { + NodeAppender_1.NodeAppender.insertAtIndex(nodeWithStatements, customNode.getNode(), 1); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayRotateFunctionNode, (customNode) => { + NodeAppender_1.NodeAppender.insertAtIndex(nodeWithStatements, customNode.getNode(), 1); + }); + } + initialize() { + this.customNodes = new Map(); + if (!this.options.stringArray) { + return; + } + const stringArrayNode = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayNode); + const stringArrayCallsWrapper = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayCallsWrapper); + const stringArrayRotateFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayRotateFunctionNode); + const stringArrayName = this.stringArrayStorage.getStorageName(); + const stringArrayCallsWrapperName = this.stringArrayStorage.getStorageCallsWrapperName(); + const stringArrayRotationAmount = this.stringArrayStorage.getRotationAmount(); + stringArrayNode.initialize(this.stringArrayStorage, stringArrayName); + stringArrayCallsWrapper.initialize(stringArrayName, stringArrayCallsWrapperName); + stringArrayRotateFunctionNode.initialize(stringArrayName, stringArrayRotationAmount); + this.customNodes.set(CustomNode_1.CustomNode.StringArrayNode, stringArrayNode); + this.customNodes.set(CustomNode_1.CustomNode.StringArrayCallsWrapper, stringArrayCallsWrapper); + if (this.options.rotateStringArray) { + this.customNodes.set(CustomNode_1.CustomNode.StringArrayRotateFunctionNode, stringArrayRotateFunctionNode); + } + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], StringArrayCustomNodeGroup.prototype, "customNodes", void 0); +StringArrayCustomNodeGroup = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorage)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof TCustomNodeFactory_1.TCustomNodeFactory !== "undefined" && TCustomNodeFactory_1.TCustomNodeFactory) === "function" ? _b : Object, typeof (_c = typeof IStringArrayStorage_1.IStringArrayStorage !== "undefined" && IStringArrayStorage_1.IStringArrayStorage) === "function" ? _c : Object, typeof (_d = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _d : Object, typeof (_e = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _e : Object, typeof (_f = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _f : Object]) +], StringArrayCustomNodeGroup); +exports.StringArrayCustomNodeGroup = StringArrayCustomNodeGroup; + + +/***/ }), + +/***/ "./src/decorators/Initializable.ts": +/*!*****************************************!*\ + !*** ./src/decorators/Initializable.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const defaultDescriptor = { + configurable: true, + enumerable: true +}; +const initializedTargetMetadataKey = '_initialized'; +const initializablePropertiesSetMetadataKey = '_initializablePropertiesSet'; +const wrappedMethodsSetMetadataKey = '_wrappedMethodsSet'; +const constructorMethodName = 'constructor'; +function initializable(initializeMethodName = 'initialize') { + const decoratorName = Object.keys(this)[0]; + return (target, propertyKey) => { + const initializeMethod = target[initializeMethodName]; + if (!initializeMethod || typeof initializeMethod !== 'function') { + throw new Error(`\`${initializeMethodName}\` method with initialization logic not ` + + `found. \`@${decoratorName}\` decorator requires \`${initializeMethodName}\` method`); + } + initializeTargetMetadata(initializedTargetMetadataKey, false, target); + initializeTargetMetadata(initializablePropertiesSetMetadataKey, new Set(), target); + initializeTargetMetadata(wrappedMethodsSetMetadataKey, new Set(), target); + wrapTargetMethodsInInitializedCheck(target, initializeMethodName); + wrapInitializeMethodInInitializeCheck(target, initializeMethodName, propertyKey); + return wrapInitializableProperty(target, propertyKey); + }; +} +exports.initializable = initializable; +function initializeTargetMetadata(metadataKey, metadataValue, target) { + const hasInitializedMetadata = Reflect.hasMetadata(metadataKey, target); + if (!hasInitializedMetadata) { + Reflect.defineMetadata(metadataKey, metadataValue, target); + } +} +function wrapTargetMethodsInInitializedCheck(target, initializeMethodName) { + const ownPropertyNames = Object.getOwnPropertyNames(target); + const prohibitedPropertyNames = [initializeMethodName, constructorMethodName]; + ownPropertyNames.forEach((propertyName) => { + var _a; + const initializablePropertiesSet = Reflect + .getMetadata(initializablePropertiesSetMetadataKey, target); + const wrappedMethodsSet = Reflect + .getMetadata(wrappedMethodsSetMetadataKey, target); + const isProhibitedPropertyName = prohibitedPropertyNames.includes(propertyName) + || initializablePropertiesSet.has(propertyName) + || wrappedMethodsSet.has(propertyName); + if (isProhibitedPropertyName) { + return; + } + const targetProperty = target[propertyName]; + if (typeof targetProperty !== 'function') { + return; + } + const methodDescriptor = (_a = Object + .getOwnPropertyDescriptor(target, propertyName)) !== null && _a !== void 0 ? _a : defaultDescriptor; + const originalMethod = methodDescriptor.value; + Object.defineProperty(target, propertyName, Object.assign(Object.assign({}, methodDescriptor), { value() { + if (!Reflect.getMetadata(initializedTargetMetadataKey, this)) { + throw new Error(`Class should be initialized with \`${initializeMethodName}()\` method`); + } + return originalMethod.apply(this, arguments); + } })); + wrappedMethodsSet.add(propertyName); + }); +} +function wrapInitializeMethodInInitializeCheck(target, initializeMethodName, propertyKey) { + var _a; + const methodDescriptor = (_a = Object + .getOwnPropertyDescriptor(target, initializeMethodName)) !== null && _a !== void 0 ? _a : defaultDescriptor; + const originalMethod = methodDescriptor.value; + Object.defineProperty(target, initializeMethodName, Object.assign(Object.assign({}, methodDescriptor), { value: function () { + Reflect.defineMetadata(initializedTargetMetadataKey, true, this); + const result = originalMethod.apply(this, arguments); + if (this[propertyKey]) { } + return result; + } })); +} +function wrapInitializableProperty(target, propertyKey) { + var _a; + const initializablePropertiesSet = Reflect + .getMetadata(initializablePropertiesSetMetadataKey, target); + initializablePropertiesSet.add(propertyKey); + const initializablePropertyMetadataKey = `_${propertyKey.toString()}`; + const propertyDescriptor = (_a = Object + .getOwnPropertyDescriptor(target, initializablePropertyMetadataKey)) !== null && _a !== void 0 ? _a : defaultDescriptor; + Object.defineProperty(target, propertyKey, Object.assign(Object.assign({}, propertyDescriptor), { get: function () { + if (this[initializablePropertyMetadataKey] === undefined) { + throw new Error(`Property \`${propertyKey.toString()}\` is not initialized! Initialize it first!`); + } + return this[initializablePropertyMetadataKey]; + }, set: function (newVal) { + this[initializablePropertyMetadataKey] = newVal; + } })); + return propertyDescriptor; +} + + +/***/ }), + +/***/ "./src/enums/ObfuscationTarget.ts": +/*!****************************************!*\ + !*** ./src/enums/ObfuscationTarget.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +exports.ObfuscationTarget = tsenum_1.MakeEnum({ + Browser: 'browser', + BrowserNoEval: 'browser-no-eval', + Node: 'node' +}); + + +/***/ }), + +/***/ "./src/enums/StringArrayEncoding.ts": +/*!******************************************!*\ + !*** ./src/enums/StringArrayEncoding.ts ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +exports.StringArrayEncoding = tsenum_1.MakeEnum({ + Base64: 'base64', + Rc4: 'rc4' +}); + + +/***/ }), + +/***/ "./src/enums/StringSeparator.ts": +/*!**************************************!*\ + !*** ./src/enums/StringSeparator.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var StringSeparator; +(function (StringSeparator) { + StringSeparator["Dot"] = "."; + StringSeparator["Comma"] = ","; +})(StringSeparator = exports.StringSeparator || (exports.StringSeparator = {})); + + +/***/ }), + +/***/ "./src/enums/analyzers/calls-graph-analyzer/CalleeDataExtractor.ts": +/*!*************************************************************************!*\ + !*** ./src/enums/analyzers/calls-graph-analyzer/CalleeDataExtractor.ts ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var CalleeDataExtractor; +(function (CalleeDataExtractor) { + CalleeDataExtractor["FunctionDeclarationCalleeDataExtractor"] = "FunctionDeclarationCalleeDataExtractor"; + CalleeDataExtractor["FunctionExpressionCalleeDataExtractor"] = "FunctionExpressionCalleeDataExtractor"; + CalleeDataExtractor["ObjectExpressionCalleeDataExtractor"] = "ObjectExpressionCalleeDataExtractor"; +})(CalleeDataExtractor = exports.CalleeDataExtractor || (exports.CalleeDataExtractor = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/ControlFlowCustomNode.ts": +/*!*********************************************************!*\ + !*** ./src/enums/custom-nodes/ControlFlowCustomNode.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ControlFlowCustomNode; +(function (ControlFlowCustomNode) { + ControlFlowCustomNode["BinaryExpressionFunctionNode"] = "BinaryExpressionFunctionNode"; + ControlFlowCustomNode["BlockStatementControlFlowFlatteningNode"] = "BlockStatementControlFlowFlatteningNode"; + ControlFlowCustomNode["CallExpressionControlFlowStorageCallNode"] = "CallExpressionControlFlowStorageCallNode"; + ControlFlowCustomNode["CallExpressionFunctionNode"] = "CallExpressionFunctionNode"; + ControlFlowCustomNode["ControlFlowStorageNode"] = "ControlFlowStorageNode"; + ControlFlowCustomNode["ExpressionWithOperatorControlFlowStorageCallNode"] = "ExpressionWithOperatorControlFlowStorageCallNode"; + ControlFlowCustomNode["LogicalExpressionFunctionNode"] = "LogicalExpressionFunctionNode"; + ControlFlowCustomNode["StringLiteralControlFlowStorageCallNode"] = "StringLiteralControlFlowStorageCallNode"; + ControlFlowCustomNode["StringLiteralNode"] = "StringLiteralNode"; +})(ControlFlowCustomNode = exports.ControlFlowCustomNode || (exports.ControlFlowCustomNode = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/CustomNode.ts": +/*!**********************************************!*\ + !*** ./src/enums/custom-nodes/CustomNode.ts ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var CustomNode; +(function (CustomNode) { + CustomNode["ConsoleOutputDisableExpressionNode"] = "ConsoleOutputDisableExpressionNode"; + CustomNode["DebugProtectionFunctionCallNode"] = "DebugProtectionFunctionCallNode"; + CustomNode["DebugProtectionFunctionIntervalNode"] = "DebugProtectionFunctionIntervalNode"; + CustomNode["DebugProtectionFunctionNode"] = "DebugProtectionFunctionNode"; + CustomNode["DomainLockNode"] = "DomainLockNode"; + CustomNode["NodeCallsControllerFunctionNode"] = "NodeCallsControllerFunctionNode"; + CustomNode["SelfDefendingUnicodeNode"] = "SelfDefendingUnicodeNode"; + CustomNode["StringArrayCallsWrapper"] = "StringArrayCallsWrapper"; + CustomNode["StringArrayNode"] = "StringArrayNode"; + CustomNode["StringArrayRotateFunctionNode"] = "StringArrayRotateFunctionNode"; +})(CustomNode = exports.CustomNode || (exports.CustomNode = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/CustomNodeGroup.ts": +/*!***************************************************!*\ + !*** ./src/enums/custom-nodes/CustomNodeGroup.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var CustomNodeGroup; +(function (CustomNodeGroup) { + CustomNodeGroup["ConsoleOutputCustomNodeGroup"] = "ConsoleOutputCustomNodeGroup"; + CustomNodeGroup["DebugProtectionCustomNodeGroup"] = "DebugProtectionCustomNodeGroup"; + CustomNodeGroup["DomainLockCustomNodeGroup"] = "DomainLockCustomNodeGroup"; + CustomNodeGroup["SelfDefendingCustomNodeGroup"] = "SelfDefendingCustomNodeGroup"; + CustomNodeGroup["StringArrayCustomNodeGroup"] = "StringArrayCustomNodeGroup"; +})(CustomNodeGroup = exports.CustomNodeGroup || (exports.CustomNodeGroup = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/DeadCodeInjectionCustomNode.ts": +/*!***************************************************************!*\ + !*** ./src/enums/custom-nodes/DeadCodeInjectionCustomNode.ts ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var DeadCodeInjectionCustomNode; +(function (DeadCodeInjectionCustomNode) { + DeadCodeInjectionCustomNode["BlockStatementDeadCodeInjectionNode"] = "BlockStatementDeadCodeInjectionNode"; +})(DeadCodeInjectionCustomNode = exports.DeadCodeInjectionCustomNode || (exports.DeadCodeInjectionCustomNode = {})); + + +/***/ }), + +/***/ "./src/enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode.ts": +/*!*****************************************************************************!*\ + !*** ./src/enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ObjectExpressionKeysTransformerCustomNode; +(function (ObjectExpressionKeysTransformerCustomNode) { + ObjectExpressionKeysTransformerCustomNode["ObjectExpressionVariableDeclarationHostNode"] = "ObjectExpressionVariableDeclarationHostNode"; +})(ObjectExpressionKeysTransformerCustomNode = exports.ObjectExpressionKeysTransformerCustomNode || (exports.ObjectExpressionKeysTransformerCustomNode = {})); + + +/***/ }), + +/***/ "./src/enums/event-emitters/ObfuscationEvent.ts": +/*!******************************************************!*\ + !*** ./src/enums/event-emitters/ObfuscationEvent.ts ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ObfuscationEvent; +(function (ObfuscationEvent) { + ObfuscationEvent["AfterObfuscation"] = "afterObfuscation"; + ObfuscationEvent["BeforeObfuscation"] = "beforeObfuscation"; +})(ObfuscationEvent = exports.ObfuscationEvent || (exports.ObfuscationEvent = {})); + + +/***/ }), + +/***/ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts": +/*!**************************************************************************************!*\ + !*** ./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +exports.IdentifierNamesGenerator = tsenum_1.MakeEnum({ + DictionaryIdentifierNamesGenerator: 'dictionary', + HexadecimalIdentifierNamesGenerator: 'hexadecimal', + MangledIdentifierNamesGenerator: 'mangled' +}); + + +/***/ }), + +/***/ "./src/enums/logger/LoggingMessage.ts": +/*!********************************************!*\ + !*** ./src/enums/logger/LoggingMessage.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LoggingMessage; +(function (LoggingMessage) { + LoggingMessage["EmptySourceCode"] = "Empty source code. Obfuscation canceled..."; + LoggingMessage["ObfuscationCompleted"] = "Obfuscation completed. Total time: %s sec."; + LoggingMessage["ObfuscationStarted"] = "Obfuscation started..."; + LoggingMessage["RandomGeneratorSeed"] = "Random generator seed: %s..."; + LoggingMessage["TransformationStage"] = "Transformation stage: %s..."; + LoggingMessage["Version"] = "Version: %s"; +})(LoggingMessage = exports.LoggingMessage || (exports.LoggingMessage = {})); + + +/***/ }), + +/***/ "./src/enums/logger/LoggingPrefix.ts": +/*!*******************************************!*\ + !*** ./src/enums/logger/LoggingPrefix.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LoggingPrefix; +(function (LoggingPrefix) { + LoggingPrefix["Base"] = "[javascript-obfuscator]"; + LoggingPrefix["CLI"] = "[javascript-obfuscator-cli]"; +})(LoggingPrefix = exports.LoggingPrefix || (exports.LoggingPrefix = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/NodeTransformer.ts": +/*!********************************************************!*\ + !*** ./src/enums/node-transformers/NodeTransformer.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var NodeTransformer; +(function (NodeTransformer) { + NodeTransformer["BlockStatementControlFlowTransformer"] = "BlockStatementControlFlowTransformer"; + NodeTransformer["CommentsTransformer"] = "CommentsTransformer"; + NodeTransformer["CustomNodesTransformer"] = "CustomNodesTransformer"; + NodeTransformer["DeadCodeInjectionTransformer"] = "DeadCodeInjectionTransformer"; + NodeTransformer["EvalCallExpressionTransformer"] = "EvalCallExpressionTransformer"; + NodeTransformer["FunctionControlFlowTransformer"] = "FunctionControlFlowTransformer"; + NodeTransformer["LabeledStatementTransformer"] = "LabeledStatementTransformer"; + NodeTransformer["LiteralTransformer"] = "LiteralTransformer"; + NodeTransformer["MemberExpressionTransformer"] = "MemberExpressionTransformer"; + NodeTransformer["MetadataTransformer"] = "MetadataTransformer"; + NodeTransformer["MethodDefinitionTransformer"] = "MethodDefinitionTransformer"; + NodeTransformer["ObfuscatingGuardsTransformer"] = "ObfuscatingGuardsTransformer"; + NodeTransformer["ObjectExpressionKeysTransformer"] = "ObjectExpressionKeysTransformer"; + NodeTransformer["ObjectExpressionTransformer"] = "ObjectExpressionTransformer"; + NodeTransformer["ParentificationTransformer"] = "ParentificationTransformer"; + NodeTransformer["ScopeIdentifiersTransformer"] = "ScopeIdentifiersTransformer"; + NodeTransformer["SplitStringTransformer"] = "SplitStringTransformer"; + NodeTransformer["TemplateLiteralTransformer"] = "TemplateLiteralTransformer"; + NodeTransformer["VariablePreserveTransformer"] = "VariablePreserveTransformer"; +})(NodeTransformer = exports.NodeTransformer || (exports.NodeTransformer = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/TransformationStage.ts": +/*!************************************************************!*\ + !*** ./src/enums/node-transformers/TransformationStage.ts ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var TransformationStage; +(function (TransformationStage) { + TransformationStage["Initializing"] = "Initializing"; + TransformationStage["Preparing"] = "Preparing"; + TransformationStage["DeadCodeInjection"] = "DeadCodeInjection"; + TransformationStage["ControlFlowFlattening"] = "ControlFlowFlattening"; + TransformationStage["Converting"] = "Converting"; + TransformationStage["Obfuscating"] = "Obfuscating"; + TransformationStage["Finalizing"] = "Finalizing"; +})(TransformationStage = exports.TransformationStage || (exports.TransformationStage = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/VisitorDirection.ts": +/*!*********************************************************!*\ + !*** ./src/enums/node-transformers/VisitorDirection.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var VisitorDirection; +(function (VisitorDirection) { + VisitorDirection["Enter"] = "enter"; + VisitorDirection["Leave"] = "leave"; +})(VisitorDirection = exports.VisitorDirection || (exports.VisitorDirection = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor.ts": +/*!****************************************************************************************************************!*\ + !*** ./src/enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor.ts ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ObjectExpressionExtractor; +(function (ObjectExpressionExtractor) { + ObjectExpressionExtractor["BasePropertiesExtractor"] = "BasePropertiesExtractor"; + ObjectExpressionExtractor["ObjectExpressionToVariableDeclarationExtractor"] = "ObjectExpressionToVariableDeclarationExtractor"; +})(ObjectExpressionExtractor = exports.ObjectExpressionExtractor || (exports.ObjectExpressionExtractor = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer.ts": +/*!***********************************************************************************************************!*\ + !*** ./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer.ts ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ControlFlowReplacer; +(function (ControlFlowReplacer) { + ControlFlowReplacer["BinaryExpressionControlFlowReplacer"] = "BinaryExpressionControlFlowReplacer"; + ControlFlowReplacer["CallExpressionControlFlowReplacer"] = "CallExpressionControlFlowReplacer"; + ControlFlowReplacer["LogicalExpressionControlFlowReplacer"] = "LogicalExpressionControlFlowReplacer"; + ControlFlowReplacer["StringLiteralControlFlowReplacer"] = "StringLiteralControlFlowReplacer"; +})(ControlFlowReplacer = exports.ControlFlowReplacer || (exports.ControlFlowReplacer = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts": +/*!*********************************************************************************************************************!*\ + !*** ./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts ***! + \*********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var IdentifierObfuscatingReplacer; +(function (IdentifierObfuscatingReplacer) { + IdentifierObfuscatingReplacer["BaseIdentifierObfuscatingReplacer"] = "BaseIdentifierObfuscatingReplacer"; +})(IdentifierObfuscatingReplacer = exports.IdentifierObfuscatingReplacer || (exports.IdentifierObfuscatingReplacer = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer.ts": +/*!******************************************************************************************************************!*\ + !*** ./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer.ts ***! + \******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LiteralObfuscatingReplacer; +(function (LiteralObfuscatingReplacer) { + LiteralObfuscatingReplacer["BooleanLiteralObfuscatingReplacer"] = "BooleanLiteralObfuscatingReplacer"; + LiteralObfuscatingReplacer["NumberLiteralObfuscatingReplacer"] = "NumberLiteralObfuscatingReplacer"; + LiteralObfuscatingReplacer["StringLiteralObfuscatingReplacer"] = "StringLiteralObfuscatingReplacer"; +})(LiteralObfuscatingReplacer = exports.LiteralObfuscatingReplacer || (exports.LiteralObfuscatingReplacer = {})); + + +/***/ }), + +/***/ "./src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts": +/*!***************************************************************************************************!*\ + !*** ./src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var ObfuscatingGuard; +(function (ObfuscatingGuard) { + ObfuscatingGuard["BlackListObfuscatingGuard"] = "BlackListObfuscatingGuard"; + ObfuscatingGuard["ConditionalCommentObfuscatingGuard"] = "ConditionalCommentObfuscatingGuard"; + ObfuscatingGuard["ReservedStringObfuscatingGuard"] = "ReservedStringObfuscatingGuard"; +})(ObfuscatingGuard = exports.ObfuscatingGuard || (exports.ObfuscatingGuard = {})); + + +/***/ }), + +/***/ "./src/enums/node/NodeType.ts": +/*!************************************!*\ + !*** ./src/enums/node/NodeType.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var NodeType; +(function (NodeType) { + NodeType["ArrayExpression"] = "ArrayExpression"; + NodeType["ArrayPattern"] = "ArrayPattern"; + NodeType["ArrowFunctionExpression"] = "ArrowFunctionExpression"; + NodeType["AssignmentExpression"] = "AssignmentExpression"; + NodeType["AssignmentPattern"] = "AssignmentPattern"; + NodeType["AwaitExpression"] = "AwaitExpression"; + NodeType["BinaryExpression"] = "BinaryExpression"; + NodeType["BlockStatement"] = "BlockStatement"; + NodeType["BreakStatement"] = "BreakStatement"; + NodeType["CallExpression"] = "CallExpression"; + NodeType["CatchClause"] = "CatchClause"; + NodeType["ClassDeclaration"] = "ClassDeclaration"; + NodeType["ConditionalExpression"] = "ConditionalExpression"; + NodeType["ContinueStatement"] = "ContinueStatement"; + NodeType["ExportNamedDeclaration"] = "ExportNamedDeclaration"; + NodeType["ExpressionStatement"] = "ExpressionStatement"; + NodeType["ForStatement"] = "ForStatement"; + NodeType["ForInStatement"] = "ForInStatement"; + NodeType["ForOfStatement"] = "ForOfStatement"; + NodeType["FunctionDeclaration"] = "FunctionDeclaration"; + NodeType["FunctionExpression"] = "FunctionExpression"; + NodeType["Identifier"] = "Identifier"; + NodeType["IfStatement"] = "IfStatement"; + NodeType["ImportDeclaration"] = "ImportDeclaration"; + NodeType["ImportDefaultSpecifier"] = "ImportDefaultSpecifier"; + NodeType["ImportNamespaceSpecifier"] = "ImportNamespaceSpecifier"; + NodeType["ImportSpecifier"] = "ImportSpecifier"; + NodeType["LabeledStatement"] = "LabeledStatement"; + NodeType["Literal"] = "Literal"; + NodeType["LogicalExpression"] = "LogicalExpression"; + NodeType["MemberExpression"] = "MemberExpression"; + NodeType["MethodDefinition"] = "MethodDefinition"; + NodeType["ObjectExpression"] = "ObjectExpression"; + NodeType["ObjectPattern"] = "ObjectPattern"; + NodeType["Program"] = "Program"; + NodeType["Property"] = "Property"; + NodeType["RestElement"] = "RestElement"; + NodeType["ReturnStatement"] = "ReturnStatement"; + NodeType["SequenceExpression"] = "SequenceExpression"; + NodeType["Super"] = "Super"; + NodeType["SwitchCase"] = "SwitchCase"; + NodeType["SwitchStatement"] = "SwitchStatement"; + NodeType["TaggedTemplateExpression"] = "TaggedTemplateExpression"; + NodeType["TemplateLiteral"] = "TemplateLiteral"; + NodeType["TryStatement"] = "TryStatement"; + NodeType["UnaryExpression"] = "UnaryExpression"; + NodeType["UpdateExpression"] = "UpdateExpression"; + NodeType["VariableDeclaration"] = "VariableDeclaration"; + NodeType["VariableDeclarator"] = "VariableDeclarator"; + NodeType["WhileStatement"] = "WhileStatement"; +})(NodeType = exports.NodeType || (exports.NodeType = {})); + + +/***/ }), + +/***/ "./src/enums/source-map/SourceMapMode.ts": +/*!***********************************************!*\ + !*** ./src/enums/source-map/SourceMapMode.ts ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +exports.SourceMapMode = tsenum_1.MakeEnum({ + Inline: 'inline', + Separate: 'separate' +}); + + +/***/ }), + +/***/ "./src/event-emitters/ObfuscationEventEmitter.ts": +/*!*******************************************************!*\ + !*** ./src/event-emitters/ObfuscationEventEmitter.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const eventemitter3_1 = __importDefault(__webpack_require__(/*! eventemitter3 */ "eventemitter3")); +inversify_1.decorate(inversify_1.injectable(), eventemitter3_1.default); +let ObfuscationEventEmitter = class ObfuscationEventEmitter extends eventemitter3_1.default { +}; +ObfuscationEventEmitter = __decorate([ + inversify_1.injectable() +], ObfuscationEventEmitter); +exports.ObfuscationEventEmitter = ObfuscationEventEmitter; + + +/***/ }), + +/***/ "./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts": +/*!****************************************************************************************!*\ + !*** ./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let AbstractIdentifierNamesGenerator = class AbstractIdentifierNamesGenerator { + constructor(randomGenerator, options) { + this.preservedNamesSet = new Set(); + this.randomGenerator = randomGenerator; + this.options = options; + } + preserveName(name) { + this.preservedNamesSet.add(name); + } + isValidIdentifierName(name) { + return this.notReservedName(name) && !this.preservedNamesSet.has(name); + } + notReservedName(name) { + return this.options.reservedNames.length + ? !this.options.reservedNames.some((reservedName) => new RegExp(reservedName, 'g').exec(name) !== null) + : true; + } +}; +AbstractIdentifierNamesGenerator = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], AbstractIdentifierNamesGenerator); +exports.AbstractIdentifierNamesGenerator = AbstractIdentifierNamesGenerator; + + +/***/ }), + +/***/ "./src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts": +/*!******************************************************************************************!*\ + !*** ./src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var DictionaryIdentifierNamesGenerator_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IArrayUtils_1 = __webpack_require__(/*! ../../interfaces/utils/IArrayUtils */ "./src/interfaces/utils/IArrayUtils.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const AbstractIdentifierNamesGenerator_1 = __webpack_require__(/*! ./AbstractIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts"); +let DictionaryIdentifierNamesGenerator = DictionaryIdentifierNamesGenerator_1 = class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator { + constructor(randomGenerator, options, arrayUtils) { + super(randomGenerator, options); + this.arrayUtils = arrayUtils; + this.identifierNamesSet = new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)); + this.identifiersIterator = this.identifierNamesSet.values(); + } + static incrementIdentifierName(identifierName) { + let newIdentifierName = ''; + let isSuccess = false; + for (const character of identifierName) { + if (!isSuccess && character === character.toUpperCase()) { + newIdentifierName += character.toLowerCase(); + } + else if (!isSuccess && character === character.toLowerCase()) { + newIdentifierName += character.toUpperCase(); + isSuccess = true; + } + else { + newIdentifierName += character; + } + } + if (isSuccess) { + return newIdentifierName; + } + return null; + } + generate() { + if (!this.identifierNamesSet.size) { + throw new Error('Too many identifiers in the code, add more words to identifiers dictionary'); + } + const iteratorResult = this.identifiersIterator.next(); + if (!iteratorResult.done) { + return iteratorResult.value; + } + this.identifierNamesSet = new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])); + this.identifiersIterator = this.identifierNamesSet.values(); + return this.generate(); + } + generateWithPrefix() { + const prefix = this.options.identifiersPrefix ? + `${this.options.identifiersPrefix}_` + : ''; + const identifierName = this.generate(); + return `${prefix}${identifierName}`.replace('__', '_'); + } + getInitialIdentifierNames(identifierNames) { + const formattedIdentifierNames = identifierNames + .filter(Boolean) + .map((identifierName) => identifierName.toLowerCase()); + return this.arrayUtils.shuffle(formattedIdentifierNames); + } + getIncrementedIdentifierNames(identifierNames) { + const formattedIdentifierNames = []; + for (const identifierName of identifierNames) { + const newIdentifierName = DictionaryIdentifierNamesGenerator_1 + .incrementIdentifierName(identifierName); + if (newIdentifierName) { + formattedIdentifierNames.push(newIdentifierName); + } + } + return this.arrayUtils.shuffle(formattedIdentifierNames); + } +}; +DictionaryIdentifierNamesGenerator = DictionaryIdentifierNamesGenerator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object, typeof (_c = typeof IArrayUtils_1.IArrayUtils !== "undefined" && IArrayUtils_1.IArrayUtils) === "function" ? _c : Object]) +], DictionaryIdentifierNamesGenerator); +exports.DictionaryIdentifierNamesGenerator = DictionaryIdentifierNamesGenerator; + + +/***/ }), + +/***/ "./src/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.ts": +/*!*******************************************************************************************!*\ + !*** ./src/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.ts ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var HexadecimalIdentifierNamesGenerator_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const AbstractIdentifierNamesGenerator_1 = __webpack_require__(/*! ./AbstractIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts"); +const NumberUtils_1 = __webpack_require__(/*! ../../utils/NumberUtils */ "./src/utils/NumberUtils.ts"); +const Utils_1 = __webpack_require__(/*! ../../utils/Utils */ "./src/utils/Utils.ts"); +let HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator_1 = class HexadecimalIdentifierNamesGenerator extends AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator { + constructor(randomGenerator, options) { + super(randomGenerator, options); + this.randomVariableNameSet = new Set(); + } + generate(nameLength) { + const rangeMinInteger = 10000; + const rangeMaxInteger = 99999999; + const randomInteger = this.randomGenerator.getRandomInteger(rangeMinInteger, rangeMaxInteger); + const hexadecimalNumber = NumberUtils_1.NumberUtils.toHex(randomInteger); + const prefixLength = Utils_1.Utils.hexadecimalPrefix.length + 1; + const baseNameLength = nameLength + ? nameLength - prefixLength + : HexadecimalIdentifierNamesGenerator_1.baseIdentifierNameLength; + const baseIdentifierName = hexadecimalNumber.substr(0, baseNameLength); + const identifierName = `_${Utils_1.Utils.hexadecimalPrefix}${baseIdentifierName}`; + if (this.randomVariableNameSet.has(identifierName)) { + return this.generate(nameLength); + } + this.randomVariableNameSet.add(identifierName); + return identifierName; + } + generateWithPrefix(nameLength) { + const identifierName = this.generate(nameLength); + return `${this.options.identifiersPrefix}${identifierName}`.replace('__', '_'); + } +}; +HexadecimalIdentifierNamesGenerator.baseIdentifierNameLength = 6; +HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], HexadecimalIdentifierNamesGenerator); +exports.HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator; + + +/***/ }), + +/***/ "./src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.ts": +/*!***************************************************************************************!*\ + !*** ./src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.ts ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var MangledIdentifierNamesGenerator_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const AbstractIdentifierNamesGenerator_1 = __webpack_require__(/*! ./AbstractIdentifierNamesGenerator */ "./src/generators/identifier-names-generators/AbstractIdentifierNamesGenerator.ts"); +let MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator_1 = class MangledIdentifierNamesGenerator extends AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator { + constructor(randomGenerator, options) { + super(randomGenerator, options); + this.previousMangledName = MangledIdentifierNamesGenerator_1.initMangledNameCharacter; + } + generate(nameLength) { + const identifierName = this.generateNewMangledName(this.previousMangledName); + this.previousMangledName = identifierName; + return identifierName; + } + generateWithPrefix(nameLength) { + const prefix = this.options.identifiersPrefix ? + `${this.options.identifiersPrefix}_` + : ''; + const identifierName = this.generate(nameLength); + return `${prefix}${identifierName}`; + } + isValidIdentifierName(mangledName) { + return super.isValidIdentifierName(mangledName) + && !MangledIdentifierNamesGenerator_1.reservedNamesSet.has(mangledName); + } + generateNewMangledName(previousMangledName) { + const generateNewMangledName = (name) => { + const nameSequence = MangledIdentifierNamesGenerator_1.nameSequence; + const nameSequenceLength = nameSequence.length; + const nameLength = name.length; + const zeroSequence = (num) => { + return '0'.repeat(num); + }; + let index = nameLength - 1; + do { + const character = name[index]; + const indexInSequence = nameSequence.indexOf(character); + const lastNameSequenceIndex = nameSequenceLength - 1; + if (indexInSequence !== lastNameSequenceIndex) { + const previousNamePart = name.substring(0, index); + const nextCharacter = nameSequence[indexInSequence + 1]; + const zeroSequenceLength = nameLength - (index + 1); + const zeroSequenceCharacters = zeroSequence(zeroSequenceLength); + return previousNamePart + nextCharacter + zeroSequenceCharacters; + } + --index; + } while (index >= 0); + return `a${zeroSequence(nameLength)}`; + }; + let newMangledName = generateNewMangledName(previousMangledName); + if (!this.isValidIdentifierName(newMangledName)) { + newMangledName = this.generateNewMangledName(newMangledName); + } + return newMangledName; + } +}; +MangledIdentifierNamesGenerator.initMangledNameCharacter = '9'; +MangledIdentifierNamesGenerator.nameSequence = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); +MangledIdentifierNamesGenerator.reservedNamesSet = new Set([ + 'byte', 'case', 'char', 'do', 'else', 'enum', 'eval', 'for', 'goto', + 'if', 'in', 'int', 'let', 'long', 'new', 'null', 'this', 'true', 'try', + 'var', 'void', 'with' +]); +MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], MangledIdentifierNamesGenerator); +exports.MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator; + + +/***/ }), + +/***/ "./src/interfaces/analyzers/calls-graph-analyzer/ICallsGraphAnalyzer.ts": +/*!******************************************************************************!*\ + !*** ./src/interfaces/analyzers/calls-graph-analyzer/ICallsGraphAnalyzer.ts ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer.ts": +/*!*********************************************************************************************!*\ + !*** ./src/interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer.ts ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/analyzers/scope-analyzer/IScopeAnalyzer.ts": +/*!*******************************************************************!*\ + !*** ./src/interfaces/analyzers/scope-analyzer/IScopeAnalyzer.ts ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer.ts": +/*!***********************************************************************************************!*\ + !*** ./src/interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer.ts ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/custom-nodes/ICustomNodeFormatter.ts": +/*!*************************************************************!*\ + !*** ./src/interfaces/custom-nodes/ICustomNodeFormatter.ts ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/event-emitters/IObfuscationEventEmitter.ts": +/*!*******************************************************************!*\ + !*** ./src/interfaces/event-emitters/IObfuscationEventEmitter.ts ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/logger/ILogger.ts": +/*!******************************************!*\ + !*** ./src/interfaces/logger/ILogger.ts ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/node-transformers/ITransformersRunner.ts": +/*!*****************************************************************!*\ + !*** ./src/interfaces/node-transformers/ITransformersRunner.ts ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/options/IOptions.ts": +/*!********************************************!*\ + !*** ./src/interfaces/options/IOptions.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/options/IOptionsNormalizer.ts": +/*!******************************************************!*\ + !*** ./src/interfaces/options/IOptionsNormalizer.ts ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/source-code/ISourceCode.ts": +/*!***************************************************!*\ + !*** ./src/interfaces/source-code/ISourceCode.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts": +/*!*****************************************************************************!*\ + !*** ./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/IArrayUtils.ts": +/*!*********************************************!*\ + !*** ./src/interfaces/utils/IArrayUtils.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/ICryptUtils.ts": +/*!*********************************************!*\ + !*** ./src/interfaces/utils/ICryptUtils.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/IEscapeSequenceEncoder.ts": +/*!********************************************************!*\ + !*** ./src/interfaces/utils/IEscapeSequenceEncoder.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/ILevelledTopologicalSorter.ts": +/*!************************************************************!*\ + !*** ./src/interfaces/utils/ILevelledTopologicalSorter.ts ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/INodeTransformerNamesGroupsBuilder.ts": +/*!********************************************************************!*\ + !*** ./src/interfaces/utils/INodeTransformerNamesGroupsBuilder.ts ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/interfaces/utils/IRandomGenerator.ts": +/*!**************************************************!*\ + !*** ./src/interfaces/utils/IRandomGenerator.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/logger/Logger.ts": +/*!******************************!*\ + !*** ./src/logger/Logger.ts ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var Logger_1, _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const chalk_1 = __importDefault(__webpack_require__(/*! chalk */ "chalk")); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const LoggingPrefix_1 = __webpack_require__(/*! ../enums/logger/LoggingPrefix */ "./src/enums/logger/LoggingPrefix.ts"); +let Logger = Logger_1 = class Logger { + constructor(options) { + this.options = options; + } + static log(loggingLevelColor, loggingPrefix, loggingMessage, value) { + const processedMessage = loggingLevelColor(`\n${loggingPrefix} ${loggingMessage}`); + console.log(processedMessage, value !== null && value !== void 0 ? value : ''); + } + info(loggingMessage, value) { + if (!this.options.log) { + return; + } + Logger_1.log(Logger_1.colorInfo, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); + } + success(loggingMessage, value) { + if (!this.options.log) { + return; + } + Logger_1.log(Logger_1.colorSuccess, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); + } + warn(loggingMessage, value) { + if (!this.options.log) { + return; + } + Logger_1.log(Logger_1.colorWarn, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); + } +}; +Logger.colorInfo = chalk_1.default.cyan; +Logger.colorSuccess = chalk_1.default.green; +Logger.colorWarn = chalk_1.default.yellow; +Logger = Logger_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], Logger); +exports.Logger = Logger; + + +/***/ }), + +/***/ "./src/node-transformers/AbstractNodeTransformer.ts": +/*!**********************************************************!*\ + !*** ./src/node-transformers/AbstractNodeTransformer.ts ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let AbstractNodeTransformer = class AbstractNodeTransformer { + constructor(randomGenerator, options) { + this.randomGenerator = randomGenerator; + this.options = options; + } +}; +AbstractNodeTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], AbstractNodeTransformer); +exports.AbstractNodeTransformer = AbstractNodeTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/TransformersRunner.ts": +/*!*****************************************************!*\ + !*** ./src/node-transformers/TransformersRunner.ts ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TNodeTransformerFactory_1 = __webpack_require__(/*! ../types/container/node-transformers/TNodeTransformerFactory */ "./src/types/container/node-transformers/TNodeTransformerFactory.ts"); +const INodeTransformerNamesGroupsBuilder_1 = __webpack_require__(/*! ../interfaces/utils/INodeTransformerNamesGroupsBuilder */ "./src/interfaces/utils/INodeTransformerNamesGroupsBuilder.ts"); +const VisitorDirection_1 = __webpack_require__(/*! ../enums/node-transformers/VisitorDirection */ "./src/enums/node-transformers/VisitorDirection.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +let TransformersRunner = class TransformersRunner { + constructor(nodeTransformerFactory, nodeTransformerNamesGroupsBuilder) { + this.cachedNodeTransformersData = new Map(); + this.nodeTransformerFactory = nodeTransformerFactory; + this.nodeTransformerNamesGroupsBuilder = nodeTransformerNamesGroupsBuilder; + } + transform(astTree, nodeTransformerNames, transformationStage) { + if (!nodeTransformerNames.length) { + return astTree; + } + let normalizedNodeTransformers; + let nodeTransformerNamesGroups; + if (!this.cachedNodeTransformersData.has(nodeTransformerNames)) { + normalizedNodeTransformers = this.buildNormalizedNodeTransformers(nodeTransformerNames); + nodeTransformerNamesGroups = this.nodeTransformerNamesGroupsBuilder.build(normalizedNodeTransformers); + this.cachedNodeTransformersData.set(nodeTransformerNames, [normalizedNodeTransformers, nodeTransformerNamesGroups]); + } + else { + [ + normalizedNodeTransformers, + nodeTransformerNamesGroups + ] = this.cachedNodeTransformersData.get(nodeTransformerNames); + } + for (const nodeTransformerNamesGroup of nodeTransformerNamesGroups) { + const enterVisitors = []; + const leaveVisitors = []; + for (const nodeTransformerName of nodeTransformerNamesGroup) { + const nodeTransformer = normalizedNodeTransformers[nodeTransformerName]; + const visitor = nodeTransformer.getVisitor(transformationStage); + if (!visitor) { + continue; + } + if (visitor.enter) { + enterVisitors.push({ enter: visitor.enter }); + } + if (visitor.leave) { + leaveVisitors.push({ leave: visitor.leave }); + } + } + if (!enterVisitors.length && !leaveVisitors.length) { + continue; + } + estraverse.replace(astTree, { + enter: this.mergeVisitorsForDirection(enterVisitors, VisitorDirection_1.VisitorDirection.Enter), + leave: this.mergeVisitorsForDirection(leaveVisitors, VisitorDirection_1.VisitorDirection.Leave) + }); + } + return astTree; + } + buildNormalizedNodeTransformers(nodeTransformerNames) { + return nodeTransformerNames + .reduce((acc, nodeTransformerName) => (Object.assign(Object.assign({}, acc), { [nodeTransformerName]: this.nodeTransformerFactory(nodeTransformerName) })), {}); + } + mergeVisitorsForDirection(visitors, direction) { + const visitorsLength = visitors.length; + if (!visitorsLength) { + return (node, parentNode) => node; + } + return (node, parentNode) => { + if (NodeMetadata_1.NodeMetadata.isIgnoredNode(node)) { + return estraverse.VisitorOption.Skip; + } + for (let i = 0; i < visitorsLength; i++) { + const visitorFunction = visitors[i][direction]; + if (!visitorFunction) { + continue; + } + const visitorResult = visitorFunction(node, parentNode); + if (!visitorResult || !NodeGuards_1.NodeGuards.isNode(visitorResult)) { + continue; + } + node = visitorResult; + } + return node; + }; + } +}; +TransformersRunner = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeTransformer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)), + __metadata("design:paramtypes", [typeof (_a = typeof TNodeTransformerFactory_1.TNodeTransformerFactory !== "undefined" && TNodeTransformerFactory_1.TNodeTransformerFactory) === "function" ? _a : Object, typeof (_b = typeof INodeTransformerNamesGroupsBuilder_1.INodeTransformerNamesGroupsBuilder !== "undefined" && INodeTransformerNamesGroupsBuilder_1.INodeTransformerNamesGroupsBuilder) === "function" ? _b : Object]) +], TransformersRunner); +exports.TransformersRunner = TransformersRunner; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer.ts": +/*!*************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/BlockStatementControlFlowTransformer.ts ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var BlockStatementControlFlowTransformer_1, _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IArrayUtils_1 = __webpack_require__(/*! ../../interfaces/utils/IArrayUtils */ "./src/interfaces/utils/IArrayUtils.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer_1 = class BlockStatementControlFlowTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(controlFlowCustomNodeFactory, arrayUtils, randomGenerator, options) { + super(randomGenerator, options); + this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; + this.arrayUtils = arrayUtils; + } + static isProhibitedStatementNode(node) { + const isBreakOrContinueStatement = NodeGuards_1.NodeGuards.isBreakStatementNode(node) + || NodeGuards_1.NodeGuards.isContinueStatementNode(node); + const isVariableDeclarationWithLetOrConstKind = NodeGuards_1.NodeGuards.isVariableDeclarationNode(node) + && (node.kind === 'const' || node.kind === 'let'); + const isClassDeclaration = NodeGuards_1.NodeGuards.isClassDeclarationNode(node); + return NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) + || isBreakOrContinueStatement + || isVariableDeclarationWithLetOrConstKind + || isClassDeclaration; + } + static canTransformBlockStatementNode(blockStatementNode) { + let canTransform = true; + estraverse.traverse(blockStatementNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isWhileStatementNode(node)) { + return estraverse.VisitorOption.Skip; + } + if (BlockStatementControlFlowTransformer_1.isProhibitedStatementNode(node)) { + canTransform = false; + } + } + }); + if (blockStatementNode.body.length <= 4) { + canTransform = false; + } + return canTransform; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.ControlFlowFlattening: + return { + leave: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(blockStatementNode, parentNode) { + if (this.randomGenerator.getMathRandom() > this.options.controlFlowFlatteningThreshold || + !BlockStatementControlFlowTransformer_1.canTransformBlockStatementNode(blockStatementNode)) { + return blockStatementNode; + } + const blockStatementBody = blockStatementNode.body; + const originalKeys = this.arrayUtils.createWithRange(blockStatementBody.length); + const shuffledKeys = this.arrayUtils.shuffle(originalKeys); + const originalKeysIndexesInShuffledArray = originalKeys.map((key) => shuffledKeys.indexOf(key)); + const blockStatementControlFlowFlatteningCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode); + blockStatementControlFlowFlatteningCustomNode.initialize(blockStatementBody, shuffledKeys, originalKeysIndexesInShuffledArray); + const newBlockStatementNode = blockStatementControlFlowFlatteningCustomNode.getNode()[0]; + NodeUtils_1.NodeUtils.parentizeNode(newBlockStatementNode, parentNode); + return newBlockStatementNode; + } +}; +BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IArrayUtils_1.IArrayUtils !== "undefined" && IArrayUtils_1.IArrayUtils) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], BlockStatementControlFlowTransformer); +exports.BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.ts": +/*!*******************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/FunctionControlFlowTransformer.ts ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var FunctionControlFlowTransformer_1, _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const TControlFlowReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TControlFlowReplacerFactory */ "./src/types/container/node-transformers/TControlFlowReplacerFactory.ts"); +const TControlFlowStorageFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TControlFlowStorageFactory */ "./src/types/container/node-transformers/TControlFlowStorageFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const ControlFlowReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/ControlFlowReplacer.ts"); +const NodeType_1 = __webpack_require__(/*! ../../enums/node/NodeType */ "./src/enums/node/NodeType.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let FunctionControlFlowTransformer = FunctionControlFlowTransformer_1 = class FunctionControlFlowTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(controlFlowStorageFactory, controlFlowReplacerFactory, controlFlowCustomNodeFactory, randomGenerator, options) { + super(randomGenerator, options); + this.controlFlowData = new Map(); + this.visitedFunctionNodes = new Set(); + this.hostNodesWithControlFlowNode = new Set(); + this.controlFlowStorageFactory = controlFlowStorageFactory; + this.controlFlowReplacerFactory = controlFlowReplacerFactory; + this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.ControlFlowFlattening: + return { + leave: (node, parentNode) => { + if (parentNode && (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || + NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || + NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node))) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(functionNode, parentNode) { + this.visitedFunctionNodes.add(functionNode); + if (!NodeGuards_1.NodeGuards.isBlockStatementNode(functionNode.body)) { + return functionNode; + } + const hostNode = this.getHostNode(functionNode.body); + const controlFlowStorage = this.getControlFlowStorage(hostNode); + this.controlFlowData.set(hostNode, controlFlowStorage); + this.transformFunctionBody(functionNode.body, controlFlowStorage); + if (!controlFlowStorage.getLength()) { + return functionNode; + } + const controlFlowStorageCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.ControlFlowStorageNode); + controlFlowStorageCustomNode.initialize(controlFlowStorage); + NodeAppender_1.NodeAppender.prepend(hostNode, controlFlowStorageCustomNode.getNode()); + this.hostNodesWithControlFlowNode.add(hostNode); + NodeUtils_1.NodeUtils.parentizeAst(functionNode); + return functionNode; + } + getControlFlowStorage(hostNode) { + const controlFlowStorage = this.controlFlowStorageFactory(); + if (this.controlFlowData.has(hostNode)) { + if (this.hostNodesWithControlFlowNode.has(hostNode)) { + if (NodeGuards_1.NodeGuards.isSwitchCaseNode(hostNode)) { + hostNode.consequent.shift(); + } + else { + hostNode.body.shift(); + } + } + const hostControlFlowStorage = this.controlFlowData.get(hostNode); + controlFlowStorage.mergeWith(hostControlFlowStorage, true); + } + return controlFlowStorage; + } + getHostNode(functionNodeBody) { + const blockScopesOfNode = NodeStatementUtils_1.NodeStatementUtils.getParentNodesWithStatements(functionNodeBody); + if (blockScopesOfNode.length === 1) { + return functionNodeBody; + } + else { + blockScopesOfNode.pop(); + } + if (blockScopesOfNode.length > FunctionControlFlowTransformer_1.hostNodeSearchMinDepth) { + blockScopesOfNode.splice(0, FunctionControlFlowTransformer_1.hostNodeSearchMinDepth); + } + if (blockScopesOfNode.length > FunctionControlFlowTransformer_1.hostNodeSearchMaxDepth) { + blockScopesOfNode.length = FunctionControlFlowTransformer_1.hostNodeSearchMaxDepth; + } + return this.randomGenerator.getRandomGenerator().pickone(blockScopesOfNode); + } + isVisitedFunctionNode(node) { + return (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || + NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || + NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node)) && this.visitedFunctionNodes.has(node); + } + transformFunctionBody(functionNodeBody, controlFlowStorage) { + estraverse.replace(functionNodeBody, { + enter: (node, parentNode) => { + if (NodeMetadata_1.NodeMetadata.isIgnoredNode(node)) { + return estraverse.VisitorOption.Skip; + } + if (this.isVisitedFunctionNode(node) || !parentNode) { + return estraverse.VisitorOption.Skip; + } + if (!FunctionControlFlowTransformer_1.controlFlowReplacersMap.has(node.type)) { + return node; + } + if (this.randomGenerator.getMathRandom() > this.options.controlFlowFlatteningThreshold) { + return node; + } + const controlFlowReplacerName = FunctionControlFlowTransformer_1 + .controlFlowReplacersMap.get(node.type); + if (controlFlowReplacerName === undefined) { + return node; + } + return Object.assign(Object.assign({}, this.controlFlowReplacerFactory(controlFlowReplacerName).replace(node, parentNode, controlFlowStorage)), { parentNode }); + } + }); + } +}; +FunctionControlFlowTransformer.controlFlowReplacersMap = new Map([ + [NodeType_1.NodeType.BinaryExpression, ControlFlowReplacer_1.ControlFlowReplacer.BinaryExpressionControlFlowReplacer], + [NodeType_1.NodeType.CallExpression, ControlFlowReplacer_1.ControlFlowReplacer.CallExpressionControlFlowReplacer], + [NodeType_1.NodeType.LogicalExpression, ControlFlowReplacer_1.ControlFlowReplacer.LogicalExpressionControlFlowReplacer], + [NodeType_1.NodeType.Literal, ControlFlowReplacer_1.ControlFlowReplacer.StringLiteralControlFlowReplacer] +]); +FunctionControlFlowTransformer.hostNodeSearchMinDepth = 0; +FunctionControlFlowTransformer.hostNodeSearchMaxDepth = 2; +FunctionControlFlowTransformer = FunctionControlFlowTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__TControlFlowStorage)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowReplacer)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowStorageFactory_1.TControlFlowStorageFactory !== "undefined" && TControlFlowStorageFactory_1.TControlFlowStorageFactory) === "function" ? _a : Object, typeof (_b = typeof TControlFlowReplacerFactory_1.TControlFlowReplacerFactory !== "undefined" && TControlFlowReplacerFactory_1.TControlFlowReplacerFactory) === "function" ? _b : Object, typeof (_c = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _c : Object, typeof (_d = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _d : Object, typeof (_e = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _e : Object]) +], FunctionControlFlowTransformer); +exports.FunctionControlFlowTransformer = FunctionControlFlowTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts": +/*!***************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var AbstractControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let AbstractControlFlowReplacer = AbstractControlFlowReplacer_1 = class AbstractControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + this.replacerDataByControlFlowStorageId = new Map(); + this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; + this.randomGenerator = randomGenerator; + this.options = options; + } + static getStorageKeysByIdForCurrentStorage(identifierDataByControlFlowStorageId, controlFlowStorageId) { + let storageKeysById; + if (identifierDataByControlFlowStorageId.has(controlFlowStorageId)) { + storageKeysById = identifierDataByControlFlowStorageId.get(controlFlowStorageId); + } + else { + storageKeysById = new Map(); + } + return storageKeysById; + } + insertCustomNodeToControlFlowStorage(customNode, controlFlowStorage, replacerId, usingExistingIdentifierChance) { + const controlFlowStorageId = controlFlowStorage.getStorageId(); + const storageKeysById = AbstractControlFlowReplacer_1 + .getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId, controlFlowStorageId); + const storageKeysForCurrentId = storageKeysById.get(replacerId); + if (this.randomGenerator.getMathRandom() < usingExistingIdentifierChance && + storageKeysForCurrentId && + storageKeysForCurrentId.length) { + return this.randomGenerator.getRandomGenerator().pickone(storageKeysForCurrentId); + } + const generateStorageKey = (length) => { + const key = this.randomGenerator.getRandomString(length); + if (controlFlowStorage.getStorage().has(key)) { + return generateStorageKey(length); + } + return key; + }; + const storageKey = generateStorageKey(5); + storageKeysById.set(replacerId, [storageKey]); + this.replacerDataByControlFlowStorageId.set(controlFlowStorageId, storageKeysById); + controlFlowStorage.set(storageKey, customNode); + return storageKey; + } +}; +AbstractControlFlowReplacer = AbstractControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], AbstractControlFlowReplacer); +exports.AbstractControlFlowReplacer = AbstractControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer.ts": +/*!***********************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/BinaryExpressionControlFlowReplacer.ts ***! + \***********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var BinaryExpressionControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const ExpressionWithOperatorControlFlowReplacer_1 = __webpack_require__(/*! ./ExpressionWithOperatorControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts"); +let BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer_1 = class BinaryExpressionControlFlowReplacer extends ExpressionWithOperatorControlFlowReplacer_1.ExpressionWithOperatorControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + replace(binaryExpressionNode, parentNode, controlFlowStorage) { + const operator = binaryExpressionNode.operator; + const binaryExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.BinaryExpressionFunctionNode); + binaryExpressionFunctionCustomNode.initialize(operator); + const storageKey = this.insertCustomNodeToControlFlowStorage(binaryExpressionFunctionCustomNode, controlFlowStorage, operator, BinaryExpressionControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, binaryExpressionNode.left, binaryExpressionNode.right); + } +}; +BinaryExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; +BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], BinaryExpressionControlFlowReplacer); +exports.BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer.ts": +/*!*********************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/CallExpressionControlFlowReplacer.ts ***! + \*********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var CallExpressionControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const AbstractControlFlowReplacer_1 = __webpack_require__(/*! ./AbstractControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer_1 = class CallExpressionControlFlowReplacer extends AbstractControlFlowReplacer_1.AbstractControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + replace(callExpressionNode, parentNode, controlFlowStorage) { + const callee = callExpressionNode.callee; + if (!NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { + return callExpressionNode; + } + const replacerId = String(callExpressionNode.arguments.length); + const callExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionFunctionNode); + const expressionArguments = callExpressionNode.arguments; + callExpressionFunctionCustomNode.initialize(expressionArguments); + const storageKey = this.insertCustomNodeToControlFlowStorage(callExpressionFunctionCustomNode, controlFlowStorage, replacerId, CallExpressionControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, callee, expressionArguments); + } + getControlFlowStorageCallNode(controlFlowStorageId, storageKey, callee, expressionArguments) { + const controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode); + controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey, callee, expressionArguments); + const statementNode = controlFlowStorageCallCustomNode.getNode()[0]; + if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { + throw new Error('`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node'); + } + return statementNode.expression; + } +}; +CallExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; +CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], CallExpressionControlFlowReplacer); +exports.CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts": +/*!*****************************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts ***! + \*****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const AbstractControlFlowReplacer_1 = __webpack_require__(/*! ./AbstractControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ExpressionWithOperatorControlFlowReplacer = class ExpressionWithOperatorControlFlowReplacer extends AbstractControlFlowReplacer_1.AbstractControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + getControlFlowStorageCallNode(controlFlowStorageId, storageKey, leftExpression, rightExpression) { + const controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode); + controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey, leftExpression, rightExpression); + const statementNode = controlFlowStorageCallCustomNode.getNode()[0]; + if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { + throw new Error('`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node'); + } + return statementNode.expression; + } +}; +ExpressionWithOperatorControlFlowReplacer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], ExpressionWithOperatorControlFlowReplacer); +exports.ExpressionWithOperatorControlFlowReplacer = ExpressionWithOperatorControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.ts": +/*!************************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.ts ***! + \************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var LogicalExpressionControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const ExpressionWithOperatorControlFlowReplacer_1 = __webpack_require__(/*! ./ExpressionWithOperatorControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/ExpressionWithOperatorControlFlowReplacer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer_1 = class LogicalExpressionControlFlowReplacer extends ExpressionWithOperatorControlFlowReplacer_1.ExpressionWithOperatorControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + replace(logicalExpressionNode, parentNode, controlFlowStorage) { + if (this.checkForProhibitedExpressions(logicalExpressionNode.left, logicalExpressionNode.right)) { + return logicalExpressionNode; + } + const operator = logicalExpressionNode.operator; + const logicalExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.LogicalExpressionFunctionNode); + logicalExpressionFunctionCustomNode.initialize(operator); + const storageKey = this.insertCustomNodeToControlFlowStorage(logicalExpressionFunctionCustomNode, controlFlowStorage, operator, LogicalExpressionControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, logicalExpressionNode.left, logicalExpressionNode.right); + } + checkForProhibitedExpressions(leftExpression, rightExpression) { + return [leftExpression, rightExpression].some((expressionNode) => { + let nodeForCheck; + if (!NodeGuards_1.NodeGuards.isUnaryExpressionNode(expressionNode)) { + nodeForCheck = expressionNode; + } + else { + nodeForCheck = NodeUtils_1.NodeUtils.getUnaryExpressionArgumentNode(expressionNode); + } + return !NodeGuards_1.NodeGuards.isLiteralNode(nodeForCheck) && + !NodeGuards_1.NodeGuards.isIdentifierNode(nodeForCheck) && + !NodeGuards_1.NodeGuards.isObjectExpressionNode(nodeForCheck) && + !NodeGuards_1.NodeGuards.isExpressionStatementNode(nodeForCheck); + }); + } +}; +LogicalExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; +LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], LogicalExpressionControlFlowReplacer); +exports.LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer.ts": +/*!********************************************************************************************************************!*\ + !*** ./src/node-transformers/control-flow-transformers/control-flow-replacers/StringLiteralControlFlowReplacer.ts ***! + \********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var StringLiteralControlFlowReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TControlFlowCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TControlFlowCustomNodeFactory */ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ControlFlowCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ControlFlowCustomNode */ "./src/enums/custom-nodes/ControlFlowCustomNode.ts"); +const AbstractControlFlowReplacer_1 = __webpack_require__(/*! ./AbstractControlFlowReplacer */ "./src/node-transformers/control-flow-transformers/control-flow-replacers/AbstractControlFlowReplacer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer_1 = class StringLiteralControlFlowReplacer extends AbstractControlFlowReplacer_1.AbstractControlFlowReplacer { + constructor(controlFlowCustomNodeFactory, randomGenerator, options) { + super(controlFlowCustomNodeFactory, randomGenerator, options); + } + replace(literalNode, parentNode, controlFlowStorage) { + if (NodeGuards_1.NodeGuards.isPropertyNode(parentNode) && parentNode.key === literalNode) { + return literalNode; + } + if (typeof literalNode.value !== 'string' || literalNode.value.length < 3) { + return literalNode; + } + const replacerId = String(literalNode.value); + const literalFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralNode); + literalFunctionCustomNode.initialize(literalNode.value); + const storageKey = this.insertCustomNodeToControlFlowStorage(literalFunctionCustomNode, controlFlowStorage, replacerId, StringLiteralControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey); + } + getControlFlowStorageCallNode(controlFlowStorageId, storageKey) { + const controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode); + controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey); + const statementNode = controlFlowStorageCallCustomNode.getNode()[0]; + if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { + throw new Error('`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node'); + } + return statementNode.expression; + } +}; +StringLiteralControlFlowReplacer.usingExistingIdentifierChance = 1; +StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory !== "undefined" && TControlFlowCustomNodeFactory_1.TControlFlowCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], StringLiteralControlFlowReplacer); +exports.StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/MemberExpressionTransformer.ts": +/*!**************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/MemberExpressionTransformer.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let MemberExpressionTransformer = class MemberExpressionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isMemberExpressionNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(memberExpressionNode, parentNode) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpressionNode.property)) { + if (memberExpressionNode.computed) { + return memberExpressionNode; + } + memberExpressionNode.computed = true; + memberExpressionNode.property = NodeFactory_1.NodeFactory.literalNode(memberExpressionNode.property.name); + } + return memberExpressionNode; + } +}; +MemberExpressionTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], MemberExpressionTransformer); +exports.MemberExpressionTransformer = MemberExpressionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/MethodDefinitionTransformer.ts": +/*!**************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/MethodDefinitionTransformer.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var MethodDefinitionTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let MethodDefinitionTransformer = MethodDefinitionTransformer_1 = class MethodDefinitionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isMethodDefinitionNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(methodDefinitionNode, parentNode) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(methodDefinitionNode.key)) { + return this.replaceIdentifierKey(methodDefinitionNode, methodDefinitionNode.key); + } + if (NodeGuards_1.NodeGuards.isLiteralNode(methodDefinitionNode.key)) { + return this.replaceLiteralKey(methodDefinitionNode, methodDefinitionNode.key); + } + return methodDefinitionNode; + } + replaceIdentifierKey(methodDefinitionNode, keyNode) { + if (!MethodDefinitionTransformer_1.ignoredNames.includes(keyNode.name) + && !methodDefinitionNode.computed) { + methodDefinitionNode.computed = true; + methodDefinitionNode.key = NodeFactory_1.NodeFactory.literalNode(keyNode.name); + } + return methodDefinitionNode; + } + replaceLiteralKey(methodDefinitionNode, keyNode) { + if (typeof keyNode.value === 'string' + && !MethodDefinitionTransformer_1.ignoredNames.includes(keyNode.value) + && !methodDefinitionNode.computed) { + methodDefinitionNode.computed = true; + } + return methodDefinitionNode; + } +}; +MethodDefinitionTransformer.ignoredNames = ['constructor']; +MethodDefinitionTransformer = MethodDefinitionTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], MethodDefinitionTransformer); +exports.MethodDefinitionTransformer = MethodDefinitionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.ts": +/*!******************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.ts ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var ObjectExpressionKeysTransformer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TObjectExpressionExtractorFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TObjectExpressionExtractorFactory */ "./src/types/container/node-transformers/TObjectExpressionExtractorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +const ObjectExpressionExtractor_1 = __webpack_require__(/*! ../../enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor */ "./src/enums/node-transformers/converting-transformers/properties-extractors/ObjectExpressionExtractor.ts"); +let ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer_1 = class ObjectExpressionKeysTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(objectExpressionExtractorFactory, randomGenerator, options) { + super(randomGenerator, options); + this.objectExpressionExtractorFactory = objectExpressionExtractorFactory; + } + static isProhibitedHostStatement(objectExpressionNode, hostStatement) { + return ObjectExpressionKeysTransformer_1.isReferencedIdentifierName(objectExpressionNode, hostStatement); + } + static isReferencedIdentifierName(objectExpressionNode, hostNode) { + const identifierNamesSet = []; + let isReferencedIdentifierName = false; + let isCurrentNode = false; + estraverse.traverse(hostNode, { + enter: (node) => { + if (node === objectExpressionNode) { + isCurrentNode = true; + } + if (!NodeGuards_1.NodeGuards.isIdentifierNode(node)) { + return; + } + if (!isCurrentNode) { + identifierNamesSet.push(node.name); + return; + } + if (identifierNamesSet.includes(node.name)) { + isReferencedIdentifierName = true; + } + }, + leave: (node) => { + if (node === objectExpressionNode) { + isCurrentNode = false; + return estraverse.VisitorOption.Break; + } + } + }); + return isReferencedIdentifierName; + } + getVisitor(transformationStage) { + if (!this.options.transformObjectKeys) { + return null; + } + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + leave: (node, parentNode) => { + if (parentNode + && NodeGuards_1.NodeGuards.isObjectExpressionNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(objectExpressionNode, parentNode) { + if (!objectExpressionNode.properties.length) { + return objectExpressionNode; + } + const hostStatement = NodeStatementUtils_1.NodeStatementUtils.getRootStatementOfNode(objectExpressionNode); + if (ObjectExpressionKeysTransformer_1.isProhibitedHostStatement(objectExpressionNode, hostStatement)) { + return objectExpressionNode; + } + return this.applyObjectExpressionKeysExtractorsRecursive(ObjectExpressionKeysTransformer_1.objectExpressionExtractorNames, objectExpressionNode, hostStatement); + } + applyObjectExpressionKeysExtractorsRecursive(objectExpressionExtractorNames, objectExpressionNode, hostStatement) { + const newObjectExpressionExtractorNames = [...objectExpressionExtractorNames]; + const objectExpressionExtractor = newObjectExpressionExtractorNames.shift(); + if (!objectExpressionExtractor) { + return objectExpressionNode; + } + const { nodeToReplace, objectExpressionHostStatement: newObjectExpressionHostStatement, objectExpressionNode: newObjectExpressionNode } = this.objectExpressionExtractorFactory(objectExpressionExtractor) + .extract(objectExpressionNode, hostStatement); + this.applyObjectExpressionKeysExtractorsRecursive(newObjectExpressionExtractorNames, newObjectExpressionNode, newObjectExpressionHostStatement); + return nodeToReplace; + } +}; +ObjectExpressionKeysTransformer.objectExpressionExtractorNames = [ + ObjectExpressionExtractor_1.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor, + ObjectExpressionExtractor_1.ObjectExpressionExtractor.BasePropertiesExtractor +]; +ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObjectExpressionExtractor)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TObjectExpressionExtractorFactory_1.TObjectExpressionExtractorFactory !== "undefined" && TObjectExpressionExtractorFactory_1.TObjectExpressionExtractorFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], ObjectExpressionKeysTransformer); +exports.ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/ObjectExpressionTransformer.ts": +/*!**************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/ObjectExpressionTransformer.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ObjectExpressionTransformer = class ObjectExpressionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isObjectExpressionNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(objectExpressionNode, parentNode) { + objectExpressionNode.properties + .forEach((property) => { + if (!property.key) { + return; + } + if (property.computed) { + this.transformComputedProperty(property); + } + else { + this.transformBaseProperty(property); + } + }); + return objectExpressionNode; + } + transformComputedProperty(property) { + if (!NodeGuards_1.NodeGuards.isLiteralNode(property.key) || !(typeof property.key.value === 'string')) { + return; + } + property.key = NodeFactory_1.NodeFactory.literalNode(property.key.value); + } + transformBaseProperty(property) { + if (property.shorthand) { + property.shorthand = false; + } + if (!NodeGuards_1.NodeGuards.isIdentifierNode(property.key)) { + return; + } + property.key = NodeFactory_1.NodeFactory.literalNode(property.key.name); + } +}; +ObjectExpressionTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], ObjectExpressionTransformer); +exports.ObjectExpressionTransformer = ObjectExpressionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/SplitStringTransformer.ts": +/*!*********************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/SplitStringTransformer.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var SplitStringTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeLiteralUtils_1 = __webpack_require__(/*! ../../node/NodeLiteralUtils */ "./src/node/NodeLiteralUtils.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let SplitStringTransformer = SplitStringTransformer_1 = class SplitStringTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + this.runAfter = [ + NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer, + NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer + ]; + } + static chunkString(string, chunkSize) { + const chunksCount = Math.ceil(string.length / chunkSize); + const chunks = []; + let nextChunkStartIndex = 0; + for (let chunkIndex = 0; chunkIndex < chunksCount; ++chunkIndex, nextChunkStartIndex += chunkSize) { + chunks[chunkIndex] = string.substr(nextChunkStartIndex, chunkSize); + } + return chunks; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (!this.options.splitStrings) { + return; + } + if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(literalNode, parentNode) { + if (NodeLiteralUtils_1.NodeLiteralUtils.isProhibitedLiteralNode(literalNode, parentNode)) { + return literalNode; + } + const firstPassChunksNode = this.transformLiteralNodeByChunkLength(literalNode, parentNode, SplitStringTransformer_1.firstPassChunkLength); + const secondPassChunksNode = estraverse.replace(firstPassChunksNode, { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return this.transformLiteralNodeByChunkLength(node, parentNode, this.options.splitStringsChunkLength); + } + } + }); + return secondPassChunksNode; + } + transformLiteralNodeByChunkLength(literalNode, parentNode, chunkLength) { + if (typeof literalNode.value !== 'string') { + return literalNode; + } + if (chunkLength >= literalNode.value.length) { + return literalNode; + } + const stringChunks = SplitStringTransformer_1.chunkString(literalNode.value, chunkLength); + const binaryExpressionNode = this.transformStringChunksToBinaryExpressionNode(stringChunks); + NodeUtils_1.NodeUtils.parentizeAst(binaryExpressionNode); + NodeUtils_1.NodeUtils.parentizeNode(binaryExpressionNode, parentNode); + return binaryExpressionNode; + } + transformStringChunksToBinaryExpressionNode(chunks) { + const firstChunk = chunks.shift(); + const secondChunk = chunks.shift(); + if (!firstChunk || !secondChunk) { + throw new Error('First and second chunks values should not be empty'); + } + const initialBinaryExpressionNode = NodeFactory_1.NodeFactory.binaryExpressionNode('+', NodeFactory_1.NodeFactory.literalNode(firstChunk), NodeFactory_1.NodeFactory.literalNode(secondChunk)); + return chunks.reduce((binaryExpressionNode, chunk) => { + const chunkLiteralNode = NodeFactory_1.NodeFactory.literalNode(chunk); + return NodeFactory_1.NodeFactory.binaryExpressionNode('+', binaryExpressionNode, chunkLiteralNode); + }, initialBinaryExpressionNode); + } +}; +SplitStringTransformer.firstPassChunkLength = 1000; +SplitStringTransformer = SplitStringTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], SplitStringTransformer); +exports.SplitStringTransformer = SplitStringTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/TemplateLiteralTransformer.ts": +/*!*************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/TemplateLiteralTransformer.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var TemplateLiteralTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let TemplateLiteralTransformer = TemplateLiteralTransformer_1 = class TemplateLiteralTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + static isLiteralNodeWithStringValue(node) { + return !!node && NodeGuards_1.NodeGuards.isLiteralNode(node) && typeof node.value === 'string'; + } + static isValidTemplateLiteralNode(node, parentNode) { + return NodeGuards_1.NodeGuards.isTemplateLiteralNode(node) && !NodeGuards_1.NodeGuards.isTaggedTemplateExpressionNode(parentNode); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: (node, parentNode) => { + if (parentNode && TemplateLiteralTransformer_1.isValidTemplateLiteralNode(node, parentNode)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(templateLiteralNode, parentNode) { + const templateLiteralExpressions = templateLiteralNode.expressions; + let nodes = []; + templateLiteralNode.quasis.forEach((templateElement) => { + nodes.push(NodeFactory_1.NodeFactory.literalNode(templateElement.value.cooked)); + const expression = templateLiteralExpressions.shift(); + if (!expression) { + return; + } + nodes.push(expression); + }); + nodes = nodes.filter((node) => { + return !(NodeGuards_1.NodeGuards.isLiteralNode(node) && node.value === ''); + }); + if (!TemplateLiteralTransformer_1.isLiteralNodeWithStringValue(nodes[0]) && + !TemplateLiteralTransformer_1.isLiteralNodeWithStringValue(nodes[1])) { + nodes.unshift(NodeFactory_1.NodeFactory.literalNode('')); + } + let transformedNode; + if (nodes.length > 1) { + let root = NodeFactory_1.NodeFactory.binaryExpressionNode('+', nodes.shift(), nodes.shift()); + nodes.forEach((node) => { + root = NodeFactory_1.NodeFactory.binaryExpressionNode('+', root, node); + }); + transformedNode = root; + } + else { + transformedNode = nodes[0]; + } + NodeUtils_1.NodeUtils.parentizeAst(transformedNode); + NodeUtils_1.NodeUtils.parentizeNode(transformedNode, parentNode); + return transformedNode; + } +}; +TemplateLiteralTransformer = TemplateLiteralTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], TemplateLiteralTransformer); +exports.TemplateLiteralTransformer = TemplateLiteralTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/object-expression-extractors/BasePropertiesExtractor.ts": +/*!***************************************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/object-expression-extractors/BasePropertiesExtractor.ts ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var BasePropertiesExtractor_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +let BasePropertiesExtractor = BasePropertiesExtractor_1 = class BasePropertiesExtractor { + static getPropertyNodeKeyName(propertyNode) { + const propertyKeyNode = propertyNode.key; + if (NodeGuards_1.NodeGuards.isLiteralNode(propertyKeyNode) + && (typeof propertyKeyNode.value === 'string' + || typeof propertyKeyNode.value === 'number')) { + return propertyKeyNode.value.toString(); + } + if (NodeGuards_1.NodeGuards.isIdentifierNode(propertyKeyNode)) { + return propertyKeyNode.name; + } + return null; + } + static isProhibitedPattern(node) { + return !node + || NodeGuards_1.NodeGuards.isObjectPatternNode(node) + || NodeGuards_1.NodeGuards.isArrayPatternNode(node) + || NodeGuards_1.NodeGuards.isAssignmentPatternNode(node) + || NodeGuards_1.NodeGuards.isRestElementNode(node); + } + extract(objectExpressionNode, hostStatement) { + const hostNode = objectExpressionNode.parentNode; + if (hostNode + && NodeGuards_1.NodeGuards.isVariableDeclaratorNode(hostNode) + && NodeGuards_1.NodeGuards.isIdentifierNode(hostNode.id)) { + return this.transformObjectExpressionNode(objectExpressionNode, hostStatement, hostNode.id); + } + return { + nodeToReplace: objectExpressionNode, + objectExpressionHostStatement: hostStatement, + objectExpressionNode: objectExpressionNode + }; + } + transformObjectExpressionNode(objectExpressionNode, hostStatement, memberExpressionHostNode) { + const properties = objectExpressionNode.properties; + const [expressionStatements, removablePropertyIds] = this + .extractPropertiesToExpressionStatements(properties, hostStatement, memberExpressionHostNode); + const hostNodeWithStatements = NodeStatementUtils_1.NodeStatementUtils.getScopeOfNode(hostStatement); + this.filterExtractedObjectExpressionProperties(objectExpressionNode, removablePropertyIds); + NodeAppender_1.NodeAppender.insertAfter(hostNodeWithStatements, expressionStatements, hostStatement); + return { + nodeToReplace: objectExpressionNode, + objectExpressionHostStatement: hostStatement, + objectExpressionNode: objectExpressionNode + }; + } + extractPropertiesToExpressionStatements(properties, hostStatement, memberExpressionHostNode) { + const propertiesLength = properties.length; + const expressionStatements = []; + const removablePropertyIds = []; + for (let i = 0; i < propertiesLength; i++) { + const property = properties[i]; + const propertyValue = property.value; + if (BasePropertiesExtractor_1.isProhibitedPattern(propertyValue)) { + continue; + } + const propertyKeyName = BasePropertiesExtractor_1.getPropertyNodeKeyName(property); + if (!propertyKeyName) { + continue; + } + const shouldCreateLiteralNode = !property.computed + || (property.computed && !!property.key && NodeGuards_1.NodeGuards.isLiteralNode(property.key)); + const memberExpressionProperty = shouldCreateLiteralNode + ? NodeFactory_1.NodeFactory.literalNode(propertyKeyName) + : NodeFactory_1.NodeFactory.identifierNode(propertyKeyName); + const memberExpressionNode = NodeFactory_1.NodeFactory + .memberExpressionNode(memberExpressionHostNode, memberExpressionProperty, true); + const expressionStatementNode = NodeFactory_1.NodeFactory.expressionStatementNode(NodeFactory_1.NodeFactory.assignmentExpressionNode('=', memberExpressionNode, propertyValue)); + if (NodeGuards_1.NodeGuards.isObjectExpressionNode(property.value)) { + this.transformObjectExpressionNode(property.value, hostStatement, memberExpressionNode); + } + expressionStatements.push(expressionStatementNode); + removablePropertyIds.push(i); + } + return [expressionStatements, removablePropertyIds]; + } + filterExtractedObjectExpressionProperties(objectExpressionNode, removablePropertyIds) { + objectExpressionNode.properties = objectExpressionNode.properties + .filter((property, index) => !removablePropertyIds.includes(index)); + } +}; +BasePropertiesExtractor = BasePropertiesExtractor_1 = __decorate([ + inversify_1.injectable() +], BasePropertiesExtractor); +exports.BasePropertiesExtractor = BasePropertiesExtractor; + + +/***/ }), + +/***/ "./src/node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor.ts": +/*!**************************************************************************************************************************************!*\ + !*** ./src/node-transformers/converting-transformers/object-expression-extractors/ObjectExpressionToVariableDeclarationExtractor.ts ***! + \**************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TObjectExpressionKeysTransformerCustomNodeFactory_1 = __webpack_require__(/*! ../../../types/container/custom-nodes/TObjectExpressionKeysTransformerCustomNodeFactory */ "./src/types/container/custom-nodes/TObjectExpressionKeysTransformerCustomNodeFactory.ts"); +const ObjectExpressionKeysTransformerCustomNode_1 = __webpack_require__(/*! ../../../enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode */ "./src/enums/custom-nodes/ObjectExpressionKeysTransformerCustomNode.ts"); +const NodeAppender_1 = __webpack_require__(/*! ../../../node/NodeAppender */ "./src/node/NodeAppender.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ObjectExpressionToVariableDeclarationExtractor = class ObjectExpressionToVariableDeclarationExtractor { + constructor(objectExpressionKeysTransformerCustomNodeFactory) { + this.objectExpressionKeysTransformerCustomNodeFactory = objectExpressionKeysTransformerCustomNodeFactory; + } + extract(objectExpressionNode, hostStatement) { + return this.transformObjectExpressionToVariableDeclaration(objectExpressionNode, hostStatement); + } + transformObjectExpressionToVariableDeclaration(objectExpressionNode, hostStatement) { + const properties = objectExpressionNode.properties; + const newObjectExpressionHostStatement = this.getObjectExpressionHostNode(properties); + const newObjectExpressionIdentifier = this.getObjectExpressionIdentifierNode(newObjectExpressionHostStatement); + const newObjectExpressionNode = this.getObjectExpressionNode(newObjectExpressionHostStatement); + const statementsToInsert = [newObjectExpressionHostStatement]; + const hostNodeWithStatements = NodeStatementUtils_1.NodeStatementUtils.getScopeOfNode(hostStatement); + NodeAppender_1.NodeAppender.insertBefore(hostNodeWithStatements, statementsToInsert, hostStatement); + NodeUtils_1.NodeUtils.parentizeAst(newObjectExpressionHostStatement); + NodeUtils_1.NodeUtils.parentizeNode(newObjectExpressionHostStatement, hostNodeWithStatements); + return { + nodeToReplace: newObjectExpressionIdentifier, + objectExpressionHostStatement: newObjectExpressionHostStatement, + objectExpressionNode: newObjectExpressionNode + }; + } + getObjectExpressionHostNode(properties) { + const variableDeclarationHostNodeCustomNode = this.objectExpressionKeysTransformerCustomNodeFactory(ObjectExpressionKeysTransformerCustomNode_1.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode); + variableDeclarationHostNodeCustomNode.initialize(properties); + const statementNode = variableDeclarationHostNodeCustomNode.getNode()[0]; + if (!statementNode + || !NodeGuards_1.NodeGuards.isVariableDeclarationNode(statementNode)) { + throw new Error('`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node'); + } + return statementNode; + } + getObjectExpressionIdentifierNode(objectExpressionHostNode) { + const newObjectExpressionIdentifierNode = objectExpressionHostNode.declarations[0].id; + if (!NodeGuards_1.NodeGuards.isIdentifierNode(newObjectExpressionIdentifierNode)) { + throw new Error('`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property'); + } + return newObjectExpressionIdentifierNode; + } + getObjectExpressionNode(objectExpressionHostNode) { + var _a; + const newObjectExpressionNode = (_a = objectExpressionHostNode.declarations[0].init) !== null && _a !== void 0 ? _a : null; + if (!newObjectExpressionNode || !NodeGuards_1.NodeGuards.isObjectExpressionNode(newObjectExpressionNode)) { + throw new Error('`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property'); + } + return newObjectExpressionNode; + } +}; +ObjectExpressionToVariableDeclarationExtractor = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)), + __metadata("design:paramtypes", [typeof (_a = typeof TObjectExpressionKeysTransformerCustomNodeFactory_1.TObjectExpressionKeysTransformerCustomNodeFactory !== "undefined" && TObjectExpressionKeysTransformerCustomNodeFactory_1.TObjectExpressionKeysTransformerCustomNodeFactory) === "function" ? _a : Object]) +], ObjectExpressionToVariableDeclarationExtractor); +exports.ObjectExpressionToVariableDeclarationExtractor = ObjectExpressionToVariableDeclarationExtractor; + + +/***/ }), + +/***/ "./src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts": +/*!************************************************************************************************!*\ + !*** ./src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var DeadCodeInjectionTransformer_1, _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TDeadNodeInjectionCustomNodeFactory_1 = __webpack_require__(/*! ../../types/container/custom-nodes/TDeadNodeInjectionCustomNodeFactory */ "./src/types/container/custom-nodes/TDeadNodeInjectionCustomNodeFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ITransformersRunner_1 = __webpack_require__(/*! ../../interfaces/node-transformers/ITransformersRunner */ "./src/interfaces/node-transformers/ITransformersRunner.ts"); +const DeadCodeInjectionCustomNode_1 = __webpack_require__(/*! ../../enums/custom-nodes/DeadCodeInjectionCustomNode */ "./src/enums/custom-nodes/DeadCodeInjectionCustomNode.ts"); +const NodeTransformer_1 = __webpack_require__(/*! ../../enums/node-transformers/NodeTransformer */ "./src/enums/node-transformers/NodeTransformer.ts"); +const NodeType_1 = __webpack_require__(/*! ../../enums/node/NodeType */ "./src/enums/node/NodeType.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeStatementUtils_1 = __webpack_require__(/*! ../../node/NodeStatementUtils */ "./src/node/NodeStatementUtils.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let DeadCodeInjectionTransformer = DeadCodeInjectionTransformer_1 = class DeadCodeInjectionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(deadCodeInjectionCustomNodeFactory, transformersRunner, randomGenerator, options) { + super(randomGenerator, options); + this.deadCodeInjectionRootAstHostNodeSet = new Set(); + this.collectedBlockStatements = []; + this.collectedBlockStatementsTotalLength = 0; + this.deadCodeInjectionCustomNodeFactory = deadCodeInjectionCustomNodeFactory; + this.transformersRunner = transformersRunner; + } + static isProhibitedNodeInsideCollectedBlockStatement(targetNode) { + return NodeGuards_1.NodeGuards.isBreakStatementNode(targetNode) + || NodeGuards_1.NodeGuards.isContinueStatementNode(targetNode) + || NodeGuards_1.NodeGuards.isAwaitExpressionNode(targetNode) + || NodeGuards_1.NodeGuards.isSuperNode(targetNode); + } + static isScopeHoistingFunctionDeclaration(targetNode) { + if (!NodeGuards_1.NodeGuards.isFunctionDeclarationNode(targetNode)) { + return false; + } + const scopeNode = NodeStatementUtils_1.NodeStatementUtils.getScopeOfNode(targetNode); + const scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) + ? scopeNode.body + : scopeNode.consequent; + const indexInScope = scopeBody.indexOf(targetNode); + if (indexInScope === 0) { + return false; + } + const slicedBody = scopeBody.slice(0, indexInScope); + const hostBlockStatementNode = NodeFactory_1.NodeFactory.blockStatementNode(slicedBody); + const functionDeclarationName = targetNode.id.name; + let isScopeHoistedFunctionDeclaration = false; + estraverse.traverse(hostBlockStatementNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isIdentifierNode(node) && node.name === functionDeclarationName) { + isScopeHoistedFunctionDeclaration = true; + return estraverse.VisitorOption.Break; + } + } + }); + return isScopeHoistedFunctionDeclaration; + } + static isValidCollectedBlockStatementNode(blockStatementNode) { + if (!blockStatementNode.body.length) { + return false; + } + let nestedBlockStatementsCount = 0; + let isValidBlockStatementNode = true; + estraverse.traverse(blockStatementNode, { + enter: (node) => { + if (NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + nestedBlockStatementsCount++; + } + if (nestedBlockStatementsCount > DeadCodeInjectionTransformer_1.maxNestedBlockStatementsCount + || DeadCodeInjectionTransformer_1.isProhibitedNodeInsideCollectedBlockStatement(node) + || DeadCodeInjectionTransformer_1.isScopeHoistingFunctionDeclaration(node)) { + isValidBlockStatementNode = false; + return estraverse.VisitorOption.Break; + } + } + }); + return isValidBlockStatementNode; + } + static isValidWrappedBlockStatementNode(blockStatementNode) { + if (!blockStatementNode.body.length) { + return false; + } + let isValidBlockStatementNode = true; + estraverse.traverse(blockStatementNode, { + enter: (node) => { + if (DeadCodeInjectionTransformer_1.isScopeHoistingFunctionDeclaration(node)) { + isValidBlockStatementNode = false; + return estraverse.VisitorOption.Break; + } + } + }); + if (!isValidBlockStatementNode) { + return false; + } + const parentNodeWithStatements = NodeStatementUtils_1.NodeStatementUtils + .getParentNodeWithStatements(blockStatementNode); + return parentNodeWithStatements.type !== NodeType_1.NodeType.Program; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.DeadCodeInjection: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.analyzeNode(node, parentNode); + return node; + } + }, + leave: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + case TransformationStage_1.TransformationStage.Finalizing: + if (!this.deadCodeInjectionRootAstHostNodeSet.size) { + return null; + } + return { + enter: (node, parentNode) => { + if (parentNode && this.isDeadCodeInjectionRootAstHostNode(node)) { + return this.restoreNode(node, parentNode); + } + } + }; + default: + return null; + } + } + analyzeNode(programNode, parentNode) { + estraverse.traverse(programNode, { + enter: (node) => { + if (!NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + return; + } + const clonedBlockStatementNode = NodeUtils_1.NodeUtils.clone(node); + if (!DeadCodeInjectionTransformer_1.isValidCollectedBlockStatementNode(clonedBlockStatementNode)) { + return; + } + const transformedBlockStatementNode = this.makeClonedBlockStatementNodeUnique(clonedBlockStatementNode); + this.collectedBlockStatements.push(transformedBlockStatementNode); + } + }); + this.collectedBlockStatementsTotalLength = this.collectedBlockStatements.length; + } + transformNode(blockStatementNode, parentNode) { + const canBreakTraverse = !this.collectedBlockStatements.length + || this.collectedBlockStatementsTotalLength < DeadCodeInjectionTransformer_1.minCollectedBlockStatementsCount; + if (canBreakTraverse) { + return estraverse.VisitorOption.Break; + } + if (this.randomGenerator.getMathRandom() > this.options.deadCodeInjectionThreshold + || !DeadCodeInjectionTransformer_1.isValidWrappedBlockStatementNode(blockStatementNode)) { + return blockStatementNode; + } + const minInteger = 0; + const maxInteger = this.collectedBlockStatements.length - 1; + const randomIndex = this.randomGenerator.getRandomInteger(minInteger, maxInteger); + const randomBlockStatementNode = this.collectedBlockStatements.splice(randomIndex, 1)[0]; + const isDuplicateBlockStatementNodes = randomBlockStatementNode === blockStatementNode; + if (isDuplicateBlockStatementNodes) { + return blockStatementNode; + } + return this.replaceBlockStatementNode(blockStatementNode, randomBlockStatementNode, parentNode); + } + restoreNode(deadCodeInjectionRootAstHostNode, parentNode) { + const hostNodeFirstStatement = deadCodeInjectionRootAstHostNode.body[0]; + if (!NodeGuards_1.NodeGuards.isFunctionDeclarationNode(hostNodeFirstStatement)) { + throw new Error('Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node'); + } + return hostNodeFirstStatement.body; + } + isDeadCodeInjectionRootAstHostNode(node) { + return NodeGuards_1.NodeGuards.isBlockStatementNode(node) && this.deadCodeInjectionRootAstHostNodeSet.has(node); + } + makeClonedBlockStatementNodeUnique(clonedBlockStatementNode) { + const hostNode = NodeFactory_1.NodeFactory + .functionExpressionNode([], clonedBlockStatementNode); + NodeUtils_1.NodeUtils.parentizeNode(hostNode, hostNode); + NodeUtils_1.NodeUtils.parentizeNode(clonedBlockStatementNode, hostNode); + return this.transformersRunner.transform(hostNode, DeadCodeInjectionTransformer_1.transformersToRenameBlockScopeIdentifiers, TransformationStage_1.TransformationStage.Obfuscating).body; + } + replaceBlockStatementNode(blockStatementNode, randomBlockStatementNode, parentNode) { + const deadCodeInjectionRootAstHostNode = NodeFactory_1.NodeFactory.blockStatementNode([ + NodeFactory_1.NodeFactory.functionDeclarationNode(DeadCodeInjectionTransformer_1.deadCodeInjectionRootAstHostNodeName, [], randomBlockStatementNode) + ]); + this.deadCodeInjectionRootAstHostNodeSet.add(deadCodeInjectionRootAstHostNode); + const blockStatementDeadCodeInjectionCustomNode = this.deadCodeInjectionCustomNodeFactory(DeadCodeInjectionCustomNode_1.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode); + blockStatementDeadCodeInjectionCustomNode.initialize(blockStatementNode, deadCodeInjectionRootAstHostNode); + const newBlockStatementNode = blockStatementDeadCodeInjectionCustomNode.getNode()[0]; + NodeUtils_1.NodeUtils.parentizeNode(newBlockStatementNode, parentNode); + return newBlockStatementNode; + } +}; +DeadCodeInjectionTransformer.deadCodeInjectionRootAstHostNodeName = 'deadCodeInjectionRootAstHostNode'; +DeadCodeInjectionTransformer.maxNestedBlockStatementsCount = 4; +DeadCodeInjectionTransformer.minCollectedBlockStatementsCount = 5; +DeadCodeInjectionTransformer.transformersToRenameBlockScopeIdentifiers = [ + NodeTransformer_1.NodeTransformer.LabeledStatementTransformer, + NodeTransformer_1.NodeTransformer.ScopeIdentifiersTransformer +]; +DeadCodeInjectionTransformer = DeadCodeInjectionTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TDeadNodeInjectionCustomNodeFactory_1.TDeadNodeInjectionCustomNodeFactory !== "undefined" && TDeadNodeInjectionCustomNodeFactory_1.TDeadNodeInjectionCustomNodeFactory) === "function" ? _a : Object, typeof (_b = typeof ITransformersRunner_1.ITransformersRunner !== "undefined" && ITransformersRunner_1.ITransformersRunner) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object]) +], DeadCodeInjectionTransformer); +exports.DeadCodeInjectionTransformer = DeadCodeInjectionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts": +/*!***************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TIdentifierObfuscatingReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TIdentifierObfuscatingReplacerFactory */ "./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeLexicalScopeUtils_1 = __webpack_require__(/*! ../../node/NodeLexicalScopeUtils */ "./src/node/NodeLexicalScopeUtils.ts"); +let LabeledStatementTransformer = class LabeledStatementTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(identifierObfuscatingReplacerFactory, randomGenerator, options) { + super(randomGenerator, options); + this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isLabeledStatementNode(node)) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(labeledStatementNode, parentNode) { + const lexicalScopeNode = NodeLexicalScopeUtils_1.NodeLexicalScopeUtils.getLexicalScope(labeledStatementNode); + if (!lexicalScopeNode) { + return labeledStatementNode; + } + this.storeLabeledStatementName(labeledStatementNode, lexicalScopeNode); + this.replaceLabeledStatementName(labeledStatementNode, lexicalScopeNode); + return labeledStatementNode; + } + storeLabeledStatementName(labeledStatementNode, lexicalScopeNode) { + this.identifierObfuscatingReplacer.storeLocalName(labeledStatementNode.label, lexicalScopeNode); + } + replaceLabeledStatementName(labeledStatementNode, lexicalScopeNode) { + estraverse.replace(labeledStatementNode, { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isLabelIdentifierNode(node, parentNode)) { + const newIdentifier = this.identifierObfuscatingReplacer + .replace(node, lexicalScopeNode); + node.name = newIdentifier.name; + } + } + }); + } +}; +LabeledStatementTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory !== "undefined" && TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], LabeledStatementTransformer); +exports.LabeledStatementTransformer = LabeledStatementTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/LiteralTransformer.ts": +/*!******************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/LiteralTransformer.ts ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TLiteralObfuscatingReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TLiteralObfuscatingReplacerFactory */ "./src/types/container/node-transformers/TLiteralObfuscatingReplacerFactory.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IStringArrayStorageAnalyzer_1 = __webpack_require__(/*! ../../interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer */ "./src/interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer.ts"); +const LiteralObfuscatingReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/LiteralObfuscatingReplacer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeLiteralUtils_1 = __webpack_require__(/*! ../../node/NodeLiteralUtils */ "./src/node/NodeLiteralUtils.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let LiteralTransformer = class LiteralTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(literalObfuscatingReplacerFactory, randomGenerator, options, stringArrayStorageAnalyzer, escapeSequenceEncoder) { + super(randomGenerator, options); + this.literalObfuscatingReplacerFactory = literalObfuscatingReplacerFactory; + this.stringArrayStorageAnalyzer = stringArrayStorageAnalyzer; + this.escapeSequenceEncoder = escapeSequenceEncoder; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.analyzeNode(node); + } + if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node) && !NodeMetadata_1.NodeMetadata.isReplacedLiteral(node)) { + return this.transformNode(node, parentNode); + } + } + }; + case TransformationStage_1.TransformationStage.Finalizing: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return this.encodeLiteralNodeToEscapeSequence(node, parentNode); + } + } + }; + default: + return null; + } + } + analyzeNode(programNode) { + this.stringArrayStorageAnalyzer.analyze(programNode); + } + transformNode(literalNode, parentNode) { + if (NodeLiteralUtils_1.NodeLiteralUtils.isProhibitedLiteralNode(literalNode, parentNode)) { + return literalNode; + } + let newLiteralNode; + switch (typeof literalNode.value) { + case 'boolean': + newLiteralNode = this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(literalNode); + break; + case 'number': + newLiteralNode = this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(literalNode); + break; + case 'string': + newLiteralNode = this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(literalNode); + break; + default: + newLiteralNode = literalNode; + } + NodeUtils_1.NodeUtils.parentizeNode(newLiteralNode, parentNode); + return newLiteralNode; + } + encodeLiteralNodeToEscapeSequence(literalNode, parentNode) { + if (typeof literalNode.value !== 'string') { + return literalNode; + } + return NodeFactory_1.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(literalNode.value, this.options.unicodeEscapeSequence)); + } +}; +LiteralTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatingReplacer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorageAnalyzer)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TLiteralObfuscatingReplacerFactory_1.TLiteralObfuscatingReplacerFactory !== "undefined" && TLiteralObfuscatingReplacerFactory_1.TLiteralObfuscatingReplacerFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object, typeof (_d = typeof IStringArrayStorageAnalyzer_1.IStringArrayStorageAnalyzer !== "undefined" && IStringArrayStorageAnalyzer_1.IStringArrayStorageAnalyzer) === "function" ? _d : Object, typeof (_e = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _e : Object]) +], LiteralTransformer); +exports.LiteralTransformer = LiteralTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer.ts": +/*!***************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/ScopeIdentifiersTransformer.ts ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var ScopeIdentifiersTransformer_1, _a, _b, _c, _d; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const TIdentifierObfuscatingReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TIdentifierObfuscatingReplacerFactory */ "./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IScopeAnalyzer_1 = __webpack_require__(/*! ../../interfaces/analyzers/scope-analyzer/IScopeAnalyzer */ "./src/interfaces/analyzers/scope-analyzer/IScopeAnalyzer.ts"); +const IdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +let ScopeIdentifiersTransformer = ScopeIdentifiersTransformer_1 = class ScopeIdentifiersTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(identifierObfuscatingReplacerFactory, randomGenerator, options, scopeAnalyzer) { + super(randomGenerator, options); + this.lexicalScopesWithObjectPatternWithoutDeclarationMap = new Map(); + this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + this.scopeAnalyzer = scopeAnalyzer; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: (node, parentNode) => { + if (parentNode && NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.analyzeNode(node, parentNode); + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + analyzeNode(programNode, parentNode) { + this.scopeAnalyzer.analyze(programNode); + } + transformNode(programNode, parentNode) { + const globalScope = this.scopeAnalyzer.acquireScope(programNode); + this.traverseScopeVariables(globalScope); + return programNode; + } + traverseScopeVariables(scope) { + const lexicalScope = scope.variableScope; + const nodeWithLexicalScope = NodeGuards_1.NodeGuards.isNodeWithBlockLexicalScope(lexicalScope.block) + ? lexicalScope.block + : null; + const isGlobalDeclaration = ScopeIdentifiersTransformer_1.globalScopeNames.includes(lexicalScope.type); + if (!nodeWithLexicalScope) { + return; + } + for (const variable of scope.variables) { + if (variable.name === ScopeIdentifiersTransformer_1.argumentsVariableName) { + continue; + } + if (!this.options.renameGlobals && isGlobalDeclaration) { + const isImportBindingOrCatchClauseIdentifier = variable.defs + .every((definition) => definition.type === 'ImportBinding' + || definition.type === 'CatchClause'); + if (!isImportBindingOrCatchClauseIdentifier) { + continue; + } + } + this.transformScopeVariableIdentifiers(variable, nodeWithLexicalScope, isGlobalDeclaration); + } + for (const childScope of scope.childScopes) { + this.traverseScopeVariables(childScope); + } + } + transformScopeVariableIdentifiers(variable, lexicalScopeNode, isGlobalDeclaration) { + for (const identifier of variable.identifiers) { + if (!this.isReplaceableIdentifierNode(identifier, lexicalScopeNode, variable)) { + continue; + } + this.storeIdentifierName(identifier, lexicalScopeNode, isGlobalDeclaration); + this.replaceIdentifierName(identifier, lexicalScopeNode, variable); + } + } + storeIdentifierName(identifierNode, lexicalScopeNode, isGlobalDeclaration) { + if (isGlobalDeclaration) { + this.identifierObfuscatingReplacer.storeGlobalName(identifierNode, lexicalScopeNode); + } + else { + this.identifierObfuscatingReplacer.storeLocalName(identifierNode, lexicalScopeNode); + } + } + replaceIdentifierName(identifierNode, lexicalScopeNode, variable) { + const newIdentifier = this.identifierObfuscatingReplacer + .replace(identifierNode, lexicalScopeNode); + identifierNode.name = newIdentifier.name; + variable.references.forEach((reference) => { + reference.identifier.name = identifierNode.name; + }); + } + isReplaceableIdentifierNode(identifierNode, lexicalScopeNode, variable) { + const parentNode = identifierNode.parentNode; + return !!parentNode + && !NodeMetadata_1.NodeMetadata.isIgnoredNode(identifierNode) + && !this.isProhibitedPropertyNode(identifierNode, parentNode) + && !this.isProhibitedClassDeclarationNameIdentifierNode(variable, identifierNode, parentNode) + && !this.isProhibitedExportNamedClassDeclarationIdentifierNode(identifierNode, parentNode) + && !this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(identifierNode, parentNode) + && !this.isProhibitedExportNamedVariableDeclarationIdentifierNode(identifierNode, parentNode) + && !this.isProhibitedImportSpecifierNode(identifierNode, parentNode) + && !this.isProhibitedVariableNameUsedInObjectPatternNode(variable, identifierNode, lexicalScopeNode) + && !NodeGuards_1.NodeGuards.isLabelIdentifierNode(identifierNode, parentNode); + } + isProhibitedClassDeclarationNameIdentifierNode(variable, identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isClassDeclarationNode(variable.scope.block) + && NodeGuards_1.NodeGuards.isClassDeclarationNode(parentNode) + && parentNode.id === identifierNode; + } + isProhibitedExportNamedClassDeclarationIdentifierNode(identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isClassDeclarationNode(parentNode) + && parentNode.id === identifierNode + && !!parentNode.parentNode + && NodeGuards_1.NodeGuards.isExportNamedDeclarationNode(parentNode.parentNode); + } + isProhibitedExportNamedFunctionDeclarationIdentifierNode(identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isFunctionDeclarationNode(parentNode) + && parentNode.id === identifierNode + && !!parentNode.parentNode + && NodeGuards_1.NodeGuards.isExportNamedDeclarationNode(parentNode.parentNode); + } + isProhibitedExportNamedVariableDeclarationIdentifierNode(identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isVariableDeclaratorNode(parentNode) + && parentNode.id === identifierNode + && !!parentNode.parentNode + && NodeGuards_1.NodeGuards.isVariableDeclarationNode(parentNode.parentNode) + && !!parentNode.parentNode.parentNode + && NodeGuards_1.NodeGuards.isExportNamedDeclarationNode(parentNode.parentNode.parentNode); + } + isProhibitedImportSpecifierNode(identifierNode, parentNode) { + return NodeGuards_1.NodeGuards.isImportSpecifierNode(parentNode) + && parentNode.imported.name === parentNode.local.name; + } + isProhibitedPropertyNode(node, parentNode) { + return NodeGuards_1.NodeGuards.isPropertyNode(parentNode) + && !parentNode.computed + && parentNode.key === node; + } + isProhibitedVariableNameUsedInObjectPatternNode(variable, identifierNode, lexicalScopeNode) { + let isLexicalScopeHasObjectPatternWithoutDeclaration = this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(lexicalScopeNode); + if (isLexicalScopeHasObjectPatternWithoutDeclaration === false) { + return false; + } + const hasVarDefinitions = variable.defs.some((definition) => definition.kind === 'var'); + if (!hasVarDefinitions) { + return false; + } + let isProhibitedVariableDeclaration = false; + estraverse.traverse(lexicalScopeNode, { + enter: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isObjectPatternNode(node) + && parentNode + && NodeGuards_1.NodeGuards.isAssignmentExpressionNode(parentNode)) { + isLexicalScopeHasObjectPatternWithoutDeclaration = true; + const properties = node.properties; + for (const property of properties) { + if (property.computed || !property.shorthand) { + continue; + } + if (!NodeGuards_1.NodeGuards.isIdentifierNode(property.key)) { + continue; + } + if (identifierNode.name !== property.key.name) { + continue; + } + isProhibitedVariableDeclaration = true; + return estraverse.VisitorOption.Break; + } + } + } + }); + this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(lexicalScopeNode, isLexicalScopeHasObjectPatternWithoutDeclaration !== null && isLexicalScopeHasObjectPatternWithoutDeclaration !== void 0 ? isLexicalScopeHasObjectPatternWithoutDeclaration : false); + return isProhibitedVariableDeclaration; + } +}; +ScopeIdentifiersTransformer.argumentsVariableName = 'arguments'; +ScopeIdentifiersTransformer.globalScopeNames = [ + 'global', + 'module' +]; +ScopeIdentifiersTransformer = ScopeIdentifiersTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IScopeAnalyzer)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory !== "undefined" && TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object, typeof (_d = typeof IScopeAnalyzer_1.IScopeAnalyzer !== "undefined" && IScopeAnalyzer_1.IScopeAnalyzer) === "function" ? _d : Object]) +], ScopeIdentifiersTransformer); +exports.ScopeIdentifiersTransformer = ScopeIdentifiersTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts": +/*!*************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +let AbstractObfuscatingReplacer = class AbstractObfuscatingReplacer { + constructor(options) { + this.options = options; + } +}; +AbstractObfuscatingReplacer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], AbstractObfuscatingReplacer); +exports.AbstractObfuscatingReplacer = AbstractObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer.ts": +/*!****************************************************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/identifier-obfuscating-replacers/BaseIdentifierObfuscatingReplacer.ts ***! + \****************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const AbstractObfuscatingReplacer_1 = __webpack_require__(/*! ../AbstractObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +let BaseIdentifierObfuscatingReplacer = class BaseIdentifierObfuscatingReplacer extends AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer { + constructor(identifierNamesGeneratorFactory, options) { + super(options); + this.blockScopesMap = new Map(); + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + } + replace(identifierNode, lexicalScopeNode) { + let identifierName = identifierNode.name; + if (this.blockScopesMap.has(lexicalScopeNode)) { + const namesMap = this.blockScopesMap.get(lexicalScopeNode); + if (namesMap.has(identifierName)) { + identifierName = namesMap.get(identifierName); + } + } + return NodeFactory_1.NodeFactory.identifierNode(identifierName); + } + storeGlobalName(identifierNode, lexicalScopeNode) { + const identifierName = identifierNode.name; + if (this.isReservedName(identifierName)) { + return; + } + const newIdentifierName = this.identifierNamesGenerator.generateWithPrefix(); + if (!this.blockScopesMap.has(lexicalScopeNode)) { + this.blockScopesMap.set(lexicalScopeNode, new Map()); + } + const namesMap = this.blockScopesMap.get(lexicalScopeNode); + namesMap.set(identifierName, newIdentifierName); + } + storeLocalName(identifierNode, lexicalScopeNode) { + const identifierName = identifierNode.name; + if (this.isReservedName(identifierName)) { + return; + } + const newIdentifierName = this.identifierNamesGenerator.generate(); + if (!this.blockScopesMap.has(lexicalScopeNode)) { + this.blockScopesMap.set(lexicalScopeNode, new Map()); + } + const namesMap = this.blockScopesMap.get(lexicalScopeNode); + namesMap.set(identifierName, newIdentifierName); + } + preserveName(name) { + this.identifierNamesGenerator.preserveName(name); + } + isReservedName(name) { + if (!this.options.reservedNames.length) { + return false; + } + return this.options.reservedNames + .some((reservedName) => { + return new RegExp(reservedName, 'g').exec(name) !== null; + }); + } +}; +BaseIdentifierObfuscatingReplacer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], BaseIdentifierObfuscatingReplacer); +exports.BaseIdentifierObfuscatingReplacer = BaseIdentifierObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer.ts": +/*!*************************************************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/BooleanLiteralObfuscatingReplacer.ts ***! + \*************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var BooleanLiteralObfuscatingReplacer_1, _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const AbstractObfuscatingReplacer_1 = __webpack_require__(/*! ../AbstractObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +let BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer_1 = class BooleanLiteralObfuscatingReplacer extends AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer { + constructor(options) { + super(options); + } + static getTrueUnaryExpressionNode() { + return NodeFactory_1.NodeFactory.unaryExpressionNode('!', BooleanLiteralObfuscatingReplacer_1.getFalseUnaryExpressionNode()); + } + static getFalseUnaryExpressionNode() { + return NodeFactory_1.NodeFactory.unaryExpressionNode('!', NodeFactory_1.NodeFactory.arrayExpressionNode()); + } + replace(literalNode) { + const literalValue = literalNode.value; + if (typeof literalValue !== 'boolean') { + throw new Error('`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value'); + } + return literalValue + ? BooleanLiteralObfuscatingReplacer_1.getTrueUnaryExpressionNode() + : BooleanLiteralObfuscatingReplacer_1.getFalseUnaryExpressionNode(); + } +}; +BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], BooleanLiteralObfuscatingReplacer); +exports.BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer.ts": +/*!************************************************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/NumberLiteralObfuscatingReplacer.ts ***! + \************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const AbstractObfuscatingReplacer_1 = __webpack_require__(/*! ../AbstractObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NumberUtils_1 = __webpack_require__(/*! ../../../../utils/NumberUtils */ "./src/utils/NumberUtils.ts"); +const Utils_1 = __webpack_require__(/*! ../../../../utils/Utils */ "./src/utils/Utils.ts"); +let NumberLiteralObfuscatingReplacer = class NumberLiteralObfuscatingReplacer extends AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer { + constructor(options) { + super(options); + this.numberLiteralCache = new Map(); + } + replace(literalNode) { + const literalValue = literalNode.value; + if (typeof literalValue !== 'number') { + throw new Error('`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value'); + } + let rawValue; + if (this.numberLiteralCache.has(literalValue)) { + rawValue = this.numberLiteralCache.get(literalValue); + } + else { + if (!NumberUtils_1.NumberUtils.isCeil(literalValue)) { + rawValue = String(literalValue); + } + else { + rawValue = `${Utils_1.Utils.hexadecimalPrefix}${NumberUtils_1.NumberUtils.toHex(literalValue)}`; + } + this.numberLiteralCache.set(literalValue, rawValue); + } + return NodeFactory_1.NodeFactory.literalNode(literalValue, rawValue); + } +}; +NumberLiteralObfuscatingReplacer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], NumberLiteralObfuscatingReplacer); +exports.NumberLiteralObfuscatingReplacer = NumberLiteralObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer.ts": +/*!************************************************************************************************************************************************!*\ + !*** ./src/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/StringLiteralObfuscatingReplacer.ts ***! + \************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var StringLiteralObfuscatingReplacer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IStringArrayStorage_1 = __webpack_require__(/*! ../../../../interfaces/storages/string-array-storage/IStringArrayStorage */ "./src/interfaces/storages/string-array-storage/IStringArrayStorage.ts"); +const IStringArrayStorageAnalyzer_1 = __webpack_require__(/*! ../../../../interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer */ "./src/interfaces/analyzers/string-array-storage-analyzer/IStringArrayStorageAnalyzer.ts"); +const Initializable_1 = __webpack_require__(/*! ../../../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const StringArrayEncoding_1 = __webpack_require__(/*! ../../../../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +const AbstractObfuscatingReplacer_1 = __webpack_require__(/*! ../AbstractObfuscatingReplacer */ "./src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NumberUtils_1 = __webpack_require__(/*! ../../../../utils/NumberUtils */ "./src/utils/NumberUtils.ts"); +const Utils_1 = __webpack_require__(/*! ../../../../utils/Utils */ "./src/utils/Utils.ts"); +let StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer_1 = class StringLiteralObfuscatingReplacer extends AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer { + constructor(stringArrayStorage, stringArrayStorageAnalyzer, options) { + super(options); + this.nodesCache = new Map(); + this.stringArrayStorage = stringArrayStorage; + this.stringArrayStorageAnalyzer = stringArrayStorageAnalyzer; + } + static getHexadecimalLiteralNode(hexadecimalIndex) { + const hexadecimalLiteralNode = NodeFactory_1.NodeFactory.literalNode(hexadecimalIndex); + NodeMetadata_1.NodeMetadata.set(hexadecimalLiteralNode, { replacedLiteral: true }); + return hexadecimalLiteralNode; + } + static getRc4KeyLiteralNode(literalValue) { + const rc4KeyLiteralNode = NodeFactory_1.NodeFactory.literalNode(literalValue); + NodeMetadata_1.NodeMetadata.set(rc4KeyLiteralNode, { replacedLiteral: true }); + return rc4KeyLiteralNode; + } + initialize() { + this.stringArrayStorageCallsWrapperName = this.stringArrayStorage.getStorageCallsWrapperName(); + if (this.options.shuffleStringArray) { + this.stringArrayStorage.shuffleStorage(); + } + if (this.options.rotateStringArray) { + this.stringArrayStorage.rotateStorage(); + } + } + replace(literalNode) { + const literalValue = literalNode.value; + if (typeof literalValue !== 'string') { + throw new Error('`StringLiteralObfuscatingReplacer` should accept only literals with `string` value'); + } + const stringArrayStorageItemData = this.stringArrayStorageAnalyzer + .getItemDataForLiteralNode(literalNode); + const cacheKey = `${literalValue}-${Boolean(stringArrayStorageItemData)}`; + const useCachedValue = this.nodesCache.has(cacheKey) && this.options.stringArrayEncoding !== StringArrayEncoding_1.StringArrayEncoding.Rc4; + if (useCachedValue) { + return this.nodesCache.get(cacheKey); + } + const resultNode = stringArrayStorageItemData + ? this.replaceWithStringArrayCallNode(stringArrayStorageItemData) + : this.replaceWithLiteralNode(literalValue); + this.nodesCache.set(cacheKey, resultNode); + return resultNode; + } + replaceWithLiteralNode(value) { + return NodeFactory_1.NodeFactory.literalNode(value); + } + replaceWithStringArrayCallNode(stringArrayStorageItemData) { + const { index, decodeKey } = stringArrayStorageItemData; + const hexadecimalIndex = `${Utils_1.Utils.hexadecimalPrefix}${NumberUtils_1.NumberUtils.toHex(index)}`; + const callExpressionArgs = [ + StringLiteralObfuscatingReplacer_1.getHexadecimalLiteralNode(hexadecimalIndex) + ]; + if (decodeKey) { + callExpressionArgs.push(StringLiteralObfuscatingReplacer_1.getRc4KeyLiteralNode(decodeKey)); + } + const stringArrayIdentifierNode = NodeFactory_1.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName); + return NodeFactory_1.NodeFactory.callExpressionNode(stringArrayIdentifierNode, callExpressionArgs); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringLiteralObfuscatingReplacer.prototype, "stringArrayStorageCallsWrapperName", void 0); +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], StringLiteralObfuscatingReplacer.prototype, "initialize", null); +StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorage)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStringArrayStorageAnalyzer)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IStringArrayStorage_1.IStringArrayStorage !== "undefined" && IStringArrayStorage_1.IStringArrayStorage) === "function" ? _a : Object, typeof (_b = typeof IStringArrayStorageAnalyzer_1.IStringArrayStorageAnalyzer !== "undefined" && IStringArrayStorageAnalyzer_1.IStringArrayStorageAnalyzer) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], StringLiteralObfuscatingReplacer); +exports.StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/CommentsTransformer.ts": +/*!*****************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/CommentsTransformer.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var CommentsTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const ConditionalCommentObfuscatingGuard_1 = __webpack_require__(/*! ./obfuscating-guards/ConditionalCommentObfuscatingGuard */ "./src/node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard.ts"); +let CommentsTransformer = CommentsTransformer_1 = class CommentsTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Initializing: + return { + leave: (node) => { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + return this.transformNode(node); + } + } + }; + default: + return null; + } + } + transformNode(rootNode) { + if (!rootNode.comments || !rootNode.comments.length) { + return rootNode; + } + const comments = this.transformComments(rootNode.comments); + if (comments.length === 0) { + return rootNode; + } + if (!rootNode.body.length) { + rootNode.leadingComments = comments; + return rootNode; + } + estraverse.traverse(rootNode, { + enter: (node) => { + if (node === rootNode) { + return; + } + const commentIdx = comments.findIndex((comment) => comment.range && node.range && comment.range[0] < node.range[0]); + if (commentIdx === -1) { + return; + } + node.leadingComments = comments.splice(commentIdx, comments.length - commentIdx).reverse(); + } + }); + if (comments.length > 0) { + rootNode.trailingComments = comments.reverse(); + } + return rootNode; + } + transformComments(comments) { + return comments.filter((comment) => CommentsTransformer_1.preservedWords + .some((preservedWord) => comment.value.includes(preservedWord)) || + ConditionalCommentObfuscatingGuard_1.ConditionalCommentObfuscatingGuard.isConditionalComment(comment)).reverse(); + } +}; +CommentsTransformer.preservedWords = [ + '@license', + '@preserve' +]; +CommentsTransformer = CommentsTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], CommentsTransformer); +exports.CommentsTransformer = CommentsTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/CustomNodesTransformer.ts": +/*!********************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/CustomNodesTransformer.ts ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c, _d, _e, _f; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeGroupStorage_1 = __webpack_require__(/*! ../../types/storages/TCustomNodeGroupStorage */ "./src/types/storages/TCustomNodeGroupStorage.ts"); +const IObfuscationEventEmitter_1 = __webpack_require__(/*! ../../interfaces/event-emitters/IObfuscationEventEmitter */ "./src/interfaces/event-emitters/IObfuscationEventEmitter.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ICallsGraphAnalyzer_1 = __webpack_require__(/*! ../../interfaces/analyzers/calls-graph-analyzer/ICallsGraphAnalyzer */ "./src/interfaces/analyzers/calls-graph-analyzer/ICallsGraphAnalyzer.ts"); +const IPrevailingKindOfVariablesAnalyzer_1 = __webpack_require__(/*! ../../interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer */ "./src/interfaces/analyzers/calls-graph-analyzer/IPrevailingKindOfVariablesAnalyzer.ts"); +const ObfuscationEvent_1 = __webpack_require__(/*! ../../enums/event-emitters/ObfuscationEvent */ "./src/enums/event-emitters/ObfuscationEvent.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let CustomNodesTransformer = class CustomNodesTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(callsGraphAnalyzer, prevailingKindOfVariablesAnalyzer, obfuscationEventEmitter, customNodeGroupStorage, randomGenerator, options) { + super(randomGenerator, options); + this.callsGraphData = []; + this.callsGraphAnalyzer = callsGraphAnalyzer; + this.prevailingKindOfVariablesAnalyzer = prevailingKindOfVariablesAnalyzer; + this.obfuscationEventEmitter = obfuscationEventEmitter; + this.customNodeGroupStorage = customNodeGroupStorage; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + leave: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.analyzeNode(node, parentNode); + this.appendCustomNodesBeforeObfuscation(node, parentNode); + return this.transformNode(node, parentNode); + } + } + }; + case TransformationStage_1.TransformationStage.Finalizing: + return { + leave: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + this.appendCustomNodesAfterObfuscation(node, parentNode); + } + } + }; + default: + return null; + } + } + analyzeNode(node, parentNode) { + this.callsGraphData = this.callsGraphAnalyzer.analyze(node); + this.prevailingKindOfVariablesAnalyzer.analyze(node); + } + transformNode(node, parentNode) { + return node; + } + appendCustomNodesBeforeObfuscation(node, parentNode) { + this.customNodeGroupStorage + .getStorage() + .forEach((customNodeGroup) => { + customNodeGroup.initialize(); + this.obfuscationEventEmitter.once(customNodeGroup.getAppendEvent(), customNodeGroup.appendCustomNodes.bind(customNodeGroup)); + }); + this.obfuscationEventEmitter.emit(ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation, node, this.callsGraphData); + } + appendCustomNodesAfterObfuscation(node, parentNode) { + this.obfuscationEventEmitter.emit(ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation, node, this.callsGraphData); + } +}; +CustomNodesTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICallsGraphAnalyzer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationEventEmitter)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TCustomNodeGroupStorage)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(5, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof ICallsGraphAnalyzer_1.ICallsGraphAnalyzer !== "undefined" && ICallsGraphAnalyzer_1.ICallsGraphAnalyzer) === "function" ? _a : Object, typeof (_b = typeof IPrevailingKindOfVariablesAnalyzer_1.IPrevailingKindOfVariablesAnalyzer !== "undefined" && IPrevailingKindOfVariablesAnalyzer_1.IPrevailingKindOfVariablesAnalyzer) === "function" ? _b : Object, typeof (_c = typeof IObfuscationEventEmitter_1.IObfuscationEventEmitter !== "undefined" && IObfuscationEventEmitter_1.IObfuscationEventEmitter) === "function" ? _c : Object, typeof (_d = typeof TCustomNodeGroupStorage_1.TCustomNodeGroupStorage !== "undefined" && TCustomNodeGroupStorage_1.TCustomNodeGroupStorage) === "function" ? _d : Object, typeof (_e = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _e : Object, typeof (_f = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _f : Object]) +], CustomNodesTransformer); +exports.CustomNodesTransformer = CustomNodesTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/EvalCallExpressionTransformer.ts": +/*!***************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/EvalCallExpressionTransformer.ts ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var EvalCallExpressionTransformer_1, _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const js_string_escape_1 = __importDefault(__webpack_require__(/*! js-string-escape */ "js-string-escape")); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeFactory_1 = __webpack_require__(/*! ../../node/NodeFactory */ "./src/node/NodeFactory.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let EvalCallExpressionTransformer = EvalCallExpressionTransformer_1 = class EvalCallExpressionTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + this.evalRootAstHostNodeSet = new Set(); + } + static extractEvalStringFromCallExpressionArgument(node) { + if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return EvalCallExpressionTransformer_1 + .extractEvalStringFromLiteralNode(node); + } + if (NodeGuards_1.NodeGuards.isTemplateLiteralNode(node)) { + return EvalCallExpressionTransformer_1 + .extractEvalStringFromTemplateLiteralNode(node); + } + return null; + } + static extractEvalStringFromLiteralNode(node) { + return typeof node.value === 'string' ? node.value : null; + } + static extractEvalStringFromTemplateLiteralNode(node) { + const quasis = node.quasis; + const allowedQuasisLength = 1; + if (quasis.length !== allowedQuasisLength || node.expressions.length) { + return null; + } + return quasis[0].value.cooked; + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + if (parentNode + && NodeGuards_1.NodeGuards.isCallExpressionNode(node) + && NodeGuards_1.NodeGuards.isIdentifierNode(node.callee) + && node.callee.name === 'eval') { + return this.transformNode(node, parentNode); + } + } + }; + case TransformationStage_1.TransformationStage.Finalizing: + if (!this.evalRootAstHostNodeSet.size) { + return null; + } + return { + leave: (node, parentNode) => { + if (parentNode && this.isEvalRootAstHostNode(node)) { + return this.restoreNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(callExpressionNode, parentNode) { + const callExpressionFirstArgument = callExpressionNode.arguments[0]; + if (!callExpressionFirstArgument) { + return callExpressionNode; + } + const evalString = EvalCallExpressionTransformer_1 + .extractEvalStringFromCallExpressionArgument(callExpressionFirstArgument); + if (!evalString) { + return callExpressionNode; + } + let ast; + try { + ast = NodeUtils_1.NodeUtils.convertCodeToStructure(evalString); + } + catch (_a) { + return callExpressionNode; + } + const evalRootAstHostNode = NodeFactory_1.NodeFactory + .functionExpressionNode([], NodeFactory_1.NodeFactory.blockStatementNode(ast)); + this.evalRootAstHostNodeSet.add(evalRootAstHostNode); + return evalRootAstHostNode; + } + restoreNode(evalRootAstHostNode, parentNode) { + const targetAst = evalRootAstHostNode.body.body; + const obfuscatedCode = NodeUtils_1.NodeUtils.convertStructureToCode(targetAst); + return NodeFactory_1.NodeFactory.callExpressionNode(NodeFactory_1.NodeFactory.identifierNode('eval'), [ + NodeFactory_1.NodeFactory.literalNode(js_string_escape_1.default(obfuscatedCode)) + ]); + } + isEvalRootAstHostNode(node) { + return NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) && this.evalRootAstHostNodeSet.has(node); + } +}; +EvalCallExpressionTransformer = EvalCallExpressionTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], EvalCallExpressionTransformer); +exports.EvalCallExpressionTransformer = EvalCallExpressionTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/MetadataTransformer.ts": +/*!*****************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/MetadataTransformer.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +let MetadataTransformer = class MetadataTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + return this.transformNode(node, parentNode); + } + }; + default: + return null; + } + } + transformNode(node, parentNode) { + NodeMetadata_1.NodeMetadata.set(node, { ignoredNode: false }); + if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { + NodeMetadata_1.NodeMetadata.set(node, { replacedLiteral: false }); + } + return node; + } +}; +MetadataTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], MetadataTransformer); +exports.MetadataTransformer = MetadataTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/ObfuscatingGuardsTransformer.ts": +/*!**************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/ObfuscatingGuardsTransformer.ts ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var ObfuscatingGuardsTransformer_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TObfuscatingGuardFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TObfuscatingGuardFactory */ "./src/types/container/node-transformers/TObfuscatingGuardFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const ObfuscatingGuard_1 = __webpack_require__(/*! ../../enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard */ "./src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ../../node/NodeMetadata */ "./src/node/NodeMetadata.ts"); +let ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer_1 = class ObfuscatingGuardsTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(obfuscatingGuardFactory, randomGenerator, options) { + super(randomGenerator, options); + this.obfuscatingGuards = ObfuscatingGuardsTransformer_1.obfuscatingGuardsList.map(obfuscatingGuardFactory); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + return this.transformNode(node, parentNode); + } + }; + default: + return null; + } + } + transformNode(node, parentNode) { + const obfuscationAllowed = this.obfuscatingGuards + .every((nodeGuard) => nodeGuard.check(node)); + NodeMetadata_1.NodeMetadata.set(node, { + ignoredNode: !obfuscationAllowed + }); + return node; + } +}; +ObfuscatingGuardsTransformer.obfuscatingGuardsList = [ + ObfuscatingGuard_1.ObfuscatingGuard.BlackListObfuscatingGuard, + ObfuscatingGuard_1.ObfuscatingGuard.ConditionalCommentObfuscatingGuard, + ObfuscatingGuard_1.ObfuscatingGuard.ReservedStringObfuscatingGuard +]; +ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeGuard)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TObfuscatingGuardFactory_1.TObfuscatingGuardFactory !== "undefined" && TObfuscatingGuardFactory_1.TObfuscatingGuardFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], ObfuscatingGuardsTransformer); +exports.ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/ParentificationTransformer.ts": +/*!************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/ParentificationTransformer.ts ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeUtils_1 = __webpack_require__(/*! ../../node/NodeUtils */ "./src/node/NodeUtils.ts"); +let ParentificationTransformer = class ParentificationTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + return this.transformNode(node, parentNode); + } + }; + default: + return null; + } + } + transformNode(node, parentNode) { + return NodeUtils_1.NodeUtils.parentizeNode(node, parentNode); + } +}; +ParentificationTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], ParentificationTransformer); +exports.ParentificationTransformer = ParentificationTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/VariablePreserveTransformer.ts": +/*!*************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/VariablePreserveTransformer.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const TIdentifierObfuscatingReplacerFactory_1 = __webpack_require__(/*! ../../types/container/node-transformers/TIdentifierObfuscatingReplacerFactory */ "./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const IdentifierObfuscatingReplacer_1 = __webpack_require__(/*! ../../enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer */ "./src/enums/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierObfuscatingReplacer.ts"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TransformationStage_1 = __webpack_require__(/*! ../../enums/node-transformers/TransformationStage */ "./src/enums/node-transformers/TransformationStage.ts"); +const AbstractNodeTransformer_1 = __webpack_require__(/*! ../AbstractNodeTransformer */ "./src/node-transformers/AbstractNodeTransformer.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let VariablePreserveTransformer = class VariablePreserveTransformer extends AbstractNodeTransformer_1.AbstractNodeTransformer { + constructor(identifierObfuscatingReplacerFactory, randomGenerator, options) { + super(randomGenerator, options); + this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + } + getVisitor(transformationStage) { + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: (node, parentNode) => { + if (NodeGuards_1.NodeGuards.isIdentifierNode(node) + && parentNode + && (NodeGuards_1.NodeGuards.parentNodeIsPropertyNode(node, parentNode) + || NodeGuards_1.NodeGuards.parentNodeIsMemberExpressionNode(node, parentNode) + || NodeGuards_1.NodeGuards.parentNodeIsMethodDefinitionNode(node, parentNode) + || NodeGuards_1.NodeGuards.isLabelIdentifierNode(node, parentNode))) { + return this.transformNode(node, parentNode); + } + } + }; + default: + return null; + } + } + transformNode(node, parentNode) { + this.identifierObfuscatingReplacer.preserveName(node.name); + return node; + } +}; +VariablePreserveTransformer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory !== "undefined" && TIdentifierObfuscatingReplacerFactory_1.TIdentifierObfuscatingReplacerFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], VariablePreserveTransformer); +exports.VariablePreserveTransformer = VariablePreserveTransformer; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard.ts": +/*!******************************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/obfuscating-guards/BlackListObfuscatingGuard.ts ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var BlackListObfuscatingGuard_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let BlackListObfuscatingGuard = BlackListObfuscatingGuard_1 = class BlackListObfuscatingGuard { + constructor() { + this.blackListGuardsLength = BlackListObfuscatingGuard_1.blackListGuards.length; + } + check(node) { + for (let i = 0; i < this.blackListGuardsLength; i++) { + if (BlackListObfuscatingGuard_1.blackListGuards[i](node)) { + return false; + } + } + return true; + } +}; +BlackListObfuscatingGuard.blackListGuards = [ + NodeGuards_1.NodeGuards.isUseStrictOperator +]; +BlackListObfuscatingGuard = BlackListObfuscatingGuard_1 = __decorate([ + inversify_1.injectable(), + __metadata("design:paramtypes", []) +], BlackListObfuscatingGuard); +exports.BlackListObfuscatingGuard = BlackListObfuscatingGuard; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard.ts": +/*!***************************************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/obfuscating-guards/ConditionalCommentObfuscatingGuard.ts ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var ConditionalCommentObfuscatingGuard_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard_1 = class ConditionalCommentObfuscatingGuard { + constructor() { + this.obfuscationAllowedForCurrentNode = true; + this.obfuscationAllowedForNextNode = null; + } + static isConditionalComment(comment) { + return ConditionalCommentObfuscatingGuard_1.obfuscationEnableCommentRegExp.test(comment.value) || + ConditionalCommentObfuscatingGuard_1.obfuscationDisableCommentRegExp.test(comment.value); + } + check(node) { + if (this.obfuscationAllowedForNextNode) { + this.obfuscationAllowedForCurrentNode = this.obfuscationAllowedForNextNode; + this.obfuscationAllowedForNextNode = null; + } + if (!NodeGuards_1.NodeGuards.isNodeWithComments(node)) { + return this.obfuscationAllowedForCurrentNode; + } + const leadingComments = node.leadingComments; + const trailingComments = node.trailingComments; + if (leadingComments) { + this.obfuscationAllowedForCurrentNode = this.checkComments(leadingComments); + } + if (trailingComments) { + this.obfuscationAllowedForNextNode = this.checkComments(trailingComments); + } + return this.obfuscationAllowedForCurrentNode; + } + checkComments(comments) { + const commentsLength = comments.length; + let obfuscationAllowed = this.obfuscationAllowedForCurrentNode; + for (let i = 0; i < commentsLength; i++) { + const comment = comments[i]; + if (ConditionalCommentObfuscatingGuard_1.obfuscationEnableCommentRegExp.test(comment.value)) { + obfuscationAllowed = true; + continue; + } + if (ConditionalCommentObfuscatingGuard_1.obfuscationDisableCommentRegExp.test(comment.value)) { + obfuscationAllowed = false; + } + } + return obfuscationAllowed; + } +}; +ConditionalCommentObfuscatingGuard.obfuscationEnableCommentRegExp = new RegExp('javascript-obfuscator *: *enable'); +ConditionalCommentObfuscatingGuard.obfuscationDisableCommentRegExp = new RegExp('javascript-obfuscator *: *disable'); +ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard_1 = __decorate([ + inversify_1.injectable() +], ConditionalCommentObfuscatingGuard); +exports.ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard; + + +/***/ }), + +/***/ "./src/node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard.ts": +/*!***********************************************************************************************************!*\ + !*** ./src/node-transformers/preparing-transformers/obfuscating-guards/ReservedStringObfuscatingGuard.ts ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const IOptions_1 = __webpack_require__(/*! ../../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const NodeGuards_1 = __webpack_require__(/*! ../../../node/NodeGuards */ "./src/node/NodeGuards.ts"); +let ReservedStringObfuscatingGuard = class ReservedStringObfuscatingGuard { + constructor(options) { + this.options = options; + } + check(node) { + if (this.options.reservedStrings.length + && NodeGuards_1.NodeGuards.isLiteralNode(node) + && typeof node.value === 'string') { + return !this.isReservedString(node.value); + } + return true; + } + isReservedString(value) { + return this.options.reservedStrings + .some((reservedString) => { + return new RegExp(reservedString, 'g').exec(value) !== null; + }); + } +}; +ReservedStringObfuscatingGuard = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _a : Object]) +], ReservedStringObfuscatingGuard); +exports.ReservedStringObfuscatingGuard = ReservedStringObfuscatingGuard; + + +/***/ }), + +/***/ "./src/node/NodeAppender.ts": +/*!**********************************!*\ + !*** ./src/node/NodeAppender.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +class NodeAppender { + static append(nodeWithStatements, statements) { + statements = NodeAppender.parentizeScopeStatementsBeforeAppend(nodeWithStatements, statements); + NodeAppender.setScopeStatements(nodeWithStatements, [ + ...NodeAppender.getScopeStatements(nodeWithStatements), + ...statements + ]); + } + static appendToOptimalBlockScope(callsGraphData, nodeWithStatements, bodyStatements, index = 0) { + const targetBlockScope = callsGraphData.length + ? NodeAppender.getOptimalBlockScope(callsGraphData, index) + : nodeWithStatements; + NodeAppender.prepend(targetBlockScope, bodyStatements); + } + static getOptimalBlockScope(callsGraphData, index, deep = Infinity) { + const firstCall = callsGraphData[index]; + if (deep <= 0) { + throw new Error('Invalid `deep` argument value. Value should be bigger then 0.'); + } + if (deep > 1 && firstCall.callsGraph.length) { + return NodeAppender.getOptimalBlockScope(firstCall.callsGraph, 0, --deep); + } + else { + return firstCall.callee; + } + } + static insertBefore(nodeWithStatements, statements, target) { + const indexInScopeStatement = NodeAppender + .getScopeStatements(nodeWithStatements) + .indexOf(target); + NodeAppender.insertAtIndex(nodeWithStatements, statements, indexInScopeStatement); + } + static insertAfter(nodeWithStatements, statements, target) { + const indexInScopeStatement = NodeAppender + .getScopeStatements(nodeWithStatements) + .indexOf(target); + NodeAppender.insertAtIndex(nodeWithStatements, statements, indexInScopeStatement + 1); + } + static insertAtIndex(nodeWithStatements, statements, index) { + statements = NodeAppender.parentizeScopeStatementsBeforeAppend(nodeWithStatements, statements); + NodeAppender.setScopeStatements(nodeWithStatements, [ + ...NodeAppender.getScopeStatements(nodeWithStatements).slice(0, index), + ...statements, + ...NodeAppender.getScopeStatements(nodeWithStatements).slice(index) + ]); + } + static prepend(nodeWithStatements, statements) { + statements = NodeAppender.parentizeScopeStatementsBeforeAppend(nodeWithStatements, statements); + NodeAppender.setScopeStatements(nodeWithStatements, [ + ...statements, + ...NodeAppender.getScopeStatements(nodeWithStatements), + ]); + } + static getScopeStatements(nodeWithStatements) { + if (NodeGuards_1.NodeGuards.isSwitchCaseNode(nodeWithStatements)) { + return nodeWithStatements.consequent; + } + return nodeWithStatements.body; + } + static parentizeScopeStatementsBeforeAppend(nodeWithStatements, statements) { + statements.forEach((statement) => { + statement.parentNode = nodeWithStatements; + }); + return statements; + } + static setScopeStatements(nodeWithStatements, statements) { + if (NodeGuards_1.NodeGuards.isSwitchCaseNode(nodeWithStatements)) { + nodeWithStatements.consequent = statements; + return; + } + nodeWithStatements.body = statements; + } +} +exports.NodeAppender = NodeAppender; + + +/***/ }), + +/***/ "./src/node/NodeFactory.ts": +/*!*********************************!*\ + !*** ./src/node/NodeFactory.ts ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const escodegen = __importStar(__webpack_require__(/*! escodegen */ "escodegen")); +const NodeType_1 = __webpack_require__(/*! ../enums/node/NodeType */ "./src/enums/node/NodeType.ts"); +class NodeFactory { + static programNode(body = []) { + return { + type: NodeType_1.NodeType.Program, + body, + sourceType: 'script', + metadata: { ignoredNode: false } + }; + } + static arrayExpressionNode(elements = []) { + return { + type: NodeType_1.NodeType.ArrayExpression, + elements, + metadata: { ignoredNode: false } + }; + } + static assignmentExpressionNode(operator, left, right) { + return { + type: NodeType_1.NodeType.AssignmentExpression, + operator, + left, + right, + metadata: { ignoredNode: false } + }; + } + static binaryExpressionNode(operator, left, right) { + return { + type: NodeType_1.NodeType.BinaryExpression, + operator, + left, + right, + metadata: { ignoredNode: false } + }; + } + static blockStatementNode(body = []) { + return { + type: NodeType_1.NodeType.BlockStatement, + body, + metadata: { ignoredNode: false } + }; + } + static breakStatement(label) { + return { + type: NodeType_1.NodeType.BreakStatement, + label, + metadata: { ignoredNode: false } + }; + } + static callExpressionNode(callee, args = []) { + return { + type: NodeType_1.NodeType.CallExpression, + callee, + arguments: args, + metadata: { ignoredNode: false } + }; + } + static continueStatement(label) { + return { + type: NodeType_1.NodeType.ContinueStatement, + label, + metadata: { ignoredNode: false } + }; + } + static directiveNode(expression, directive) { + return { + type: NodeType_1.NodeType.ExpressionStatement, + expression, + directive, + metadata: { ignoredNode: false } + }; + } + static expressionStatementNode(expression) { + return { + type: NodeType_1.NodeType.ExpressionStatement, + expression, + metadata: { ignoredNode: false } + }; + } + static functionDeclarationNode(functionName, params, body) { + return { + type: NodeType_1.NodeType.FunctionDeclaration, + id: NodeFactory.identifierNode(functionName), + params, + body, + generator: false, + metadata: { ignoredNode: false } + }; + } + static functionExpressionNode(params, body) { + return { + type: NodeType_1.NodeType.FunctionExpression, + params, + body, + generator: false, + metadata: { ignoredNode: false } + }; + } + static ifStatementNode(test, consequent, alternate) { + return Object.assign(Object.assign({ type: NodeType_1.NodeType.IfStatement, test, + consequent }, alternate && { alternate }), { metadata: { ignoredNode: false } }); + } + static identifierNode(name) { + return { + type: NodeType_1.NodeType.Identifier, + name, + metadata: { ignoredNode: false } + }; + } + static importDeclarationNode(specifiers, source) { + return { + type: NodeType_1.NodeType.ImportDeclaration, + specifiers, + source, + metadata: { ignoredNode: false } + }; + } + static literalNode(value, raw) { + raw = raw !== undefined ? raw : `'${value}'`; + return { + type: NodeType_1.NodeType.Literal, + value, + raw, + 'x-verbatim-property': { + content: raw, + precedence: escodegen.Precedence.Primary + }, + metadata: { ignoredNode: false } + }; + } + static logicalExpressionNode(operator, left, right) { + return { + type: NodeType_1.NodeType.LogicalExpression, + operator, + left, + right, + metadata: { ignoredNode: false } + }; + } + static memberExpressionNode(object, property, computed = false) { + return { + type: NodeType_1.NodeType.MemberExpression, + computed, + object, + property, + metadata: { ignoredNode: false } + }; + } + static methodDefinitionNode(key, value, kind, computed) { + return { + type: NodeType_1.NodeType.MethodDefinition, + key, + value, + kind, + computed, + static: false, + metadata: { ignoredNode: false } + }; + } + static objectExpressionNode(properties) { + return { + type: NodeType_1.NodeType.ObjectExpression, + properties, + metadata: { ignoredNode: false } + }; + } + static propertyNode(key, value, computed = false) { + return { + type: NodeType_1.NodeType.Property, + key, + value, + kind: 'init', + method: false, + shorthand: false, + computed, + metadata: { ignoredNode: false } + }; + } + static returnStatementNode(argument) { + return { + type: NodeType_1.NodeType.ReturnStatement, + argument, + metadata: { ignoredNode: false } + }; + } + static switchStatementNode(discriminant, cases) { + return { + type: NodeType_1.NodeType.SwitchStatement, + discriminant, + cases, + metadata: { ignoredNode: false } + }; + } + static switchCaseNode(test, consequent) { + return { + type: NodeType_1.NodeType.SwitchCase, + test, + consequent, + metadata: { ignoredNode: false } + }; + } + static unaryExpressionNode(operator, argument, prefix = true) { + return { + type: NodeType_1.NodeType.UnaryExpression, + operator, + argument, + prefix, + metadata: { ignoredNode: false } + }; + } + static updateExpressionNode(operator, argumentExpr) { + return { + type: NodeType_1.NodeType.UpdateExpression, + operator, + argument: argumentExpr, + prefix: false, + metadata: { ignoredNode: false } + }; + } + static variableDeclarationNode(declarations = [], kind = 'var') { + return { + type: NodeType_1.NodeType.VariableDeclaration, + declarations, + kind, + metadata: { ignoredNode: false } + }; + } + static variableDeclaratorNode(id, init) { + return { + type: NodeType_1.NodeType.VariableDeclarator, + id, + init, + metadata: { ignoredNode: false } + }; + } + static whileStatementNode(test, body) { + return { + type: NodeType_1.NodeType.WhileStatement, + test, + body, + metadata: { ignoredNode: false } + }; + } +} +exports.NodeFactory = NodeFactory; + + +/***/ }), + +/***/ "./src/node/NodeGuards.ts": +/*!********************************!*\ + !*** ./src/node/NodeGuards.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeType_1 = __webpack_require__(/*! ../enums/node/NodeType */ "./src/enums/node/NodeType.ts"); +class NodeGuards { + static isArrayPatternNode(node) { + return node.type === NodeType_1.NodeType.ArrayPattern; + } + static isArrowFunctionExpressionNode(node) { + return node.type === NodeType_1.NodeType.ArrowFunctionExpression; + } + static isAssignmentExpressionNode(node) { + return node.type === NodeType_1.NodeType.AssignmentExpression; + } + static isAssignmentPatternNode(node) { + return node.type === NodeType_1.NodeType.AssignmentPattern; + } + static isAwaitExpressionNode(node) { + return node.type === NodeType_1.NodeType.AwaitExpression; + } + static isBlockStatementNode(node) { + return node.type === NodeType_1.NodeType.BlockStatement; + } + static isBreakStatementNode(node) { + return node.type === NodeType_1.NodeType.BreakStatement; + } + static isCallExpressionNode(node) { + return node.type === NodeType_1.NodeType.CallExpression; + } + static isClassDeclarationNode(node) { + return node.type === NodeType_1.NodeType.ClassDeclaration && node.id !== null; + } + static isContinueStatementNode(node) { + return node.type === NodeType_1.NodeType.ContinueStatement; + } + static isDirectiveNode(node) { + return node.type === NodeType_1.NodeType.ExpressionStatement + && 'directive' in node; + } + static isExportNamedDeclarationNode(node) { + return node.type === NodeType_1.NodeType.ExportNamedDeclaration; + } + static isExpressionStatementNode(node) { + return node.type === NodeType_1.NodeType.ExpressionStatement + && !('directive' in node); + } + static isFunctionNode(node) { + return NodeGuards.isFunctionDeclarationNode(node) || + NodeGuards.isFunctionExpressionNode(node) || + NodeGuards.isArrowFunctionExpressionNode(node); + } + static isFunctionDeclarationNode(node) { + return node.type === NodeType_1.NodeType.FunctionDeclaration && node.id !== null; + } + static isFunctionExpressionNode(node) { + return node.type === NodeType_1.NodeType.FunctionExpression; + } + static isIdentifierNode(node) { + return node.type === NodeType_1.NodeType.Identifier; + } + static isImportDeclarationNode(node) { + return node.type === NodeType_1.NodeType.ImportDeclaration; + } + static isImportSpecifierNode(node) { + return node.type === NodeType_1.NodeType.ImportSpecifier; + } + static isLabelIdentifierNode(node, parentNode) { + const parentNodeIsLabeledStatementNode = NodeGuards.isLabeledStatementNode(parentNode) && parentNode.label === node; + const parentNodeIsContinueStatementNode = NodeGuards.isContinueStatementNode(parentNode) && parentNode.label === node; + const parentNodeIsBreakStatementNode = NodeGuards.isBreakStatementNode(parentNode) && parentNode.label === node; + return parentNodeIsLabeledStatementNode || parentNodeIsContinueStatementNode || parentNodeIsBreakStatementNode; + } + static isLabeledStatementNode(node) { + return node.type === NodeType_1.NodeType.LabeledStatement; + } + static isLiteralNode(node) { + return node.type === NodeType_1.NodeType.Literal; + } + static isMemberExpressionNode(node) { + return node.type === NodeType_1.NodeType.MemberExpression; + } + static isMethodDefinitionNode(node) { + return node.type === NodeType_1.NodeType.MethodDefinition; + } + static isNode(object) { + return object && !object.type !== undefined; + } + static isNodeWithLexicalScope(node) { + return NodeGuards.isProgramNode(node) || NodeGuards.isFunctionNode(node); + } + static isNodeWithBlockLexicalScope(node) { + return NodeGuards.isNodeWithLexicalScope(node) || NodeGuards.isBlockStatementNode(node); + } + static isNodeWithLexicalScopeStatements(node, parentNode) { + return NodeGuards.isProgramNode(node) + || (NodeGuards.isBlockStatementNode(node) && NodeGuards.nodesWithLexicalStatements.includes(parentNode.type)); + } + static isNodeWithStatements(node) { + return NodeGuards.isProgramNode(node) + || NodeGuards.isBlockStatementNode(node) + || NodeGuards.isSwitchCaseNode(node); + } + static isNodeWithComments(node) { + return Boolean(node.leadingComments) || Boolean(node.trailingComments); + } + static isObjectPatternNode(node) { + return node.type === NodeType_1.NodeType.ObjectPattern; + } + static isObjectExpressionNode(node) { + return node.type === NodeType_1.NodeType.ObjectExpression; + } + static isProgramNode(node) { + return node.type === NodeType_1.NodeType.Program; + } + static isPropertyNode(node) { + return node.type === NodeType_1.NodeType.Property; + } + static parentNodeIsPropertyNode(node, parentNode) { + return NodeGuards.isPropertyNode(parentNode) + && !parentNode.computed + && parentNode.key === node; + } + static parentNodeIsMemberExpressionNode(node, parentNode) { + return (NodeGuards.isMemberExpressionNode(parentNode) + && !parentNode.computed + && parentNode.property === node); + } + static parentNodeIsMethodDefinitionNode(node, parentNode) { + return NodeGuards.isMethodDefinitionNode(parentNode) + && !parentNode.computed; + } + static isRestElementNode(node) { + return node.type === NodeType_1.NodeType.RestElement; + } + static isReturnStatementNode(node) { + return node.type === NodeType_1.NodeType.ReturnStatement; + } + static isSuperNode(node) { + return node.type === NodeType_1.NodeType.Super; + } + static isSwitchCaseNode(node) { + return node.type === NodeType_1.NodeType.SwitchCase; + } + static isTaggedTemplateExpressionNode(node) { + return node.type === NodeType_1.NodeType.TaggedTemplateExpression; + } + static isTemplateLiteralNode(node) { + return node.type === NodeType_1.NodeType.TemplateLiteral; + } + static isUnaryExpressionNode(node) { + return node.type === NodeType_1.NodeType.UnaryExpression; + } + static isUseStrictOperator(node) { + return NodeGuards.isDirectiveNode(node) + && node.directive === 'use strict'; + } + static isVariableDeclarationNode(node) { + return node.type === NodeType_1.NodeType.VariableDeclaration; + } + static isVariableDeclaratorNode(node) { + return node.type === NodeType_1.NodeType.VariableDeclarator; + } + static isWhileStatementNode(node) { + return node.type === NodeType_1.NodeType.WhileStatement; + } +} +exports.NodeGuards = NodeGuards; +NodeGuards.nodesWithLexicalStatements = [ + NodeType_1.NodeType.ArrowFunctionExpression, + NodeType_1.NodeType.FunctionDeclaration, + NodeType_1.NodeType.FunctionExpression, + NodeType_1.NodeType.MethodDefinition, +]; + + +/***/ }), + +/***/ "./src/node/NodeLexicalScopeUtils.ts": +/*!*******************************************!*\ + !*** ./src/node/NodeLexicalScopeUtils.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +class NodeLexicalScopeUtils { + static getLexicalScope(node) { + return NodeLexicalScopeUtils.getLexicalScopesRecursive(node, 1)[0]; + } + static getLexicalScopes(node) { + return NodeLexicalScopeUtils.getLexicalScopesRecursive(node); + } + static getLexicalScopesRecursive(node, maxSize = Infinity, nodesWithLexicalScope = [], depth = 0) { + if (nodesWithLexicalScope.length >= maxSize) { + return nodesWithLexicalScope; + } + const parentNode = node.parentNode; + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + if (NodeGuards_1.NodeGuards.isNodeWithLexicalScope(node)) { + nodesWithLexicalScope.push(node); + } + if (node !== parentNode) { + return NodeLexicalScopeUtils.getLexicalScopesRecursive(parentNode, maxSize, nodesWithLexicalScope, ++depth); + } + return nodesWithLexicalScope; + } +} +exports.NodeLexicalScopeUtils = NodeLexicalScopeUtils; + + +/***/ }), + +/***/ "./src/node/NodeLiteralUtils.ts": +/*!**************************************!*\ + !*** ./src/node/NodeLiteralUtils.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +class NodeLiteralUtils { + static isProhibitedLiteralNode(literalNode, parentNode) { + if (NodeGuards_1.NodeGuards.isPropertyNode(parentNode) && !parentNode.computed && parentNode.key === literalNode) { + return true; + } + if (NodeGuards_1.NodeGuards.isImportDeclarationNode(parentNode)) { + return true; + } + return false; + } +} +exports.NodeLiteralUtils = NodeLiteralUtils; + + +/***/ }), + +/***/ "./src/node/NodeMetadata.ts": +/*!**********************************!*\ + !*** ./src/node/NodeMetadata.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class NodeMetadata { + static set(node, metadata) { + var _a; + node.metadata = Object.assign((_a = node.metadata) !== null && _a !== void 0 ? _a : {}, metadata); + } + static get(node, metadataKey) { + return node.metadata !== undefined + ? node.metadata[metadataKey] + : undefined; + } + static isIgnoredNode(node) { + return NodeMetadata.get(node, 'ignoredNode') === true; + } + static isReplacedLiteral(literalNode) { + return NodeMetadata.get(literalNode, 'replacedLiteral') === true; + } +} +exports.NodeMetadata = NodeMetadata; + + +/***/ }), + +/***/ "./src/node/NodeStatementUtils.ts": +/*!****************************************!*\ + !*** ./src/node/NodeStatementUtils.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +class NodeStatementUtils { + static getParentNodeWithStatements(node) { + return NodeStatementUtils.getParentNodesWithStatementsRecursive(node, 1)[0]; + } + static getParentNodesWithStatements(node) { + return NodeStatementUtils.getParentNodesWithStatementsRecursive(node); + } + static getNextSiblingStatement(statement) { + return NodeStatementUtils.getSiblingStatementByOffset(statement, 1); + } + static getPreviousSiblingStatement(statement) { + return NodeStatementUtils.getSiblingStatementByOffset(statement, -1); + } + static getRootStatementOfNode(node) { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + throw new Error('Unable to find root statement for `Program` node'); + } + const parentNode = node.parentNode; + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + if (!NodeGuards_1.NodeGuards.isNodeWithStatements(parentNode)) { + return NodeStatementUtils.getRootStatementOfNode(parentNode); + } + return node; + } + static getScopeOfNode(node) { + const parentNode = node.parentNode; + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + if (!NodeGuards_1.NodeGuards.isNodeWithStatements(parentNode)) { + return NodeStatementUtils.getScopeOfNode(parentNode); + } + return parentNode; + } + static getParentNodesWithStatementsRecursive(node, maxSize = Infinity, nodesWithStatements = [], depth = 0) { + if (nodesWithStatements.length >= maxSize) { + return nodesWithStatements; + } + const parentNode = node.parentNode; + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + if (NodeGuards_1.NodeGuards.isProgramNode(node) || + (NodeGuards_1.NodeGuards.isNodeWithLexicalScopeStatements(node, parentNode) && depth > 0)) { + nodesWithStatements.push(node); + } + if (node !== parentNode) { + return NodeStatementUtils.getParentNodesWithStatementsRecursive(parentNode, maxSize, nodesWithStatements, ++depth); + } + return nodesWithStatements; + } + static getSiblingStatementByOffset(statement, offset) { + const scopeNode = NodeStatementUtils.getScopeOfNode(statement); + const scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) + ? scopeNode.body + : scopeNode.consequent; + const indexInScope = scopeBody.indexOf(statement); + return scopeBody[indexInScope + offset] || null; + } +} +exports.NodeStatementUtils = NodeStatementUtils; + + +/***/ }), + +/***/ "./src/node/NodeUtils.ts": +/*!*******************************!*\ + !*** ./src/node/NodeUtils.ts ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const escodegen = __importStar(__webpack_require__(/*! escodegen */ "escodegen")); +const estraverse = __importStar(__webpack_require__(/*! estraverse */ "estraverse")); +const EcmaVersion_1 = __webpack_require__(/*! ../constants/EcmaVersion */ "./src/constants/EcmaVersion.ts"); +const ASTParserFacade_1 = __webpack_require__(/*! ../ASTParserFacade */ "./src/ASTParserFacade.ts"); +const NodeGuards_1 = __webpack_require__(/*! ./NodeGuards */ "./src/node/NodeGuards.ts"); +const NodeMetadata_1 = __webpack_require__(/*! ./NodeMetadata */ "./src/node/NodeMetadata.ts"); +class NodeUtils { + static addXVerbatimPropertyTo(literalNode) { + literalNode['x-verbatim-property'] = { + content: literalNode.raw, + precedence: escodegen.Precedence.Primary + }; + return literalNode; + } + static clone(astTree) { + return NodeUtils.parentizeAst(NodeUtils.cloneRecursive(astTree)); + } + static convertCodeToStructure(code) { + const structure = ASTParserFacade_1.ASTParserFacade.parse({ sourceCode: code }, { + ecmaVersion: EcmaVersion_1.ecmaVersion, + sourceType: 'script' + }); + estraverse.replace(structure, { + enter: (node, parentNode) => { + NodeUtils.parentizeNode(node, parentNode); + if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { + NodeUtils.addXVerbatimPropertyTo(node); + } + NodeMetadata_1.NodeMetadata.set(node, { ignoredNode: false }); + return node; + } + }); + return structure.body; + } + static convertStructureToCode(structure) { + return structure.reduce((code, node) => { + return code + escodegen.generate(node, { + sourceMapWithCode: true + }).code; + }, ''); + } + static getUnaryExpressionArgumentNode(unaryExpressionNode) { + if (NodeGuards_1.NodeGuards.isUnaryExpressionNode(unaryExpressionNode.argument)) { + return NodeUtils.getUnaryExpressionArgumentNode(unaryExpressionNode.argument); + } + return unaryExpressionNode.argument; + } + static parentizeAst(astTree) { + estraverse.replace(astTree, { + enter: NodeUtils.parentizeNode + }); + return astTree; + } + static parentizeNode(node, parentNode) { + node.parentNode = parentNode !== null && parentNode !== void 0 ? parentNode : node; + return node; + } + static cloneRecursive(node) { + if (node === null) { + return node; + } + const copy = {}; + const nodeKeys = Object.keys(node); + nodeKeys + .forEach((property) => { + if (property === 'parentNode') { + return; + } + const value = node[property]; + let clonedValue; + if (value === null || value instanceof RegExp) { + clonedValue = value; + } + else if (Array.isArray(value)) { + clonedValue = value.map(NodeUtils.cloneRecursive); + } + else if (typeof value === 'object') { + clonedValue = NodeUtils.cloneRecursive(value); + } + else { + clonedValue = value; + } + copy[property] = clonedValue; + }); + return copy; + } +} +exports.NodeUtils = NodeUtils; + + +/***/ }), + +/***/ "./src/options/Options.ts": +/*!********************************!*\ + !*** ./src/options/Options.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var Options_1, _a, _b, _c, _d, _e, _f; +Object.defineProperty(exports, "__esModule", { value: true }); +const tsenum_1 = __webpack_require__(/*! @gradecam/tsenum */ "@gradecam/tsenum"); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator"); +const TInputOptions_1 = __webpack_require__(/*! ../types/options/TInputOptions */ "./src/types/options/TInputOptions.ts"); +const TStringArrayEncoding_1 = __webpack_require__(/*! ../types/options/TStringArrayEncoding */ "./src/types/options/TStringArrayEncoding.ts"); +const IOptionsNormalizer_1 = __webpack_require__(/*! ../interfaces/options/IOptionsNormalizer */ "./src/interfaces/options/IOptionsNormalizer.ts"); +const IdentifierNamesGenerator_1 = __webpack_require__(/*! ../enums/generators/identifier-names-generators/IdentifierNamesGenerator */ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const SourceMapMode_1 = __webpack_require__(/*! ../enums/source-map/SourceMapMode */ "./src/enums/source-map/SourceMapMode.ts"); +const StringArrayEncoding_1 = __webpack_require__(/*! ../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +const Default_1 = __webpack_require__(/*! ./presets/Default */ "./src/options/presets/Default.ts"); +const ValidationErrorsFormatter_1 = __webpack_require__(/*! ./ValidationErrorsFormatter */ "./src/options/ValidationErrorsFormatter.ts"); +const IsAllowedForObfuscationTargets_1 = __webpack_require__(/*! ./validators/IsAllowedForObfuscationTargets */ "./src/options/validators/IsAllowedForObfuscationTargets.ts"); +let Options = Options_1 = class Options { + constructor(inputOptions, optionsNormalizer) { + Object.assign(this, Default_1.DEFAULT_PRESET, inputOptions); + const errors = class_validator_1.validateSync(this, Options_1.validatorOptions); + if (errors.length) { + throw new ReferenceError(`Validation failed. errors:\n${ValidationErrorsFormatter_1.ValidationErrorsFormatter.format(errors)}`); + } + Object.assign(this, optionsNormalizer.normalize(this)); + } +}; +Options.validatorOptions = { + validationError: { + target: false + } +}; +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "compact", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "controlFlowFlattening", void 0); +__decorate([ + class_validator_1.IsNumber(), + class_validator_1.Min(0), + class_validator_1.Max(1), + __metadata("design:type", Number) +], Options.prototype, "controlFlowFlatteningThreshold", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "deadCodeInjection", void 0); +__decorate([ + class_validator_1.IsNumber(), + __metadata("design:type", Number) +], Options.prototype, "deadCodeInjectionThreshold", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "debugProtection", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "debugProtectionInterval", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "disableConsoleOutput", void 0); +__decorate([ + class_validator_1.IsArray(), + class_validator_1.ArrayUnique(), + class_validator_1.IsString({ + each: true + }), + IsAllowedForObfuscationTargets_1.IsAllowedForObfuscationTargets([ + ObfuscationTarget_1.ObfuscationTarget.Browser, + ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval, + ]), + __metadata("design:type", Array) +], Options.prototype, "domainLock", void 0); +__decorate([ + class_validator_1.IsIn([ + IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator, + IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, + IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator + ]), + __metadata("design:type", typeof (_a = typeof tsenum_1.TypeFromEnum !== "undefined" && tsenum_1.TypeFromEnum) === "function" ? _a : Object) +], Options.prototype, "identifierNamesGenerator", void 0); +__decorate([ + class_validator_1.IsString(), + __metadata("design:type", String) +], Options.prototype, "identifiersPrefix", void 0); +__decorate([ + class_validator_1.IsArray(), + class_validator_1.ArrayUnique(), + class_validator_1.IsString({ + each: true + }), + class_validator_1.ValidateIf((options) => options.identifierNamesGenerator === IdentifierNamesGenerator_1.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator), + class_validator_1.ArrayNotEmpty(), + __metadata("design:type", Array) +], Options.prototype, "identifiersDictionary", void 0); +__decorate([ + class_validator_1.IsString(), + __metadata("design:type", String) +], Options.prototype, "inputFileName", void 0); +__decorate([ + class_validator_1.IsString(), + __metadata("design:type", String) +], Options.prototype, "inputFilePath", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "log", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "renameGlobals", void 0); +__decorate([ + class_validator_1.IsArray(), + class_validator_1.ArrayUnique(), + class_validator_1.IsString({ + each: true + }), + __metadata("design:type", Array) +], Options.prototype, "reservedNames", void 0); +__decorate([ + class_validator_1.IsArray(), + class_validator_1.ArrayUnique(), + class_validator_1.IsString({ + each: true + }), + __metadata("design:type", Array) +], Options.prototype, "reservedStrings", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "rotateStringArray", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "selfDefending", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "shuffleStringArray", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "sourceMap", void 0); +__decorate([ + class_validator_1.IsString(), + class_validator_1.ValidateIf((options) => Boolean(options.sourceMapBaseUrl)), + class_validator_1.IsUrl({ + require_protocol: true, + require_tld: false, + require_valid_protocol: true + }), + __metadata("design:type", String) +], Options.prototype, "sourceMapBaseUrl", void 0); +__decorate([ + class_validator_1.IsString(), + __metadata("design:type", String) +], Options.prototype, "sourceMapFileName", void 0); +__decorate([ + class_validator_1.IsIn([SourceMapMode_1.SourceMapMode.Inline, SourceMapMode_1.SourceMapMode.Separate]), + __metadata("design:type", typeof (_b = typeof tsenum_1.TypeFromEnum !== "undefined" && tsenum_1.TypeFromEnum) === "function" ? _b : Object) +], Options.prototype, "sourceMapMode", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "splitStrings", void 0); +__decorate([ + class_validator_1.IsNumber(), + class_validator_1.ValidateIf((options) => Boolean(options.splitStrings)), + class_validator_1.Min(1), + __metadata("design:type", Number) +], Options.prototype, "splitStringsChunkLength", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "stringArray", void 0); +__decorate([ + class_validator_1.IsIn([true, false, StringArrayEncoding_1.StringArrayEncoding.Base64, StringArrayEncoding_1.StringArrayEncoding.Rc4]), + __metadata("design:type", typeof (_c = typeof TStringArrayEncoding_1.TStringArrayEncoding !== "undefined" && TStringArrayEncoding_1.TStringArrayEncoding) === "function" ? _c : Object) +], Options.prototype, "stringArrayEncoding", void 0); +__decorate([ + class_validator_1.IsNumber(), + class_validator_1.Min(0), + class_validator_1.Max(1), + __metadata("design:type", Number) +], Options.prototype, "stringArrayThreshold", void 0); +__decorate([ + class_validator_1.IsIn([ObfuscationTarget_1.ObfuscationTarget.Browser, ObfuscationTarget_1.ObfuscationTarget.BrowserNoEval, ObfuscationTarget_1.ObfuscationTarget.Node]), + __metadata("design:type", typeof (_d = typeof tsenum_1.TypeFromEnum !== "undefined" && tsenum_1.TypeFromEnum) === "function" ? _d : Object) +], Options.prototype, "target", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "transformObjectKeys", void 0); +__decorate([ + class_validator_1.IsBoolean(), + __metadata("design:type", Boolean) +], Options.prototype, "unicodeEscapeSequence", void 0); +Options = Options_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TInputOptions)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptionsNormalizer)), + __metadata("design:paramtypes", [typeof (_e = typeof TInputOptions_1.TInputOptions !== "undefined" && TInputOptions_1.TInputOptions) === "function" ? _e : Object, typeof (_f = typeof IOptionsNormalizer_1.IOptionsNormalizer !== "undefined" && IOptionsNormalizer_1.IOptionsNormalizer) === "function" ? _f : Object]) +], Options); +exports.Options = Options; + + +/***/ }), + +/***/ "./src/options/OptionsNormalizer.ts": +/*!******************************************!*\ + !*** ./src/options/OptionsNormalizer.ts ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var OptionsNormalizer_1; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ControlFlowFlatteningThresholdRule_1 = __webpack_require__(/*! ./normalizer-rules/ControlFlowFlatteningThresholdRule */ "./src/options/normalizer-rules/ControlFlowFlatteningThresholdRule.ts"); +const DeadCodeInjectionRule_1 = __webpack_require__(/*! ./normalizer-rules/DeadCodeInjectionRule */ "./src/options/normalizer-rules/DeadCodeInjectionRule.ts"); +const DeadCodeInjectionThresholdRule_1 = __webpack_require__(/*! ./normalizer-rules/DeadCodeInjectionThresholdRule */ "./src/options/normalizer-rules/DeadCodeInjectionThresholdRule.ts"); +const DomainLockRule_1 = __webpack_require__(/*! ./normalizer-rules/DomainLockRule */ "./src/options/normalizer-rules/DomainLockRule.ts"); +const InputFileNameRule_1 = __webpack_require__(/*! ./normalizer-rules/InputFileNameRule */ "./src/options/normalizer-rules/InputFileNameRule.ts"); +const SeedRule_1 = __webpack_require__(/*! ./normalizer-rules/SeedRule */ "./src/options/normalizer-rules/SeedRule.ts"); +const SelfDefendingRule_1 = __webpack_require__(/*! ./normalizer-rules/SelfDefendingRule */ "./src/options/normalizer-rules/SelfDefendingRule.ts"); +const SourceMapBaseUrlRule_1 = __webpack_require__(/*! ./normalizer-rules/SourceMapBaseUrlRule */ "./src/options/normalizer-rules/SourceMapBaseUrlRule.ts"); +const SourceMapFileNameRule_1 = __webpack_require__(/*! ./normalizer-rules/SourceMapFileNameRule */ "./src/options/normalizer-rules/SourceMapFileNameRule.ts"); +const SplitStringsChunkLengthRule_1 = __webpack_require__(/*! ./normalizer-rules/SplitStringsChunkLengthRule */ "./src/options/normalizer-rules/SplitStringsChunkLengthRule.ts"); +const StringArrayRule_1 = __webpack_require__(/*! ./normalizer-rules/StringArrayRule */ "./src/options/normalizer-rules/StringArrayRule.ts"); +const StringArrayEncodingRule_1 = __webpack_require__(/*! ./normalizer-rules/StringArrayEncodingRule */ "./src/options/normalizer-rules/StringArrayEncodingRule.ts"); +const StringArrayThresholdRule_1 = __webpack_require__(/*! ./normalizer-rules/StringArrayThresholdRule */ "./src/options/normalizer-rules/StringArrayThresholdRule.ts"); +let OptionsNormalizer = OptionsNormalizer_1 = class OptionsNormalizer { + normalize(options) { + let normalizedOptions = Object.assign({}, options); + for (const normalizerRule of OptionsNormalizer_1.normalizerRules) { + normalizedOptions = normalizerRule(normalizedOptions); + } + return normalizedOptions; + } +}; +OptionsNormalizer.normalizerRules = [ + ControlFlowFlatteningThresholdRule_1.ControlFlowFlatteningThresholdRule, + DeadCodeInjectionRule_1.DeadCodeInjectionRule, + DeadCodeInjectionThresholdRule_1.DeadCodeInjectionThresholdRule, + DomainLockRule_1.DomainLockRule, + InputFileNameRule_1.InputFileNameRule, + SeedRule_1.SeedRule, + SelfDefendingRule_1.SelfDefendingRule, + SourceMapBaseUrlRule_1.SourceMapBaseUrlRule, + SourceMapFileNameRule_1.SourceMapFileNameRule, + SplitStringsChunkLengthRule_1.SplitStringsChunkLengthRule, + StringArrayRule_1.StringArrayRule, + StringArrayEncodingRule_1.StringArrayEncodingRule, + StringArrayThresholdRule_1.StringArrayThresholdRule, +]; +OptionsNormalizer = OptionsNormalizer_1 = __decorate([ + inversify_1.injectable() +], OptionsNormalizer); +exports.OptionsNormalizer = OptionsNormalizer; + + +/***/ }), + +/***/ "./src/options/ValidationErrorsFormatter.ts": +/*!**************************************************!*\ + !*** ./src/options/ValidationErrorsFormatter.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class ValidationErrorsFormatter { + static format(errors) { + return errors + .reduce((errorMessages, error) => [ + ...errorMessages, + ValidationErrorsFormatter.formatWithNestedConstraints(error) + ], []) + .join('\n'); + } + static formatWithNestedConstraints(error) { + const constraints = error.constraints; + const rootError = `\`${error.property}\` errors:\n`; + const nestedErrors = Object + .keys(constraints) + .map((constraint) => ` - ${constraints[constraint]}\n`) + .join(); + return `${rootError}${nestedErrors}`; + } +} +exports.ValidationErrorsFormatter = ValidationErrorsFormatter; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/ControlFlowFlatteningThresholdRule.ts": +/*!****************************************************************************!*\ + !*** ./src/options/normalizer-rules/ControlFlowFlatteningThresholdRule.ts ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ControlFlowFlatteningThresholdRule = (options) => { + if (options.controlFlowFlatteningThreshold === 0) { + options = Object.assign(Object.assign({}, options), { controlFlowFlattening: false, controlFlowFlatteningThreshold: 0 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/DeadCodeInjectionRule.ts": +/*!***************************************************************!*\ + !*** ./src/options/normalizer-rules/DeadCodeInjectionRule.ts ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const Default_1 = __webpack_require__(/*! ../presets/Default */ "./src/options/presets/Default.ts"); +exports.DeadCodeInjectionRule = (options) => { + if (options.deadCodeInjection) { + options = Object.assign(Object.assign({}, options), { deadCodeInjection: true, stringArray: true }); + if (!options.stringArrayThreshold) { + options = Object.assign(Object.assign({}, options), { stringArray: true, stringArrayThreshold: Default_1.DEFAULT_PRESET.stringArrayThreshold }); + } + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/DeadCodeInjectionThresholdRule.ts": +/*!************************************************************************!*\ + !*** ./src/options/normalizer-rules/DeadCodeInjectionThresholdRule.ts ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeadCodeInjectionThresholdRule = (options) => { + if (options.deadCodeInjectionThreshold === 0) { + options = Object.assign(Object.assign({}, options), { deadCodeInjection: false, deadCodeInjectionThreshold: 0 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/DomainLockRule.ts": +/*!********************************************************!*\ + !*** ./src/options/normalizer-rules/DomainLockRule.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const Utils_1 = __webpack_require__(/*! ../../utils/Utils */ "./src/utils/Utils.ts"); +exports.DomainLockRule = (options) => { + if (options.domainLock.length) { + const normalizedDomains = []; + for (const domain of options.domainLock) { + normalizedDomains.push(Utils_1.Utils.extractDomainFrom(domain)); + } + options = Object.assign(Object.assign({}, options), { domainLock: normalizedDomains }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/InputFileNameRule.ts": +/*!***********************************************************!*\ + !*** ./src/options/normalizer-rules/InputFileNameRule.ts ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const StringSeparator_1 = __webpack_require__(/*! ../../enums/StringSeparator */ "./src/enums/StringSeparator.ts"); +exports.InputFileNameRule = (options) => { + let { inputFileName } = options; + if (inputFileName) { + inputFileName = inputFileName + .replace(/^\/+/, '') + .split(StringSeparator_1.StringSeparator.Dot) + .slice(0, -1) + .join(StringSeparator_1.StringSeparator.Dot) || inputFileName; + options = Object.assign(Object.assign({}, options), { inputFileName: `${inputFileName}.js` }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SeedRule.ts": +/*!**************************************************!*\ + !*** ./src/options/normalizer-rules/SeedRule.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SeedRule = (options) => { + if (options.seed) { + return Object.assign(Object.assign({}, options), { seed: options.seed }); + } + const getRandomInteger = (min, max) => { + return Math.floor(Math.random() * (max - min + 1) + min); + }; + return Object.assign(Object.assign({}, options), { seed: getRandomInteger(0, 999999999) }); +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SelfDefendingRule.ts": +/*!***********************************************************!*\ + !*** ./src/options/normalizer-rules/SelfDefendingRule.ts ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SelfDefendingRule = (options) => { + if (options.selfDefending) { + options = Object.assign(Object.assign({}, options), { compact: true, selfDefending: true }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SourceMapBaseUrlRule.ts": +/*!**************************************************************!*\ + !*** ./src/options/normalizer-rules/SourceMapBaseUrlRule.ts ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SourceMapBaseUrlRule = (options) => { + const { sourceMapBaseUrl } = options; + if (!options.sourceMapFileName) { + options = Object.assign(Object.assign({}, options), { sourceMapBaseUrl: '' }); + return options; + } + if (sourceMapBaseUrl && !sourceMapBaseUrl.endsWith('/')) { + options = Object.assign(Object.assign({}, options), { sourceMapBaseUrl: `${sourceMapBaseUrl}/` }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SourceMapFileNameRule.ts": +/*!***************************************************************!*\ + !*** ./src/options/normalizer-rules/SourceMapFileNameRule.ts ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const StringSeparator_1 = __webpack_require__(/*! ../../enums/StringSeparator */ "./src/enums/StringSeparator.ts"); +exports.SourceMapFileNameRule = (options) => { + let { sourceMapFileName } = options; + if (sourceMapFileName) { + sourceMapFileName = sourceMapFileName + .replace(/^\/+/, '') + .replace(/(?:\.js)?(?:\.map)?$/, ''); + let sourceMapFileNameParts = sourceMapFileName.split(StringSeparator_1.StringSeparator.Dot); + const sourceMapFileNamePartsCount = sourceMapFileNameParts.length; + const lastPart = sourceMapFileNameParts[sourceMapFileNamePartsCount - 1]; + if (sourceMapFileNamePartsCount > 1 && lastPart.length <= 3) { + sourceMapFileNameParts = sourceMapFileNameParts.slice(0, -1); + } + sourceMapFileName = sourceMapFileNameParts.join(StringSeparator_1.StringSeparator.Dot); + options = Object.assign(Object.assign({}, options), { sourceMapFileName: `${sourceMapFileName}.js.map` }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/SplitStringsChunkLengthRule.ts": +/*!*********************************************************************!*\ + !*** ./src/options/normalizer-rules/SplitStringsChunkLengthRule.ts ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SplitStringsChunkLengthRule = (options) => { + if (options.splitStringsChunkLength === 0) { + options = Object.assign(Object.assign({}, options), { splitStrings: false, splitStringsChunkLength: 0 }); + } + else { + options = Object.assign(Object.assign({}, options), { splitStringsChunkLength: Math.floor(options.splitStringsChunkLength) }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/StringArrayEncodingRule.ts": +/*!*****************************************************************!*\ + !*** ./src/options/normalizer-rules/StringArrayEncodingRule.ts ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const StringArrayEncoding_1 = __webpack_require__(/*! ../../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +exports.StringArrayEncodingRule = (options) => { + if (options.stringArrayEncoding === true) { + options = Object.assign(Object.assign({}, options), { stringArrayEncoding: StringArrayEncoding_1.StringArrayEncoding.Base64 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/StringArrayRule.ts": +/*!*********************************************************!*\ + !*** ./src/options/normalizer-rules/StringArrayRule.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StringArrayRule = (options) => { + if (!options.stringArray) { + options = Object.assign(Object.assign({}, options), { rotateStringArray: false, shuffleStringArray: false, stringArray: false, stringArrayEncoding: false, stringArrayThreshold: 0 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/normalizer-rules/StringArrayThresholdRule.ts": +/*!******************************************************************!*\ + !*** ./src/options/normalizer-rules/StringArrayThresholdRule.ts ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StringArrayThresholdRule = (options) => { + if (options.stringArrayThreshold === 0) { + options = Object.assign(Object.assign({}, options), { rotateStringArray: false, stringArray: false, stringArrayEncoding: false, stringArrayThreshold: 0 }); + } + return options; +}; + + +/***/ }), + +/***/ "./src/options/presets/Default.ts": +/*!****************************************!*\ + !*** ./src/options/presets/Default.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const IdentifierNamesGenerator_1 = __webpack_require__(/*! ../../enums/generators/identifier-names-generators/IdentifierNamesGenerator */ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const SourceMapMode_1 = __webpack_require__(/*! ../../enums/source-map/SourceMapMode */ "./src/enums/source-map/SourceMapMode.ts"); +exports.DEFAULT_PRESET = Object.freeze({ + compact: true, + config: '', + controlFlowFlattening: false, + controlFlowFlatteningThreshold: 0.75, + deadCodeInjection: false, + deadCodeInjectionThreshold: 0.4, + debugProtection: false, + debugProtectionInterval: false, + disableConsoleOutput: false, + domainLock: [], + exclude: [], + identifierNamesGenerator: IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, + identifiersPrefix: '', + identifiersDictionary: [], + inputFileName: '', + inputFilePath: '', + log: false, + renameGlobals: false, + reservedNames: [], + reservedStrings: [], + rotateStringArray: true, + seed: 0, + selfDefending: false, + shuffleStringArray: true, + sourceMap: false, + sourceMapBaseUrl: '', + sourceMapFileName: '', + sourceMapMode: SourceMapMode_1.SourceMapMode.Separate, + splitStrings: false, + splitStringsChunkLength: 10, + stringArray: true, + stringArrayEncoding: false, + stringArrayThreshold: 0.75, + target: ObfuscationTarget_1.ObfuscationTarget.Browser, + transformObjectKeys: false, + unicodeEscapeSequence: false +}); + + +/***/ }), + +/***/ "./src/options/presets/NoCustomNodes.ts": +/*!**********************************************!*\ + !*** ./src/options/presets/NoCustomNodes.ts ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const IdentifierNamesGenerator_1 = __webpack_require__(/*! ../../enums/generators/identifier-names-generators/IdentifierNamesGenerator */ "./src/enums/generators/identifier-names-generators/IdentifierNamesGenerator.ts"); +const ObfuscationTarget_1 = __webpack_require__(/*! ../../enums/ObfuscationTarget */ "./src/enums/ObfuscationTarget.ts"); +const SourceMapMode_1 = __webpack_require__(/*! ../../enums/source-map/SourceMapMode */ "./src/enums/source-map/SourceMapMode.ts"); +exports.NO_ADDITIONAL_NODES_PRESET = Object.freeze({ + compact: true, + controlFlowFlattening: false, + controlFlowFlatteningThreshold: 0, + deadCodeInjection: false, + deadCodeInjectionThreshold: 0, + debugProtection: false, + debugProtectionInterval: false, + disableConsoleOutput: false, + domainLock: [], + exclude: [], + identifierNamesGenerator: IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, + identifiersPrefix: '', + identifiersDictionary: [], + inputFileName: '', + inputFilePath: '', + log: false, + renameGlobals: false, + reservedNames: [], + reservedStrings: [], + rotateStringArray: false, + seed: 0, + selfDefending: false, + shuffleStringArray: false, + sourceMap: false, + sourceMapBaseUrl: '', + sourceMapFileName: '', + sourceMapMode: SourceMapMode_1.SourceMapMode.Separate, + splitStrings: false, + splitStringsChunkLength: 0, + stringArray: false, + stringArrayEncoding: false, + stringArrayThreshold: 0, + target: ObfuscationTarget_1.ObfuscationTarget.Browser, + transformObjectKeys: false, + unicodeEscapeSequence: false +}); + + +/***/ }), + +/***/ "./src/options/validators/IsAllowedForObfuscationTargets.ts": +/*!******************************************************************!*\ + !*** ./src/options/validators/IsAllowedForObfuscationTargets.ts ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator"); +const fast_deep_equal_1 = __importDefault(__webpack_require__(/*! fast-deep-equal */ "fast-deep-equal")); +const StringSeparator_1 = __webpack_require__(/*! ../../enums/StringSeparator */ "./src/enums/StringSeparator.ts"); +const Default_1 = __webpack_require__(/*! ../presets/Default */ "./src/options/presets/Default.ts"); +function IsAllowedForObfuscationTargets(obfuscationTargets, validationOptions) { + return (optionsObject, propertyName) => { + class_validator_1.registerDecorator({ + propertyName, + constraints: [obfuscationTargets], + name: 'IsAllowedForObfuscationTargets', + options: validationOptions, + target: optionsObject.constructor, + validator: { + validate(value, validationArguments) { + const options = validationArguments.object; + const defaultValue = Default_1.DEFAULT_PRESET[propertyName]; + const isDefaultValue = fast_deep_equal_1.default(value, defaultValue); + return isDefaultValue || obfuscationTargets.includes(options.target); + }, + defaultMessage(validationArguments) { + const requiredObfuscationTargetsString = obfuscationTargets.join(`${StringSeparator_1.StringSeparator.Comma} `); + return `This option allowed only for obfuscation targets: ${requiredObfuscationTargetsString}`; + } + } + }); + }; +} +exports.IsAllowedForObfuscationTargets = IsAllowedForObfuscationTargets; + + +/***/ }), + +/***/ "./src/source-code/ObfuscatedCode.ts": +/*!*******************************************!*\ + !*** ./src/source-code/ObfuscatedCode.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ICryptUtils_1 = __webpack_require__(/*! ../interfaces/utils/ICryptUtils */ "./src/interfaces/utils/ICryptUtils.ts"); +const Initializable_1 = __webpack_require__(/*! ../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const SourceMapMode_1 = __webpack_require__(/*! ../enums/source-map/SourceMapMode */ "./src/enums/source-map/SourceMapMode.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +let ObfuscatedCode = class ObfuscatedCode { + constructor(cryptUtils, options) { + this.cryptUtils = cryptUtils; + this.options = options; + } + initialize(obfuscatedCode, sourceMap) { + this.obfuscatedCode = obfuscatedCode; + this.sourceMap = sourceMap; + } + getObfuscatedCode() { + return this.correctObfuscatedCode(); + } + getSourceMap() { + return this.sourceMap; + } + toString() { + return this.obfuscatedCode; + } + correctObfuscatedCode() { + if (!this.sourceMap) { + return this.obfuscatedCode; + } + const sourceMapUrl = this.options.sourceMapBaseUrl + this.options.sourceMapFileName; + let sourceMappingUrl = '//# sourceMappingURL='; + switch (this.options.sourceMapMode) { + case SourceMapMode_1.SourceMapMode.Inline: + sourceMappingUrl += `data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`; + break; + case SourceMapMode_1.SourceMapMode.Separate: + default: + if (!sourceMapUrl) { + return this.obfuscatedCode; + } + sourceMappingUrl += sourceMapUrl; + } + return `${this.obfuscatedCode}\n${sourceMappingUrl}`; + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ObfuscatedCode.prototype, "obfuscatedCode", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], ObfuscatedCode.prototype, "sourceMap", void 0); +ObfuscatedCode = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof ICryptUtils_1.ICryptUtils !== "undefined" && ICryptUtils_1.ICryptUtils) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], ObfuscatedCode); +exports.ObfuscatedCode = ObfuscatedCode; + + +/***/ }), + +/***/ "./src/source-code/SourceCode.ts": +/*!***************************************!*\ + !*** ./src/source-code/SourceCode.ts ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class SourceCode { + constructor(sourceCode, sourceMap) { + this.sourceCode = sourceCode; + this.sourceMap = sourceMap; + } + getSourceCode() { + return this.sourceCode; + } + getSourceMap() { + return this.sourceMap; + } + toString() { + return this.sourceCode; + } +} +exports.SourceCode = SourceCode; + + +/***/ }), + +/***/ "./src/storages/MapStorage.ts": +/*!************************************!*\ + !*** ./src/storages/MapStorage.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../decorators/Initializable */ "./src/decorators/Initializable.ts"); +let MapStorage = class MapStorage { + constructor(randomGenerator, options) { + this.randomGenerator = randomGenerator; + this.options = options; + } + initialize() { + this.storage = new Map(); + this.storageId = this.randomGenerator.getRandomString(6); + } + get(key) { + return this.storage.get(key); + } + getOrThrow(key) { + const value = this.get(key); + if (!value) { + throw new Error(`No value found in map storage with key \`${key}\``); + } + return value; + } + getKeyOf(value) { + for (const [key, storageValue] of this.storage) { + if (value === storageValue) { + return key; + } + } + return null; + } + getLength() { + return this.storage.size; + } + getStorage() { + return this.storage; + } + getStorageId() { + return this.storageId; + } + has(key) { + return this.storage.has(key); + } + mergeWith(storage, mergeId = false) { + this.storage = new Map([...this.storage, ...storage.getStorage()]); + if (mergeId) { + this.storageId = storage.getStorageId(); + } + } + set(key, value) { + this.storage.set(key, value); + } +}; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], MapStorage.prototype, "storageId", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) +], MapStorage.prototype, "storage", void 0); +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], MapStorage.prototype, "initialize", null); +MapStorage = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], MapStorage); +exports.MapStorage = MapStorage; + + +/***/ }), + +/***/ "./src/storages/control-flow/ControlFlowStorage.ts": +/*!*********************************************************!*\ + !*** ./src/storages/control-flow/ControlFlowStorage.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a, _b; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const MapStorage_1 = __webpack_require__(/*! ../MapStorage */ "./src/storages/MapStorage.ts"); +let ControlFlowStorage = class ControlFlowStorage extends MapStorage_1.MapStorage { + constructor(randomGenerator, options) { + super(randomGenerator, options); + } +}; +ControlFlowStorage = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object, typeof (_b = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _b : Object]) +], ControlFlowStorage); +exports.ControlFlowStorage = ControlFlowStorage; + + +/***/ }), + +/***/ "./src/storages/custom-node-group/CustomNodeGroupStorage.ts": +/*!******************************************************************!*\ + !*** ./src/storages/custom-node-group/CustomNodeGroupStorage.ts ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var CustomNodeGroupStorage_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TCustomNodeGroupFactory_1 = __webpack_require__(/*! ../../types/container/custom-nodes/TCustomNodeGroupFactory */ "./src/types/container/custom-nodes/TCustomNodeGroupFactory.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const CustomNodeGroup_1 = __webpack_require__(/*! ../../enums/custom-nodes/CustomNodeGroup */ "./src/enums/custom-nodes/CustomNodeGroup.ts"); +const MapStorage_1 = __webpack_require__(/*! ../MapStorage */ "./src/storages/MapStorage.ts"); +let CustomNodeGroupStorage = CustomNodeGroupStorage_1 = class CustomNodeGroupStorage extends MapStorage_1.MapStorage { + constructor(customNodeGroupFactory, randomGenerator, options) { + super(randomGenerator, options); + this.customNodeGroupFactory = customNodeGroupFactory; + } + initialize() { + super.initialize(); + CustomNodeGroupStorage_1.customNodeGroupsList.forEach((customNodeGroupName) => { + const customNodeGroup = this.customNodeGroupFactory(customNodeGroupName); + this.storage.set(customNodeGroupName, customNodeGroup); + }); + } +}; +CustomNodeGroupStorage.customNodeGroupsList = [ + CustomNodeGroup_1.CustomNodeGroup.ConsoleOutputCustomNodeGroup, + CustomNodeGroup_1.CustomNodeGroup.DebugProtectionCustomNodeGroup, + CustomNodeGroup_1.CustomNodeGroup.DomainLockCustomNodeGroup, + CustomNodeGroup_1.CustomNodeGroup.SelfDefendingCustomNodeGroup, + CustomNodeGroup_1.CustomNodeGroup.StringArrayCustomNodeGroup +]; +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], CustomNodeGroupStorage.prototype, "initialize", null); +CustomNodeGroupStorage = CustomNodeGroupStorage_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNodeGroup)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_a = typeof TCustomNodeGroupFactory_1.TCustomNodeGroupFactory !== "undefined" && TCustomNodeGroupFactory_1.TCustomNodeGroupFactory) === "function" ? _a : Object, typeof (_b = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], CustomNodeGroupStorage); +exports.CustomNodeGroupStorage = CustomNodeGroupStorage; + + +/***/ }), + +/***/ "./src/storages/string-array/StringArrayStorage.ts": +/*!*********************************************************!*\ + !*** ./src/storages/string-array/StringArrayStorage.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var StringArrayStorage_1, _a, _b, _c, _d, _e, _f; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const TIdentifierNamesGeneratorFactory_1 = __webpack_require__(/*! ../../types/container/generators/TIdentifierNamesGeneratorFactory */ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts"); +const IArrayUtils_1 = __webpack_require__(/*! ../../interfaces/utils/IArrayUtils */ "./src/interfaces/utils/IArrayUtils.ts"); +const ICryptUtils_1 = __webpack_require__(/*! ../../interfaces/utils/ICryptUtils */ "./src/interfaces/utils/ICryptUtils.ts"); +const IEscapeSequenceEncoder_1 = __webpack_require__(/*! ../../interfaces/utils/IEscapeSequenceEncoder */ "./src/interfaces/utils/IEscapeSequenceEncoder.ts"); +const IOptions_1 = __webpack_require__(/*! ../../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const Initializable_1 = __webpack_require__(/*! ../../decorators/Initializable */ "./src/decorators/Initializable.ts"); +const StringArrayEncoding_1 = __webpack_require__(/*! ../../enums/StringArrayEncoding */ "./src/enums/StringArrayEncoding.ts"); +const MapStorage_1 = __webpack_require__(/*! ../MapStorage */ "./src/storages/MapStorage.ts"); +let StringArrayStorage = StringArrayStorage_1 = class StringArrayStorage extends MapStorage_1.MapStorage { + constructor(identifierNamesGeneratorFactory, arrayUtils, randomGenerator, options, cryptUtils, escapeSequenceEncoder) { + super(randomGenerator, options); + this.rc4EncodedValuesSourcesCache = new Map(); + this.rotationAmount = 0; + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + this.arrayUtils = arrayUtils; + this.cryptUtils = cryptUtils; + this.escapeSequenceEncoder = escapeSequenceEncoder; + this.rc4Keys = this.randomGenerator.getRandomGenerator() + .n(() => this.randomGenerator.getRandomGenerator().string({ + length: StringArrayStorage_1.rc4KeyLength + }), StringArrayStorage_1.rc4KeysCount); + } + initialize() { + super.initialize(); + const baseStringArrayName = this.identifierNamesGenerator + .generate(StringArrayStorage_1.stringArrayNameLength); + const baseStringArrayCallsWrapperName = this.identifierNamesGenerator + .generate(StringArrayStorage_1.stringArrayNameLength); + this.stringArrayStorageName = `${this.options.identifiersPrefix}${baseStringArrayName}`; + this.stringArrayStorageCallsWrapperName = `${this.options.identifiersPrefix}${baseStringArrayCallsWrapperName}`; + this.rotationAmount = this.options.rotateStringArray + ? this.randomGenerator.getRandomInteger(StringArrayStorage_1.minimumRotationAmount, StringArrayStorage_1.maximumRotationAmount) + : 0; + } + get(value) { + return this.getOrSetIfDoesNotExist(value); + } + getRotationAmount() { + return this.rotationAmount; + } + getStorageId() { + return this.stringArrayStorageName; + } + getStorageName() { + return this.getStorageId(); + } + getStorageCallsWrapperName() { + return this.stringArrayStorageCallsWrapperName; + } + rotateStorage() { + if (!this.getLength()) { + return; + } + this.storage = new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()), this.rotationAmount)); + } + shuffleStorage() { + this.storage = new Map(this.arrayUtils + .shuffle(Array.from(this.storage.entries())) + .map(([value, stringArrayStorageItemData], index) => { + stringArrayStorageItemData.index = index; + return [value, stringArrayStorageItemData]; + }) + .sort(([, stringArrayStorageItemDataA], [, stringArrayStorageItemDataB]) => stringArrayStorageItemDataA.index - stringArrayStorageItemDataB.index)); + } + toString() { + return Array + .from(this.storage.values()) + .map((stringArrayStorageItemData) => { + return `'${this.escapeSequenceEncoder.encode(stringArrayStorageItemData.encodedValue, this.options.unicodeEscapeSequence)}'`; + }).toString(); + } + getOrSetIfDoesNotExist(value) { + const { encodedValue, decodeKey } = this.getEncodedValue(value); + const storedStringArrayStorageItemData = this.storage.get(encodedValue); + if (storedStringArrayStorageItemData) { + return storedStringArrayStorageItemData; + } + const stringArrayStorageItemData = { + encodedValue, + decodeKey, + value, + index: this.getLength() + }; + this.storage.set(encodedValue, stringArrayStorageItemData); + return stringArrayStorageItemData; + } + getEncodedValue(value) { + var _a; + switch (this.options.stringArrayEncoding) { + case StringArrayEncoding_1.StringArrayEncoding.Rc4: { + const decodeKey = this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys); + const encodedValue = this.cryptUtils.btoa(this.cryptUtils.rc4(value, decodeKey)); + const encodedValueSources = (_a = this.rc4EncodedValuesSourcesCache.get(encodedValue)) !== null && _a !== void 0 ? _a : []; + let encodedValueSourcesLength = encodedValueSources.length; + const shouldAddValueToSourcesCache = !encodedValueSourcesLength || !encodedValueSources.includes(value); + if (shouldAddValueToSourcesCache) { + encodedValueSources.push(value); + encodedValueSourcesLength++; + } + this.rc4EncodedValuesSourcesCache.set(encodedValue, encodedValueSources); + if (encodedValueSourcesLength > 1) { + return this.getEncodedValue(value); + } + return { encodedValue, decodeKey }; + } + case StringArrayEncoding_1.StringArrayEncoding.Base64: { + const decodeKey = null; + const encodedValue = this.cryptUtils.btoa(value); + return { encodedValue, decodeKey }; + } + default: { + const decodeKey = null; + const encodedValue = value; + return { encodedValue, decodeKey }; + } + } + } +}; +StringArrayStorage.minimumRotationAmount = 100; +StringArrayStorage.maximumRotationAmount = 500; +StringArrayStorage.rc4KeyLength = 4; +StringArrayStorage.rc4KeysCount = 50; +StringArrayStorage.stringArrayNameLength = 7; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayStorage.prototype, "stringArrayStorageName", void 0); +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", String) +], StringArrayStorage.prototype, "stringArrayStorageCallsWrapperName", void 0); +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], StringArrayStorage.prototype, "initialize", null); +StringArrayStorage = StringArrayStorage_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), + __param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), + __param(5, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), + __metadata("design:paramtypes", [typeof (_a = typeof TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory !== "undefined" && TIdentifierNamesGeneratorFactory_1.TIdentifierNamesGeneratorFactory) === "function" ? _a : Object, typeof (_b = typeof IArrayUtils_1.IArrayUtils !== "undefined" && IArrayUtils_1.IArrayUtils) === "function" ? _b : Object, typeof (_c = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _c : Object, typeof (_d = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _d : Object, typeof (_e = typeof ICryptUtils_1.ICryptUtils !== "undefined" && ICryptUtils_1.ICryptUtils) === "function" ? _e : Object, typeof (_f = typeof IEscapeSequenceEncoder_1.IEscapeSequenceEncoder !== "undefined" && IEscapeSequenceEncoder_1.IEscapeSequenceEncoder) === "function" ? _f : Object]) +], StringArrayStorage); +exports.StringArrayStorage = StringArrayStorage; + + +/***/ }), + +/***/ "./src/templates/AtobTemplate.ts": +/*!***************************************!*\ + !*** ./src/templates/AtobTemplate.ts ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function AtobTemplate() { + return ` + (function () { + {globalVariableTemplate} + + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + that.atob || ( + that.atob = function(input) { + const str = String(input).replace(/=+$/, ''); + let output = ''; + for ( + let bc = 0, bs, buffer, idx = 0; + buffer = str.charAt(idx++); + ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, + bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 + ) { + buffer = chars.indexOf(buffer); + } + return output; + } + ); + })(); + `; +} +exports.AtobTemplate = AtobTemplate; + + +/***/ }), + +/***/ "./src/templates/GlobalVariableNoEvalTemplate.ts": +/*!*******************************************************!*\ + !*** ./src/templates/GlobalVariableNoEvalTemplate.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function GlobalVariableNoEvalTemplate() { + return ` + const that = (typeof window !== 'undefined' + ? window + : (typeof process === 'object' && + typeof require === 'function' && + typeof global === 'object') + ? global + : this); + `; +} +exports.GlobalVariableNoEvalTemplate = GlobalVariableNoEvalTemplate; + + +/***/ }), + +/***/ "./src/templates/GlobalVariableTemplate1.ts": +/*!**************************************************!*\ + !*** ./src/templates/GlobalVariableTemplate1.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function GlobalVariableTemplate1() { + return ` + let that; + + try { + const getGlobal = Function('return (function() ' + '{}.constructor("return this")( )' + ');'); + + that = getGlobal(); + } catch (e) { + that = window; + } + `; +} +exports.GlobalVariableTemplate1 = GlobalVariableTemplate1; + + +/***/ }), + +/***/ "./src/templates/GlobalVariableTemplate2.ts": +/*!**************************************************!*\ + !*** ./src/templates/GlobalVariableTemplate2.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function GlobalVariableTemplate2() { + return ` + const getGlobal = function () { + let globalObject; + + try { + globalObject = Function('return (function() ' + '{}.constructor("return this")( )' + ');')(); + } catch (e) { + globalObject = window; + } + + return globalObject; + }; + const that = getGlobal(); + `; +} +exports.GlobalVariableTemplate2 = GlobalVariableTemplate2; + + +/***/ }), + +/***/ "./src/templates/Rc4Template.ts": +/*!**************************************!*\ + !*** ./src/templates/Rc4Template.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function Rc4Template() { + return ` + const rc4 = function (str, key) { + let s = [], j = 0, x, res = '', newStr = ''; + + str = atob(str); + + for (let k = 0, length = str.length; k < length; k++) { + newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2); + } + + str = decodeURIComponent(newStr); + + let i; + + for (i = 0; i < 256; i++) { + s[i] = i; + } + + for (i = 0; i < 256; i++) { + j = (j + s[i] + key.charCodeAt(i % key.length)) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + } + + i = 0; + j = 0; + + for (let y = 0; y < str.length; y++) { + i = (i + 1) % 256; + j = (j + s[i]) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]); + } + + return res; + } + `; +} +exports.Rc4Template = Rc4Template; + + +/***/ }), + +/***/ "./src/templates/SingleNodeCallControllerTemplate.ts": +/*!***********************************************************!*\ + !*** ./src/templates/SingleNodeCallControllerTemplate.ts ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function SingleNodeCallControllerTemplate() { + return ` + const {singleNodeCallControllerFunctionName} = (function(){ + let firstCall = true; + + return function (context, fn){ + const rfn = firstCall ? function(){ + if(fn){ + const res = fn.apply(context, arguments); + fn = null; + return res; + } + } : function(){} + + firstCall = false; + + return rfn; + } + })(); + `; +} +exports.SingleNodeCallControllerTemplate = SingleNodeCallControllerTemplate; + + +/***/ }), + +/***/ "./src/templates/console-output-nodes/console-output-disable-expression-node/ConsoleOutputDisableExpressionTemplate.ts": +/*!*****************************************************************************************************************************!*\ + !*** ./src/templates/console-output-nodes/console-output-disable-expression-node/ConsoleOutputDisableExpressionTemplate.ts ***! + \*****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function ConsoleOutputDisableExpressionTemplate() { + return ` + const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () { + const func = function () {}; + + {globalVariableTemplate} + + if (!that.console) { + that.console = (function (func){ + const c = {}; + + c.log = func; + c.warn = func; + c.debug = func; + c.info = func; + c.error = func; + c.exception = func; + c.table = func; + c.trace = func; + + return c; + })(func); + } else { + that.console.log = func; + that.console.warn = func; + that.console.debug = func; + that.console.info = func; + that.console.error = func; + that.console.exception = func; + that.console.table = func; + that.console.trace = func; + } + }); + + {consoleLogDisableFunctionName}(); + `; +} +exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-call-node/DebugProtectionFunctionCallTemplate.ts": +/*!*************************************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-call-node/DebugProtectionFunctionCallTemplate.ts ***! + \*************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebugProtectionFunctionCallTemplate() { + return ` + (function () { + {singleNodeCallControllerFunctionName}( + this, + function () { + const regExp1 = new RegExp('function *\\\\( *\\\\)'); + const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i'); + + const result = {debugProtectionFunctionName}('init'); + + if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) { + result('0'); + } else { + {debugProtectionFunctionName}(); + } + } + )(); + })(); + `; +} +exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts": +/*!*********************************************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts ***! + \*********************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebugProtectionFunctionIntervalTemplate() { + return ` + setInterval(function () { + {debugProtectionFunctionName}(); + }, 4000); + `; +} +exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts": +/*!****************************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebugProtectionFunctionTemplate() { + return ` + function {debugProtectionFunctionName} (ret) { + function debuggerProtection (counter) { + + {debuggerTemplate} + + debuggerProtection(++counter); + } + + try { + if (ret) { + return debuggerProtection; + } else { + debuggerProtection(0); + } + } catch (y) {} + } + `; +} +exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplate.ts": +/*!*************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplate.ts ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebuggerTemplate() { + return ` + if (typeof counter === 'string') { + return (function (arg) {}.constructor('while (true) {}').apply('counter')); + } else { + if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) { + (function () {return true;}.constructor('debu' + 'gger').call('action')); + } else { + (function () {return false;}.constructor('debu' + 'gger').apply('stateObject')); + } + + } + `; +} +exports.DebuggerTemplate = DebuggerTemplate; + + +/***/ }), + +/***/ "./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplateNoEval.ts": +/*!*******************************************************************************************************!*\ + !*** ./src/templates/debug-protection-nodes/debug-protection-function-node/DebuggerTemplateNoEval.ts ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DebuggerTemplateNoEval() { + return ` + if (typeof counter === 'string') { + const func = function () { + while (true) {} + }; + + return func(); + } else { + if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) { + debugger; + } else { + debugger; + } + + } + `; +} +exports.DebuggerTemplateNoEval = DebuggerTemplateNoEval; + + +/***/ }), + +/***/ "./src/templates/domain-lock-nodes/domain-lock-node/DomainLockNodeTemplate.ts": +/*!************************************************************************************!*\ + !*** ./src/templates/domain-lock-nodes/domain-lock-node/DomainLockNodeTemplate.ts ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function DomainLockNodeTemplate() { + return ` + const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () { + + {globalVariableTemplate} + + const func = function () { + return { + key: 'item', + value: 'attribute', + getAttribute: function () { + for (let i = 0; i < 1000; i--) { + const isPositive = i > 0; + + switch (isPositive) { + case true: + return this.item + '_' + this.value + '_' + i; + default: + this.item + '_' + this.value; + } + } + }() + }; + }; + + const regExp = new RegExp("[{diff}]", "g"); + const domains = "{domains}".replace(regExp, "").split(";"); + let document; + let domain; + let location; + let hostname; + + for (let d in that) { + if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) { + document = d; + + break; + } + } + + for (let d1 in that[document]) { + if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) { + domain = d1; + + break; + } + } + + if (!("~" > domain)) { + for (let d2 in that[document]) { + if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) { + location = d2; + + break; + } + } + + for (let d3 in that[document][location]) { + if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) { + hostname = d3; + + break; + } + } + } + + if (!document || !that[document]) { + return; + } + + const documentDomain = that[document][domain]; + const documentLocationHostName = !!that[document][location] && that[document][location][hostname]; + const currentDomain = documentDomain || documentLocationHostName; + + if (!currentDomain) { + return; + } + + let ok = false; + + for (let i = 0; i < domains.length; i++) { + const domain = domains[i]; + const position = currentDomain.length - domain.length; + const lastIndex = currentDomain.indexOf(domain, position); + const endsWith = lastIndex !== -1 && lastIndex === position; + + if (endsWith) { + if (currentDomain.length == domain.length || domain.indexOf(".") === 0) { + ok = true; + } + } + } + + if (!ok) { + data; + } else { + return; + } + + func(); + }); + + {domainLockFunctionName}(); + `; +} +exports.DomainLockNodeTemplate = DomainLockNodeTemplate; + + +/***/ }), + +/***/ "./src/templates/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts": +/*!*************************************************************************************************!*\ + !*** ./src/templates/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function SelfDefendingTemplate(escapeSequenceEncoder) { + return ` + const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () { + const func1 = function(){return 'dev';}, + func2 = function () { + return 'window'; + }; + + const test1 = function () { + const regExp = new RegExp('${escapeSequenceEncoder.encode('\\w+ *\\(\\) *{\\w+ *[\'|"].+[\'|"];? *}', true)}'); + + return !regExp.test(func1.toString()); + }; + + const test2 = function () { + const regExp = new RegExp('${escapeSequenceEncoder.encode('(\\\\[x|u](\\w){2,4})+', true)}'); + + return regExp.test(func2.toString()); + }; + + const recursiveFunc1 = function (string) { + const i = ~-1 >> 1 + 255 % 0; + + if (string.indexOf('i' === i)) { + recursiveFunc2(string) + } + }; + + const recursiveFunc2 = function (string) { + const i = ~-4 >> 1 + 255 % 0; + + if (string.indexOf((true+"")[3]) !== i) { + recursiveFunc1(string) + } + }; + + if (!test1()) { + if (!test2()) { + recursiveFunc1('indеxOf'); + } else { + recursiveFunc1('indexOf'); + } + } else { + recursiveFunc1('indеxOf'); + } + }) + + {selfDefendingFunctionName}(); + `; +} +exports.SelfDefendingTemplate = SelfDefendingTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-calls-wrapper/SelfDefendingTemplate.ts": +/*!**********************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-calls-wrapper/SelfDefendingTemplate.ts ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function SelfDefendingTemplate(randomGenerator, escapeSequenceEncoder) { + const identifierLength = 6; + const rc4BytesIdentifier = randomGenerator.getRandomString(identifierLength); + const statesIdentifier = randomGenerator.getRandomString(identifierLength); + const newStateIdentifier = randomGenerator.getRandomString(identifierLength); + const firstStateIdentifier = randomGenerator.getRandomString(identifierLength); + const secondStateIdentifier = randomGenerator.getRandomString(identifierLength); + const checkStateIdentifier = randomGenerator.getRandomString(identifierLength); + const runStateIdentifier = randomGenerator.getRandomString(identifierLength); + const getStateIdentifier = randomGenerator.getRandomString(identifierLength); + const stateResultIdentifier = randomGenerator.getRandomString(identifierLength); + return ` + const StatesClass = function (${rc4BytesIdentifier}) { + this.${rc4BytesIdentifier} = ${rc4BytesIdentifier}; + this.${statesIdentifier} = [1, 0, 0]; + this.${newStateIdentifier} = function(){return 'newState';}; + this.${firstStateIdentifier} = '${escapeSequenceEncoder.encode('\\w+ *\\(\\) *{\\w+ *', true)}'; + this.${secondStateIdentifier} = '${escapeSequenceEncoder.encode('[\'|"].+[\'|"];? *}', true)}'; + }; + + StatesClass.prototype.${checkStateIdentifier} = function () { + const regExp = new RegExp(this.${firstStateIdentifier} + this.${secondStateIdentifier}); + const expression = regExp.test(this.${newStateIdentifier}.toString()) + ? --this.${statesIdentifier}[1] + : --this.${statesIdentifier}[0]; + + return this.${runStateIdentifier}(expression); + }; + + StatesClass.prototype.${runStateIdentifier} = function (${stateResultIdentifier}) { + if (!Boolean(~${stateResultIdentifier})) { + return ${stateResultIdentifier}; + } + + return this.${getStateIdentifier}(this.${rc4BytesIdentifier}); + }; + + StatesClass.prototype.${getStateIdentifier} = function (${rc4BytesIdentifier}) { + for (let i = 0, len = this.${statesIdentifier}.length; i < len; i++) { + this.${statesIdentifier}.push(Math.round(Math.random())); + len = this.${statesIdentifier}.length; + } + + return ${rc4BytesIdentifier}(this.${statesIdentifier}[0]); + }; + + new StatesClass({stringArrayCallsWrapperName}).${checkStateIdentifier}(); + `; +} +exports.SelfDefendingTemplate = SelfDefendingTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayBase64DecodeNodeTemplate.ts": +/*!************************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayBase64DecodeNodeTemplate.ts ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayBase64DecodeNodeTemplate(randomGenerator) { + const identifierLength = 6; + const initializedIdentifier = randomGenerator.getRandomString(identifierLength); + const base64DecodeFunctionIdentifier = randomGenerator.getRandomString(identifierLength); + const dataIdentifier = randomGenerator.getRandomString(identifierLength); + return ` + if ({stringArrayCallsWrapperName}.${initializedIdentifier} === undefined) { + {atobPolyfill} + + {stringArrayCallsWrapperName}.${base64DecodeFunctionIdentifier} = function (str) { + const string = atob(str); + let newStringChars = []; + + for (let i = 0, length = string.length; i < length; i++) { + newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2); + } + + return decodeURIComponent(newStringChars); + }; + + {stringArrayCallsWrapperName}.${dataIdentifier} = {}; + + {stringArrayCallsWrapperName}.${initializedIdentifier} = true; + } + + const cachedValue = {stringArrayCallsWrapperName}.${dataIdentifier}[index]; + + if (cachedValue === undefined) { + {selfDefendingCode} + + value = {stringArrayCallsWrapperName}.${base64DecodeFunctionIdentifier}(value); + {stringArrayCallsWrapperName}.${dataIdentifier}[index] = value; + } else { + value = cachedValue; + } + `; +} +exports.StringArrayBase64DecodeNodeTemplate = StringArrayBase64DecodeNodeTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayCallsWrapperTemplate.ts": +/*!********************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayCallsWrapperTemplate.ts ***! + \********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayCallsWrapperTemplate() { + return ` + const {stringArrayCallsWrapperName} = function (index, key) { + index = index - 0; + + let value = {stringArrayName}[index]; + + {decodeNodeTemplate} + + return value; + }; + `; +} +exports.StringArrayCallsWrapperTemplate = StringArrayCallsWrapperTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayRC4DecodeNodeTemplate.ts": +/*!*********************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-calls-wrapper/StringArrayRC4DecodeNodeTemplate.ts ***! + \*********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayRc4DecodeNodeTemplate(randomGenerator) { + const identifierLength = 6; + const initializedIdentifier = randomGenerator.getRandomString(identifierLength); + const rc4Identifier = randomGenerator.getRandomString(identifierLength); + const dataIdentifier = randomGenerator.getRandomString(identifierLength); + const onceIdentifier = randomGenerator.getRandomString(identifierLength); + return ` + if ({stringArrayCallsWrapperName}.${initializedIdentifier} === undefined) { + {atobPolyfill} + + {rc4Polyfill} + {stringArrayCallsWrapperName}.${rc4Identifier} = rc4; + + {stringArrayCallsWrapperName}.${dataIdentifier} = {}; + + {stringArrayCallsWrapperName}.${initializedIdentifier} = true; + } + + const cachedValue = {stringArrayCallsWrapperName}.${dataIdentifier}[index]; + + if (cachedValue === undefined) { + if ({stringArrayCallsWrapperName}.${onceIdentifier} === undefined) { + {selfDefendingCode} + + {stringArrayCallsWrapperName}.${onceIdentifier} = true; + } + + value = {stringArrayCallsWrapperName}.${rc4Identifier}(value, key); + {stringArrayCallsWrapperName}.${dataIdentifier}[index] = value; + } else { + value = cachedValue; + } + `; +} +exports.StringArrayRc4DecodeNodeTemplate = StringArrayRc4DecodeNodeTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-node/StringArrayTemplate.ts": +/*!***********************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-node/StringArrayTemplate.ts ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayTemplate() { + return ` + const {stringArrayName} = [{stringArray}]; + `; +} +exports.StringArrayTemplate = StringArrayTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-rotate-function-node/SelfDefendingTemplate.ts": +/*!*****************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-rotate-function-node/SelfDefendingTemplate.ts ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function SelfDefendingTemplate(escapeSequenceEncoder) { + return ` + const selfDefendingFunc = function () { + const object = { + data: { + key: 'cookie', + value: 'timeout' + }, + setCookie: function (options, name, value, document) { + document = document || {}; + + let updatedCookie = name + "=" + value; + let i = 0; + + for (let i = 0, len = options.length; i < len; i++) { + const propName = options[i]; + + updatedCookie += "; " + propName; + + const propValue = options[propName]; + + options.push(propValue); + len = options.length; + + if (propValue !== true) { + updatedCookie += "=" + propValue; + } + } + + document['cookie'] = updatedCookie; + }, + removeCookie: function(){return 'dev';}, + getCookie: function (document, name) { + document = document || function (value) { return value }; + const matches = document(new RegExp( + "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" + )); + + const func = function (param1, param2) { + param1(++param2); + }; + + func({whileFunctionName}, {timesName}); + + return matches ? decodeURIComponent(matches[1]) : undefined; + } + }; + + const test1 = function () { + const regExp = new RegExp('${escapeSequenceEncoder.encode('\\w+ *\\(\\) *{\\w+ *[\'|"].+[\'|"];? *}', true)}'); + + return regExp.test(object.removeCookie.toString()); + }; + + object['updateCookie'] = test1; + + let cookie = ''; + const result = object['updateCookie'](); + + if (!result) { + object['setCookie'](['*'], 'counter', 1); + } else if (result) { + cookie = object['getCookie'](null, 'counter'); + } else { + object['removeCookie'](); + } + }; + + selfDefendingFunc(); + `; +} +exports.SelfDefendingTemplate = SelfDefendingTemplate; + + +/***/ }), + +/***/ "./src/templates/string-array-nodes/string-array-rotate-function-node/StringArrayRotateFunctionTemplate.ts": +/*!*****************************************************************************************************************!*\ + !*** ./src/templates/string-array-nodes/string-array-rotate-function-node/StringArrayRotateFunctionTemplate.ts ***! + \*****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function StringArrayRotateFunctionTemplate() { + return ` + (function (array, {timesName}) { + const {whileFunctionName} = function (times) { + while (--times) { + array['push'](array['shift']()); + } + }; + + {code} + })({stringArrayName}, 0x{stringArrayRotationAmount}); + `; +} +exports.StringArrayRotateFunctionTemplate = StringArrayRotateFunctionTemplate; + + +/***/ }), + +/***/ "./src/types/container/calls-graph-analyzer/TCalleeDataExtractorFactory.ts": +/*!*********************************************************************************!*\ + !*** ./src/types/container/calls-graph-analyzer/TCalleeDataExtractorFactory.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts": +/*!***************************************************************************!*\ + !*** ./src/types/container/custom-nodes/TControlFlowCustomNodeFactory.ts ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TCustomNodeFactory.ts": +/*!****************************************************************!*\ + !*** ./src/types/container/custom-nodes/TCustomNodeFactory.ts ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TCustomNodeGroupFactory.ts": +/*!*********************************************************************!*\ + !*** ./src/types/container/custom-nodes/TCustomNodeGroupFactory.ts ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TDeadNodeInjectionCustomNodeFactory.ts": +/*!*********************************************************************************!*\ + !*** ./src/types/container/custom-nodes/TDeadNodeInjectionCustomNodeFactory.ts ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/custom-nodes/TObjectExpressionKeysTransformerCustomNodeFactory.ts": +/*!***********************************************************************************************!*\ + !*** ./src/types/container/custom-nodes/TObjectExpressionKeysTransformerCustomNodeFactory.ts ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts": +/*!****************************************************************************!*\ + !*** ./src/types/container/generators/TIdentifierNamesGeneratorFactory.ts ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TControlFlowReplacerFactory.ts": +/*!******************************************************************************!*\ + !*** ./src/types/container/node-transformers/TControlFlowReplacerFactory.ts ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TControlFlowStorageFactory.ts": +/*!*****************************************************************************!*\ + !*** ./src/types/container/node-transformers/TControlFlowStorageFactory.ts ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts": +/*!****************************************************************************************!*\ + !*** ./src/types/container/node-transformers/TIdentifierObfuscatingReplacerFactory.ts ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TLiteralObfuscatingReplacerFactory.ts": +/*!*************************************************************************************!*\ + !*** ./src/types/container/node-transformers/TLiteralObfuscatingReplacerFactory.ts ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TNodeTransformerFactory.ts": +/*!**************************************************************************!*\ + !*** ./src/types/container/node-transformers/TNodeTransformerFactory.ts ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TObfuscatingGuardFactory.ts": +/*!***************************************************************************!*\ + !*** ./src/types/container/node-transformers/TObfuscatingGuardFactory.ts ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/node-transformers/TObjectExpressionExtractorFactory.ts": +/*!************************************************************************************!*\ + !*** ./src/types/container/node-transformers/TObjectExpressionExtractorFactory.ts ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/container/source-code/TObfuscatedCodeFactory.ts": +/*!*******************************************************************!*\ + !*** ./src/types/container/source-code/TObfuscatedCodeFactory.ts ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/options/TInputOptions.ts": +/*!********************************************!*\ + !*** ./src/types/options/TInputOptions.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/options/TStringArrayEncoding.ts": +/*!***************************************************!*\ + !*** ./src/types/options/TStringArrayEncoding.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/storages/TControlFlowStorage.ts": +/*!***************************************************!*\ + !*** ./src/types/storages/TControlFlowStorage.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/types/storages/TCustomNodeGroupStorage.ts": +/*!*******************************************************!*\ + !*** ./src/types/storages/TCustomNodeGroupStorage.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); + + +/***/ }), + +/***/ "./src/utils/ArrayUtils.ts": +/*!*********************************!*\ + !*** ./src/utils/ArrayUtils.ts ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +let ArrayUtils = class ArrayUtils { + constructor(randomGenerator) { + this.randomGenerator = randomGenerator; + } + createWithRange(length) { + const range = []; + for (let i = 0; i < length; i++) { + range.push(i); + } + return range; + } + findMostOccurringElement(array) { + var _a; + const arrayLength = array.length; + if (!arrayLength) { + return null; + } + const elementsMap = {}; + let mostOccurringElement = array[0]; + let mostOccurringElementCount = 1; + for (const element of array) { + const currentElementCount = (_a = elementsMap[element]) !== null && _a !== void 0 ? _a : 0; + const updatedElementCount = currentElementCount + 1; + if (updatedElementCount > mostOccurringElementCount) { + mostOccurringElement = element; + mostOccurringElementCount = updatedElementCount; + } + elementsMap[element] = updatedElementCount; + } + return mostOccurringElement; + } + rotate(array, times) { + if (!array.length) { + throw new ReferenceError('Cannot rotate empty array.'); + } + if (times <= 0) { + return array; + } + const newArray = array; + let temp; + while (times--) { + temp = newArray.pop(); + if (temp) { + newArray.unshift(temp); + } + } + return newArray; + } + shuffle(array) { + const shuffledArray = [...array]; + for (let i = shuffledArray.length; i; i--) { + const j = Math.floor(this.randomGenerator.getMathRandom() * i); + [shuffledArray[i - 1], shuffledArray[j]] = [shuffledArray[j], shuffledArray[i - 1]]; + } + return shuffledArray; + } +}; +ArrayUtils = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object]) +], ArrayUtils); +exports.ArrayUtils = ArrayUtils; + + +/***/ }), + +/***/ "./src/utils/CryptUtils.ts": +/*!*********************************!*\ + !*** ./src/utils/CryptUtils.ts ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const IRandomGenerator_1 = __webpack_require__(/*! ../interfaces/utils/IRandomGenerator */ "./src/interfaces/utils/IRandomGenerator.ts"); +const RandomGenerator_1 = __webpack_require__(/*! ./RandomGenerator */ "./src/utils/RandomGenerator.ts"); +const Utils_1 = __webpack_require__(/*! ./Utils */ "./src/utils/Utils.ts"); +let CryptUtils = class CryptUtils { + constructor(randomGenerator) { + this.randomGenerator = randomGenerator; + } + btoa(string) { + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + let output = ''; + string = encodeURIComponent(string).replace(/%([0-9A-F]{2})/g, (match, p1) => { + return String.fromCharCode(parseInt(`${Utils_1.Utils.hexadecimalPrefix}${p1}`, 16)); + }); + for (let block, charCode, idx = 0, map = chars; string.charAt(idx | 0) || (map = '=', idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { + charCode = string.charCodeAt(idx += 3 / 4); + if (charCode > 0xFF) { + throw new Error('\'btoa\' failed: The string to be encoded contains characters outside of the Latin1 range.'); + } + block = block << 8 | charCode; + } + return output; + } + hideString(str, length) { + const escapeRegExp = (s) => s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + const randomMerge = (s1, s2) => { + let i1 = -1; + let i2 = -1; + let result = ''; + while (i1 < s1.length || i2 < s2.length) { + if (this.randomGenerator.getMathRandom() < 0.5 && i2 < s2.length) { + result += s2.charAt(++i2); + } + else { + result += s1.charAt(++i1); + } + } + return result; + }; + const randomString = this.randomGenerator.getRandomGenerator().string({ + length: length, + pool: RandomGenerator_1.RandomGenerator.randomGeneratorPool + }); + let randomStringDiff = randomString.replace(new RegExp(`[${escapeRegExp(str)}]`, 'g'), ''); + const randomStringDiffArray = randomStringDiff.split(''); + this.randomGenerator.getRandomGenerator().shuffle(randomStringDiffArray); + randomStringDiff = randomStringDiffArray.join(''); + return [randomMerge(str, randomStringDiff), randomStringDiff]; + } + rc4(string, key) { + const s = []; + let j = 0; + let x; + let result = ''; + for (var i = 0; i < 256; i++) { + s[i] = i; + } + for (i = 0; i < 256; i++) { + j = (j + s[i] + key.charCodeAt(i % key.length)) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + } + i = 0; + j = 0; + for (let y = 0; y < string.length; y++) { + i = (i + 1) % 256; + j = (j + s[i]) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + result += String.fromCharCode(string.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]); + } + return result; + } +}; +CryptUtils = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), + __metadata("design:paramtypes", [typeof (_a = typeof IRandomGenerator_1.IRandomGenerator !== "undefined" && IRandomGenerator_1.IRandomGenerator) === "function" ? _a : Object]) +], CryptUtils); +exports.CryptUtils = CryptUtils; + + +/***/ }), + +/***/ "./src/utils/EscapeSequenceEncoder.ts": +/*!********************************************!*\ + !*** ./src/utils/EscapeSequenceEncoder.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +let EscapeSequenceEncoder = class EscapeSequenceEncoder { + constructor() { + this.stringsCache = new Map(); + } + encode(string, encodeAllSymbols) { + const cacheKey = `${string}-${String(encodeAllSymbols)}`; + if (this.stringsCache.has(cacheKey)) { + return this.stringsCache.get(cacheKey); + } + const radix = 16; + const replaceRegExp = new RegExp('[\\s\\S]', 'g'); + const escapeSequenceRegExp = new RegExp('[\'\"\\\\\\s]'); + const regExp = new RegExp('[\\x00-\\x7F]'); + let prefix; + let template; + const result = string.replace(replaceRegExp, (character) => { + if (!encodeAllSymbols && !escapeSequenceRegExp.exec(character)) { + return character; + } + if (regExp.exec(character)) { + prefix = '\\x'; + template = '00'; + } + else { + prefix = '\\u'; + template = '0000'; + } + return `${prefix}${(template + character.charCodeAt(0).toString(radix)).slice(-template.length)}`; + }); + this.stringsCache.set(cacheKey, result); + this.stringsCache.set(`${result}-${String(encodeAllSymbols)}`, result); + return result; + } +}; +EscapeSequenceEncoder = __decorate([ + inversify_1.injectable() +], EscapeSequenceEncoder); +exports.EscapeSequenceEncoder = EscapeSequenceEncoder; + + +/***/ }), + +/***/ "./src/utils/LevelledTopologicalSorter.ts": +/*!************************************************!*\ + !*** ./src/utils/LevelledTopologicalSorter.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +let LevelledTopologicalSorter = class LevelledTopologicalSorter { + constructor() { + this.graph = new Map(); + } + add(precedent, consequent = null) { + if (consequent !== null) { + return this.link(precedent, consequent); + } + return this.register(precedent); + } + sort() { + const consequents = Array.from(this.graph.keys()); + const results = []; + const marks = {}; + for (const consequent of consequents) { + if (marks[consequent] !== undefined) { + continue; + } + this.visit(results, marks, consequent); + } + return results; + } + sortByGroups() { + this.sort(); + const resultItemsGroups = []; + while (this.hasNodes()) { + const rootNodes = this.findRootNodes(); + resultItemsGroups.push(rootNodes); + for (const rootNode of rootNodes) { + this.delete(rootNode); + } + } + return resultItemsGroups; + } + delete(consequent) { + const precedents = this.getPrecedents(consequent); + if (precedents.length) { + throw new Error(`Unable to remove non-root node: ${consequent}`); + } + this.graph.delete(consequent); + const precedentsGroups = Array.from(this.graph.values()); + for (const precedentsGroup of precedentsGroups) { + const precedentsCount = precedentsGroup.length - 1; + for (let index = precedentsCount; index >= 0; index = index - 1) { + if (precedentsGroup[index] !== consequent) { + continue; + } + precedentsGroup.splice(index, 1); + } + } + } + findRootNodes() { + const consequents = Array.from(this.graph.keys()); + const rootNodes = []; + for (const consequent of consequents) { + if (!this.hasPrecedents(consequent)) { + rootNodes.push(consequent); + } + } + return rootNodes; + } + getPrecedents(consequent) { + const precedents = this.graph.get(consequent); + if (!precedents) { + throw new Error(`Unknown node: ${consequent}`); + } + return precedents; + } + hasNodes() { + return this.graph.size > 0; + } + hasPrecedents(consequent) { + return this.getPrecedents(consequent).length > 0; + } + link(precedent, consequent) { + this.register(precedent); + this.register(consequent); + const target = this.graph.get(consequent); + if (target && !target.includes(precedent)) { + target.push(precedent); + } + return this; + } + register(name) { + if (!this.graph.has(name)) { + this.graph.set(name, []); + } + return this; + } + visit(results, marks, name) { + const mark = marks[name]; + if (mark === 'visiting') { + throw new Error(`Detected cycle involving node: ${name}`); + } + if (mark) { + return; + } + marks[name] = 'visiting'; + const precedents = this.getPrecedents(name); + for (const precedent of precedents) { + this.visit(results, marks, precedent); + } + marks[name] = 'ok'; + results.push(name); + return; + } +}; +LevelledTopologicalSorter = __decorate([ + inversify_1.injectable() +], LevelledTopologicalSorter); +exports.LevelledTopologicalSorter = LevelledTopologicalSorter; + + +/***/ }), + +/***/ "./src/utils/NodeTransformerNamesGroupsBuilder.ts": +/*!********************************************************!*\ + !*** ./src/utils/NodeTransformerNamesGroupsBuilder.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const ILevelledTopologicalSorter_1 = __webpack_require__(/*! ../interfaces/utils/ILevelledTopologicalSorter */ "./src/interfaces/utils/ILevelledTopologicalSorter.ts"); +let NodeTransformerNamesGroupsBuilder = class NodeTransformerNamesGroupsBuilder { + constructor(levelledTopologicalSorter) { + this.levelledTopologicalSorter = levelledTopologicalSorter; + } + build(normalizedNodeTransformers) { + const nodeTransformerNames = Object.keys(normalizedNodeTransformers); + const relationEdges = this.buildNodeTransformersRelationEdges(nodeTransformerNames, normalizedNodeTransformers); + for (const [precedent, consequent] of relationEdges) { + this.levelledTopologicalSorter.add(precedent, consequent); + } + return this.levelledTopologicalSorter.sortByGroups(); + } + buildNodeTransformersRelationEdges(nodeTransformerNames, normalizedNodeTransformers) { + const relationEdges = []; + for (const nodeTransformerName of nodeTransformerNames) { + const nodeTransformer = normalizedNodeTransformers[nodeTransformerName]; + const runAfterRelations = nodeTransformer.runAfter; + if (!runAfterRelations || !runAfterRelations.length) { + relationEdges.push([nodeTransformerName, null]); + continue; + } + for (const runAfterRelation of runAfterRelations) { + const isUnknownRelation = normalizedNodeTransformers[runAfterRelation] === undefined; + if (isUnknownRelation) { + relationEdges.push([nodeTransformerName, null]); + continue; + } + relationEdges.push([runAfterRelation, nodeTransformerName]); + } + } + return relationEdges; + } +}; +NodeTransformerNamesGroupsBuilder = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ILevelledTopologicalSorter)), + __metadata("design:paramtypes", [typeof (_a = typeof ILevelledTopologicalSorter_1.ILevelledTopologicalSorter !== "undefined" && ILevelledTopologicalSorter_1.ILevelledTopologicalSorter) === "function" ? _a : Object]) +], NodeTransformerNamesGroupsBuilder); +exports.NodeTransformerNamesGroupsBuilder = NodeTransformerNamesGroupsBuilder; + + +/***/ }), + +/***/ "./src/utils/NumberUtils.ts": +/*!**********************************!*\ + !*** ./src/utils/NumberUtils.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class NumberUtils { + static toHex(dec) { + const radix = 16; + return dec.toString(radix); + } + static isCeil(number) { + return number % 1 === 0; + } +} +exports.NumberUtils = NumberUtils; + + +/***/ }), + +/***/ "./src/utils/RandomGenerator.ts": +/*!**************************************!*\ + !*** ./src/utils/RandomGenerator.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var RandomGenerator_1, _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +const inversify_1 = __webpack_require__(/*! inversify */ "inversify"); +const ServiceIdentifiers_1 = __webpack_require__(/*! ../container/ServiceIdentifiers */ "./src/container/ServiceIdentifiers.ts"); +const md5_1 = __importDefault(__webpack_require__(/*! md5 */ "md5")); +const chance_1 = __webpack_require__(/*! chance */ "chance"); +const IOptions_1 = __webpack_require__(/*! ../interfaces/options/IOptions */ "./src/interfaces/options/IOptions.ts"); +const ISourceCode_1 = __webpack_require__(/*! ../interfaces/source-code/ISourceCode */ "./src/interfaces/source-code/ISourceCode.ts"); +const Initializable_1 = __webpack_require__(/*! ../decorators/Initializable */ "./src/decorators/Initializable.ts"); +let RandomGenerator = RandomGenerator_1 = class RandomGenerator { + constructor(sourceCode, options) { + this.sourceCode = sourceCode; + this.options = options; + } + initialize() { + this.randomGenerator = new chance_1.Chance(this.getRawSeed()); + } + getMathRandom() { + return this.getRandomInteger(0, 99999) / 100000; + } + getRandomGenerator() { + return this.randomGenerator; + } + getRandomInteger(min, max) { + return this.getRandomGenerator().integer({ + min: min, + max: max + }); + } + getRandomString(length, pool = RandomGenerator_1.randomGeneratorPool) { + return this.getRandomGenerator().string({ length, pool }); + } + getInputSeed() { + return this.options.seed.toString(); + } + getRawSeed() { + const inputSeed = this.getInputSeed(); + const inputSeedParts = `${inputSeed}`.split('|'); + if (inputSeedParts.length > 1) { + return inputSeed; + } + const sourceCodeMD5Hash = md5_1.default(this.sourceCode.getSourceCode()); + return `${inputSeed}|${sourceCodeMD5Hash}`; + } +}; +RandomGenerator.randomGeneratorPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; +__decorate([ + Initializable_1.initializable(), + __metadata("design:type", typeof (_a = typeof chance_1.Chance !== "undefined" && chance_1.Chance.Chance) === "function" ? _a : Object) +], RandomGenerator.prototype, "randomGenerator", void 0); +__decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], RandomGenerator.prototype, "initialize", null); +RandomGenerator = RandomGenerator_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ISourceCode)), + __param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), + __metadata("design:paramtypes", [typeof (_b = typeof ISourceCode_1.ISourceCode !== "undefined" && ISourceCode_1.ISourceCode) === "function" ? _b : Object, typeof (_c = typeof IOptions_1.IOptions !== "undefined" && IOptions_1.IOptions) === "function" ? _c : Object]) +], RandomGenerator); +exports.RandomGenerator = RandomGenerator; + + +/***/ }), + +/***/ "./src/utils/Utils.ts": +/*!****************************!*\ + !*** ./src/utils/Utils.ts ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +class Utils { + static extractDomainFrom(url) { + let domain; + if (url.includes('://') || url.indexOf('//') === 0) { + domain = url.split('/')[2]; + } + else { + domain = url.split('/')[0]; + } + domain = domain.split(':')[0]; + return domain; + } +} +exports.Utils = Utils; +Utils.hexadecimalPrefix = '0x'; + + +/***/ }), + +/***/ "@gradecam/tsenum": +/*!***********************************!*\ + !*** external "@gradecam/tsenum" ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("@gradecam/tsenum"); + +/***/ }), + +/***/ "acorn": +/*!************************!*\ + !*** external "acorn" ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("acorn"); + +/***/ }), + +/***/ "acorn-import-meta": +/*!************************************!*\ + !*** external "acorn-import-meta" ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("acorn-import-meta"); + +/***/ }), + +/***/ "chalk": +/*!************************!*\ + !*** external "chalk" ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("chalk"); + +/***/ }), + +/***/ "chance": +/*!*************************!*\ + !*** external "chance" ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("chance"); + +/***/ }), + +/***/ "class-validator": +/*!**********************************!*\ + !*** external "class-validator" ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("class-validator"); + +/***/ }), + +/***/ "escodegen": +/*!****************************!*\ + !*** external "escodegen" ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("escodegen"); + +/***/ }), + +/***/ "eslint-scope": +/*!*******************************!*\ + !*** external "eslint-scope" ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("eslint-scope"); + +/***/ }), + +/***/ "estraverse": +/*!*****************************!*\ + !*** external "estraverse" ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("estraverse"); + +/***/ }), + +/***/ "eventemitter3": +/*!********************************!*\ + !*** external "eventemitter3" ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("eventemitter3"); + +/***/ }), + +/***/ "fast-deep-equal": +/*!**********************************!*\ + !*** external "fast-deep-equal" ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("fast-deep-equal"); + +/***/ }), + +/***/ "inversify": +/*!****************************!*\ + !*** external "inversify" ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("inversify"); + +/***/ }), + +/***/ "js-string-escape": +/*!***********************************!*\ + !*** external "js-string-escape" ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("js-string-escape"); + +/***/ }), + +/***/ "md5": +/*!**********************!*\ + !*** external "md5" ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("md5"); + +/***/ }), + +/***/ "reflect-metadata": +/*!***********************************!*\ + !*** external "reflect-metadata" ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("reflect-metadata"); + +/***/ }), + +/***/ "string-template": +/*!**********************************!*\ + !*** external "string-template" ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("string-template"); + +/***/ }) + +/******/ }); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/src/cli/JavaScriptObfuscatorCLI.ts b/src/cli/JavaScriptObfuscatorCLI.ts index 70b586fa..2ef88021 100644 --- a/src/cli/JavaScriptObfuscatorCLI.ts +++ b/src/cli/JavaScriptObfuscatorCLI.ts @@ -3,7 +3,6 @@ import * as path from 'path'; import { TInputCLIOptions } from '../types/options/TInputCLIOptions'; import { TInputOptions } from '../types/options/TInputOptions'; -import { TSourceCodeData } from '../types/cli/TSourceCodeData'; import { IFileData } from '../interfaces/cli/IFileData'; import { IInitializable } from '../interfaces/IInitializable'; @@ -76,6 +75,33 @@ export class JavaScriptObfuscatorCLI implements IInitializable { this.arguments = argv.slice(2); } + /** + * @param {TInputCLIOptions} inputOptions + * @param {string} inputCodePath + * @returns {TInputOptions} + */ + private static buildOptions ( + inputOptions: TInputCLIOptions, + inputCodePath: string + ): TInputOptions { + const inputCLIOptions: TInputOptions = JavaScriptObfuscatorCLI.filterOptions(inputOptions); + const configFilePath: string | undefined = inputOptions.config; + const configFileLocation: string = configFilePath ? path.resolve(configFilePath, '.') : ''; + const configFileOptions: TInputOptions = configFileLocation ? CLIUtils.getUserConfig(configFileLocation) : {}; + const inputFileName: string = path.basename(inputCodePath); + const inputFilePath: string = inputCodePath; + + console.log(inputFilePath, inputFileName); + + return { + ...DEFAULT_PRESET, + ...configFileOptions, + ...inputCLIOptions, + inputFileName, + inputFilePath + }; + } + /** * @param {TObject} options * @returns {TInputOptions} @@ -159,32 +185,12 @@ export class JavaScriptObfuscatorCLI implements IInitializable { return; } - const sourceCodeData: TSourceCodeData = new SourceCodeReader(this.inputCLIOptions) + const sourceCodeData: IFileData[] = new SourceCodeReader(this.inputCLIOptions) .readSourceCode(this.inputPath); this.processSourceCodeData(sourceCodeData); } - /** - * @returns {TInputOptions} - */ - private buildOptions (): TInputOptions { - const inputCLIOptions: TInputOptions = JavaScriptObfuscatorCLI.filterOptions(this.inputCLIOptions); - const configFilePath: string | undefined = this.inputCLIOptions.config; - const configFileLocation: string = configFilePath ? path.resolve(configFilePath, '.') : ''; - const configFileOptions: TInputOptions = configFileLocation ? CLIUtils.getUserConfig(configFileLocation) : {}; - const inputFileName: string = path.basename(this.inputPath); - const inputFilePath: string = this.inputPath; - - return { - ...DEFAULT_PRESET, - ...configFileOptions, - ...inputCLIOptions, - inputFileName, - inputFilePath - }; - } - private configureCommands (): void { this.commands .usage(' [options]') @@ -380,39 +386,32 @@ export class JavaScriptObfuscatorCLI implements IInitializable { } /** - * @param {TSourceCodeData} sourceCodeData + * @param {IFileData[]} sourceCodeData */ - private processSourceCodeData (sourceCodeData: TSourceCodeData): void { - const outputPath: string = this.inputCLIOptions.output - ? path.normalize(this.inputCLIOptions.output) - : ''; + private processSourceCodeData (sourceCodeData: IFileData[]): void { + sourceCodeData.forEach(({ filePath, content }: IFileData, index: number) => { + const outputCodePath: string = CLIUtils.getOutputCodePath(filePath, this.inputCLIOptions.output); - if (!Array.isArray(sourceCodeData)) { - const outputCodePath: string = outputPath || CLIUtils.getOutputCodePath(this.inputPath); - - this.processSourceCode(sourceCodeData, outputCodePath, null); - } else { - sourceCodeData.forEach(({ filePath, content }: IFileData, index: number) => { - const outputCodePath: string = outputPath - ? path.join(outputPath, filePath) - : CLIUtils.getOutputCodePath(filePath); - - this.processSourceCode(content, outputCodePath, index); - }); - } + this.processSourceCode(content, filePath, outputCodePath, index); + }); } /** * @param {string} sourceCode + * @param {string} inputCodePath * @param {string} outputCodePath * @param {number | null} sourceCodeIndex */ private processSourceCode ( sourceCode: string, + inputCodePath: string, outputCodePath: string, sourceCodeIndex: number | null ): void { - let options: TInputOptions = this.buildOptions(); + let options: TInputOptions = JavaScriptObfuscatorCLI.buildOptions( + this.inputCLIOptions, + inputCodePath + ); if (sourceCodeIndex !== null) { const baseIdentifiersPrefix: string = this.inputCLIOptions.identifiersPrefix diff --git a/src/cli/utils/CLIUtils.ts b/src/cli/utils/CLIUtils.ts index e63faef1..d9b52ac3 100644 --- a/src/cli/utils/CLIUtils.ts +++ b/src/cli/utils/CLIUtils.ts @@ -11,16 +11,29 @@ import { JavaScriptObfuscatorCLI } from '../JavaScriptObfuscatorCLI'; export class CLIUtils { /** * @param {string} inputPath + * @param {string | null} baseOutputPath * @returns {string} */ - public static getOutputCodePath (inputPath: string): string { - return path - .normalize(inputPath) - .split(StringSeparator.Dot) - .map((value: string, index: number) => { - return index === 0 ? `${value}${JavaScriptObfuscatorCLI.obfuscatedFilePrefix}` : value; - }) - .join(StringSeparator.Dot); + public static getOutputCodePath (inputPath: string, baseOutputPath?: string | null): string { + const normalizedBaseOutputPath: string | null = baseOutputPath + ? path.normalize(baseOutputPath) + : null; + + if (!normalizedBaseOutputPath) { + return path + .normalize(inputPath) + .split(StringSeparator.Dot) + .map((value: string, index: number) => { + return index === 0 ? `${value}${JavaScriptObfuscatorCLI.obfuscatedFilePrefix}` : value; + }) + .join(StringSeparator.Dot); + } + + const isDirectoryPath: boolean = path.extname(normalizedBaseOutputPath) === ''; + + return isDirectoryPath + ? path.join(normalizedBaseOutputPath, inputPath) + : normalizedBaseOutputPath; } /** diff --git a/src/cli/utils/SourceCodeReader.ts b/src/cli/utils/SourceCodeReader.ts index 88dbeaf6..fcc015b0 100644 --- a/src/cli/utils/SourceCodeReader.ts +++ b/src/cli/utils/SourceCodeReader.ts @@ -3,7 +3,6 @@ import * as path from 'path'; import multimatch from 'multimatch'; import { TInputCLIOptions } from '../../types/options/TInputCLIOptions'; -import { TSourceCodeData } from '../../types/cli/TSourceCodeData'; import { IFileData } from '../../interfaces/cli/IFileData'; @@ -90,11 +89,11 @@ export class SourceCodeReader { /** * @param {string} inputPath - * @returns {TSourceCodeData} + * @returns {IFileData[]} */ - public readSourceCode (inputPath: string): TSourceCodeData { + public readSourceCode (inputPath: string): IFileData[] { if (SourceCodeReader.isFilePath(inputPath) && this.isValidFile(inputPath)) { - return this.readFile(inputPath); + return [this.readFile(inputPath)]; } if (SourceCodeReader.isDirectoryPath(inputPath) && this.isValidDirectory(inputPath)) { @@ -111,34 +110,37 @@ export class SourceCodeReader { /** * @param {string} directoryPath - * @param {IFileData[]} fileData + * @param {IFileData[]} filesData * @returns {IFileData[]} */ - private readDirectoryRecursive (directoryPath: string, fileData: IFileData[] = []): IFileData[] { + private readDirectoryRecursive (directoryPath: string, filesData: IFileData[] = []): IFileData[] { fs.readdirSync(directoryPath, JavaScriptObfuscatorCLI.encoding) .forEach((fileName: string) => { const filePath: string = `${directoryPath}/${fileName}`; if (SourceCodeReader.isDirectoryPath(filePath) && this.isValidDirectory(filePath)) { - fileData.push(...this.readDirectoryRecursive(filePath)); + filesData.push(...this.readDirectoryRecursive(filePath)); } else if (SourceCodeReader.isFilePath(filePath) && this.isValidFile(filePath)) { - const content: string = this.readFile(filePath); + const fileData: IFileData = this.readFile(filePath); - fileData.push({ filePath, content }); + filesData.push(fileData); } }); - return fileData; + return filesData; } /** * @param {string} filePath * @returns {string} */ - private readFile (filePath: string): string { + private readFile (filePath: string): IFileData { SourceCodeReader.logFilePath(filePath); - return fs.readFileSync(filePath, JavaScriptObfuscatorCLI.encoding); + return { + filePath, + content: fs.readFileSync(filePath, JavaScriptObfuscatorCLI.encoding) + }; } /** diff --git a/src/types/cli/TSourceCodeData.ts b/src/types/cli/TSourceCodeData.ts deleted file mode 100644 index 51e4adf1..00000000 --- a/src/types/cli/TSourceCodeData.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IFileData } from '../../interfaces/cli/IFileData'; - -export type TSourceCodeData = string | IFileData[]; diff --git a/test/unit-tests/cli/utils/SourceCodeReader.spec.ts b/test/unit-tests/cli/utils/SourceCodeReader.spec.ts index c1b133aa..ddc83849 100644 --- a/test/unit-tests/cli/utils/SourceCodeReader.spec.ts +++ b/test/unit-tests/cli/utils/SourceCodeReader.spec.ts @@ -23,16 +23,20 @@ describe('SourceCodeReader', () => { describe('Variant #1: `inputPath` is a valid path', () => { const tmpFileName: string = 'test.js'; const inputPath: string = `${tmpDirectoryPath}/${tmpFileName}`; + const expectedFilesData: IFileData[] = [{ + content: fileContent, + filePath: inputPath + }]; - let result: string | IFileData[]; + let filesData: IFileData[]; before(() => { fs.writeFileSync(inputPath, fileContent); - result = new SourceCodeReader({}).readSourceCode(inputPath); + filesData = new SourceCodeReader({}).readSourceCode(inputPath); }); - it('should return content of file', () => { - assert.equal(result, fileContent); + it('should return valid files data', () => { + assert.deepEqual(filesData, expectedFilesData); }); after(() => { @@ -79,17 +83,22 @@ describe('SourceCodeReader', () => { describe('Variant #1: `inputPath` isn\'t excluded path', () => { const tmpFileName: string = 'test.js'; const inputPath: string = `${tmpDirectoryPath}/${tmpFileName}`; + const expectedFilesData: IFileData[] = [{ + content: fileContent, + filePath: inputPath + }]; - let result: string | IFileData[]; + let filesData: IFileData[]; before(() => { fs.writeFileSync(inputPath, fileContent); - result = new SourceCodeReader({ + filesData = new SourceCodeReader({ exclude: ['**/foo.js'] - }).readSourceCode(inputPath); }); + }).readSourceCode(inputPath); + }); - it('should return content of file', () => { - assert.equal(result, fileContent); + it('should return valid files data', () => { + assert.deepEqual(filesData, expectedFilesData); }); after(() => { @@ -189,7 +198,7 @@ describe('SourceCodeReader', () => { } ]; - let result: string | IFileData[]; + let result: IFileData[]; before(() => { fs.writeFileSync(filePath1, fileContent); @@ -258,7 +267,7 @@ describe('SourceCodeReader', () => { } ]; - let result: string | IFileData[]; + let result: IFileData[]; before(() => { mkdirp.sync(parentDirectoryPath1); @@ -306,7 +315,7 @@ describe('SourceCodeReader', () => { } ]; - let result: string | IFileData[]; + let result: IFileData[]; before(() => { fs.writeFileSync(filePath1, fileContent); @@ -352,7 +361,7 @@ describe('SourceCodeReader', () => { } ]; - let result: string | IFileData[]; + let result: IFileData[]; before(() => { fs.writeFileSync(filePath1, fileContent); @@ -400,7 +409,7 @@ describe('SourceCodeReader', () => { } ]; - let result: string | IFileData[]; + let result: IFileData[]; before(() => { fs.writeFileSync(filePath1, fileContent); @@ -448,7 +457,7 @@ describe('SourceCodeReader', () => { } ]; - let result: string | IFileData[]; + let result: IFileData[]; before(() => { fs.writeFileSync(filePath1, fileContent); diff --git a/yarn.lock b/yarn.lock index 90929e06..6effffdd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -522,11 +522,6 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - acorn-import-meta@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/acorn-import-meta/-/acorn-import-meta-1.0.0.tgz#6cff1f01db3b60148934823d3d2dd0c08354aead" @@ -650,7 +645,7 @@ append-transform@^2.0.0: dependencies: default-require-extensions "^3.0.0" -aproba@^1.0.3, aproba@^1.1.1: +aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== @@ -660,14 +655,6 @@ archy@^1.0.0: resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1237,11 +1224,6 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -1331,11 +1313,6 @@ console-browserify@^1.1.0: resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" @@ -1480,7 +1457,7 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -debug@3.2.6, debug@^3.2.6: +debug@3.2.6: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== @@ -1518,11 +1495,6 @@ deep-eql@^3.0.1: dependencies: type-detect "^4.0.0" -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -1569,11 +1541,6 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - des.js@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" @@ -1587,11 +1554,6 @@ detect-file@^1.0.0: resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - diff@3.5.0, diff@^3.1.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -2280,13 +2242,6 @@ fromentries@^1.2.0: resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.2.0.tgz#e6aa06f240d6267f913cea422075ef88b63e7897" integrity sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ== -fs-minipass@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" @@ -2325,20 +2280,6 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - gensync@^1.0.0-beta.1: version "1.0.0-beta.1" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" @@ -2515,11 +2456,6 @@ has-symbols@^1.0.0, has-symbols@^1.0.1: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -2627,7 +2563,7 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -iconv-lite@^0.4.24, iconv-lite@^0.4.4: +iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -2644,13 +2580,6 @@ iferr@^0.1.5: resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= -ignore-walk@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37" - integrity sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw== - dependencies: - minimatch "^3.0.4" - ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" @@ -2715,7 +2644,7 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: +ini@^1.3.4, ini@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== @@ -2856,13 +2785,6 @@ is-extglob@^2.1.0, is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" @@ -3501,21 +3423,6 @@ minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - mississippi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" @@ -3540,7 +3447,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@0.5.1, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= @@ -3657,15 +3564,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -needle@^2.2.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" - integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== - dependencies: - debug "^3.2.6" - iconv-lite "^0.4.4" - sax "^1.2.4" - neo-async@^2.5.0, neo-async@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" @@ -3741,22 +3639,6 @@ node-notifier@^6.0.0: shellwords "^0.1.1" which "^1.3.1" -node-pre-gyp@*: - version "0.14.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" - integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4.4.2" - node-preload@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/node-preload/-/node-preload-0.2.1.tgz#c03043bb327f417a18fee7ab7ee57b408a144301" @@ -3764,14 +3646,6 @@ node-preload@^0.2.0: dependencies: process-on-spawn "^1.0.0" -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -3794,27 +3668,6 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -npm-bundled@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b" - integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA== - dependencies: - npm-normalize-package-bin "^1.0.1" - -npm-normalize-package-bin@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" - integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== - -npm-packlist@^1.1.6: - version "1.4.8" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.8.tgz#56ee6cc135b9f98ad3d51c1c95da22bbb9b2ef3e" - integrity sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - npm-normalize-package-bin "^1.0.1" - npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -3822,21 +3675,6 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - nyc@15.0.0: version "15.0.0" resolved "https://registry.yarnpkg.com/nyc/-/nyc-15.0.0.tgz#eb32db2c0f29242c2414fe46357f230121cfc162" @@ -3876,7 +3714,7 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -3978,11 +3816,6 @@ os-browserify@^0.3.0: resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - os-locale@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" @@ -3997,19 +3830,11 @@ os-shim@^0.1.2: resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" integrity sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc= -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: +os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - p-defer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" @@ -4406,16 +4231,6 @@ randomfill@^1.0.3: randombytes "^2.0.5" safe-buffer "^5.1.0" -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" @@ -4452,7 +4267,7 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -4646,7 +4461,7 @@ rimraf@3.0.1, rimraf@^3.0.0: dependencies: glob "^7.1.3" -rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3: +rimraf@^2.5.4, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -4711,11 +4526,6 @@ safe-regex@^2.1.1: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - schema-utils@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" @@ -4725,7 +4535,7 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: +"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -4740,7 +4550,7 @@ serialize-javascript@^2.1.2: resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= @@ -5018,15 +4828,6 @@ string-template@1.0.0: resolved "https://registry.yarnpkg.com/string-template/-/string-template-1.0.0.tgz#9e9f2233dc00f218718ec379a28a5673ecca8b96" integrity sha1-np8iM9wA8hhxjsN5oopWc+zKi5Y= -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - "string-width@^1.0.2 || 2": version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -5083,7 +4884,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: +strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= @@ -5126,7 +4927,7 @@ strip-eof@^1.0.0: resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= -strip-json-comments@2.0.1, strip-json-comments@~2.0.1: +strip-json-comments@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= @@ -5189,19 +4990,6 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tar@^4.4.2: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - terser-webpack-plugin@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c" @@ -5645,7 +5433,7 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@1.1.3, wide-align@^1.1.0: +wide-align@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== @@ -5726,7 +5514,7 @@ yallist@^2.1.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= -yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: +yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== From 0fe1c15f150b317531faba99e7b83103dc4a617b Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Fri, 7 Feb 2020 10:24:47 +0300 Subject: [PATCH 2/3] Refactoring of CLI utils --- dist/index.cli.js | 2 +- package.json | 10 +- src/cli/JavaScriptObfuscatorCLI.ts | 120 ++++++++------- src/cli/utils/CLIUtils.ts | 68 --------- src/cli/utils/ObfuscatedCodeWriter.ts | 104 +++++++++++++ src/cli/utils/SourceCodeReader.ts | 111 ++++++++------ test/index.spec.ts | 1 + test/unit-tests/cli/utils/CLIUtils.spec.ts | 29 ---- .../cli/utils/ObfuscatedCodeWriter.spec.ts | 138 ++++++++++++++++++ .../cli/utils/SourceCodeReader.spec.ts | 113 ++++++++------ yarn.lock | 71 ++++----- 11 files changed, 496 insertions(+), 271 deletions(-) create mode 100644 src/cli/utils/ObfuscatedCodeWriter.ts create mode 100644 test/unit-tests/cli/utils/ObfuscatedCodeWriter.spec.ts diff --git a/dist/index.cli.js b/dist/index.cli.js index d56cb45f..4d030cf6 100644 --- a/dist/index.cli.js +++ b/dist/index.cli.js @@ -21,5 +21,5 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -require("source-map-support").install(),module.exports=function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=241)}([function(e,t){e.exports=require("inversify")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(33);class n{static isArrayPatternNode(e){return e.type===r.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===r.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===r.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===r.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===r.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===r.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===r.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===r.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===r.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===r.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===r.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===r.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===r.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return n.isFunctionDeclarationNode(e)||n.isFunctionExpressionNode(e)||n.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===r.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===r.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===r.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===r.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===r.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const o=n.isLabeledStatementNode(t)&&t.label===e,r=n.isContinueStatementNode(t)&&t.label===e,i=n.isBreakStatementNode(t)&&t.label===e;return o||r||i}static isLabeledStatementNode(e){return e.type===r.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===r.NodeType.Literal}static isMemberExpressionNode(e){return e.type===r.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===r.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return n.isProgramNode(e)||n.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return n.isNodeWithLexicalScope(e)||n.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return n.isProgramNode(e)||n.isBlockStatementNode(e)&&n.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return n.isProgramNode(e)||n.isBlockStatementNode(e)||n.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===r.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===r.NodeType.ObjectExpression}static isProgramNode(e){return e.type===r.NodeType.Program}static isPropertyNode(e){return e.type===r.NodeType.Property}static parentNodeIsPropertyNode(e,t){return n.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return n.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return n.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===r.NodeType.RestElement}static isReturnStatementNode(e){return e.type===r.NodeType.ReturnStatement}static isSuperNode(e){return e.type===r.NodeType.Super}static isSwitchCaseNode(e){return e.type===r.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===r.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===r.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===r.NodeType.UnaryExpression}static isUseStrictOperator(e){return n.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===r.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===r.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===r.NodeType.WhileStatement}}t.NodeGuards=n,n.nodesWithLexicalStatements=[r.NodeType.ArrowFunctionExpression,r.NodeType.FunctionDeclaration,r.NodeType.FunctionExpression,r.NodeType.MethodDefinition]},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(46)),i=r(o(13)),a=o(43),s=o(55),c=o(4),d=o(15);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:n.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),c.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+n.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return c.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(o=>{if("parentNode"===o)return;const r=e[o];let n;n=null===r||r instanceof RegExp?r:Array.isArray(r)?r.map(l.cloneRecursive):"object"==typeof r?l.cloneRecursive(r):r,t[o]=n}),t}}t.NodeUtils=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={configurable:!0,enumerable:!0};function n(e,t,o){Reflect.hasMetadata(e,o)||Reflect.defineMetadata(e,t,o)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(o,i)=>{const a=o[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return n("_initialized",!1,o),n("_initializablePropertiesSet",new Set,o),n("_wrappedMethodsSet",new Set,o),function(e,t){const o=Object.getOwnPropertyNames(e),n=[t,"constructor"];o.forEach(o=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(n.includes(o)||a.has(o)||s.has(o))return;if("function"!=typeof e[o])return;const c=null!==(i=Object.getOwnPropertyDescriptor(e,o))&&void 0!==i?i:r,d=c.value;Object.defineProperty(e,o,Object.assign(Object.assign({},c),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(o)})}(o,e),function(e,t,o){var n;const i=null!==(n=Object.getOwnPropertyDescriptor(e,t))&&void 0!==n?n:r,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[o],e}}))}(o,e,i),function(e,t){var o;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const n=`_${t.toString()}`,i=null!==(o=Object.getOwnPropertyDescriptor(e,n))&&void 0!==o?o:r;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[n])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[n]},set:function(e){this[n]=e}})),i}(o,i)}}},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(46)),i=o(33);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,o){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,o){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,o){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:o,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,o){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},o&&{alternate:o}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:n.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,o){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,o=!1){return{type:i.NodeType.MemberExpression,computed:o,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,o,r){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:o,computed:r,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,o=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:o,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,o=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:o,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(113),N=o(114);let b=r=class{constructor(e,t,o,r){this.cachedNode=null,this.identifierNamesGenerator=e(r),this.customNodeFormatter=t,this.randomGenerator=o,this.options=r}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(r.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};b.globalVariableTemplateFunctions=[h.GlobalVariableTemplate1(),N.GlobalVariableTemplate2()],b=r=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],b),t.AbstractCustomNode=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3);let f=class{constructor(e,t){this.randomGenerator=e,this.options=t}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractNodeTransformer=f},function(e,t){e.exports=require("estraverse")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static getParentNodeWithStatements(e){return n.getParentNodesWithStatementsRecursive(e,1)[0]}static getParentNodesWithStatements(e){return n.getParentNodesWithStatementsRecursive(e)}static getNextSiblingStatement(e){return n.getSiblingStatementByOffset(e,1)}static getPreviousSiblingStatement(e){return n.getSiblingStatementByOffset(e,-1)}static getRootStatementOfNode(e){if(r.NodeGuards.isProgramNode(e))throw new Error("Unable to find root statement for `Program` node");const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithStatements(t)?e:n.getRootStatementOfNode(t)}static getScopeOfNode(e){const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithStatements(t)?t:n.getScopeOfNode(t)}static getParentNodesWithStatementsRecursive(e,t=1/0,o=[],i=0){if(o.length>=t)return o;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(r.NodeGuards.isProgramNode(e)||r.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&o.push(e),e!==a?n.getParentNodesWithStatementsRecursive(a,t,o,++i):o}static getSiblingStatementByOffset(e,t){const o=n.getScopeOfNode(e),i=r.NodeGuards.isSwitchCaseNode(o)?o.consequent:o.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static set(e,t){var o;e.metadata=Object.assign(null!==(o=e.metadata)&&void 0!==o?o:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===r.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===r.get(e,"replacedLiteral")}}t.NodeMetadata=r},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(72),a=o(82),s=o(95),c=o(106),d=o(156),l=o(157),u=o(161),f=o(162),p=o(173),m=o(195),g=o(210),y=o(215),h=o(225),N=o(70),b=o(229),v=o(231),I=o(232),S=o(233);t.InversifyContainerFacade=class{constructor(){this.container=new r.Container}static getFactory(e){return t=>o=>t.container.getNamed(e,o)}static getCacheFactory(e){return t=>{const o=new Map;return r=>{if(o.has(r))return o.get(r);const n=t.container.getNamed(e,r);return o.set(r,n),n}}}static getConstructorFactory(e,...t){return o=>{const r=new Map,n=[];return i=>{if(t.forEach((e,t)=>{n[t]||(n[t]=o.container.get(e))}),r.has(i))return new(r.get(i))(...n);const a=o.container.getNamed(e,i);return r.set(i,a),new a(...n)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,o){this.container.bind(n.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new I.SourceCode(e,t)).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>o).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ILogger).to(N.Logger).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IJavaScriptObfuscator).to(h.JavaScriptObfuscator).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ITransformersRunner).to(S.TransformersRunner).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IObfuscatedCode).to(v.ObfuscatedCode),this.container.bind(n.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,o)=>{const r=e.container.get(n.ServiceIdentifiers.IObfuscatedCode);return r.initialize(t,o),r}),this.container.bind(n.ServiceIdentifiers.IObfuscationEventEmitter).to(b.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(c.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(u.nodeTransformersModule),this.container.load(f.obfuscatingTransformersModule),this.container.load(p.optionsModule),this.container.load(m.preparingTransformersModule),this.container.load(g.storagesModule),this.container.load(y.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static append(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e),...t])}static appendToOptimalBlockScope(e,t,o,r=0){const i=e.length?n.getOptimalBlockScope(e,r):t;n.prepend(i,o)}static getOptimalBlockScope(e,t,o=1/0){const r=e[t];if(o<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return o>1&&r.callsGraph.length?n.getOptimalBlockScope(r.callsGraph,0,--o):r.callee}static insertBefore(e,t,o){const r=n.getScopeStatements(e).indexOf(o);n.insertAtIndex(e,t,r)}static insertAfter(e,t,o){const r=n.getScopeStatements(e).indexOf(o);n.insertAtIndex(e,t,r+1)}static insertAtIndex(e,t,o){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e).slice(0,o),...t,...n.getScopeStatements(e).slice(o)])}static prepend(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...t,...n.getScopeStatements(e)])}static getScopeStatements(e){return r.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){r.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.ObfuscationTarget=r.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.StringArrayEncoding=r.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(69);const r=o(1),n=o(16);class i{static obfuscate(e,t={}){const o=new n.InversifyContainerFacade;o.load(e,"",t);const i=o.get(r.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return o.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.5"?"0.24.5":"unknown"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(5),f=o(2),p=o(3);let m=class{constructor(e,t,o){this.identifierNamesGenerator=e(o),this.randomGenerator=t,this.options=o}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const o=this.customNodes.get(e);o&&t(o)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==u.TIdentifierNamesGeneratorFactory&&u.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],m),t.AbstractCustomNodeGroup=m},function(e,t){e.exports=require("@gradecam/tsenum")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=r,r.hexadecimalPrefix="0x"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.IdentifierNamesGenerator=r.MakeEnum({DictionaryIdentifierNamesGenerator:"dictionary",HexadecimalIdentifierNamesGenerator:"hexadecimal",MangledIdentifierNamesGenerator:"mangled"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.SourceMapMode=r.MakeEnum({Inline:"inline",Separate:"separate"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31),n=o(20),i=o(32);t.NO_ADDITIONAL_NODES_PRESET=Object.freeze({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:r.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!1,seed:0,selfDefending:!1,shuffleStringArray:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:0,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NumberUtils=class{static toHex(e){return e.toString(16)}static isCeil(e){return e%1==0}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(2);let l=class{constructor(e){this.options=e}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IOptions&&d.IOptions)?r:Object])],l),t.AbstractObfuscatingReplacer=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31),n=o(20),i=o(32);t.DEFAULT_PRESET=Object.freeze({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:r.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!0,seed:0,selfDefending:!1,shuffleStringArray:!0,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:10,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Dot=".",e.Comma=","}(t.StringSeparator||(t.StringSeparator={}))},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{};n=r([o(0).injectable()],n),t.AbstractCalleeDataExtractor=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecmaVersion=11},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);t.NodeLiteralUtils=class{static isProhibitedLiteralNode(e,t){return!(!r.NodeGuards.isPropertyNode(t)||t.computed||t.key!==e)||!!r.NodeGuards.isImportDeclarationNode(t)}}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3);let g=r=class{constructor(e,t,o){this.replacerDataByControlFlowStorageId=new Map,this.controlFlowCustomNodeFactory=e,this.randomGenerator=t,this.options=o}static getStorageKeysByIdForCurrentStorage(e,t){let o;return o=e.has(t)?e.get(t):new Map,o}insertCustomNodeToControlFlowStorage(e,t,o,n){const i=t.getStorageId(),a=r.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,i),s=a.get(o);if(this.randomGenerator.getMathRandom(){const o=this.randomGenerator.getRandomString(e);return t.getStorage().has(o)?c(e):o},d=c(5);return a.set(o,[d]),this.replacerDataByControlFlowStorageId.set(i,a),t.set(d,e),d}};g=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],g),t.AbstractControlFlowReplacer=g},function(e,t){e.exports=require("escodegen")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n const that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3);let f=class{constructor(e,t){this.preservedNamesSet=new Set,this.randomGenerator=e,this.options=t}preserveName(e){this.preservedNamesSet.add(e)}isValidIdentifierName(e){return this.notReservedName(e)&&!this.preservedNamesSet.has(e)}notReservedName(e){return!this.options.reservedNames.length||!this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractIdentifierNamesGenerator=f},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(7);let m=class{constructor(e,t){this.randomGenerator=e,this.options=t}initialize(){this.storage=new Map,this.storageId=this.randomGenerator.getRandomString(6)}get(e){return this.storage.get(e)}getOrThrow(e){const t=this.get(e);if(!t)throw new Error(`No value found in map storage with key \`${e}\``);return t}getKeyOf(e){for(const[t,o]of this.storage)if(e===o)return t;return null}getLength(){return this.storage.size}getStorage(){return this.storage}getStorageId(){return this.storageId}has(e){return this.storage.has(e)}mergeWith(e,t=!1){this.storage=new Map([...this.storage,...e.getStorage()]),t&&(this.storageId=e.getStorageId())}set(e,t){this.storage.set(e,t)}};a([p.initializable(),s("design:type",String)],m.prototype,"storageId",void 0),a([p.initializable(),s("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],m.prototype,"storage",void 0),a([d.postConstruct(),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],m.prototype,"initialize",null),m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MapStorage=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(17),f=o(2),p=o(3),m=o(18),g=o(45),y=o(4);let h=class extends g.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}getControlFlowStorageCallNode(e,t,o,r){const n=this.controlFlowCustomNodeFactory(m.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);n.initialize(e,t,o,r);const i=n.getNode()[0];if(!i||!y.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};h=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==u.TControlFlowCustomNodeFactory&&u.TControlFlowCustomNodeFactory)?r:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],h),t.ExpressionWithOperatorControlFlowReplacer=h},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(o(85)),a=n(o(86)),s=n(o(56));class c{static parse(e,t){const o=c.sourceTypes.length;for(let r=0;r"),u=`...${i.substring(s,d).replace(/^\s+/,"")}...`;throw new Error(`ERROR in ${a}line ${o.line}: ${t}\n${l} ${u}`)}}t.ASTParserFacade=c,c.colorError=s.default.red,c.nearestSymbolsCount=15,c.sourceTypes=["script","module"]},function(e,t){e.exports=require("chalk")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BasePropertiesExtractor="BasePropertiesExtractor",e.ObjectExpressionToVariableDeclarationExtractor="ObjectExpressionToVariableDeclarationExtractor"}(t.ObjectExpressionExtractor||(t.ObjectExpressionExtractor={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ObjectExpressionVariableDeclarationHostNode="ObjectExpressionVariableDeclarationHostNode"}(t.ObjectExpressionKeysTransformerCustomNode||(t.ObjectExpressionKeysTransformerCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t){e.exports=require("class-validator")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListObfuscatingGuard="BlackListObfuscatingGuard",e.ConditionalCommentObfuscatingGuard="ConditionalCommentObfuscatingGuard",e.ReservedStringObfuscatingGuard="ReservedStringObfuscatingGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(4);let s=r=class{constructor(){this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}static isConditionalComment(e){return r.obfuscationEnableCommentRegExp.test(e.value)||r.obfuscationDisableCommentRegExp.test(e.value)}check(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!a.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;const t=e.leadingComments,o=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),o&&(this.obfuscationAllowedForNextNode=this.checkComments(o)),this.obfuscationAllowedForCurrentNode}checkComments(e){const t=e.length;let o=this.obfuscationAllowedForCurrentNode;for(let n=0;n=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(218)),m=o(219),g=o(2),y=o(220),h=o(7);let N=r=class{constructor(e,t){this.sourceCode=e,this.options=t}initialize(){this.randomGenerator=new m.Chance(this.getRawSeed())}getMathRandom(){return this.getRandomInteger(0,99999)/1e5}getRandomGenerator(){return this.randomGenerator}getRandomInteger(e,t){return this.getRandomGenerator().integer({min:e,max:t})}getRandomString(e,t=r.randomGeneratorPool){return this.getRandomGenerator().string({length:e,pool:t})}getInputSeed(){return this.options.seed.toString()}getRawSeed(){const e=this.getInputSeed();return`${e}`.split("|").length>1?e:`${e}|${p.default(this.sourceCode.getSourceCode())}`}};N.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s([h.initializable(),c("design:type","function"==typeof(n=void 0!==m.Chance&&m.Chance.Chance)?n:Object)],N.prototype,"randomGenerator",void 0),s([u.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],N.prototype,"initialize",null),N=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.ISourceCode)),d(1,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(i=void 0!==y.ISourceCode&&y.ISourceCode)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],N),t.RandomGenerator=N},function(e,t){e.exports=require("reflect-metadata")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(56)),f=o(2),p=o(71);let m=r=class{constructor(e){this.options=e}static log(e,t,o,r){const n=e(`\n${t} ${o}`);console.log(n,null!=r?r:"")}info(e,t){this.options.log&&r.log(r.colorInfo,p.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&r.log(r.colorSuccess,p.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&r.log(r.colorWarn,p.LoggingPrefix.Base,e,t)}};m.colorInfo=u.default.cyan,m.colorSuccess=u.default.green,m.colorWarn=u.default.yellow,m=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IOptions&&f.IOptions)?n:Object])],m),t.Logger=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(52),s=o(73),c=o(75),d=o(76),l=o(77),u=o(78),f=o(79),p=o(81);t.analyzersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICallsGraphAnalyzer).to(s.CallsGraphAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer).to(u.PrevailingKindOfVariablesAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IScopeAnalyzer).to(f.ScopeAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IStringArrayStorageAnalyzer).to(p.StringArrayStorageAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(d.FunctionExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(l.ObjectExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(74),p=o(52),m=o(4),g=o(14);let y=r=class{constructor(e){this.calleeDataExtractorFactory=e}static getLimitIndex(e){const t=e-1,o=r.limitThresholdActivationLength-1;let n=t;return t>o&&(n=Math.round(o+t*r.limitThreshold),n>t&&(n=t)),n}analyze(e){return this.analyzeRecursive(e.body)}analyzeRecursive(e){const t=r.getLimitIndex(e.length),o=[],n=e.length;for(let r=0;rt);r++){const t=e[r];u.traverse(t,{enter:r=>{if(m.NodeGuards.isCallExpressionNode(r))return t.parentNode!==g.NodeStatementUtils.getParentNodeWithStatements(r)?u.VisitorOption.Skip:void this.analyzeCallExpressionNode(o,e,r)}})}return o}analyzeCallExpressionNode(e,t,o){r.calleeDataExtractorsList.forEach(r=>{const n=this.calleeDataExtractorFactory(r).extract(t,o.callee);n&&e.push(Object.assign(Object.assign({},n),{callsGraph:this.analyzeRecursive(n.callee.body)}))})}};y.calleeDataExtractorsList=[p.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,p.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,p.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],y.limitThresholdActivationLength=25,y.limitThreshold=.002,y=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__ICalleeDataExtractor)),a("design:paramtypes",["function"==typeof(n=void 0!==f.TCalleeDataExtractorFactory&&f.TCalleeDataExtractorFactory)?n:Object])],y),t.CallsGraphAnalyzer=y},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(13)),s=o(42),c=o(4),d=o(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){if(!c.NodeGuards.isIdentifierNode(t))return null;const o=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name);return o?{callee:o,name:t.name}:null}getCalleeBlockStatement(e,t){let o=null;return a.traverse(e,{enter:e=>{if(c.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return o=e.body,a.VisitorOption.Break}}),o}};l=r([i.injectable()],l),t.FunctionDeclarationCalleeDataExtractor=l},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(13)),s=o(42),c=o(4),d=o(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){var o;let r=null;return c.NodeGuards.isIdentifierNode(t)&&(r=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name)),c.NodeGuards.isFunctionExpressionNode(t)&&(r=t.body),r?{callee:r,name:null!==(o=t.name)&&void 0!==o?o:null}:null}getCalleeBlockStatement(e,t){let o=null;return a.traverse(e,{enter:(e,r)=>{if(c.NodeGuards.isFunctionExpressionNode(e)&&r&&c.NodeGuards.isVariableDeclaratorNode(r)&&c.NodeGuards.isIdentifierNode(r.id)&&r.id.name===t)return o=e.body,a.VisitorOption.Break}}),o}};l=r([i.injectable()],l),t.FunctionExpressionCalleeDataExtractor=l},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=i(o(13)),c=o(42),d=o(4),l=o(14);let u=r=class extends c.AbstractCalleeDataExtractor{static isValidTargetPropertyNode(e,t){if(!e.key)return!1;const o=d.NodeGuards.isIdentifierNode(e.key)&&e.key.name===t,r=d.NodeGuards.isLiteralNode(e.key)&&Boolean(e.key.value)&&e.key.value===t;return o||r}extract(e,t){if(!d.NodeGuards.isMemberExpressionNode(t))return null;const o=this.createObjectMembersCallsChain([],t);if(!o.length)return null;const r=o[o.length-1],n=this.getCalleeBlockStatement(l.NodeStatementUtils.getParentNodeWithStatements(e[0]),o);return n?{callee:n,name:r}:null}createObjectMembersCallsChain(e,t){if(d.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!d.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return d.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(d.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}getCalleeBlockStatement(e,t){const o=t.shift();if(!o)return null;let r=null;return s.traverse(e,{enter:e=>{if(d.NodeGuards.isVariableDeclaratorNode(e)&&d.NodeGuards.isIdentifierNode(e.id)&&e.init&&d.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===o)return r=this.findCalleeBlockStatement(e.init.properties,t),s.VisitorOption.Break}}),r}findCalleeBlockStatement(e,t){const o=t.shift();if(!o)return null;for(const n of e)if(r.isValidTargetPropertyNode(n,o)){if(d.NodeGuards.isObjectExpressionNode(n.value))return this.findCalleeBlockStatement(n.value.properties,t);if(d.NodeGuards.isFunctionExpressionNode(n.value))return n.value.body}return null}};u=r=n([a.injectable()],u),t.ObjectExpressionCalleeDataExtractor=u},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(34),p=o(4);let m=r=class{constructor(e){this.prevailingKindOfVariables=r.defaultKindOfVariables,this.arrayUtils=e}analyze(e){var t;const o=[];u.traverse(e,{enter:e=>{p.NodeGuards.isVariableDeclarationNode(e)&&o.push(e.kind)}}),this.prevailingKindOfVariables=null!==(t=this.arrayUtils.findMostOccurringElement(o))&&void 0!==t?t:r.defaultKindOfVariables}getPrevailingKind(){return this.prevailingKindOfVariables}};m.defaultKindOfVariables="var",m=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IArrayUtils)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IArrayUtils&&f.IArrayUtils)?n:Object])],m),t.PrevailingKindOfVariablesAnalyzer=m},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=i(o(80)),c=i(o(13)),d=o(43),l=o(4);let u=r=class{constructor(){this.scopeManager=null}static attachMissingRanges(e){c.replace(e,{enter:e=>(e.range||(e.range=[r.emptyRangeValue,r.emptyRangeValue]),e)})}static isRootNode(e){return l.NodeGuards.isProgramNode(e)||e.parentNode===e}analyze(e){const t=r.sourceTypes.length;r.attachMissingRanges(e);for(let o=0;o{if("class"===e.type&&e.upper){if(!e.variables.length)return;const t=e.variables[0],o=e.upper.variables.find(e=>t.defs.some(e=>"ClassName"===e.type)&&e.name===t.name);null==o||o.references.push(...e.variables[0].references)}});for(const t of e.childScopes)this.sanitizeScopes(t)}};u.eslintScopeOptions={ecmaVersion:d.ecmaVersion,optimistic:!0},u.sourceTypes=["script","module"],u.emptyRangeValue=0,u=r=n([a.injectable()],u),t.ScopeAnalyzer=u},function(e,t){e.exports=require("eslint-scope")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(13)),m=o(2),g=o(3),y=o(35),h=o(4),N=o(15),b=o(44);let v=r=class{constructor(e,t,o){this.stringArrayStorageData=new Map,this.stringArrayStorage=e,this.randomGenerator=t,this.options=o}analyze(e){this.options.stringArray&&p.traverse(e,{enter:(e,t)=>{if(t)return N.NodeMetadata.isIgnoredNode(e)?p.VisitorOption.Skip:void(h.NodeGuards.isLiteralNode(e)&&this.analyzeLiteralNode(e,t))}})}getItemDataForLiteralNode(e){return this.stringArrayStorageData.get(e)}analyzeLiteralNode(e,t){"string"==typeof e.value&&(b.NodeLiteralUtils.isProhibitedLiteralNode(e,t)||this.shouldAddValueToStringArray(e.value)&&this.stringArrayStorageData.set(e,this.stringArrayStorage.getOrThrow(e.value)))}shouldAddValueToStringArray(e){return e.length>=r.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}};v.minimumLengthForStringArray=3,v=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.IStringArrayStorage)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==y.IStringArrayStorage&&y.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==m.IOptions&&m.IOptions)?a:Object])],v),t.StringArrayStorageAnalyzer=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(53),s=o(21),c=o(83),d=o(84),l=o(87),u=o(88),f=o(90),p=o(93),m=o(94);t.controlFlowTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(l.CallExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(i.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(54);let h=r=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.BinaryExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a,e.left,e.right)}};h.usingExistingIdentifierChance=.5,h=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.BinaryExpressionControlFlowReplacer=h},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(17),y=o(34),h=o(2),N=o(3),b=o(18),v=o(11),I=o(12),S=o(4),O=o(6);let j=r=class extends I.AbstractNodeTransformer{constructor(e,t,o,r){super(o,r),this.controlFlowCustomNodeFactory=e,this.arrayUtils=t}static isProhibitedStatementNode(e){const t=S.NodeGuards.isBreakStatementNode(e)||S.NodeGuards.isContinueStatementNode(e),o=S.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),r=S.NodeGuards.isClassDeclarationNode(e);return S.NodeGuards.isFunctionDeclarationNode(e)||t||o||r}static canTransformBlockStatementNode(e){let t=!0;return m.traverse(e,{enter:e=>{if(S.NodeGuards.isWhileStatementNode(e))return m.VisitorOption.Skip;r.isProhibitedStatementNode(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}getVisitor(e){switch(e){case v.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&S.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!r.canTransformBlockStatementNode(e))return e;const o=e.body,n=this.arrayUtils.createWithRange(o.length),i=this.arrayUtils.shuffle(n),a=n.map(e=>i.indexOf(e)),s=this.controlFlowCustomNodeFactory(b.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);s.initialize(o,i,a);const c=s.getNode()[0];return O.NodeUtils.parentizeNode(c,t),c}};j=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IControlFlowCustomNode)),l(1,f.inject(p.ServiceIdentifiers.IArrayUtils)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TControlFlowCustomNodeFactory&&g.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==h.IOptions&&h.IOptions)?s:Object])],j),t.BlockStatementControlFlowTransformer=j},function(e,t){e.exports=require("acorn")},function(e,t){e.exports=require("acorn-import-meta")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(45),h=o(4);let N=r=class extends y.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){const n=e.callee;if(!h.NodeGuards.isIdentifierNode(n))return e;const i=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionFunctionNode),s=e.arguments;a.initialize(s);const c=this.insertCustomNodeToControlFlowStorage(a,o,i,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),c,n,s)}getControlFlowStorageCallNode(e,t,o,r){const n=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);n.initialize(e,t,o,r);const i=n.getNode()[0];if(!i||!h.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};N.usingExistingIdentifierChance=.5,N=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.CallExpressionControlFlowReplacer=N},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(89),y=o(2),h=o(3),N=o(57),b=o(58),v=o(21),I=o(33),S=o(11),O=o(12),j=o(8),_=o(4),C=o(14),R=o(6);let F=r=class extends O.AbstractNodeTransformer{constructor(e,t,o,r){super(o,r),this.deadCodeInjectionRootAstHostNodeSet=new Set,this.collectedBlockStatements=[],this.collectedBlockStatementsTotalLength=0,this.deadCodeInjectionCustomNodeFactory=e,this.transformersRunner=t}static isProhibitedNodeInsideCollectedBlockStatement(e){return _.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e)||_.NodeGuards.isAwaitExpressionNode(e)||_.NodeGuards.isSuperNode(e)}static isScopeHoistingFunctionDeclaration(e){if(!_.NodeGuards.isFunctionDeclarationNode(e))return!1;const t=C.NodeStatementUtils.getScopeOfNode(e),o=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,r=o.indexOf(e);if(0===r)return!1;const n=o.slice(0,r),i=j.NodeFactory.blockStatementNode(n),a=e.id.name;let s=!1;return m.traverse(i,{enter:e=>{if(_.NodeGuards.isIdentifierNode(e)&&e.name===a)return s=!0,m.VisitorOption.Break}}),s}static isValidCollectedBlockStatementNode(e){if(!e.body.length)return!1;let t=0,o=!0;return m.traverse(e,{enter:e=>{if(_.NodeGuards.isBlockStatementNode(e)&&t++,t>r.maxNestedBlockStatementsCount||r.isProhibitedNodeInsideCollectedBlockStatement(e)||r.isScopeHoistingFunctionDeclaration(e))return o=!1,m.VisitorOption.Break}}),o}static isValidWrappedBlockStatementNode(e){if(!e.body.length)return!1;let t=!0;if(m.traverse(e,{enter:e=>{if(r.isScopeHoistingFunctionDeclaration(e))return t=!1,m.VisitorOption.Break}}),!t)return!1;return C.NodeStatementUtils.getParentNodeWithStatements(e).type!==I.NodeType.Program}getVisitor(e){switch(e){case S.TransformationStage.DeadCodeInjection:return{enter:(e,t)=>{if(t&&_.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),e},leave:(e,t)=>{if(t&&_.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};case S.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:(e,t)=>{if(t&&this.isDeadCodeInjectionRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}analyzeNode(e,t){m.traverse(e,{enter:e=>{if(!_.NodeGuards.isBlockStatementNode(e))return;const t=R.NodeUtils.clone(e);if(!r.isValidCollectedBlockStatementNode(t))return;const o=this.makeClonedBlockStatementNodeUnique(t);this.collectedBlockStatements.push(o)}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}transformNode(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!r.isValidWrappedBlockStatementNode(e))return e;const o=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,o),i=this.collectedBlockStatements.splice(n,1)[0];return i===e?e:this.replaceBlockStatementNode(e,i,t)}restoreNode(e,t){const o=e.body[0];if(!_.NodeGuards.isFunctionDeclarationNode(o))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return o.body}isDeadCodeInjectionRootAstHostNode(e){return _.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}makeClonedBlockStatementNodeUnique(e){const t=j.NodeFactory.functionExpressionNode([],e);return R.NodeUtils.parentizeNode(t,t),R.NodeUtils.parentizeNode(e,t),this.transformersRunner.transform(t,r.transformersToRenameBlockScopeIdentifiers,S.TransformationStage.Obfuscating).body}replaceBlockStatementNode(e,t,o){const n=j.NodeFactory.blockStatementNode([j.NodeFactory.functionDeclarationNode(r.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);const i=this.deadCodeInjectionCustomNodeFactory(b.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);i.initialize(e,n);const a=i.getNode()[0];return R.NodeUtils.parentizeNode(a,o),a}};F.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",F.maxNestedBlockStatementsCount=4,F.minCollectedBlockStatementsCount=5,F.transformersToRenameBlockScopeIdentifiers=[v.NodeTransformer.LabeledStatementTransformer,v.NodeTransformer.ScopeIdentifiersTransformer],F=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),l(1,f.inject(p.ServiceIdentifiers.ITransformersRunner)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TDeadNodeInjectionCustomNodeFactory&&g.TDeadNodeInjectionCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.ITransformersRunner&&N.ITransformersRunner)?i:Object,"function"==typeof(a=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==y.IOptions&&y.IOptions)?s:Object])],F),t.DeadCodeInjectionTransformer=F},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=f(o(13)),y=o(17),h=o(91),N=o(92),b=o(2),v=o(3),I=o(18),S=o(53),O=o(33),j=o(11),_=o(12),C=o(19),R=o(4),F=o(15),T=o(14),w=o(6);let x=r=class extends _.AbstractNodeTransformer{constructor(e,t,o,r,n){super(r,n),this.controlFlowData=new Map,this.visitedFunctionNodes=new Set,this.hostNodesWithControlFlowNode=new Set,this.controlFlowStorageFactory=e,this.controlFlowReplacerFactory=t,this.controlFlowCustomNodeFactory=o}getVisitor(e){switch(e){case j.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.visitedFunctionNodes.add(e),!R.NodeGuards.isBlockStatementNode(e.body))return e;const o=this.getHostNode(e.body),r=this.getControlFlowStorage(o);if(this.controlFlowData.set(o,r),this.transformFunctionBody(e.body,r),!r.getLength())return e;const n=this.controlFlowCustomNodeFactory(I.ControlFlowCustomNode.ControlFlowStorageNode);return n.initialize(r),C.NodeAppender.prepend(o,n.getNode()),this.hostNodesWithControlFlowNode.add(o),w.NodeUtils.parentizeAst(e),e}getControlFlowStorage(e){const t=this.controlFlowStorageFactory();if(this.controlFlowData.has(e)){this.hostNodesWithControlFlowNode.has(e)&&(R.NodeGuards.isSwitchCaseNode(e)?e.consequent.shift():e.body.shift());const o=this.controlFlowData.get(e);t.mergeWith(o,!0)}return t}getHostNode(e){const t=T.NodeStatementUtils.getParentNodesWithStatements(e);return 1===t.length?e:(t.pop(),t.length>r.hostNodeSearchMinDepth&&t.splice(0,r.hostNodeSearchMinDepth),t.length>r.hostNodeSearchMaxDepth&&(t.length=r.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}isVisitedFunctionNode(e){return(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}transformFunctionBody(e,t){g.replace(e,{enter:(e,o)=>{if(F.NodeMetadata.isIgnoredNode(e))return g.VisitorOption.Skip;if(this.isVisitedFunctionNode(e)||!o)return g.VisitorOption.Skip;if(!r.controlFlowReplacersMap.has(e.type))return e;if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold)return e;const n=r.controlFlowReplacersMap.get(e.type);return void 0===n?e:Object.assign(Object.assign({},this.controlFlowReplacerFactory(n).replace(e,o,t)),{parentNode:o})}})}};x.controlFlowReplacersMap=new Map([[O.NodeType.BinaryExpression,S.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[O.NodeType.CallExpression,S.ControlFlowReplacer.CallExpressionControlFlowReplacer],[O.NodeType.LogicalExpression,S.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[O.NodeType.Literal,S.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),x.hostNodeSearchMinDepth=0,x.hostNodeSearchMaxDepth=2,x=r=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),u(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),u(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==N.TControlFlowStorageFactory&&N.TControlFlowStorageFactory)?n:Object,"function"==typeof(i=void 0!==h.TControlFlowReplacerFactory&&h.TControlFlowReplacerFactory)?i:Object,"function"==typeof(a=void 0!==y.TControlFlowCustomNodeFactory&&y.TControlFlowCustomNodeFactory)?a:Object,"function"==typeof(s=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==b.IOptions&&b.IOptions)?c:Object])],x),t.FunctionControlFlowTransformer=x},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(54),h=o(4),N=o(6);let b=r=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){if(this.checkForProhibitedExpressions(e.left,e.right))return e;const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.LogicalExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a,e.left,e.right)}checkForProhibitedExpressions(e,t){return[e,t].some(e=>{let t;return t=h.NodeGuards.isUnaryExpressionNode(e)?N.NodeUtils.getUnaryExpressionArgumentNode(e):e,!(h.NodeGuards.isLiteralNode(t)||h.NodeGuards.isIdentifierNode(t)||h.NodeGuards.isObjectExpressionNode(t)||h.NodeGuards.isExpressionStatementNode(t))})}};b.usingExistingIdentifierChance=.5,b=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionControlFlowReplacer=b},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(45),h=o(4);let N=r=class extends y.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){if(h.NodeGuards.isPropertyNode(t)&&t.key===e)return e;if("string"!=typeof e.value||e.value.length<3)return e;const n=String(e.value),i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralNode);i.initialize(e.value);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a)}getControlFlowStorageCallNode(e,t){const o=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode);o.initialize(e,t);const r=o.getNode()[0];if(!r||!h.NodeGuards.isExpressionStatementNode(r))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return r.expression}};N.usingExistingIdentifierChance=1,N=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.StringLiteralControlFlowReplacer=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(16),i=o(1),a=o(21),s=o(59),c=o(96),d=o(98),l=o(99),u=o(100),f=o(102),p=o(103),m=o(104),g=o(105);t.convertingTransformersModule=new r.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.MemberExpressionTransformer).whenTargetNamed(a.NodeTransformer.MemberExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(l.MethodDefinitionTransformer).whenTargetNamed(a.NodeTransformer.MethodDefinitionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.ObjectExpressionKeysTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionKeysTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.ObjectExpressionTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.SplitStringTransformer).whenTargetNamed(a.NodeTransformer.SplitStringTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.TemplateLiteralTransformer).whenTargetNamed(a.NodeTransformer.TemplateLiteralTransformer),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(c.ObjectExpressionToVariableDeclarationExtractor).whenTargetNamed(s.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(g.BasePropertiesExtractor).whenTargetNamed(s.ObjectExpressionExtractor.BasePropertiesExtractor),e(i.ServiceIdentifiers.Factory__IObjectExpressionExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObjectExpressionExtractor))})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(97),l=o(60),u=o(19),f=o(4),p=o(14),m=o(6);let g=class{constructor(e){this.objectExpressionKeysTransformerCustomNodeFactory=e}extract(e,t){return this.transformObjectExpressionToVariableDeclaration(e,t)}transformObjectExpressionToVariableDeclaration(e,t){const o=e.properties,r=this.getObjectExpressionHostNode(o),n=this.getObjectExpressionIdentifierNode(r),i=this.getObjectExpressionNode(r),a=[r],s=p.NodeStatementUtils.getScopeOfNode(t);return u.NodeAppender.insertBefore(s,a,t),m.NodeUtils.parentizeAst(r),m.NodeUtils.parentizeNode(r,s),{nodeToReplace:n,objectExpressionHostStatement:r,objectExpressionNode:i}}getObjectExpressionHostNode(e){const t=this.objectExpressionKeysTransformerCustomNodeFactory(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode);t.initialize(e);const o=t.getNode()[0];if(!o||!f.NodeGuards.isVariableDeclarationNode(o))throw new Error("`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node");return o}getObjectExpressionIdentifierNode(e){const t=e.declarations[0].id;if(!f.NodeGuards.isIdentifierNode(t))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property");return t}getObjectExpressionNode(e){var t;const o=null!==(t=e.declarations[0].init)&&void 0!==t?t:null;if(!o||!f.NodeGuards.isObjectExpressionNode(o))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property");return o}};g=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)),i("design:paramtypes",["function"==typeof(r=void 0!==d.TObjectExpressionKeysTransformerCustomNodeFactory&&d.TObjectExpressionKeysTransformerCustomNodeFactory)?r:Object])],g),t.ObjectExpressionToVariableDeclarationExtractor=g},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(8),g=o(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isMemberExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(g.NodeGuards.isIdentifierNode(e.property)){if(e.computed)return e;e.computed=!0,e.property=m.NodeFactory.literalNode(e.property.name)}return e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MemberExpressionTransformer=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(11),m=o(12),g=o(8),y=o(4);let h=r=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&y.NodeGuards.isMethodDefinitionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return y.NodeGuards.isIdentifierNode(e.key)?this.replaceIdentifierKey(e,e.key):y.NodeGuards.isLiteralNode(e.key)?this.replaceLiteralKey(e,e.key):e}replaceIdentifierKey(e,t){return r.ignoredNames.includes(t.name)||e.computed||(e.computed=!0,e.key=g.NodeFactory.literalNode(t.name)),e}replaceLiteralKey(e,t){return"string"!=typeof t.value||r.ignoredNames.includes(t.value)||e.computed||(e.computed=!0),e}};h.ignoredNames=["constructor"],h=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.MethodDefinitionTransformer=h},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(13)),m=o(101),g=o(2),y=o(3),h=o(11),N=o(12),b=o(4),v=o(14),I=o(59);let S=r=class extends N.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.objectExpressionExtractorFactory=e}static isProhibitedHostStatement(e,t){return r.isReferencedIdentifierName(e,t)}static isReferencedIdentifierName(e,t){const o=[];let r=!1,n=!1;return p.traverse(t,{enter:t=>{t===e&&(n=!0),b.NodeGuards.isIdentifierNode(t)&&(n?o.includes(t.name)&&(r=!0):o.push(t.name))},leave:t=>{if(t===e)return n=!1,p.VisitorOption.Break}}),r}getVisitor(e){if(!this.options.transformObjectKeys)return null;switch(e){case h.TransformationStage.Converting:return{leave:(e,t)=>{if(t&&b.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(!e.properties.length)return e;const o=v.NodeStatementUtils.getRootStatementOfNode(e);return r.isProhibitedHostStatement(e,o)?e:this.applyObjectExpressionKeysExtractorsRecursive(r.objectExpressionExtractorNames,e,o)}applyObjectExpressionKeysExtractorsRecursive(e,t,o){const r=[...e],n=r.shift();if(!n)return t;const{nodeToReplace:i,objectExpressionHostStatement:a,objectExpressionNode:s}=this.objectExpressionExtractorFactory(n).extract(t,o);return this.applyObjectExpressionKeysExtractorsRecursive(r,s,a),i}};S.objectExpressionExtractorNames=[I.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor,I.ObjectExpressionExtractor.BasePropertiesExtractor],S=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.Factory__IObjectExpressionExtractor)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==m.TObjectExpressionExtractorFactory&&m.TObjectExpressionExtractorFactory)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],S),t.ObjectExpressionKeysTransformer=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(8),g=o(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return e.properties.forEach(e=>{e.key&&(e.computed?this.transformComputedProperty(e):this.transformBaseProperty(e))}),e}transformComputedProperty(e){g.NodeGuards.isLiteralNode(e.key)&&"string"==typeof e.key.value&&(e.key=m.NodeFactory.literalNode(e.key.value))}transformBaseProperty(e){e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=m.NodeFactory.literalNode(e.key.name))}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.ObjectExpressionTransformer=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(2),m=o(3),g=o(21),y=o(11),h=o(12),N=o(8),b=o(4),v=o(44),I=o(6);let S=r=class extends h.AbstractNodeTransformer{constructor(e,t){super(e,t),this.runAfter=[g.NodeTransformer.ObjectExpressionKeysTransformer,g.NodeTransformer.TemplateLiteralTransformer]}static chunkString(e,t){const o=Math.ceil(e.length/t),r=[];let n=0;for(let i=0;i{if(this.options.splitStrings)return t&&b.NodeGuards.isLiteralNode(e)?this.transformNode(e,t):void 0}};default:return null}}transformNode(e,t){if(v.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;const o=this.transformLiteralNodeByChunkLength(e,t,r.firstPassChunkLength);return f.replace(o,{enter:(e,t)=>{if(t&&b.NodeGuards.isLiteralNode(e))return this.transformLiteralNodeByChunkLength(e,t,this.options.splitStringsChunkLength)}})}transformLiteralNodeByChunkLength(e,t,o){if("string"!=typeof e.value)return e;if(o>=e.value.length)return e;const n=r.chunkString(e.value,o),i=this.transformStringChunksToBinaryExpressionNode(n);return I.NodeUtils.parentizeAst(i),I.NodeUtils.parentizeNode(i,t),i}transformStringChunksToBinaryExpressionNode(e){const t=e.shift(),o=e.shift();if(!t||!o)throw new Error("First and second chunks values should not be empty");const r=N.NodeFactory.binaryExpressionNode("+",N.NodeFactory.literalNode(t),N.NodeFactory.literalNode(o));return e.reduce((e,t)=>{const o=N.NodeFactory.literalNode(t);return N.NodeFactory.binaryExpressionNode("+",e,o)},r)}};S.firstPassChunkLength=1e3,S=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],S),t.SplitStringTransformer=S},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(11),m=o(12),g=o(8),y=o(4),h=o(6);let N=r=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}static isLiteralNodeWithStringValue(e){return!!e&&y.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}static isValidTemplateLiteralNode(e,t){return y.NodeGuards.isTemplateLiteralNode(e)&&!y.NodeGuards.isTaggedTemplateExpressionNode(t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&r.isValidTemplateLiteralNode(e,t))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const o=e.expressions;let n,i=[];if(e.quasis.forEach(e=>{i.push(g.NodeFactory.literalNode(e.value.cooked));const t=o.shift();t&&i.push(t)}),i=i.filter(e=>!(y.NodeGuards.isLiteralNode(e)&&""===e.value)),r.isLiteralNodeWithStringValue(i[0])||r.isLiteralNodeWithStringValue(i[1])||i.unshift(g.NodeFactory.literalNode("")),i.length>1){let e=g.NodeFactory.binaryExpressionNode("+",i.shift(),i.shift());i.forEach(t=>{e=g.NodeFactory.binaryExpressionNode("+",e,t)}),n=e}else n=i[0];return h.NodeUtils.parentizeAst(n),h.NodeUtils.parentizeNode(n,t),n}};N=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.TemplateLiteralTransformer=N},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(19),s=o(8),c=o(4),d=o(14);let l=r=class{static getPropertyNodeKeyName(e){const t=e.key;return!c.NodeGuards.isLiteralNode(t)||"string"!=typeof t.value&&"number"!=typeof t.value?c.NodeGuards.isIdentifierNode(t)?t.name:null:t.value.toString()}static isProhibitedPattern(e){return!e||c.NodeGuards.isObjectPatternNode(e)||c.NodeGuards.isArrayPatternNode(e)||c.NodeGuards.isAssignmentPatternNode(e)||c.NodeGuards.isRestElementNode(e)}extract(e,t){const o=e.parentNode;return o&&c.NodeGuards.isVariableDeclaratorNode(o)&&c.NodeGuards.isIdentifierNode(o.id)?this.transformObjectExpressionNode(e,t,o.id):{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}transformObjectExpressionNode(e,t,o){const r=e.properties,[n,i]=this.extractPropertiesToExpressionStatements(r,t,o),s=d.NodeStatementUtils.getScopeOfNode(t);return this.filterExtractedObjectExpressionProperties(e,i),a.NodeAppender.insertAfter(s,n,t),{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}extractPropertiesToExpressionStatements(e,t,o){const n=e.length,i=[],a=[];for(let d=0;d!t.includes(o))}};l=r=n([i.injectable()],l),t.BasePropertiesExtractor=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(18),s=o(23),c=o(61),d=o(58),l=o(60),u=o(107),f=o(108),p=o(109),m=o(110),g=o(111),y=o(112),h=o(115),N=o(116),b=o(117),v=o(118),I=o(119),S=o(120),O=o(122),j=o(124),_=o(126),C=o(128),R=o(130),F=o(134),T=o(136),w=o(137),x=o(138),E=o(140),G=o(142),P=o(149),A=o(151),M=o(154),D=o(155);t.customNodesModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICustomNode).to(O.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(i.ServiceIdentifiers.ICustomNode).to(_.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(i.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(i.ServiceIdentifiers.ICustomNode).to(R.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(F.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(i.ServiceIdentifiers.ICustomNode).to(x.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(E.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(i.ServiceIdentifiers.ICustomNode).to(G.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(i.ServiceIdentifiers.ICustomNode).to(P.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(i.ServiceIdentifiers.ICustomNode).to(A.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.BinaryExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BlockStatementControlFlowFlatteningNode).whenTargetNamed(a.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(I.CallExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(S.ControlFlowStorageNode).whenTargetNamed(a.ControlFlowCustomNode.ControlFlowStorageNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(T.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(w.LogicalExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(D.StringLiteralNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(M.StringLiteralControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(b.BlockStatementDeadCodeInjectionNode).whenTargetNamed(d.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.ObjectExpressionVariableDeclarationHostNode).whenTargetNamed(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode),e(i.ServiceIdentifiers.ICustomNodeGroup).to(u.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(f.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(p.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(m.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(g.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(i.ServiceIdentifiers.Factory__ICustomNode).toFactory(r.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNode)),e(i.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions)),e(i.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(r.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNodeGroup)),e(i.ServiceIdentifiers.ICustomNodeFormatter).to(j.CustomNodeFormatter).inSingletonScope()})},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.ConsoleOutputDisableExpressionNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.disableConsoleOutput)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.ConsoleOutputDisableExpressionNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.ConsoleOutputCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19),S=o(4);let O=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionCallNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionNode,t=>{I.NodeAppender.append(e,t.getNode())}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionIntervalNode,t=>{const o=S.NodeGuards.isSwitchCaseNode(e)?e.consequent.length:e.body.length,r=this.randomGenerator.getRandomInteger(0,o);I.NodeAppender.insertAtIndex(e,t.getNode(),r)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.debugProtection)return;const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),o=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionNode),r=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionCallNode),n=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);o.initialize(e),r.initialize(e,t),n.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(N.CustomNode.DebugProtectionFunctionNode,o),this.customNodes.set(N.CustomNode.DebugProtectionFunctionCallNode,r),this.options.debugProtectionInterval&&this.customNodes.set(N.CustomNode.DebugProtectionFunctionIntervalNode,n),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,i)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],O.prototype,"customNodes",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.DebugProtectionCustomNodeGroup=O},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DomainLockNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.domainLock.length)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.DomainLockNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.DomainLockNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.DomainLockCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.SelfDefendingUnicodeNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.selfDefending)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.SelfDefendingUnicodeNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.SelfDefendingCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=o(26),g=o(5),y=o(2),h=o(3),N=o(35),b=o(7),v=o(23),I=o(22),S=o(27),O=o(19);let j=class extends S.AbstractCustomNodeGroup{constructor(e,t,o,r,n){super(o,r,n),this.appendEvent=I.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e,this.stringArrayStorage=t}appendCustomNodes(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(v.CustomNode.StringArrayNode,t=>{O.NodeAppender.prepend(e,t.getNode())}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayCallsWrapper,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayRotateFunctionNode,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}))}initialize(){if(this.customNodes=new Map,!this.options.stringArray)return;const e=this.customNodeFactory(v.CustomNode.StringArrayNode),t=this.customNodeFactory(v.CustomNode.StringArrayCallsWrapper),o=this.customNodeFactory(v.CustomNode.StringArrayRotateFunctionNode),r=this.stringArrayStorage.getStorageName(),n=this.stringArrayStorage.getStorageCallsWrapperName(),i=this.stringArrayStorage.getRotationAmount();e.initialize(this.stringArrayStorage,r),t.initialize(r,n),o.initialize(r,i),this.customNodes.set(v.CustomNode.StringArrayNode,e),this.customNodes.set(v.CustomNode.StringArrayCallsWrapper,t),this.options.rotateStringArray&&this.customNodes.set(v.CustomNode.StringArrayRotateFunctionNode,o)}};d([b.initializable(),l("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],j.prototype,"customNodes",void 0),j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.Factory__ICustomNode)),u(1,f.inject(p.ServiceIdentifiers.IStringArrayStorage)),u(2,f.inject(p.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u(3,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(4,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==m.TCustomNodeFactory&&m.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.IStringArrayStorage&&N.IStringArrayStorage)?i:Object,"function"==typeof(a=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.StringArrayCustomNodeGroup=j},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8);let N=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.properties=e}getNodeStructure(e){return[h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()),h.NodeFactory.objectExpressionNode(this.properties))],"const")]}};N=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.ObjectExpressionVariableDeclarationHostNode=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n let that;\n \n try {\n const getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n const getGlobal = function () {\n let globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n const that = getGlobal();\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.binaryExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BinaryExpressionFunctionNode=b},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(4),v=o(6);let I=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=o}getNodeStructure(e){const t=this.randomGenerator.getRandomString(6),o=this.randomGenerator.getRandomString(6),r=N.NodeFactory.blockStatementNode([N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(t),N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join("|")),N.NodeFactory.identifierNode("split")),[N.NodeFactory.literalNode("|")]))],"const"),N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(o),N.NodeFactory.literalNode(0))],"let"),N.NodeFactory.whileStatementNode(N.NodeFactory.literalNode(!0),N.NodeFactory.blockStatementNode([N.NodeFactory.switchStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(t),N.NodeFactory.updateExpressionNode("++",N.NodeFactory.identifierNode(o)),!0),this.shuffledKeys.map((e,t)=>{const o=this.blockStatementBody[e],r=[o];return b.NodeGuards.isReturnStatementNode(o)||r.push(N.NodeFactory.continueStatement()),N.NodeFactory.switchCaseNode(N.NodeFactory.literalNode(String(t)),r)})),N.NodeFactory.breakStatement()]))]);return v.NodeUtils.parentizeAst(r),[r]}};s([y.initializable(),c("design:type",Array)],I.prototype,"blockStatementBody",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"originalKeysIndexesInShuffledArray",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"shuffledKeys",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.BlockStatementControlFlowFlatteningNode=I},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.blockStatementNode=e,this.deadCodeInjectionRootAstHostNode=t}getNodeStructure(e){const t=this.randomGenerator.getMathRandom()>.5,o=this.randomGenerator.getMathRandom()>.5,r=t?"===":"!==",n=this.randomGenerator.getRandomString(5),i=o?n:this.randomGenerator.getRandomString(5),[a,s]=t===o?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],c=h.NodeFactory.blockStatementNode([h.NodeFactory.ifStatementNode(h.NodeFactory.binaryExpressionNode(r,h.NodeFactory.literalNode(n),h.NodeFactory.literalNode(i)),a,s)]);return N.NodeUtils.parentizeAst(c),[c]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BlockStatementDeadCodeInjectionNode=b},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(7),N=o(10),b=o(8),v=o(6);let I=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o,r){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.callee=o,this.expressionArguments=r}getNodeStructure(){const e=b.NodeFactory.expressionStatementNode(b.NodeFactory.callExpressionNode(b.NodeFactory.memberExpressionNode(b.NodeFactory.identifierNode(this.controlFlowStorageName),b.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.callee,...this.expressionArguments]));return v.NodeUtils.parentizeAst(e),[e]}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof ESTree&&ESTree.Expression)?r:Object)],I.prototype,"callee",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageName",void 0),c([h.initializable(),d("design:type",Array)],I.prototype,"expressionArguments",void 0),I=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],I),t.CallExpressionControlFlowStorageCallNode=I},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.expressionArguments=e}getNodeStructure(e){const t=N.NodeFactory.identifierNode("callee"),o=[],r=this.expressionArguments.length;for(let e=0;e=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(121),m=o(5),g=o(2),y=o(3),h=o(9),N=o(7),b=o(10),v=o(8),I=o(4),S=o(6);let O=class extends b.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.controlFlowStorage=e}getNodeStructure(e){const t=Array.from(this.controlFlowStorage.getStorage()).map(([e,t])=>{const o=t.getNode()[0];if(!I.NodeGuards.isExpressionStatementNode(o))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return v.NodeFactory.propertyNode(v.NodeFactory.identifierNode(e),o.expression)});let o=v.NodeFactory.variableDeclarationNode([v.NodeFactory.variableDeclaratorNode(v.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()),v.NodeFactory.objectExpressionNode(t))],"const");return o=S.NodeUtils.parentizeAst(o),[o]}};c([N.initializable(),d("design:type","function"==typeof(r=void 0!==p.TControlFlowStorage&&p.TControlFlowStorage)?r:Object)],O.prototype,"controlFlowStorage",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.ControlFlowStorageNode=O},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(20),h=o(123),N=o(47),b=o(7),v=o(10),I=o(6);let S=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():N.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(h.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([b.initializable(),c("design:type",String)],S.prototype,"callsControllerFunctionName",void 0),S=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],S),t.ConsoleOutputDisableExpressionNode=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n const c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.table = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.table = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=s(o(13)),f=c(o(125)),p=o(62),m=o(4);let g=class{constructor(e){this.prevailingKindOfVariables=e.getPrevailingKind()}formatTemplate(e,t){return f.default(e,t)}formatStructure(e){for(const t of e)u.replace(t,{enter:e=>{if(m.NodeGuards.isVariableDeclarationNode(e))return"var"===this.prevailingKindOfVariables&&(e.kind="var"),e}});return e}};g=n([d.injectable(),a(0,d.inject(l.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),i("design:paramtypes",["function"==typeof(r=void 0!==p.IPrevailingKindOfVariablesAnalyzer&&p.IPrevailingKindOfVariablesAnalyzer)?r:Object])],g),t.CustomNodeFormatter=g},function(e,t){e.exports=require("string-template")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(127),N=o(10),b=o(6);let v=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"callsControllerFunctionName",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionCallNode=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(\n this,\n function () {\n const regExp1 = new RegExp('function *\\\\( *\\\\)');\n const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');\n \n const result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n }\n )();\n })();\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(129),N=o(10),b=o(6);let v=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionIntervalNode=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(20),h=o(7),N=o(131),b=o(132),v=o(133),I=o(10),S=o(6);let O=class extends I.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?N.DebuggerTemplate():b.DebuggerTemplateNoEval();return this.customNodeFormatter.formatTemplate(v.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([h.initializable(),c("design:type",String)],O.prototype,"debugProtectionFunctionName",void 0),O=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],O),t.DebugProtectionFunctionNode=O},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n const func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(48),g=o(2),y=o(3),h=o(9),N=o(20),b=o(7),v=o(135),I=o(47),S=o(10),O=o(6);let j=class extends S.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.cryptUtils=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.domainLock.join(";"),[t,o]=this.cryptUtils.hideString(e,3*e.length),r=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():I.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(v.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:o,domains:t,globalVariableTemplate:r,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([b.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.ICryptUtils)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.ICryptUtils&&m.ICryptUtils)?s:Object])],j),t.DomainLockNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n const func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (let i = 0; i < 1000; i--) {\n const isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n const regExp = new RegExp("[{diff}]", "g");\n const domains = "{domains}".replace(regExp, "").split(";");\n let document;\n let domain;\n let location;\n let hostname;\n\n for (let d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (let d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n\n if (!("~" > domain)) {\n for (let d2 in that[document]) {\n if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) {\n location = d2;\n \n break;\n }\n }\n\n for (let d3 in that[document][location]) {\n if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) {\n hostname = d3;\n \n break;\n }\n }\n }\n \n if (!document || !that[document]) {\n return;\n }\n \n const documentDomain = that[document][domain];\n const documentLocationHostName = !!that[document][location] && that[document][location][hostname];\n const currentDomain = documentDomain || documentLocationHostName;\n \n if (!currentDomain) {\n return;\n }\n \n let ok = false;\n \n for (let i = 0; i < domains.length; i++) {\n const domain = domains[i];\n const position = currentDomain.length - domain.length;\n const lastIndex = currentDomain.indexOf(domain, position);\n const endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o,r){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=o,this.rightValue=r}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.ExpressionWithOperatorControlFlowStorageCallNode=v},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.logicalExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionFunctionNode=b},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(22),h=o(7),N=o(139),b=o(36),v=o(10),I=o(25),S=o(6),O=o(9);let j=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.appendEvent===y.ObfuscationEvent.AfterObfuscation?I.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed})).getObfuscatedCode():this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([h.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),c([h.initializable(),d("design:type","function"==typeof(r=void 0!==y.ObfuscationEvent&&y.ObfuscationEvent)?r:Object)],j.prototype,"appendEvent",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==O.ICustomNodeFormatter&&O.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],j),t.NodeCallsControllerFunctionNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n const {singleNodeCallControllerFunctionName} = (function(){\n let firstCall = true;\n \n return function (context, fn){\n const rfn = firstCall ? function(){\n if(fn){\n const res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(7),b=o(36),v=o(141),I=o(10),S=o(25),O=o(6);let j=class extends I.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return S.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],j),t.SelfDefendingUnicodeNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return !regExp.test(func1.toString());\n };\n \n const test2 = function () {\n const regExp = new RegExp('${e.encode("(\\\\[x|u](\\w){2,4})+",!0)}');\n \n return regExp.test(func2.toString());\n };\n \n const recursiveFunc1 = function (string) {\n const i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n const recursiveFunc2 = function (string) {\n const i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+"")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n `}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(20),b=o(24),v=o(7),I=o(36),S=o(143),O=o(47),j=o(144),_=o(145),C=o(146),R=o(147),F=o(148),T=o(10),w=o(25),x=o(6);let E=class extends T.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}getNodeStructure(e){return x.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.getDecodeStringArrayTemplate();return w.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(R.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),Object.assign(Object.assign({},I.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}getDecodeStringArrayTemplate(){const e=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():O.GlobalVariableNoEvalTemplate(),t=this.customNodeFormatter.formatTemplate(S.AtobTemplate(),{globalVariableTemplate:e});let o="",r="";switch(this.options.selfDefending&&(r=this.customNodeFormatter.formatTemplate(_.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case b.StringArrayEncoding.Rc4:o=this.customNodeFormatter.formatTemplate(F.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:j.Rc4Template(),selfDefendingCode:r,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case b.StringArrayEncoding.Base64:o=this.customNodeFormatter.formatTemplate(C.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:r,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return o}};c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayName",void 0),c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayCallsWrapperName",void 0),E=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],E),t.StringArrayCallsWrapper=E},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n const str = String(input).replace(/=+$/, '');\n let output = '';\n for (\n let bc = 0, bs, buffer, idx = 0;\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n }\n );\n })();\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n const rc4 = function (str, key) {\n let s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (let k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n let i;\n \t \n\t for (i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (let y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){const o=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6),i=e.getRandomString(6),a=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),d=e.getRandomString(6),l=e.getRandomString(6);return`\n const StatesClass = function (${o}) {\n this.${o} = ${o};\n this.${r} = [1, 0, 0];\n this.${n} = function(){return 'newState';};\n this.${i} = '${t.encode("\\w+ *\\(\\) *{\\w+ *",!0)}';\n this.${a} = '${t.encode("['|\"].+['|\"];? *}",!0)}';\n };\n \n StatesClass.prototype.${s} = function () {\n const regExp = new RegExp(this.${i} + this.${a});\n const expression = regExp.test(this.${n}.toString())\n ? --this.${r}[1]\n : --this.${r}[0];\n \n return this.${c}(expression);\n };\n \n StatesClass.prototype.${c} = function (${l}) {\n if (!Boolean(~${l})) {\n return ${l};\n }\n \n return this.${d}(this.${o});\n };\n\n StatesClass.prototype.${d} = function (${o}) {\n for (let i = 0, len = this.${r}.length; i < len; i++) {\n this.${r}.push(Math.round(Math.random()));\n len = this.${r}.length;\n }\n \n return ${o}(this.${r}[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).${s}();\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){const t=e.getRandomString(6),o=e.getRandomString(6),r=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.${o} = function (str) {\n const string = atob(str);\n let newStringChars = [];\n \n for (let i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.${r} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${r}[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.${o}(value);\n {stringArrayCallsWrapperName}.${r}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n const {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n let value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){const t=e.getRandomString(6),o=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.${o} = rc4;\n \n {stringArrayCallsWrapperName}.${r} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${r}[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.${n} === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.${n} = true;\n }\n \n value = {stringArrayCallsWrapperName}.${o}(value, key);\n {stringArrayCallsWrapperName}.${r}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(35),N=o(7),b=o(150),v=o(10),I=o(6);let S=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.stringArrayStorage=e,this.stringArrayName=t}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(b.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}};c([N.initializable(),d("design:type","function"==typeof(r=void 0!==h.IStringArrayStorage&&h.IStringArrayStorage)?r:Object)],S.prototype,"stringArrayStorage",void 0),c([N.initializable(),d("design:type",String)],S.prototype,"stringArrayName",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],S),t.StringArrayNode=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n const {stringArrayName} = [{stringArray}];\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(7),b=o(36),v=o(152),I=o(153),S=o(10),O=o(25),j=o(6),_=o(37);let C=class extends S.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayRotationAmount=t}getNodeStructure(e){return j.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate();let o="";return o=this.options.selfDefending?this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):`${t}(++${e})`,O.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(I.StringArrayRotateFunctionTemplate(),{code:o,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotationAmount:_.NumberUtils.toHex(this.stringArrayRotationAmount),whileFunctionName:t}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],C.prototype,"stringArrayName",void 0),c([N.initializable(),d("design:type",Number)],C.prototype,"stringArrayRotationAmount",void 0),C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.StringArrayRotateFunctionNode=C},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const selfDefendingFunc = function () {\n const object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n let updatedCookie = name + "=" + value;\n let i = 0;\n \n for (let i = 0, len = options.length; i < len; i++) {\n const propName = options[i];\n \n updatedCookie += "; " + propName;\n \n const propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += "=" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n const matches = document(new RegExp(\n "(?:^|; )" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + "=([^;]*)"\n ));\n \n const func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n let cookie = '';\n const result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n const {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotationAmount});\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.StringLiteralControlFlowStorageCallNode=v},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8);let b=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.literalValue=e}getNodeStructure(e){return[N.NodeFactory.expressionStatementNode(N.NodeFactory.literalNode(this.literalValue))]}};s([y.initializable(),c("design:type",String)],b.prototype,"literalValue",void 0),b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.StringLiteralNode=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0);t.finalizingTransformersModule=new r.ContainerModule(e=>{})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(31),a=o(158),s=o(159),c=o(160);t.generatorsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(a.DictionaryIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(c.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(n.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(){let e=null;return t=>o=>{if(e)return e;let r;switch(o.identifierNamesGenerator){case i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return e=r,r}}())})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(34),p=o(2),m=o(3),g=o(49);let y=r=class extends g.AbstractIdentifierNamesGenerator{constructor(e,t,o){super(e,t),this.arrayUtils=o,this.identifierNamesSet=new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)),this.identifiersIterator=this.identifierNamesSet.values()}static incrementIdentifierName(e){let t="",o=!1;for(const r of e)o||r!==r.toUpperCase()?o||r!==r.toLowerCase()?t+=r:(t+=r.toUpperCase(),o=!0):t+=r.toLowerCase();return o?t:null}generate(){if(!this.identifierNamesSet.size)throw new Error("Too many identifiers in the code, add more words to identifiers dictionary");const e=this.identifiersIterator.next();return e.done?(this.identifierNamesSet=new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])),this.identifiersIterator=this.identifierNamesSet.values(),this.generate()):e.value}generateWithPrefix(){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate()}`.replace("__","_")}getInitialIdentifierNames(e){const t=e.filter(Boolean).map(e=>e.toLowerCase());return this.arrayUtils.shuffle(t)}getIncrementedIdentifierNames(e){const t=[];for(const o of e){const e=r.incrementIdentifierName(o);e&&t.push(e)}return this.arrayUtils.shuffle(t)}};y=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(1,l.inject(u.ServiceIdentifiers.IOptions)),d(2,l.inject(u.ServiceIdentifiers.IArrayUtils)),c("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object,"function"==typeof(a=void 0!==f.IArrayUtils&&f.IArrayUtils)?a:Object])],y),t.DictionaryIdentifierNamesGenerator=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(49),m=o(37),g=o(30);let y=r=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.randomVariableNameSet=new Set}generate(e){const t=this.randomGenerator.getRandomInteger(1e4,99999999),o=m.NumberUtils.toHex(t),n=g.Utils.hexadecimalPrefix.length+1,i=e?e-n:r.baseIdentifierNameLength,a=o.substr(0,i),s=`_${g.Utils.hexadecimalPrefix}${a}`;return this.randomVariableNameSet.has(s)?this.generate(e):(this.randomVariableNameSet.add(s),s)}generateWithPrefix(e){const t=this.generate(e);return`${this.options.identifiersPrefix}${t}`.replace("__","_")}};y.baseIdentifierNameLength=6,y=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],y),t.HexadecimalIdentifierNamesGenerator=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(49);let m=r=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.previousMangledName=r.initMangledNameCharacter}generate(e){const t=this.generateNewMangledName(this.previousMangledName);return this.previousMangledName=t,t}generateWithPrefix(e){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate(e)}`}isValidIdentifierName(e){return super.isValidIdentifierName(e)&&!r.reservedNamesSet.has(e)}generateNewMangledName(e){let t=(e=>{const t=r.nameSequence,o=t.length,n=e.length,i=e=>"0".repeat(e);let a=n-1;do{const r=e[a],s=t.indexOf(r);if(s!==o-1){return e.substring(0,a)+t[s+1]+i(n-(a+1))}--a}while(a>=0);return`a${i(n)}`})(e);return this.isValidIdentifierName(t)||(t=this.generateNewMangledName(t)),t}};m.initMangledNameCharacter="9",m.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),m.reservedNamesSet=new Set(["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"]),m=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MangledIdentifierNamesGenerator=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1);t.nodeTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.Factory__INodeTransformer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeTransformer))})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(38),s=o(63),c=o(21),d=o(163),l=o(164),u=o(165),f=o(167),p=o(169),m=o(170),g=o(171);t.obfuscatingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(u.LabeledStatementTransformer).whenTargetNamed(c.NodeTransformer.LabeledStatementTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.LiteralTransformer).whenTargetNamed(c.NodeTransformer.LiteralTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ScopeIdentifiersTransformer).whenTargetNamed(c.NodeTransformer.ScopeIdentifiersTransformer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(l.BooleanLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(p.NumberLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(m.StringLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(d.BaseIdentifierObfuscatingReplacer).whenTargetNamed(a.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),e(i.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObfuscatingReplacer)),e(i.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer))})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(5),u=o(2),f=o(39),p=o(8);let m=class extends f.AbstractObfuscatingReplacer{constructor(e,t){super(t),this.blockScopesMap=new Map,this.identifierNamesGenerator=e(t)}replace(e,t){let o=e.name;if(this.blockScopesMap.has(t)){const e=this.blockScopesMap.get(t);e.has(o)&&(o=e.get(o))}return p.NodeFactory.identifierNode(o)}storeGlobalName(e,t){const o=e.name;if(this.isReservedName(o))return;const r=this.identifierNamesGenerator.generateWithPrefix();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(o,r)}storeLocalName(e,t){const o=e.name;if(this.isReservedName(o))return;const r=this.identifierNamesGenerator.generate();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(o,r)}preserveName(e){this.identifierNamesGenerator.preserveName(e)}isReservedName(e){return!!this.options.reservedNames.length&&this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==l.TIdentifierNamesGeneratorFactory&&l.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==u.IOptions&&u.IOptions)?n:Object])],m),t.BaseIdentifierObfuscatingReplacer=m},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(39),f=o(8);let p=r=class extends u.AbstractObfuscatingReplacer{constructor(e){super(e)}static getTrueUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",r.getFalseUnaryExpressionNode())}static getFalseUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",f.NodeFactory.arrayExpressionNode())}replace(e){const t=e.value;if("boolean"!=typeof t)throw new Error("`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value");return t?r.getTrueUnaryExpressionNode():r.getFalseUnaryExpressionNode()}};p=r=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.BooleanLiteralObfuscatingReplacer=p},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(50),m=o(2),g=o(3),y=o(38),h=o(11),N=o(12),b=o(4),v=o(166);let I=class extends N.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.identifierObfuscatingReplacer=e(y.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case h.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&b.NodeGuards.isLabeledStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const o=v.NodeLexicalScopeUtils.getLexicalScope(e);return o?(this.storeLabeledStatementName(e,o),this.replaceLabeledStatementName(e,o),e):e}storeLabeledStatementName(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label,t)}replaceLabeledStatementName(e,t){f.replace(e,{enter:(e,o)=>{if(o&&b.NodeGuards.isLabelIdentifierNode(e,o)){const o=this.identifierObfuscatingReplacer.replace(e,t);e.name=o.name}}})}};I=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(2,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierObfuscatingReplacerFactory&&p.TIdentifierObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==m.IOptions&&m.IOptions)?i:Object])],I),t.LabeledStatementTransformer=I},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static getLexicalScope(e){return n.getLexicalScopesRecursive(e,1)[0]}static getLexicalScopes(e){return n.getLexicalScopesRecursive(e)}static getLexicalScopesRecursive(e,t=1/0,o=[],i=0){if(o.length>=t)return o;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithLexicalScope(e)&&o.push(e),e!==a?n.getLexicalScopesRecursive(a,t,o,++i):o}}t.NodeLexicalScopeUtils=n},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(168),m=o(29),g=o(2),y=o(3),h=o(64),N=o(63),b=o(11),v=o(12),I=o(8),S=o(4),O=o(44),j=o(15),_=o(6);let C=class extends v.AbstractNodeTransformer{constructor(e,t,o,r,n){super(t,o),this.literalObfuscatingReplacerFactory=e,this.stringArrayStorageAnalyzer=r,this.escapeSequenceEncoder=n}getVisitor(e){switch(e){case b.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(S.NodeGuards.isProgramNode(e)&&this.analyzeNode(e),t&&S.NodeGuards.isLiteralNode(e)&&!j.NodeMetadata.isReplacedLiteral(e))return this.transformNode(e,t)}};case b.TransformationStage.Finalizing:return{enter:(e,t)=>{if(t&&S.NodeGuards.isLiteralNode(e))return this.encodeLiteralNodeToEscapeSequence(e,t)}};default:return null}}analyzeNode(e){this.stringArrayStorageAnalyzer.analyze(e)}transformNode(e,t){if(O.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;let o;switch(typeof e.value){case"boolean":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e);break;case"number":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e);break;case"string":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e);break;default:o=e}return _.NodeUtils.parentizeNode(o,t),o}encodeLiteralNodeToEscapeSequence(e,t){return"string"!=typeof e.value?e:I.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(e.value,this.options.unicodeEscapeSequence))}};C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IObfuscatingReplacer)),l(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(2,u.inject(f.ServiceIdentifiers.IOptions)),l(3,u.inject(f.ServiceIdentifiers.IStringArrayStorageAnalyzer)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TLiteralObfuscatingReplacerFactory&&p.TLiteralObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==g.IOptions&&g.IOptions)?i:Object,"function"==typeof(a=void 0!==h.IStringArrayStorageAnalyzer&&h.IStringArrayStorageAnalyzer)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.LiteralTransformer=C},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(2),l=o(39),u=o(8),f=o(37),p=o(30);let m=class extends l.AbstractObfuscatingReplacer{constructor(e){super(e),this.numberLiteralCache=new Map}replace(e){const t=e.value;if("number"!=typeof t)throw new Error("`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value");let o;return this.numberLiteralCache.has(t)?o=this.numberLiteralCache.get(t):(o=f.NumberUtils.isCeil(t)?`${p.Utils.hexadecimalPrefix}${f.NumberUtils.toHex(t)}`:String(t),this.numberLiteralCache.set(t,o)),u.NodeFactory.literalNode(t,o)}};m=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IOptions&&d.IOptions)?r:Object])],m),t.NumberLiteralObfuscatingReplacer=m},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(2),p=o(35),m=o(64),g=o(7),y=o(24),h=o(39),N=o(15),b=o(8),v=o(37),I=o(30);let S=r=class extends h.AbstractObfuscatingReplacer{constructor(e,t,o){super(o),this.nodesCache=new Map,this.stringArrayStorage=e,this.stringArrayStorageAnalyzer=t}static getHexadecimalLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}static getRc4KeyLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}initialize(){this.stringArrayStorageCallsWrapperName=this.stringArrayStorage.getStorageCallsWrapperName(),this.options.shuffleStringArray&&this.stringArrayStorage.shuffleStorage(),this.options.rotateStringArray&&this.stringArrayStorage.rotateStorage()}replace(e){const t=e.value;if("string"!=typeof t)throw new Error("`StringLiteralObfuscatingReplacer` should accept only literals with `string` value");const o=this.stringArrayStorageAnalyzer.getItemDataForLiteralNode(e),r=`${t}-${Boolean(o)}`;if(this.nodesCache.has(r)&&this.options.stringArrayEncoding!==y.StringArrayEncoding.Rc4)return this.nodesCache.get(r);const n=o?this.replaceWithStringArrayCallNode(o):this.replaceWithLiteralNode(t);return this.nodesCache.set(r,n),n}replaceWithLiteralNode(e){return b.NodeFactory.literalNode(e)}replaceWithStringArrayCallNode(e){const{index:t,decodeKey:o}=e,n=`${I.Utils.hexadecimalPrefix}${v.NumberUtils.toHex(t)}`,i=[r.getHexadecimalLiteralNode(n)];o&&i.push(r.getRc4KeyLiteralNode(o));const a=b.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName);return b.NodeFactory.callExpressionNode(a,i)}};s([g.initializable(),c("design:type",String)],S.prototype,"stringArrayStorageCallsWrapperName",void 0),s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],S.prototype,"initialize",null),S=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IStringArrayStorage)),d(1,l.inject(u.ServiceIdentifiers.IStringArrayStorageAnalyzer)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==p.IStringArrayStorage&&p.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==m.IStringArrayStorageAnalyzer&&m.IStringArrayStorageAnalyzer)?i:Object,"function"==typeof(a=void 0!==f.IOptions&&f.IOptions)?a:Object])],S),t.StringLiteralObfuscatingReplacer=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(50),y=o(2),h=o(3),N=o(172),b=o(38),v=o(11),I=o(12),S=o(4),O=o(15);let j=r=class extends I.AbstractNodeTransformer{constructor(e,t,o,r){super(t,o),this.lexicalScopesWithObjectPatternWithoutDeclarationMap=new Map,this.identifierObfuscatingReplacer=e(b.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),this.scopeAnalyzer=r}getVisitor(e){switch(e){case v.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&S.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.transformNode(e,t)}};default:return null}}analyzeNode(e,t){this.scopeAnalyzer.analyze(e)}transformNode(e,t){const o=this.scopeAnalyzer.acquireScope(e);return this.traverseScopeVariables(o),e}traverseScopeVariables(e){const t=e.variableScope,o=S.NodeGuards.isNodeWithBlockLexicalScope(t.block)?t.block:null,n=r.globalScopeNames.includes(t.type);if(o){for(const t of e.variables)if(t.name!==r.argumentsVariableName){if(!this.options.renameGlobals&&n){if(!t.defs.every(e=>"ImportBinding"===e.type||"CatchClause"===e.type))continue}this.transformScopeVariableIdentifiers(t,o,n)}for(const t of e.childScopes)this.traverseScopeVariables(t)}}transformScopeVariableIdentifiers(e,t,o){for(const r of e.identifiers)this.isReplaceableIdentifierNode(r,t,e)&&(this.storeIdentifierName(r,t,o),this.replaceIdentifierName(r,t,e))}storeIdentifierName(e,t,o){o?this.identifierObfuscatingReplacer.storeGlobalName(e,t):this.identifierObfuscatingReplacer.storeLocalName(e,t)}replaceIdentifierName(e,t,o){const r=this.identifierObfuscatingReplacer.replace(e,t);e.name=r.name,o.references.forEach(t=>{t.identifier.name=e.name})}isReplaceableIdentifierNode(e,t,o){const r=e.parentNode;return!(!r||O.NodeMetadata.isIgnoredNode(e)||this.isProhibitedPropertyNode(e,r)||this.isProhibitedClassDeclarationNameIdentifierNode(o,e,r)||this.isProhibitedExportNamedClassDeclarationIdentifierNode(e,r)||this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,r)||this.isProhibitedExportNamedVariableDeclarationIdentifierNode(e,r)||this.isProhibitedImportSpecifierNode(e,r)||this.isProhibitedVariableNameUsedInObjectPatternNode(o,e,t)||S.NodeGuards.isLabelIdentifierNode(e,r))}isProhibitedClassDeclarationNameIdentifierNode(e,t,o){return S.NodeGuards.isClassDeclarationNode(e.scope.block)&&S.NodeGuards.isClassDeclarationNode(o)&&o.id===t}isProhibitedExportNamedClassDeclarationIdentifierNode(e,t){return S.NodeGuards.isClassDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,t){return S.NodeGuards.isFunctionDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedVariableDeclarationIdentifierNode(e,t){return S.NodeGuards.isVariableDeclaratorNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isVariableDeclarationNode(t.parentNode)&&!!t.parentNode.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode.parentNode)}isProhibitedImportSpecifierNode(e,t){return S.NodeGuards.isImportSpecifierNode(t)&&t.imported.name===t.local.name}isProhibitedPropertyNode(e,t){const o=S.NodeGuards.isPropertyNode(t)&&!t.computed&&t.key===e,r=S.NodeGuards.isAssignmentPatternNode(t)&&t.left===e&&!!t.parentNode&&S.NodeGuards.isPropertyNode(t.parentNode)&&t.left===t.parentNode.key;return o||r}isProhibitedVariableNameUsedInObjectPatternNode(e,t,o){let r=this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(o);if(!1===r)return!1;if(!e.defs.some(e=>"var"===e.kind))return!1;let n=!1;return m.traverse(o,{enter:(e,o)=>{if(S.NodeGuards.isObjectPatternNode(e)&&o&&S.NodeGuards.isAssignmentExpressionNode(o)){r=!0;const o=e.properties;for(const e of o)if(!e.computed&&e.shorthand&&S.NodeGuards.isIdentifierNode(e.key)&&t.name===e.key.name)return n=!0,m.VisitorOption.Break}}}),this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(o,null!=r&&r),n}};j.argumentsVariableName="arguments",j.globalScopeNames=["global","module"],j=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),l(1,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(2,f.inject(p.ServiceIdentifiers.IOptions)),l(3,f.inject(p.ServiceIdentifiers.IScopeAnalyzer)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierObfuscatingReplacerFactory&&g.TIdentifierObfuscatingReplacerFactory)?n:Object,"function"==typeof(i=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.IOptions&&y.IOptions)?a:Object,"function"==typeof(s=void 0!==N.IScopeAnalyzer&&N.IScopeAnalyzer)?s:Object])],j),t.ScopeIdentifiersTransformer=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(174),a=o(181);t.optionsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IOptions).to(i.Options).inSingletonScope(),e(n.ServiceIdentifiers.IOptionsNormalizer).to(a.OptionsNormalizer).inSingletonScope()})},function(e,t,o){"use strict";var r,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=o(28),m=o(0),g=o(1),y=o(65),h=o(175),N=o(176),b=o(177),v=o(31),I=o(20),S=o(32),O=o(24),j=o(40),_=o(178),C=o(179);let R=r=class{constructor(e,t){Object.assign(this,j.DEFAULT_PRESET,e);const o=y.validateSync(this,r.validatorOptions);if(o.length)throw new ReferenceError(`Validation failed. errors:\n${_.ValidationErrorsFormatter.format(o)}`);Object.assign(this,t.normalize(this))}};R.validatorOptions={validationError:{target:!1}},l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"compact",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"controlFlowFlattening",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"controlFlowFlatteningThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"deadCodeInjection",void 0),l([y.IsNumber(),u("design:type",Number)],R.prototype,"deadCodeInjectionThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtection",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtectionInterval",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"disableConsoleOutput",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),C.IsAllowedForObfuscationTargets([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval]),u("design:type",Array)],R.prototype,"domainLock",void 0),l([y.IsIn([v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,v.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,v.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]),u("design:type","function"==typeof(n=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?n:Object)],R.prototype,"identifierNamesGenerator",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"identifiersPrefix",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),y.ValidateIf(e=>e.identifierNamesGenerator===v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),y.ArrayNotEmpty(),u("design:type",Array)],R.prototype,"identifiersDictionary",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFileName",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFilePath",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"log",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"renameGlobals",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedNames",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedStrings",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"rotateStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"selfDefending",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"shuffleStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"sourceMap",void 0),l([y.IsString(),y.ValidateIf(e=>Boolean(e.sourceMapBaseUrl)),y.IsUrl({require_protocol:!0,require_tld:!1,require_valid_protocol:!0}),u("design:type",String)],R.prototype,"sourceMapBaseUrl",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"sourceMapFileName",void 0),l([y.IsIn([S.SourceMapMode.Inline,S.SourceMapMode.Separate]),u("design:type","function"==typeof(i=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?i:Object)],R.prototype,"sourceMapMode",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"splitStrings",void 0),l([y.IsNumber(),y.ValidateIf(e=>Boolean(e.splitStrings)),y.Min(1),u("design:type",Number)],R.prototype,"splitStringsChunkLength",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"stringArray",void 0),l([y.IsIn([!0,!1,O.StringArrayEncoding.Base64,O.StringArrayEncoding.Rc4]),u("design:type","function"==typeof(a=void 0!==N.TStringArrayEncoding&&N.TStringArrayEncoding)?a:Object)],R.prototype,"stringArrayEncoding",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"stringArrayThreshold",void 0),l([y.IsIn([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval,I.ObfuscationTarget.Node]),u("design:type","function"==typeof(s=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?s:Object)],R.prototype,"target",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"transformObjectKeys",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"unicodeEscapeSequence",void 0),R=r=l([m.injectable(),f(0,m.inject(g.ServiceIdentifiers.TInputOptions)),f(1,m.inject(g.ServiceIdentifiers.IOptionsNormalizer)),u("design:paramtypes",["function"==typeof(c=void 0!==h.TInputOptions&&h.TInputOptions)?c:Object,"function"==typeof(d=void 0!==b.IOptionsNormalizer&&b.IOptionsNormalizer)?d:Object])],R),t.Options=R},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static format(e){return e.reduce((e,t)=>[...e,r.formatWithNestedConstraints(t)],[]).join("\n")}static formatWithNestedConstraints(e){const t=e.constraints;return`${`\`${e.property}\` errors:\n`}${Object.keys(t).map(e=>` - ${t[e]}\n`).join()}`}}t.ValidationErrorsFormatter=r},function(e,t,o){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=o(65),i=r(o(180)),a=o(41),s=o(40);t.IsAllowedForObfuscationTargets=function(e,t){return(o,r)=>{n.registerDecorator({propertyName:r,constraints:[e],name:"IsAllowedForObfuscationTargets",options:t,target:o.constructor,validator:{validate(t,o){const n=o.object,a=s.DEFAULT_PRESET[r];return i.default(t,a)||e.includes(n.target)},defaultMessage:t=>`This option allowed only for obfuscation targets: ${e.join(`${a.StringSeparator.Comma} `)}`}})}}},function(e,t){e.exports=require("fast-deep-equal")},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(182),s=o(183),c=o(184),d=o(185),l=o(186),u=o(187),f=o(188),p=o(189),m=o(190),g=o(191),y=o(192),h=o(193),N=o(194);let b=r=class{normalize(e){let t=Object.assign({},e);for(const e of r.normalizerRules)t=e(t);return t}};b.normalizerRules=[a.ControlFlowFlatteningThresholdRule,s.DeadCodeInjectionRule,c.DeadCodeInjectionThresholdRule,d.DomainLockRule,l.InputFileNameRule,u.SeedRule,f.SelfDefendingRule,p.SourceMapBaseUrlRule,m.SourceMapFileNameRule,g.SplitStringsChunkLengthRule,y.StringArrayRule,h.StringArrayEncodingRule,N.StringArrayThresholdRule],b=r=n([i.injectable()],b),t.OptionsNormalizer=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControlFlowFlatteningThresholdRule=e=>(0===e.controlFlowFlatteningThreshold&&(e=Object.assign(Object.assign({},e),{controlFlowFlattening:!1,controlFlowFlatteningThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(40);t.DeadCodeInjectionRule=e=>(e.deadCodeInjection&&((e=Object.assign(Object.assign({},e),{deadCodeInjection:!0,stringArray:!0})).stringArrayThreshold||(e=Object.assign(Object.assign({},e),{stringArray:!0,stringArrayThreshold:r.DEFAULT_PRESET.stringArrayThreshold}))),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeadCodeInjectionThresholdRule=e=>(0===e.deadCodeInjectionThreshold&&(e=Object.assign(Object.assign({},e),{deadCodeInjection:!1,deadCodeInjectionThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(30);t.DomainLockRule=e=>{if(e.domainLock.length){const t=[];for(const o of e.domainLock)t.push(r.Utils.extractDomainFrom(o));e=Object.assign(Object.assign({},e),{domainLock:t})}return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(41);t.InputFileNameRule=e=>{let{inputFileName:t}=e;return t&&(t=t.replace(/^\/+/,"").split(r.StringSeparator.Dot).slice(0,-1).join(r.StringSeparator.Dot)||t,e=Object.assign(Object.assign({},e),{inputFileName:`${t}.js`})),e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeedRule=e=>{if(e.seed)return Object.assign(Object.assign({},e),{seed:e.seed});return Object.assign(Object.assign({},e),{seed:(t=0,o=999999999,Math.floor(Math.random()*(o-t+1)+t))});var t,o}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingRule=e=>(e.selfDefending&&(e=Object.assign(Object.assign({},e),{compact:!0,selfDefending:!0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapBaseUrlRule=e=>{const{sourceMapBaseUrl:t}=e;return e.sourceMapFileName?(t&&!t.endsWith("/")&&(e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:`${t}/`})),e):e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:""})}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(41);t.SourceMapFileNameRule=e=>{let{sourceMapFileName:t}=e;if(t){t=t.replace(/^\/+/,"").replace(/(?:\.js)?(?:\.map)?$/,"");let o=t.split(r.StringSeparator.Dot);const n=o.length,i=o[n-1];n>1&&i.length<=3&&(o=o.slice(0,-1)),t=o.join(r.StringSeparator.Dot),e=Object.assign(Object.assign({},e),{sourceMapFileName:`${t}.js.map`})}return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SplitStringsChunkLengthRule=e=>e=0===e.splitStringsChunkLength?Object.assign(Object.assign({},e),{splitStrings:!1,splitStringsChunkLength:0}):Object.assign(Object.assign({},e),{splitStringsChunkLength:Math.floor(e.splitStringsChunkLength)})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRule=e=>(e.stringArray||(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,shuffleStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(24);t.StringArrayEncodingRule=e=>(!0===e.stringArrayEncoding&&(e=Object.assign(Object.assign({},e),{stringArrayEncoding:r.StringArrayEncoding.Base64})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayThresholdRule=e=>(0===e.stringArrayThreshold&&(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(21),s=o(66),c=o(196),d=o(197),l=o(67),u=o(198),f=o(202),p=o(204),m=o(205),g=o(207),y=o(208),h=o(209);t.preparingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.CommentsTransformer).whenTargetNamed(a.NodeTransformer.CommentsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.CustomNodesTransformer).whenTargetNamed(a.NodeTransformer.CustomNodesTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.EvalCallExpressionTransformer).whenTargetNamed(a.NodeTransformer.EvalCallExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.MetadataTransformer).whenTargetNamed(a.NodeTransformer.MetadataTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.ObfuscatingGuardsTransformer).whenTargetNamed(a.NodeTransformer.ObfuscatingGuardsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ParentificationTransformer).whenTargetNamed(a.NodeTransformer.ParentificationTransformer),e(i.ServiceIdentifiers.INodeGuard).to(c.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.BlackListObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(l.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ConditionalCommentObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(y.ReservedStringObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ReservedStringObfuscatingGuard),e(i.ServiceIdentifiers.Factory__INodeGuard).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeGuard)),e(i.ServiceIdentifiers.INodeTransformer).to(h.VariablePreserveTransformer).whenTargetNamed(a.NodeTransformer.VariablePreserveTransformer)})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=o(4);let c=r=class{constructor(){this.blackListGuardsLength=r.blackListGuards.length}check(e){for(let t=0;t=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(2),m=o(3),g=o(11),y=o(12),h=o(4),N=o(67);let b=r=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case g.TransformationStage.Initializing:return{leave:e=>{if(h.NodeGuards.isProgramNode(e))return this.transformNode(e)}};default:return null}}transformNode(e){if(!e.comments||!e.comments.length)return e;const t=this.transformComments(e.comments);return 0===t.length?e:e.body.length?(f.traverse(e,{enter:o=>{if(o===e)return;const r=t.findIndex(e=>e.range&&o.range&&e.range[0]0&&(e.trailingComments=t.reverse()),e):(e.leadingComments=t,e)}transformComments(e){return e.filter(e=>r.preservedWords.some(t=>e.value.includes(t))||N.ConditionalCommentObfuscatingGuard.isConditionalComment(e)).reverse()}};b.preservedWords=["@license","@preserve"],b=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],b),t.CommentsTransformer=b},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=o(199),g=o(200),y=o(2),h=o(3),N=o(201),b=o(62),v=o(22),I=o(11),S=o(12),O=o(4);let j=class extends S.AbstractNodeTransformer{constructor(e,t,o,r,n,i){super(n,i),this.callsGraphData=[],this.callsGraphAnalyzer=e,this.prevailingKindOfVariablesAnalyzer=t,this.obfuscationEventEmitter=o,this.customNodeGroupStorage=r}getVisitor(e){switch(e){case I.TransformationStage.Preparing:return{leave:(e,t)=>{if(O.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.appendCustomNodesBeforeObfuscation(e,t),this.transformNode(e,t)}};case I.TransformationStage.Finalizing:return{leave:(e,t)=>{O.NodeGuards.isProgramNode(e)&&this.appendCustomNodesAfterObfuscation(e,t)}};default:return null}}analyzeNode(e,t){this.callsGraphData=this.callsGraphAnalyzer.analyze(e),this.prevailingKindOfVariablesAnalyzer.analyze(e)}transformNode(e,t){return e}appendCustomNodesBeforeObfuscation(e,t){this.customNodeGroupStorage.getStorage().forEach(e=>{e.initialize(),this.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(v.ObfuscationEvent.BeforeObfuscation,e,this.callsGraphData)}appendCustomNodesAfterObfuscation(e,t){this.obfuscationEventEmitter.emit(v.ObfuscationEvent.AfterObfuscation,e,this.callsGraphData)}};j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.ICallsGraphAnalyzer)),u(1,f.inject(p.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),u(2,f.inject(p.ServiceIdentifiers.IObfuscationEventEmitter)),u(3,f.inject(p.ServiceIdentifiers.TCustomNodeGroupStorage)),u(4,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(5,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(r=void 0!==N.ICallsGraphAnalyzer&&N.ICallsGraphAnalyzer)?r:Object,"function"==typeof(n=void 0!==b.IPrevailingKindOfVariablesAnalyzer&&b.IPrevailingKindOfVariablesAnalyzer)?n:Object,"function"==typeof(i=void 0!==g.IObfuscationEventEmitter&&g.IObfuscationEventEmitter)?i:Object,"function"==typeof(a=void 0!==m.TCustomNodeGroupStorage&&m.TCustomNodeGroupStorage)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.CustomNodesTransformer=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(203)),p=o(2),m=o(3),g=o(11),y=o(12),h=o(8),N=o(4),b=o(6);let v=r=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t),this.evalRootAstHostNodeSet=new Set}static extractEvalStringFromCallExpressionArgument(e){return N.NodeGuards.isLiteralNode(e)?r.extractEvalStringFromLiteralNode(e):N.NodeGuards.isTemplateLiteralNode(e)?r.extractEvalStringFromTemplateLiteralNode(e):null}static extractEvalStringFromLiteralNode(e){return"string"==typeof e.value?e.value:null}static extractEvalStringFromTemplateLiteralNode(e){const t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(t&&N.NodeGuards.isCallExpressionNode(e)&&N.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return this.transformNode(e,t)}};case g.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:(e,t)=>{if(t&&this.isEvalRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}transformNode(e,t){const o=e.arguments[0];if(!o)return e;const n=r.extractEvalStringFromCallExpressionArgument(o);if(!n)return e;let i;try{i=b.NodeUtils.convertCodeToStructure(n)}catch(t){return e}const a=h.NodeFactory.functionExpressionNode([],h.NodeFactory.blockStatementNode(i));return this.evalRootAstHostNodeSet.add(a),a}restoreNode(e,t){const o=e.body.body,r=b.NodeUtils.convertStructureToCode(o);return h.NodeFactory.callExpressionNode(h.NodeFactory.identifierNode("eval"),[h.NodeFactory.literalNode(f.default(r))])}isEvalRootAstHostNode(e){return N.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}};v=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],v),t.EvalCallExpressionTransformer=v},function(e,t){e.exports=require("js-string-escape")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(4),g=o(15);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return g.NodeMetadata.set(e,{ignoredNode:!1}),m.NodeGuards.isLiteralNode(e)&&g.NodeMetadata.set(e,{replacedLiteral:!1}),e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MetadataTransformer=y},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(206),p=o(2),m=o(3),g=o(66),y=o(11),h=o(12),N=o(15);let b=r=class extends h.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.obfuscatingGuards=r.obfuscatingGuardsList.map(e)}getVisitor(e){switch(e){case y.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){const o=this.obfuscatingGuards.every(t=>t.check(e));return N.NodeMetadata.set(e,{ignoredNode:!o}),e}};b.obfuscatingGuardsList=[g.ObfuscatingGuard.BlackListObfuscatingGuard,g.ObfuscatingGuard.ConditionalCommentObfuscatingGuard,g.ObfuscatingGuard.ReservedStringObfuscatingGuard],b=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__INodeGuard)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TObfuscatingGuardFactory&&f.TObfuscatingGuardFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.ObfuscatingGuardsTransformer=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(6);let g=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return m.NodeUtils.parentizeNode(e,t)}};g=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],g),t.ParentificationTransformer=g},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(2),d=o(1),l=o(4);let u=class{constructor(e){this.options=e}check(e){return!this.options.reservedStrings.length||!l.NodeGuards.isLiteralNode(e)||"string"!=typeof e.value||!this.isReservedString(e.value)}isReservedString(e){return this.options.reservedStrings.some(t=>null!==new RegExp(t,"g").exec(e))}};u=n([s.injectable(),a(0,s.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==c.IOptions&&c.IOptions)?r:Object])],u),t.ReservedStringObfuscatingGuard=u},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(50),u=o(2),f=o(3),p=o(38),m=o(1),g=o(11),y=o(12),h=o(4);let N=class extends y.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(h.NodeGuards.isIdentifierNode(e)&&t&&(h.NodeGuards.parentNodeIsPropertyNode(e,t)||h.NodeGuards.parentNodeIsMemberExpressionNode(e,t)||h.NodeGuards.parentNodeIsMethodDefinitionNode(e,t)||h.NodeGuards.isLabelIdentifierNode(e,t)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return this.identifierObfuscatingReplacer.preserveName(e.name),e}};N=a([d.injectable(),c(0,d.inject(m.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,d.inject(m.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(m.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==l.TIdentifierObfuscatingReplacerFactory&&l.TIdentifierObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.VariablePreserveTransformer=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(211),a=o(212),s=o(214);t.storagesModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.TCustomNodeGroupStorage).to(a.CustomNodeGroupStorage).inSingletonScope(),e(n.ServiceIdentifiers.IStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(n.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(i.ControlFlowStorage),e(n.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(e=>()=>{const t=new(e.container.get(n.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(n.ServiceIdentifiers.IRandomGenerator),e.container.get(n.ServiceIdentifiers.IOptions));return t.initialize(),t})})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(51);let p=class extends f.MapStorage{constructor(e,t){super(e,t)}};p=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.ControlFlowStorage=p},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(213),p=o(2),m=o(3),g=o(61),y=o(51);let h=r=class extends y.MapStorage{constructor(e,t,o){super(t,o),this.customNodeGroupFactory=e}initialize(){super.initialize(),r.customNodeGroupsList.forEach(e=>{const t=this.customNodeGroupFactory(e);this.storage.set(e,t)})}};h.customNodeGroupsList=[g.CustomNodeGroup.ConsoleOutputCustomNodeGroup,g.CustomNodeGroup.DebugProtectionCustomNodeGroup,g.CustomNodeGroup.DomainLockCustomNodeGroup,g.CustomNodeGroup.SelfDefendingCustomNodeGroup,g.CustomNodeGroup.StringArrayCustomNodeGroup],s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],h.prototype,"initialize",null),h=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__ICustomNodeGroup)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TCustomNodeGroupFactory&&f.TCustomNodeGroupFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.CustomNodeGroupStorage=h},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=o(5),y=o(34),h=o(48),N=o(29),b=o(2),v=o(3),I=o(7),S=o(24),O=o(51);let j=r=class extends O.MapStorage{constructor(e,t,o,n,i,a){super(o,n),this.rc4EncodedValuesSourcesCache=new Map,this.rotationAmount=0,this.identifierNamesGenerator=e(n),this.arrayUtils=t,this.cryptUtils=i,this.escapeSequenceEncoder=a,this.rc4Keys=this.randomGenerator.getRandomGenerator().n(()=>this.randomGenerator.getRandomGenerator().string({length:r.rc4KeyLength}),r.rc4KeysCount)}initialize(){super.initialize();const e=this.identifierNamesGenerator.generate(r.stringArrayNameLength),t=this.identifierNamesGenerator.generate(r.stringArrayNameLength);this.stringArrayStorageName=`${this.options.identifiersPrefix}${e}`,this.stringArrayStorageCallsWrapperName=`${this.options.identifiersPrefix}${t}`,this.rotationAmount=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(r.minimumRotationAmount,r.maximumRotationAmount):0}get(e){return this.getOrSetIfDoesNotExist(e)}getRotationAmount(){return this.rotationAmount}getStorageId(){return this.stringArrayStorageName}getStorageName(){return this.getStorageId()}getStorageCallsWrapperName(){return this.stringArrayStorageCallsWrapperName}rotateStorage(){this.getLength()&&(this.storage=new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()),this.rotationAmount)))}shuffleStorage(){this.storage=new Map(this.arrayUtils.shuffle(Array.from(this.storage.entries())).map(([e,t],o)=>(t.index=o,[e,t])).sort(([,e],[,t])=>e.index-t.index))}toString(){return Array.from(this.storage.values()).map(e=>`'${this.escapeSequenceEncoder.encode(e.encodedValue,this.options.unicodeEscapeSequence)}'`).toString()}getOrSetIfDoesNotExist(e){const{encodedValue:t,decodeKey:o}=this.getEncodedValue(e),r=this.storage.get(t);if(r)return r;const n={encodedValue:t,decodeKey:o,value:e,index:this.getLength()};return this.storage.set(t,n),n}getEncodedValue(e){var t;switch(this.options.stringArrayEncoding){case S.StringArrayEncoding.Rc4:{const o=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),r=this.cryptUtils.btoa(this.cryptUtils.rc4(e,o)),n=null!==(t=this.rc4EncodedValuesSourcesCache.get(r))&&void 0!==t?t:[];let i=n.length;return(!i||!n.includes(e))&&(n.push(e),i++),this.rc4EncodedValuesSourcesCache.set(r,n),i>1?this.getEncodedValue(e):{encodedValue:r,decodeKey:o}}case S.StringArrayEncoding.Base64:{const t=null;return{encodedValue:this.cryptUtils.btoa(e),decodeKey:t}}default:return{encodedValue:e,decodeKey:null}}}};j.minimumRotationAmount=100,j.maximumRotationAmount=500,j.rc4KeyLength=4,j.rc4KeysCount=50,j.stringArrayNameLength=7,l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageName",void 0),l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageCallsWrapperName",void 0),l([p.postConstruct(),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],j.prototype,"initialize",null),j=r=l([p.injectable(),f(0,p.inject(m.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),f(1,p.inject(m.ServiceIdentifiers.IArrayUtils)),f(2,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f(3,p.inject(m.ServiceIdentifiers.IOptions)),f(4,p.inject(m.ServiceIdentifiers.ICryptUtils)),f(5,p.inject(m.ServiceIdentifiers.IEscapeSequenceEncoder)),u("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==b.IOptions&&b.IOptions)?s:Object,"function"==typeof(c=void 0!==h.ICryptUtils&&h.ICryptUtils)?c:Object,"function"==typeof(d=void 0!==N.IEscapeSequenceEncoder&&N.IEscapeSequenceEncoder)?d:Object])],j),t.StringArrayStorage=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(216),a=o(217),s=o(221),c=o(222),d=o(223),l=o(68);t.utilsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IArrayUtils).to(i.ArrayUtils).inSingletonScope(),e(n.ServiceIdentifiers.IRandomGenerator).to(l.RandomGenerator).inSingletonScope(),e(n.ServiceIdentifiers.ICryptUtils).to(a.CryptUtils).inSingletonScope(),e(n.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope(),e(n.ServiceIdentifiers.ILevelledTopologicalSorter).to(c.LevelledTopologicalSorter),e(n.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder).to(d.NodeTransformerNamesGroupsBuilder).inSingletonScope()})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(3);let l=class{constructor(e){this.randomGenerator=e}createWithRange(e){const t=[];for(let o=0;on&&(r=i,n=e),o[i]=e}return r}rotate(e,t){if(!e.length)throw new ReferenceError("Cannot rotate empty array.");if(t<=0)return e;const o=e;let r;for(;t--;)r=o.pop(),r&&o.unshift(r);return o}shuffle(e){const t=[...e];for(let e=t.length;e;e--){const o=Math.floor(this.randomGenerator.getMathRandom()*e);[t[e-1],t[o]]=[t[o],t[e-1]]}return t}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IRandomGenerator&&d.IRandomGenerator)?r:Object])],l),t.ArrayUtils=l},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(3),l=o(68),u=o(30);let f=class{constructor(e){this.randomGenerator=e}btoa(e){let t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(`${u.Utils.hexadecimalPrefix}${t}`,16)));for(let o,r,n=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|n)||(i="=",n%1);t+=i.charAt(63&o>>8-n%1*8)){if(r=e.charCodeAt(n+=.75),r>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|r}return t}hideString(e,t){let o=this.randomGenerator.getRandomGenerator().string({length:t,pool:l.RandomGenerator.randomGeneratorPool}).replace(new RegExp(`[${r=e,r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}]`,"g"),"");var r;const n=o.split("");return this.randomGenerator.getRandomGenerator().shuffle(n),o=n.join(""),[((e,t)=>{let o=-1,r=-1,n="";for(;o=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.stringsCache=new Map}encode(e,t){const o=`${e}-${String(t)}`;if(this.stringsCache.has(o))return this.stringsCache.get(o);const r=new RegExp("[\\s\\S]","g"),n=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const c=e.replace(r,e=>t||n.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(o,c),this.stringsCache.set(`${c}-${String(t)}`,c),c}};n=r([o(0).injectable()],n),t.EscapeSequenceEncoder=n},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],o={};for(const r of e)void 0===o[r]&&this.visit(t,o,r);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const o of t){for(let t=o.length-1;t>=0;t-=1)o[t]===e&&o.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const o of e)this.hasPrecedents(o)||t.push(o);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const o=this.graph.get(t);return o&&!o.includes(e)&&o.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,o){const r=t[o];if("visiting"===r)throw new Error(`Detected cycle involving node: ${o}`);if(r)return;t[o]="visiting";const n=this.getPrecedents(o);for(const o of n)this.visit(e,t,o);t[o]="ok",e.push(o)}};n=r([o(0).injectable()],n),t.LevelledTopologicalSorter=n},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(224);let l=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),o=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of o)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const o=[];for(const r of e){const e=t[r].runAfter;if(e&&e.length)for(const n of e){void 0===t[n]?o.push([r,null]):o.push([n,r])}else o.push([r,null])}return o}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.ILevelledTopologicalSorter)),i("design:paramtypes",["function"==typeof(r=void 0!==d.ILevelledTopologicalSorter&&d.ILevelledTopologicalSorter)?r:Object])],l),t.NodeTransformerNamesGroupsBuilder=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=f(o(46)),y=o(226),h=o(227),N=o(2),b=o(3),v=o(57),I=o(228),S=o(21),O=o(11),j=o(43),_=o(55),C=o(4);let R=r=class{constructor(e,t,o,r,n){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=o,this.logger=r,this.options=n}obfuscate(e){const t=Date.now();this.logger.info(I.LoggingMessage.Version,"0.24.5"),this.logger.info(I.LoggingMessage.ObfuscationStarted),this.logger.info(I.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const o=this.parseCode(e),r=this.transformAstTree(o),n=this.generateCode(e,r),i=(Date.now()-t)/1e3;return this.logger.success(I.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(n)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return _.ASTParserFacade.parse(t,r.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,O.TransformationStage.Initializing),!C.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,O.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,O.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,O.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,O.TransformationStage.Converting),e=this.runTransformationStage(e,O.TransformationStage.Obfuscating),e=this.runTransformationStage(e,O.TransformationStage.Finalizing)):(this.logger.warn(I.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const o=Object.assign({},r.escodegenParams);this.options.sourceMap&&(o.sourceMap=this.options.inputFileName||"sourceMap",o.sourceContent=e);const n=g.generate(t,Object.assign(Object.assign({},o),{format:{compact:this.options.compact}}));return n.map=n.map?n.map.toString():"",n}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(I.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,r.transformersList,t)}};R.parseOptions={ecmaVersion:j.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},R.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},R.transformersList=[S.NodeTransformer.BlockStatementControlFlowTransformer,S.NodeTransformer.CommentsTransformer,S.NodeTransformer.CustomNodesTransformer,S.NodeTransformer.DeadCodeInjectionTransformer,S.NodeTransformer.EvalCallExpressionTransformer,S.NodeTransformer.FunctionControlFlowTransformer,S.NodeTransformer.LabeledStatementTransformer,S.NodeTransformer.LiteralTransformer,S.NodeTransformer.MemberExpressionTransformer,S.NodeTransformer.MetadataTransformer,S.NodeTransformer.MethodDefinitionTransformer,S.NodeTransformer.ObfuscatingGuardsTransformer,S.NodeTransformer.ObjectExpressionKeysTransformer,S.NodeTransformer.ObjectExpressionTransformer,S.NodeTransformer.ParentificationTransformer,S.NodeTransformer.ScopeIdentifiersTransformer,S.NodeTransformer.SplitStringTransformer,S.NodeTransformer.TemplateLiteralTransformer,S.NodeTransformer.VariablePreserveTransformer],R=r=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.ITransformersRunner)),u(1,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(2,p.inject(m.ServiceIdentifiers.Factory__IObfuscatedCode)),u(3,p.inject(m.ServiceIdentifiers.ILogger)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==v.ITransformersRunner&&v.ITransformersRunner)?n:Object,"function"==typeof(i=void 0!==b.IRandomGenerator&&b.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.TObfuscatedCodeFactory&&y.TObfuscatedCodeFactory)?a:Object,"function"==typeof(s=void 0!==h.ILogger&&h.ILogger)?s:Object,"function"==typeof(c=void 0!==N.IOptions&&N.IOptions)?c:Object])],R),t.JavaScriptObfuscator=R},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(230));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=r([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t){e.exports=require("eventemitter3")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(48),u=o(7),f=o(32),p=o(2);let m=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case f.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case f.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};i([u.initializable(),a("design:type",String)],m.prototype,"obfuscatedCode",void 0),i([u.initializable(),a("design:type",String)],m.prototype,"sourceMap",void 0),m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.ICryptUtils)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==l.ICryptUtils&&l.ICryptUtils)?r:Object,"function"==typeof(n=void 0!==p.IOptions&&p.IOptions)?n:Object])],m),t.ObfuscatedCode=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(234),p=o(235),m=o(236),g=o(4),y=o(15);let h=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,o){if(!t.length)return e;let r,n;this.cachedNodeTransformersData.has(t)?[r,n]=this.cachedNodeTransformersData.get(t):(r=this.buildNormalizedNodeTransformers(t),n=this.nodeTransformerNamesGroupsBuilder.build(r),this.cachedNodeTransformersData.set(t,[r,n]));for(const t of n){const n=[],i=[];for(const e of t){const t=r[e].getVisitor(o);t&&(t.enter&&n.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(n.length||i.length)&&u.replace(e,{enter:this.mergeVisitorsForDirection(n,m.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,m.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const o=e.length;return o?(r,n)=>{if(y.NodeMetadata.isIgnoredNode(r))return u.VisitorOption.Skip;for(let i=0;ie}};h=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__INodeTransformer)),s(1,d.inject(l.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),a("design:paramtypes",["function"==typeof(r=void 0!==f.TNodeTransformerFactory&&f.TNodeTransformerFactory)?r:Object,"function"==typeof(n=void 0!==p.INodeTransformerNamesGroupsBuilder&&p.INodeTransformerNamesGroupsBuilder)?n:Object])],h),t.TransformersRunner=h},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const c=s(o(243)),d=s(o(238)),l=o(244),u=o(7),f=o(40),p=o(245),m=o(246),g=o(247),y=o(248),h=o(249),N=o(250),b=o(251),v=o(25),I=o(254);class S{constructor(e){this.rawArguments=e,this.arguments=e.slice(2)}static buildOptions(e,t){const o=S.filterOptions(e),r=e.config,n=r?d.resolve(r,"."):"",i=n?b.CLIUtils.getUserConfig(n):{},a=d.basename(t),s=t;return console.log(s,a),Object.assign(Object.assign(Object.assign(Object.assign({},f.DEFAULT_PRESET),i),o),{inputFileName:a,inputFilePath:s})}static filterOptions(e){const t={};return Object.keys(e).forEach(o=>{void 0!==e[o]&&(t[o]=e[o])}),t}static processSourceCodeWithoutSourceMap(e,t,o){const r=v.JavaScriptObfuscator.obfuscate(e,o).getObfuscatedCode();b.CLIUtils.writeFile(t,r)}static processSourceCodeWithSourceMap(e,t,o){var r;const n=b.CLIUtils.getOutputSourceMapPath(t,null!==(r=o.sourceMapFileName)&&void 0!==r?r:"");o=Object.assign(Object.assign({},o),{sourceMapFileName:d.basename(n)});const i=v.JavaScriptObfuscator.obfuscate(e,o);b.CLIUtils.writeFile(t,i.getObfuscatedCode()),"separate"===o.sourceMapMode&&i.getSourceMap()&&b.CLIUtils.writeFile(n,i.getSourceMap())}initialize(){this.inputPath=d.normalize(this.arguments[0]||""),this.commands=new c.Command,this.configureCommands(),this.configureHelp(),this.inputCLIOptions=this.commands.opts()}run(){if(!this.arguments.length||this.arguments.includes("--help"))return void this.commands.outputHelp();const e=new I.SourceCodeReader(this.inputCLIOptions).readSourceCode(this.inputPath);this.processSourceCodeData(e)}configureCommands(){this.commands.usage(" [options]").version(null!=="0.24.5"?"0.24.5":"unknown","-v, --version").option("-o, --output ","Output path for obfuscated code").option("--compact ","Disable one line output code compacting",m.BooleanSanitizer).option("--config ","Name of js / json config file").option("--control-flow-flattening ","Enables control flow flattening",m.BooleanSanitizer).option("--control-flow-flattening-threshold ","The probability that the control flow flattening transformation will be applied to the node",parseFloat).option("--dead-code-injection ","Enables dead code injection",m.BooleanSanitizer).option("--dead-code-injection-threshold ","The probability that the dead code injection transformation will be applied to the node",parseFloat).option("--debug-protection ","Disable browser Debug panel (can cause DevTools enabled browser freeze)",m.BooleanSanitizer).option("--debug-protection-interval ","Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)",m.BooleanSanitizer).option("--disable-console-output ","Allow console.log, console.info, console.error and console.warn messages output into browser console",m.BooleanSanitizer).option("--domain-lock (comma separated, without whitespaces)","Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)",p.ArraySanitizer).option("--exclude (comma separated, without whitespaces)","A filename or glob which indicates files to exclude from obfuscation",p.ArraySanitizer).option("--identifier-names-generator ","Sets identifier names generator. Values: hexadecimal, mangled, dictionary. Default: hexadecimal",g.IdentifierNamesGeneratorSanitizer).option("--identifiers-prefix ","Sets prefix for all global identifiers.").option("--identifiers-dictionary (comma separated, without whitespaces)","Identifiers dictionary (comma separated) for `--identifier-names-generator dictionary` option",p.ArraySanitizer).option("--log ","Enables logging of the information to the console",m.BooleanSanitizer).option("--reserved-names (comma separated, without whitespaces)","Disables obfuscation and generation of identifiers, which being matched by passed RegExp patterns (comma separated)",p.ArraySanitizer).option("--reserved-strings (comma separated, without whitespaces)","Disables transformation of string literals, which being matched by passed RegExp patterns (comma separated)",p.ArraySanitizer).option("--rename-globals ","Allows to enable obfuscation of global variable and function names with declaration.",m.BooleanSanitizer).option("--rotate-string-array ","Enable rotation of string array values during obfuscation",m.BooleanSanitizer).option("--seed ","Sets seed for random generator. This is useful for creating repeatable results.",parseFloat).option("--self-defending ","Disables self-defending for obfuscated code",m.BooleanSanitizer).option("--shuffle-string-array ","Randomly shuffles string array items",m.BooleanSanitizer).option("--source-map ","Enables source map generation",m.BooleanSanitizer).option("--source-map-base-url ","Sets base url to the source map import url when `--source-map-mode=separate`").option("--source-map-file-name ","Sets file name for output source map when `--source-map-mode=separate`").option("--source-map-mode ","Specify source map output mode. Values: inline, separate. Default: separate",h.SourceMapModeSanitizer).option("--split-strings ","Splits literal strings into chunks with length of `splitStringsChunkLength` option value",m.BooleanSanitizer).option("--split-strings-chunk-length ","Sets chunk length of `splitStrings` option",parseFloat).option("--string-array ","Disables gathering of all literal strings into an array and replacing every literal string with an array call",m.BooleanSanitizer).option("--string-array-encoding ","Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed. Values: true, false, base64, rc4. Default: false",N.StringArrayEncodingSanitizer).option("--string-array-threshold ","The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)",parseFloat).option("--target ","Allows to set target environment for obfuscated code. Values: browser, browser-no-eval, node. Default: browser",y.ObfuscationTargetSanitizer).option("--transform-object-keys ","Enables transformation of object keys",m.BooleanSanitizer).option("--unicode-escape-sequence ","Allows to enable/disable string conversion to unicode escape sequence",m.BooleanSanitizer).parse(this.rawArguments)}configureHelp(){this.commands.on("--help",()=>{console.log(" Examples:\n"),console.log(" %> javascript-obfuscator input_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_directory_name --compact true --self-defending false"),console.log("")})}processSourceCodeData(e){e.forEach(({filePath:e,content:t},o)=>{const r=b.CLIUtils.getOutputCodePath(e,this.inputCLIOptions.output);this.processSourceCode(t,e,r,o)})}processSourceCode(e,t,o,r){var n;let i=S.buildOptions(this.inputCLIOptions,t);if(null!==r){const e=`${null!==(n=this.inputCLIOptions.identifiersPrefix)&&void 0!==n?n:S.baseIdentifiersPrefix}${r}`;i=Object.assign(Object.assign({},i),{identifiersPrefix:e})}i.sourceMap?S.processSourceCodeWithSourceMap(e,o,i):S.processSourceCodeWithoutSourceMap(e,o,i)}}S.encoding="utf8",S.obfuscatedFilePrefix="-obfuscated",S.baseIdentifiersPrefix="a",i([u.initializable(),a("design:type","function"==typeof(r=void 0!==c&&c.CommanderStatic)?r:Object)],S.prototype,"commands",void 0),i([u.initializable(),a("design:type","function"==typeof(n=void 0!==l.TInputCLIOptions&&l.TInputCLIOptions)?n:Object)],S.prototype,"inputCLIOptions",void 0),i([u.initializable(),a("design:type",String)],S.prototype,"inputPath",void 0),t.JavaScriptObfuscatorCLI=S},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("fs")},,function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(242);e.exports=r.JavaScriptObfuscatorCLI},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(69);const r=o(237);t.JavaScriptObfuscatorCLI=class{static obfuscate(e){const t=new r.JavaScriptObfuscatorCLI(e);t.initialize(),t.run()}}},function(e,t){e.exports=require("commander")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArraySanitizer=e=>{if(e.endsWith(","))throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1','value2'");return e.split(",").map(e=>e.trim())}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=e=>"true"===e||"1"===e},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31);t.IdentifierNamesGeneratorSanitizer=e=>{if(!Object.keys(r.IdentifierNamesGenerator).some(t=>r.IdentifierNamesGenerator[t]===e))throw new ReferenceError("Invalid value of `--identifier-names-generator` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(20);t.ObfuscationTargetSanitizer=e=>{if(!Object.keys(r.ObfuscationTarget).some(t=>r.ObfuscationTarget[t]===e))throw new ReferenceError("Invalid value of `--target` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(32);t.SourceMapModeSanitizer=e=>{if(!Object.keys(r.SourceMapMode).some(t=>r.SourceMapMode[t]===e))throw new ReferenceError("Invalid value of `--source-map-mode` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(24);t.StringArrayEncodingSanitizer=e=>{switch(e){case"true":case"1":case r.StringArrayEncoding.Base64:return!0;case r.StringArrayEncoding.Rc4:return r.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(239)),i=r(o(252)),a=r(o(238)),s=o(41),c=o(237);t.CLIUtils=class{static getOutputCodePath(e,t){const o=t?a.normalize(t):null;return o?""===a.extname(o)?a.join(o,e):o:a.normalize(e).split(s.StringSeparator.Dot).map((e,t)=>0===t?`${e}${c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix}`:e).join(s.StringSeparator.Dot)}static getOutputSourceMapPath(e,t=""){return t&&(e=`${e.substring(0,e.lastIndexOf("/"))}/${t}`),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e=`${e.split(s.StringSeparator.Dot)[0]}.js.map`,e}static getUserConfig(e){let t;try{t=o(253)(e)}catch(o){try{t=require(e)}catch(e){throw new ReferenceError("Given config path must be a valid `.js` or `.json` file path")}}return t}static writeFile(e,t){i.sync(a.dirname(e)),n.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}},function(e,t){e.exports=require("mkdirp")},function(e,t){function o(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}o.keys=function(){return[]},o.resolve=o,e.exports=o,o.id=253},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(o(239)),a=r(o(238)),s=n(o(255)),c=o(71),d=o(237),l=o(70);class u{constructor(e){this.options=e}static isExcludedPath(e,t=[]){if(!t.length)return!1;const o=a.basename(e),r=!!s.default([e],t).length;return t.some(t=>e.includes(t)||o.includes(t))||r}static isDirectoryPath(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}static isFilePath(e){try{return i.statSync(e).isFile()}catch(e){return!1}}static logFilePath(e){const t=a.normalize(e);l.Logger.log(l.Logger.colorInfo,c.LoggingPrefix.CLI,`Obfuscating file: ${t}...`)}readSourceCode(e){if(u.isFilePath(e)&&this.isValidFile(e))return[this.readFile(e)];if(u.isDirectoryPath(e)&&this.isValidDirectory(e))return this.readDirectoryRecursive(e);const t=u.availableInputExtensions.map(e=>`\`${e}\``).join(", ");throw new ReferenceError(`Given input path must be a valid ${t} file or directory path`)}readDirectoryRecursive(e,t=[]){return i.readdirSync(e,d.JavaScriptObfuscatorCLI.encoding).forEach(o=>{const r=`${e}/${o}`;if(u.isDirectoryPath(r)&&this.isValidDirectory(r))t.push(...this.readDirectoryRecursive(r));else if(u.isFilePath(r)&&this.isValidFile(r)){const e=this.readFile(r);t.push(e)}}),t}readFile(e){return u.logFilePath(e),{filePath:e,content:i.readFileSync(e,d.JavaScriptObfuscatorCLI.encoding)}}isValidDirectory(e){return!u.isExcludedPath(e,this.options.exclude)}isValidFile(e){return u.availableInputExtensions.includes(a.extname(e))&&!e.includes(d.JavaScriptObfuscatorCLI.obfuscatedFilePrefix)&&!u.isExcludedPath(e,this.options.exclude)}}t.SourceCodeReader=u,u.availableInputExtensions=[".js"]},function(e,t){e.exports=require("multimatch")}]); +require("source-map-support").install(),module.exports=function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=241)}([function(e,t){e.exports=require("inversify")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(33);class n{static isArrayPatternNode(e){return e.type===r.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===r.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===r.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===r.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===r.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===r.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===r.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===r.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===r.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===r.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===r.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===r.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===r.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return n.isFunctionDeclarationNode(e)||n.isFunctionExpressionNode(e)||n.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===r.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===r.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===r.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===r.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===r.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const o=n.isLabeledStatementNode(t)&&t.label===e,r=n.isContinueStatementNode(t)&&t.label===e,i=n.isBreakStatementNode(t)&&t.label===e;return o||r||i}static isLabeledStatementNode(e){return e.type===r.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===r.NodeType.Literal}static isMemberExpressionNode(e){return e.type===r.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===r.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return n.isProgramNode(e)||n.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return n.isNodeWithLexicalScope(e)||n.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return n.isProgramNode(e)||n.isBlockStatementNode(e)&&n.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return n.isProgramNode(e)||n.isBlockStatementNode(e)||n.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===r.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===r.NodeType.ObjectExpression}static isProgramNode(e){return e.type===r.NodeType.Program}static isPropertyNode(e){return e.type===r.NodeType.Property}static parentNodeIsPropertyNode(e,t){return n.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return n.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return n.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===r.NodeType.RestElement}static isReturnStatementNode(e){return e.type===r.NodeType.ReturnStatement}static isSuperNode(e){return e.type===r.NodeType.Super}static isSwitchCaseNode(e){return e.type===r.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===r.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===r.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===r.NodeType.UnaryExpression}static isUseStrictOperator(e){return n.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===r.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===r.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===r.NodeType.WhileStatement}}t.NodeGuards=n,n.nodesWithLexicalStatements=[r.NodeType.ArrowFunctionExpression,r.NodeType.FunctionDeclaration,r.NodeType.FunctionExpression,r.NodeType.MethodDefinition]},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(46)),i=r(o(13)),a=o(43),s=o(55),c=o(4),d=o(15);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:n.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),c.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+n.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return c.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(o=>{if("parentNode"===o)return;const r=e[o];let n;n=null===r||r instanceof RegExp?r:Array.isArray(r)?r.map(l.cloneRecursive):"object"==typeof r?l.cloneRecursive(r):r,t[o]=n}),t}}t.NodeUtils=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={configurable:!0,enumerable:!0};function n(e,t,o){Reflect.hasMetadata(e,o)||Reflect.defineMetadata(e,t,o)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(o,i)=>{const a=o[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return n("_initialized",!1,o),n("_initializablePropertiesSet",new Set,o),n("_wrappedMethodsSet",new Set,o),function(e,t){const o=Object.getOwnPropertyNames(e),n=[t,"constructor"];o.forEach(o=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(n.includes(o)||a.has(o)||s.has(o))return;if("function"!=typeof e[o])return;const c=null!==(i=Object.getOwnPropertyDescriptor(e,o))&&void 0!==i?i:r,d=c.value;Object.defineProperty(e,o,Object.assign(Object.assign({},c),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(o)})}(o,e),function(e,t,o){var n;const i=null!==(n=Object.getOwnPropertyDescriptor(e,t))&&void 0!==n?n:r,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[o],e}}))}(o,e,i),function(e,t){var o;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const n=`_${t.toString()}`,i=null!==(o=Object.getOwnPropertyDescriptor(e,n))&&void 0!==o?o:r;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[n])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[n]},set:function(e){this[n]=e}})),i}(o,i)}}},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(46)),i=o(33);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,o){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,o){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,o){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:o,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,o){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},o&&{alternate:o}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:n.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,o){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,o=!1){return{type:i.NodeType.MemberExpression,computed:o,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,o,r){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:o,computed:r,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,o=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:o,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,o=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:o,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(113),N=o(114);let b=r=class{constructor(e,t,o,r){this.cachedNode=null,this.identifierNamesGenerator=e(r),this.customNodeFormatter=t,this.randomGenerator=o,this.options=r}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(r.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};b.globalVariableTemplateFunctions=[h.GlobalVariableTemplate1(),N.GlobalVariableTemplate2()],b=r=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],b),t.AbstractCustomNode=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3);let f=class{constructor(e,t){this.randomGenerator=e,this.options=t}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractNodeTransformer=f},function(e,t){e.exports=require("estraverse")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static getParentNodeWithStatements(e){return n.getParentNodesWithStatementsRecursive(e,1)[0]}static getParentNodesWithStatements(e){return n.getParentNodesWithStatementsRecursive(e)}static getNextSiblingStatement(e){return n.getSiblingStatementByOffset(e,1)}static getPreviousSiblingStatement(e){return n.getSiblingStatementByOffset(e,-1)}static getRootStatementOfNode(e){if(r.NodeGuards.isProgramNode(e))throw new Error("Unable to find root statement for `Program` node");const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithStatements(t)?e:n.getRootStatementOfNode(t)}static getScopeOfNode(e){const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithStatements(t)?t:n.getScopeOfNode(t)}static getParentNodesWithStatementsRecursive(e,t=1/0,o=[],i=0){if(o.length>=t)return o;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(r.NodeGuards.isProgramNode(e)||r.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&o.push(e),e!==a?n.getParentNodesWithStatementsRecursive(a,t,o,++i):o}static getSiblingStatementByOffset(e,t){const o=n.getScopeOfNode(e),i=r.NodeGuards.isSwitchCaseNode(o)?o.consequent:o.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static set(e,t){var o;e.metadata=Object.assign(null!==(o=e.metadata)&&void 0!==o?o:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===r.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===r.get(e,"replacedLiteral")}}t.NodeMetadata=r},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(72),a=o(82),s=o(95),c=o(106),d=o(156),l=o(157),u=o(161),f=o(162),p=o(173),m=o(195),g=o(210),y=o(215),h=o(225),N=o(70),b=o(229),v=o(231),I=o(232),S=o(233);t.InversifyContainerFacade=class{constructor(){this.container=new r.Container}static getFactory(e){return t=>o=>t.container.getNamed(e,o)}static getCacheFactory(e){return t=>{const o=new Map;return r=>{if(o.has(r))return o.get(r);const n=t.container.getNamed(e,r);return o.set(r,n),n}}}static getConstructorFactory(e,...t){return o=>{const r=new Map,n=[];return i=>{if(t.forEach((e,t)=>{n[t]||(n[t]=o.container.get(e))}),r.has(i))return new(r.get(i))(...n);const a=o.container.getNamed(e,i);return r.set(i,a),new a(...n)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,o){this.container.bind(n.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new I.SourceCode(e,t)).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>o).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ILogger).to(N.Logger).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IJavaScriptObfuscator).to(h.JavaScriptObfuscator).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ITransformersRunner).to(S.TransformersRunner).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IObfuscatedCode).to(v.ObfuscatedCode),this.container.bind(n.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,o)=>{const r=e.container.get(n.ServiceIdentifiers.IObfuscatedCode);return r.initialize(t,o),r}),this.container.bind(n.ServiceIdentifiers.IObfuscationEventEmitter).to(b.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(c.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(u.nodeTransformersModule),this.container.load(f.obfuscatingTransformersModule),this.container.load(p.optionsModule),this.container.load(m.preparingTransformersModule),this.container.load(g.storagesModule),this.container.load(y.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static append(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e),...t])}static appendToOptimalBlockScope(e,t,o,r=0){const i=e.length?n.getOptimalBlockScope(e,r):t;n.prepend(i,o)}static getOptimalBlockScope(e,t,o=1/0){const r=e[t];if(o<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return o>1&&r.callsGraph.length?n.getOptimalBlockScope(r.callsGraph,0,--o):r.callee}static insertBefore(e,t,o){const r=n.getScopeStatements(e).indexOf(o);n.insertAtIndex(e,t,r)}static insertAfter(e,t,o){const r=n.getScopeStatements(e).indexOf(o);n.insertAtIndex(e,t,r+1)}static insertAtIndex(e,t,o){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e).slice(0,o),...t,...n.getScopeStatements(e).slice(o)])}static prepend(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...t,...n.getScopeStatements(e)])}static getScopeStatements(e){return r.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){r.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.ObfuscationTarget=r.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.StringArrayEncoding=r.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(69);const r=o(1),n=o(16);class i{static obfuscate(e,t={}){const o=new n.InversifyContainerFacade;o.load(e,"",t);const i=o.get(r.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return o.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.5"?"0.24.5":"unknown"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(5),f=o(2),p=o(3);let m=class{constructor(e,t,o){this.identifierNamesGenerator=e(o),this.randomGenerator=t,this.options=o}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const o=this.customNodes.get(e);o&&t(o)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==u.TIdentifierNamesGeneratorFactory&&u.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],m),t.AbstractCustomNodeGroup=m},function(e,t){e.exports=require("@gradecam/tsenum")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=r,r.hexadecimalPrefix="0x"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.IdentifierNamesGenerator=r.MakeEnum({DictionaryIdentifierNamesGenerator:"dictionary",HexadecimalIdentifierNamesGenerator:"hexadecimal",MangledIdentifierNamesGenerator:"mangled"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.SourceMapMode=r.MakeEnum({Inline:"inline",Separate:"separate"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31),n=o(20),i=o(32);t.NO_ADDITIONAL_NODES_PRESET=Object.freeze({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:r.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!1,seed:0,selfDefending:!1,shuffleStringArray:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:0,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NumberUtils=class{static toHex(e){return e.toString(16)}static isCeil(e){return e%1==0}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(2);let l=class{constructor(e){this.options=e}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IOptions&&d.IOptions)?r:Object])],l),t.AbstractObfuscatingReplacer=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31),n=o(20),i=o(32);t.DEFAULT_PRESET=Object.freeze({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:r.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!0,seed:0,selfDefending:!1,shuffleStringArray:!0,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:10,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Dot=".",e.Comma=","}(t.StringSeparator||(t.StringSeparator={}))},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{};n=r([o(0).injectable()],n),t.AbstractCalleeDataExtractor=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecmaVersion=11},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);t.NodeLiteralUtils=class{static isProhibitedLiteralNode(e,t){return!(!r.NodeGuards.isPropertyNode(t)||t.computed||t.key!==e)||!!r.NodeGuards.isImportDeclarationNode(t)}}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3);let g=r=class{constructor(e,t,o){this.replacerDataByControlFlowStorageId=new Map,this.controlFlowCustomNodeFactory=e,this.randomGenerator=t,this.options=o}static getStorageKeysByIdForCurrentStorage(e,t){let o;return o=e.has(t)?e.get(t):new Map,o}insertCustomNodeToControlFlowStorage(e,t,o,n){const i=t.getStorageId(),a=r.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,i),s=a.get(o);if(this.randomGenerator.getMathRandom(){const o=this.randomGenerator.getRandomString(e);return t.getStorage().has(o)?c(e):o},d=c(5);return a.set(o,[d]),this.replacerDataByControlFlowStorageId.set(i,a),t.set(d,e),d}};g=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],g),t.AbstractControlFlowReplacer=g},function(e,t){e.exports=require("escodegen")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n const that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3);let f=class{constructor(e,t){this.preservedNamesSet=new Set,this.randomGenerator=e,this.options=t}preserveName(e){this.preservedNamesSet.add(e)}isValidIdentifierName(e){return this.notReservedName(e)&&!this.preservedNamesSet.has(e)}notReservedName(e){return!this.options.reservedNames.length||!this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractIdentifierNamesGenerator=f},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(7);let m=class{constructor(e,t){this.randomGenerator=e,this.options=t}initialize(){this.storage=new Map,this.storageId=this.randomGenerator.getRandomString(6)}get(e){return this.storage.get(e)}getOrThrow(e){const t=this.get(e);if(!t)throw new Error(`No value found in map storage with key \`${e}\``);return t}getKeyOf(e){for(const[t,o]of this.storage)if(e===o)return t;return null}getLength(){return this.storage.size}getStorage(){return this.storage}getStorageId(){return this.storageId}has(e){return this.storage.has(e)}mergeWith(e,t=!1){this.storage=new Map([...this.storage,...e.getStorage()]),t&&(this.storageId=e.getStorageId())}set(e,t){this.storage.set(e,t)}};a([p.initializable(),s("design:type",String)],m.prototype,"storageId",void 0),a([p.initializable(),s("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],m.prototype,"storage",void 0),a([d.postConstruct(),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],m.prototype,"initialize",null),m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MapStorage=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(17),f=o(2),p=o(3),m=o(18),g=o(45),y=o(4);let h=class extends g.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}getControlFlowStorageCallNode(e,t,o,r){const n=this.controlFlowCustomNodeFactory(m.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);n.initialize(e,t,o,r);const i=n.getNode()[0];if(!i||!y.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};h=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==u.TControlFlowCustomNodeFactory&&u.TControlFlowCustomNodeFactory)?r:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],h),t.ExpressionWithOperatorControlFlowReplacer=h},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(o(85)),a=n(o(86)),s=n(o(56));class c{static parse(e,t){const o=c.sourceTypes.length;for(let r=0;r"),u=`...${i.substring(s,d).replace(/^\s+/,"")}...`;throw new Error(`ERROR in ${a}line ${o.line}: ${t}\n${l} ${u}`)}}t.ASTParserFacade=c,c.colorError=s.default.red,c.nearestSymbolsCount=15,c.sourceTypes=["script","module"]},function(e,t){e.exports=require("chalk")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BasePropertiesExtractor="BasePropertiesExtractor",e.ObjectExpressionToVariableDeclarationExtractor="ObjectExpressionToVariableDeclarationExtractor"}(t.ObjectExpressionExtractor||(t.ObjectExpressionExtractor={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ObjectExpressionVariableDeclarationHostNode="ObjectExpressionVariableDeclarationHostNode"}(t.ObjectExpressionKeysTransformerCustomNode||(t.ObjectExpressionKeysTransformerCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t){e.exports=require("class-validator")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListObfuscatingGuard="BlackListObfuscatingGuard",e.ConditionalCommentObfuscatingGuard="ConditionalCommentObfuscatingGuard",e.ReservedStringObfuscatingGuard="ReservedStringObfuscatingGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(4);let s=r=class{constructor(){this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}static isConditionalComment(e){return r.obfuscationEnableCommentRegExp.test(e.value)||r.obfuscationDisableCommentRegExp.test(e.value)}check(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!a.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;const t=e.leadingComments,o=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),o&&(this.obfuscationAllowedForNextNode=this.checkComments(o)),this.obfuscationAllowedForCurrentNode}checkComments(e){const t=e.length;let o=this.obfuscationAllowedForCurrentNode;for(let n=0;n=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(218)),m=o(219),g=o(2),y=o(220),h=o(7);let N=r=class{constructor(e,t){this.sourceCode=e,this.options=t}initialize(){this.randomGenerator=new m.Chance(this.getRawSeed())}getMathRandom(){return this.getRandomInteger(0,99999)/1e5}getRandomGenerator(){return this.randomGenerator}getRandomInteger(e,t){return this.getRandomGenerator().integer({min:e,max:t})}getRandomString(e,t=r.randomGeneratorPool){return this.getRandomGenerator().string({length:e,pool:t})}getInputSeed(){return this.options.seed.toString()}getRawSeed(){const e=this.getInputSeed();return`${e}`.split("|").length>1?e:`${e}|${p.default(this.sourceCode.getSourceCode())}`}};N.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s([h.initializable(),c("design:type","function"==typeof(n=void 0!==m.Chance&&m.Chance.Chance)?n:Object)],N.prototype,"randomGenerator",void 0),s([u.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],N.prototype,"initialize",null),N=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.ISourceCode)),d(1,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(i=void 0!==y.ISourceCode&&y.ISourceCode)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],N),t.RandomGenerator=N},function(e,t){e.exports=require("reflect-metadata")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(56)),f=o(2),p=o(71);let m=r=class{constructor(e){this.options=e}static log(e,t,o,r){const n=e(`\n${t} ${o}`);console.log(n,null!=r?r:"")}info(e,t){this.options.log&&r.log(r.colorInfo,p.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&r.log(r.colorSuccess,p.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&r.log(r.colorWarn,p.LoggingPrefix.Base,e,t)}};m.colorInfo=u.default.cyan,m.colorSuccess=u.default.green,m.colorWarn=u.default.yellow,m=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IOptions&&f.IOptions)?n:Object])],m),t.Logger=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(52),s=o(73),c=o(75),d=o(76),l=o(77),u=o(78),f=o(79),p=o(81);t.analyzersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICallsGraphAnalyzer).to(s.CallsGraphAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer).to(u.PrevailingKindOfVariablesAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IScopeAnalyzer).to(f.ScopeAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IStringArrayStorageAnalyzer).to(p.StringArrayStorageAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(d.FunctionExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(l.ObjectExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(74),p=o(52),m=o(4),g=o(14);let y=r=class{constructor(e){this.calleeDataExtractorFactory=e}static getLimitIndex(e){const t=e-1,o=r.limitThresholdActivationLength-1;let n=t;return t>o&&(n=Math.round(o+t*r.limitThreshold),n>t&&(n=t)),n}analyze(e){return this.analyzeRecursive(e.body)}analyzeRecursive(e){const t=r.getLimitIndex(e.length),o=[],n=e.length;for(let r=0;rt);r++){const t=e[r];u.traverse(t,{enter:r=>{if(m.NodeGuards.isCallExpressionNode(r))return t.parentNode!==g.NodeStatementUtils.getParentNodeWithStatements(r)?u.VisitorOption.Skip:void this.analyzeCallExpressionNode(o,e,r)}})}return o}analyzeCallExpressionNode(e,t,o){r.calleeDataExtractorsList.forEach(r=>{const n=this.calleeDataExtractorFactory(r).extract(t,o.callee);n&&e.push(Object.assign(Object.assign({},n),{callsGraph:this.analyzeRecursive(n.callee.body)}))})}};y.calleeDataExtractorsList=[p.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,p.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,p.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],y.limitThresholdActivationLength=25,y.limitThreshold=.002,y=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__ICalleeDataExtractor)),a("design:paramtypes",["function"==typeof(n=void 0!==f.TCalleeDataExtractorFactory&&f.TCalleeDataExtractorFactory)?n:Object])],y),t.CallsGraphAnalyzer=y},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(13)),s=o(42),c=o(4),d=o(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){if(!c.NodeGuards.isIdentifierNode(t))return null;const o=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name);return o?{callee:o,name:t.name}:null}getCalleeBlockStatement(e,t){let o=null;return a.traverse(e,{enter:e=>{if(c.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return o=e.body,a.VisitorOption.Break}}),o}};l=r([i.injectable()],l),t.FunctionDeclarationCalleeDataExtractor=l},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(13)),s=o(42),c=o(4),d=o(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){var o;let r=null;return c.NodeGuards.isIdentifierNode(t)&&(r=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name)),c.NodeGuards.isFunctionExpressionNode(t)&&(r=t.body),r?{callee:r,name:null!==(o=t.name)&&void 0!==o?o:null}:null}getCalleeBlockStatement(e,t){let o=null;return a.traverse(e,{enter:(e,r)=>{if(c.NodeGuards.isFunctionExpressionNode(e)&&r&&c.NodeGuards.isVariableDeclaratorNode(r)&&c.NodeGuards.isIdentifierNode(r.id)&&r.id.name===t)return o=e.body,a.VisitorOption.Break}}),o}};l=r([i.injectable()],l),t.FunctionExpressionCalleeDataExtractor=l},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=i(o(13)),c=o(42),d=o(4),l=o(14);let u=r=class extends c.AbstractCalleeDataExtractor{static isValidTargetPropertyNode(e,t){if(!e.key)return!1;const o=d.NodeGuards.isIdentifierNode(e.key)&&e.key.name===t,r=d.NodeGuards.isLiteralNode(e.key)&&Boolean(e.key.value)&&e.key.value===t;return o||r}extract(e,t){if(!d.NodeGuards.isMemberExpressionNode(t))return null;const o=this.createObjectMembersCallsChain([],t);if(!o.length)return null;const r=o[o.length-1],n=this.getCalleeBlockStatement(l.NodeStatementUtils.getParentNodeWithStatements(e[0]),o);return n?{callee:n,name:r}:null}createObjectMembersCallsChain(e,t){if(d.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!d.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return d.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(d.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}getCalleeBlockStatement(e,t){const o=t.shift();if(!o)return null;let r=null;return s.traverse(e,{enter:e=>{if(d.NodeGuards.isVariableDeclaratorNode(e)&&d.NodeGuards.isIdentifierNode(e.id)&&e.init&&d.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===o)return r=this.findCalleeBlockStatement(e.init.properties,t),s.VisitorOption.Break}}),r}findCalleeBlockStatement(e,t){const o=t.shift();if(!o)return null;for(const n of e)if(r.isValidTargetPropertyNode(n,o)){if(d.NodeGuards.isObjectExpressionNode(n.value))return this.findCalleeBlockStatement(n.value.properties,t);if(d.NodeGuards.isFunctionExpressionNode(n.value))return n.value.body}return null}};u=r=n([a.injectable()],u),t.ObjectExpressionCalleeDataExtractor=u},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(34),p=o(4);let m=r=class{constructor(e){this.prevailingKindOfVariables=r.defaultKindOfVariables,this.arrayUtils=e}analyze(e){var t;const o=[];u.traverse(e,{enter:e=>{p.NodeGuards.isVariableDeclarationNode(e)&&o.push(e.kind)}}),this.prevailingKindOfVariables=null!==(t=this.arrayUtils.findMostOccurringElement(o))&&void 0!==t?t:r.defaultKindOfVariables}getPrevailingKind(){return this.prevailingKindOfVariables}};m.defaultKindOfVariables="var",m=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IArrayUtils)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IArrayUtils&&f.IArrayUtils)?n:Object])],m),t.PrevailingKindOfVariablesAnalyzer=m},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=i(o(80)),c=i(o(13)),d=o(43),l=o(4);let u=r=class{constructor(){this.scopeManager=null}static attachMissingRanges(e){c.replace(e,{enter:e=>(e.range||(e.range=[r.emptyRangeValue,r.emptyRangeValue]),e)})}static isRootNode(e){return l.NodeGuards.isProgramNode(e)||e.parentNode===e}analyze(e){const t=r.sourceTypes.length;r.attachMissingRanges(e);for(let o=0;o{if("class"===e.type&&e.upper){if(!e.variables.length)return;const t=e.variables[0],o=e.upper.variables.find(e=>t.defs.some(e=>"ClassName"===e.type)&&e.name===t.name);null==o||o.references.push(...e.variables[0].references)}});for(const t of e.childScopes)this.sanitizeScopes(t)}};u.eslintScopeOptions={ecmaVersion:d.ecmaVersion,optimistic:!0},u.sourceTypes=["script","module"],u.emptyRangeValue=0,u=r=n([a.injectable()],u),t.ScopeAnalyzer=u},function(e,t){e.exports=require("eslint-scope")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(13)),m=o(2),g=o(3),y=o(35),h=o(4),N=o(15),b=o(44);let v=r=class{constructor(e,t,o){this.stringArrayStorageData=new Map,this.stringArrayStorage=e,this.randomGenerator=t,this.options=o}analyze(e){this.options.stringArray&&p.traverse(e,{enter:(e,t)=>{if(t)return N.NodeMetadata.isIgnoredNode(e)?p.VisitorOption.Skip:void(h.NodeGuards.isLiteralNode(e)&&this.analyzeLiteralNode(e,t))}})}getItemDataForLiteralNode(e){return this.stringArrayStorageData.get(e)}analyzeLiteralNode(e,t){"string"==typeof e.value&&(b.NodeLiteralUtils.isProhibitedLiteralNode(e,t)||this.shouldAddValueToStringArray(e.value)&&this.stringArrayStorageData.set(e,this.stringArrayStorage.getOrThrow(e.value)))}shouldAddValueToStringArray(e){return e.length>=r.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}};v.minimumLengthForStringArray=3,v=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.IStringArrayStorage)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==y.IStringArrayStorage&&y.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==m.IOptions&&m.IOptions)?a:Object])],v),t.StringArrayStorageAnalyzer=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(53),s=o(21),c=o(83),d=o(84),l=o(87),u=o(88),f=o(90),p=o(93),m=o(94);t.controlFlowTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(l.CallExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(i.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(54);let h=r=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.BinaryExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a,e.left,e.right)}};h.usingExistingIdentifierChance=.5,h=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.BinaryExpressionControlFlowReplacer=h},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(17),y=o(34),h=o(2),N=o(3),b=o(18),v=o(11),I=o(12),S=o(4),O=o(6);let j=r=class extends I.AbstractNodeTransformer{constructor(e,t,o,r){super(o,r),this.controlFlowCustomNodeFactory=e,this.arrayUtils=t}static isProhibitedStatementNode(e){const t=S.NodeGuards.isBreakStatementNode(e)||S.NodeGuards.isContinueStatementNode(e),o=S.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),r=S.NodeGuards.isClassDeclarationNode(e);return S.NodeGuards.isFunctionDeclarationNode(e)||t||o||r}static canTransformBlockStatementNode(e){let t=!0;return m.traverse(e,{enter:e=>{if(S.NodeGuards.isWhileStatementNode(e))return m.VisitorOption.Skip;r.isProhibitedStatementNode(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}getVisitor(e){switch(e){case v.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&S.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!r.canTransformBlockStatementNode(e))return e;const o=e.body,n=this.arrayUtils.createWithRange(o.length),i=this.arrayUtils.shuffle(n),a=n.map(e=>i.indexOf(e)),s=this.controlFlowCustomNodeFactory(b.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);s.initialize(o,i,a);const c=s.getNode()[0];return O.NodeUtils.parentizeNode(c,t),c}};j=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IControlFlowCustomNode)),l(1,f.inject(p.ServiceIdentifiers.IArrayUtils)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TControlFlowCustomNodeFactory&&g.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==h.IOptions&&h.IOptions)?s:Object])],j),t.BlockStatementControlFlowTransformer=j},function(e,t){e.exports=require("acorn")},function(e,t){e.exports=require("acorn-import-meta")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(45),h=o(4);let N=r=class extends y.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){const n=e.callee;if(!h.NodeGuards.isIdentifierNode(n))return e;const i=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionFunctionNode),s=e.arguments;a.initialize(s);const c=this.insertCustomNodeToControlFlowStorage(a,o,i,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),c,n,s)}getControlFlowStorageCallNode(e,t,o,r){const n=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);n.initialize(e,t,o,r);const i=n.getNode()[0];if(!i||!h.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};N.usingExistingIdentifierChance=.5,N=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.CallExpressionControlFlowReplacer=N},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(89),y=o(2),h=o(3),N=o(57),b=o(58),v=o(21),I=o(33),S=o(11),O=o(12),j=o(8),_=o(4),C=o(14),R=o(6);let F=r=class extends O.AbstractNodeTransformer{constructor(e,t,o,r){super(o,r),this.deadCodeInjectionRootAstHostNodeSet=new Set,this.collectedBlockStatements=[],this.collectedBlockStatementsTotalLength=0,this.deadCodeInjectionCustomNodeFactory=e,this.transformersRunner=t}static isProhibitedNodeInsideCollectedBlockStatement(e){return _.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e)||_.NodeGuards.isAwaitExpressionNode(e)||_.NodeGuards.isSuperNode(e)}static isScopeHoistingFunctionDeclaration(e){if(!_.NodeGuards.isFunctionDeclarationNode(e))return!1;const t=C.NodeStatementUtils.getScopeOfNode(e),o=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,r=o.indexOf(e);if(0===r)return!1;const n=o.slice(0,r),i=j.NodeFactory.blockStatementNode(n),a=e.id.name;let s=!1;return m.traverse(i,{enter:e=>{if(_.NodeGuards.isIdentifierNode(e)&&e.name===a)return s=!0,m.VisitorOption.Break}}),s}static isValidCollectedBlockStatementNode(e){if(!e.body.length)return!1;let t=0,o=!0;return m.traverse(e,{enter:e=>{if(_.NodeGuards.isBlockStatementNode(e)&&t++,t>r.maxNestedBlockStatementsCount||r.isProhibitedNodeInsideCollectedBlockStatement(e)||r.isScopeHoistingFunctionDeclaration(e))return o=!1,m.VisitorOption.Break}}),o}static isValidWrappedBlockStatementNode(e){if(!e.body.length)return!1;let t=!0;if(m.traverse(e,{enter:e=>{if(r.isScopeHoistingFunctionDeclaration(e))return t=!1,m.VisitorOption.Break}}),!t)return!1;return C.NodeStatementUtils.getParentNodeWithStatements(e).type!==I.NodeType.Program}getVisitor(e){switch(e){case S.TransformationStage.DeadCodeInjection:return{enter:(e,t)=>{if(t&&_.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),e},leave:(e,t)=>{if(t&&_.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};case S.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:(e,t)=>{if(t&&this.isDeadCodeInjectionRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}analyzeNode(e,t){m.traverse(e,{enter:e=>{if(!_.NodeGuards.isBlockStatementNode(e))return;const t=R.NodeUtils.clone(e);if(!r.isValidCollectedBlockStatementNode(t))return;const o=this.makeClonedBlockStatementNodeUnique(t);this.collectedBlockStatements.push(o)}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}transformNode(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!r.isValidWrappedBlockStatementNode(e))return e;const o=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,o),i=this.collectedBlockStatements.splice(n,1)[0];return i===e?e:this.replaceBlockStatementNode(e,i,t)}restoreNode(e,t){const o=e.body[0];if(!_.NodeGuards.isFunctionDeclarationNode(o))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return o.body}isDeadCodeInjectionRootAstHostNode(e){return _.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}makeClonedBlockStatementNodeUnique(e){const t=j.NodeFactory.functionExpressionNode([],e);return R.NodeUtils.parentizeNode(t,t),R.NodeUtils.parentizeNode(e,t),this.transformersRunner.transform(t,r.transformersToRenameBlockScopeIdentifiers,S.TransformationStage.Obfuscating).body}replaceBlockStatementNode(e,t,o){const n=j.NodeFactory.blockStatementNode([j.NodeFactory.functionDeclarationNode(r.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);const i=this.deadCodeInjectionCustomNodeFactory(b.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);i.initialize(e,n);const a=i.getNode()[0];return R.NodeUtils.parentizeNode(a,o),a}};F.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",F.maxNestedBlockStatementsCount=4,F.minCollectedBlockStatementsCount=5,F.transformersToRenameBlockScopeIdentifiers=[v.NodeTransformer.LabeledStatementTransformer,v.NodeTransformer.ScopeIdentifiersTransformer],F=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),l(1,f.inject(p.ServiceIdentifiers.ITransformersRunner)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TDeadNodeInjectionCustomNodeFactory&&g.TDeadNodeInjectionCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.ITransformersRunner&&N.ITransformersRunner)?i:Object,"function"==typeof(a=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==y.IOptions&&y.IOptions)?s:Object])],F),t.DeadCodeInjectionTransformer=F},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=f(o(13)),y=o(17),h=o(91),N=o(92),b=o(2),v=o(3),I=o(18),S=o(53),O=o(33),j=o(11),_=o(12),C=o(19),R=o(4),F=o(15),T=o(14),w=o(6);let x=r=class extends _.AbstractNodeTransformer{constructor(e,t,o,r,n){super(r,n),this.controlFlowData=new Map,this.visitedFunctionNodes=new Set,this.hostNodesWithControlFlowNode=new Set,this.controlFlowStorageFactory=e,this.controlFlowReplacerFactory=t,this.controlFlowCustomNodeFactory=o}getVisitor(e){switch(e){case j.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.visitedFunctionNodes.add(e),!R.NodeGuards.isBlockStatementNode(e.body))return e;const o=this.getHostNode(e.body),r=this.getControlFlowStorage(o);if(this.controlFlowData.set(o,r),this.transformFunctionBody(e.body,r),!r.getLength())return e;const n=this.controlFlowCustomNodeFactory(I.ControlFlowCustomNode.ControlFlowStorageNode);return n.initialize(r),C.NodeAppender.prepend(o,n.getNode()),this.hostNodesWithControlFlowNode.add(o),w.NodeUtils.parentizeAst(e),e}getControlFlowStorage(e){const t=this.controlFlowStorageFactory();if(this.controlFlowData.has(e)){this.hostNodesWithControlFlowNode.has(e)&&(R.NodeGuards.isSwitchCaseNode(e)?e.consequent.shift():e.body.shift());const o=this.controlFlowData.get(e);t.mergeWith(o,!0)}return t}getHostNode(e){const t=T.NodeStatementUtils.getParentNodesWithStatements(e);return 1===t.length?e:(t.pop(),t.length>r.hostNodeSearchMinDepth&&t.splice(0,r.hostNodeSearchMinDepth),t.length>r.hostNodeSearchMaxDepth&&(t.length=r.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}isVisitedFunctionNode(e){return(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}transformFunctionBody(e,t){g.replace(e,{enter:(e,o)=>{if(F.NodeMetadata.isIgnoredNode(e))return g.VisitorOption.Skip;if(this.isVisitedFunctionNode(e)||!o)return g.VisitorOption.Skip;if(!r.controlFlowReplacersMap.has(e.type))return e;if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold)return e;const n=r.controlFlowReplacersMap.get(e.type);return void 0===n?e:Object.assign(Object.assign({},this.controlFlowReplacerFactory(n).replace(e,o,t)),{parentNode:o})}})}};x.controlFlowReplacersMap=new Map([[O.NodeType.BinaryExpression,S.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[O.NodeType.CallExpression,S.ControlFlowReplacer.CallExpressionControlFlowReplacer],[O.NodeType.LogicalExpression,S.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[O.NodeType.Literal,S.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),x.hostNodeSearchMinDepth=0,x.hostNodeSearchMaxDepth=2,x=r=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),u(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),u(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==N.TControlFlowStorageFactory&&N.TControlFlowStorageFactory)?n:Object,"function"==typeof(i=void 0!==h.TControlFlowReplacerFactory&&h.TControlFlowReplacerFactory)?i:Object,"function"==typeof(a=void 0!==y.TControlFlowCustomNodeFactory&&y.TControlFlowCustomNodeFactory)?a:Object,"function"==typeof(s=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==b.IOptions&&b.IOptions)?c:Object])],x),t.FunctionControlFlowTransformer=x},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(54),h=o(4),N=o(6);let b=r=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){if(this.checkForProhibitedExpressions(e.left,e.right))return e;const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.LogicalExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a,e.left,e.right)}checkForProhibitedExpressions(e,t){return[e,t].some(e=>{let t;return t=h.NodeGuards.isUnaryExpressionNode(e)?N.NodeUtils.getUnaryExpressionArgumentNode(e):e,!(h.NodeGuards.isLiteralNode(t)||h.NodeGuards.isIdentifierNode(t)||h.NodeGuards.isObjectExpressionNode(t)||h.NodeGuards.isExpressionStatementNode(t))})}};b.usingExistingIdentifierChance=.5,b=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionControlFlowReplacer=b},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(45),h=o(4);let N=r=class extends y.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){if(h.NodeGuards.isPropertyNode(t)&&t.key===e)return e;if("string"!=typeof e.value||e.value.length<3)return e;const n=String(e.value),i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralNode);i.initialize(e.value);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a)}getControlFlowStorageCallNode(e,t){const o=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode);o.initialize(e,t);const r=o.getNode()[0];if(!r||!h.NodeGuards.isExpressionStatementNode(r))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return r.expression}};N.usingExistingIdentifierChance=1,N=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.StringLiteralControlFlowReplacer=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(16),i=o(1),a=o(21),s=o(59),c=o(96),d=o(98),l=o(99),u=o(100),f=o(102),p=o(103),m=o(104),g=o(105);t.convertingTransformersModule=new r.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.MemberExpressionTransformer).whenTargetNamed(a.NodeTransformer.MemberExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(l.MethodDefinitionTransformer).whenTargetNamed(a.NodeTransformer.MethodDefinitionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.ObjectExpressionKeysTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionKeysTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.ObjectExpressionTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.SplitStringTransformer).whenTargetNamed(a.NodeTransformer.SplitStringTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.TemplateLiteralTransformer).whenTargetNamed(a.NodeTransformer.TemplateLiteralTransformer),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(c.ObjectExpressionToVariableDeclarationExtractor).whenTargetNamed(s.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(g.BasePropertiesExtractor).whenTargetNamed(s.ObjectExpressionExtractor.BasePropertiesExtractor),e(i.ServiceIdentifiers.Factory__IObjectExpressionExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObjectExpressionExtractor))})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(97),l=o(60),u=o(19),f=o(4),p=o(14),m=o(6);let g=class{constructor(e){this.objectExpressionKeysTransformerCustomNodeFactory=e}extract(e,t){return this.transformObjectExpressionToVariableDeclaration(e,t)}transformObjectExpressionToVariableDeclaration(e,t){const o=e.properties,r=this.getObjectExpressionHostNode(o),n=this.getObjectExpressionIdentifierNode(r),i=this.getObjectExpressionNode(r),a=[r],s=p.NodeStatementUtils.getScopeOfNode(t);return u.NodeAppender.insertBefore(s,a,t),m.NodeUtils.parentizeAst(r),m.NodeUtils.parentizeNode(r,s),{nodeToReplace:n,objectExpressionHostStatement:r,objectExpressionNode:i}}getObjectExpressionHostNode(e){const t=this.objectExpressionKeysTransformerCustomNodeFactory(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode);t.initialize(e);const o=t.getNode()[0];if(!o||!f.NodeGuards.isVariableDeclarationNode(o))throw new Error("`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node");return o}getObjectExpressionIdentifierNode(e){const t=e.declarations[0].id;if(!f.NodeGuards.isIdentifierNode(t))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property");return t}getObjectExpressionNode(e){var t;const o=null!==(t=e.declarations[0].init)&&void 0!==t?t:null;if(!o||!f.NodeGuards.isObjectExpressionNode(o))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property");return o}};g=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)),i("design:paramtypes",["function"==typeof(r=void 0!==d.TObjectExpressionKeysTransformerCustomNodeFactory&&d.TObjectExpressionKeysTransformerCustomNodeFactory)?r:Object])],g),t.ObjectExpressionToVariableDeclarationExtractor=g},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(8),g=o(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isMemberExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(g.NodeGuards.isIdentifierNode(e.property)){if(e.computed)return e;e.computed=!0,e.property=m.NodeFactory.literalNode(e.property.name)}return e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MemberExpressionTransformer=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(11),m=o(12),g=o(8),y=o(4);let h=r=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&y.NodeGuards.isMethodDefinitionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return y.NodeGuards.isIdentifierNode(e.key)?this.replaceIdentifierKey(e,e.key):y.NodeGuards.isLiteralNode(e.key)?this.replaceLiteralKey(e,e.key):e}replaceIdentifierKey(e,t){return r.ignoredNames.includes(t.name)||e.computed||(e.computed=!0,e.key=g.NodeFactory.literalNode(t.name)),e}replaceLiteralKey(e,t){return"string"!=typeof t.value||r.ignoredNames.includes(t.value)||e.computed||(e.computed=!0),e}};h.ignoredNames=["constructor"],h=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.MethodDefinitionTransformer=h},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(13)),m=o(101),g=o(2),y=o(3),h=o(11),N=o(12),b=o(4),v=o(14),I=o(59);let S=r=class extends N.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.objectExpressionExtractorFactory=e}static isProhibitedHostStatement(e,t){return r.isReferencedIdentifierName(e,t)}static isReferencedIdentifierName(e,t){const o=[];let r=!1,n=!1;return p.traverse(t,{enter:t=>{t===e&&(n=!0),b.NodeGuards.isIdentifierNode(t)&&(n?o.includes(t.name)&&(r=!0):o.push(t.name))},leave:t=>{if(t===e)return n=!1,p.VisitorOption.Break}}),r}getVisitor(e){if(!this.options.transformObjectKeys)return null;switch(e){case h.TransformationStage.Converting:return{leave:(e,t)=>{if(t&&b.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(!e.properties.length)return e;const o=v.NodeStatementUtils.getRootStatementOfNode(e);return r.isProhibitedHostStatement(e,o)?e:this.applyObjectExpressionKeysExtractorsRecursive(r.objectExpressionExtractorNames,e,o)}applyObjectExpressionKeysExtractorsRecursive(e,t,o){const r=[...e],n=r.shift();if(!n)return t;const{nodeToReplace:i,objectExpressionHostStatement:a,objectExpressionNode:s}=this.objectExpressionExtractorFactory(n).extract(t,o);return this.applyObjectExpressionKeysExtractorsRecursive(r,s,a),i}};S.objectExpressionExtractorNames=[I.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor,I.ObjectExpressionExtractor.BasePropertiesExtractor],S=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.Factory__IObjectExpressionExtractor)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==m.TObjectExpressionExtractorFactory&&m.TObjectExpressionExtractorFactory)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],S),t.ObjectExpressionKeysTransformer=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(8),g=o(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return e.properties.forEach(e=>{e.key&&(e.computed?this.transformComputedProperty(e):this.transformBaseProperty(e))}),e}transformComputedProperty(e){g.NodeGuards.isLiteralNode(e.key)&&"string"==typeof e.key.value&&(e.key=m.NodeFactory.literalNode(e.key.value))}transformBaseProperty(e){e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=m.NodeFactory.literalNode(e.key.name))}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.ObjectExpressionTransformer=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(2),m=o(3),g=o(21),y=o(11),h=o(12),N=o(8),b=o(4),v=o(44),I=o(6);let S=r=class extends h.AbstractNodeTransformer{constructor(e,t){super(e,t),this.runAfter=[g.NodeTransformer.ObjectExpressionKeysTransformer,g.NodeTransformer.TemplateLiteralTransformer]}static chunkString(e,t){const o=Math.ceil(e.length/t),r=[];let n=0;for(let i=0;i{if(this.options.splitStrings)return t&&b.NodeGuards.isLiteralNode(e)?this.transformNode(e,t):void 0}};default:return null}}transformNode(e,t){if(v.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;const o=this.transformLiteralNodeByChunkLength(e,t,r.firstPassChunkLength);return f.replace(o,{enter:(e,t)=>{if(t&&b.NodeGuards.isLiteralNode(e))return this.transformLiteralNodeByChunkLength(e,t,this.options.splitStringsChunkLength)}})}transformLiteralNodeByChunkLength(e,t,o){if("string"!=typeof e.value)return e;if(o>=e.value.length)return e;const n=r.chunkString(e.value,o),i=this.transformStringChunksToBinaryExpressionNode(n);return I.NodeUtils.parentizeAst(i),I.NodeUtils.parentizeNode(i,t),i}transformStringChunksToBinaryExpressionNode(e){const t=e.shift(),o=e.shift();if(!t||!o)throw new Error("First and second chunks values should not be empty");const r=N.NodeFactory.binaryExpressionNode("+",N.NodeFactory.literalNode(t),N.NodeFactory.literalNode(o));return e.reduce((e,t)=>{const o=N.NodeFactory.literalNode(t);return N.NodeFactory.binaryExpressionNode("+",e,o)},r)}};S.firstPassChunkLength=1e3,S=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],S),t.SplitStringTransformer=S},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(11),m=o(12),g=o(8),y=o(4),h=o(6);let N=r=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}static isLiteralNodeWithStringValue(e){return!!e&&y.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}static isValidTemplateLiteralNode(e,t){return y.NodeGuards.isTemplateLiteralNode(e)&&!y.NodeGuards.isTaggedTemplateExpressionNode(t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&r.isValidTemplateLiteralNode(e,t))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const o=e.expressions;let n,i=[];if(e.quasis.forEach(e=>{i.push(g.NodeFactory.literalNode(e.value.cooked));const t=o.shift();t&&i.push(t)}),i=i.filter(e=>!(y.NodeGuards.isLiteralNode(e)&&""===e.value)),r.isLiteralNodeWithStringValue(i[0])||r.isLiteralNodeWithStringValue(i[1])||i.unshift(g.NodeFactory.literalNode("")),i.length>1){let e=g.NodeFactory.binaryExpressionNode("+",i.shift(),i.shift());i.forEach(t=>{e=g.NodeFactory.binaryExpressionNode("+",e,t)}),n=e}else n=i[0];return h.NodeUtils.parentizeAst(n),h.NodeUtils.parentizeNode(n,t),n}};N=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.TemplateLiteralTransformer=N},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(19),s=o(8),c=o(4),d=o(14);let l=r=class{static getPropertyNodeKeyName(e){const t=e.key;return!c.NodeGuards.isLiteralNode(t)||"string"!=typeof t.value&&"number"!=typeof t.value?c.NodeGuards.isIdentifierNode(t)?t.name:null:t.value.toString()}static isProhibitedPattern(e){return!e||c.NodeGuards.isObjectPatternNode(e)||c.NodeGuards.isArrayPatternNode(e)||c.NodeGuards.isAssignmentPatternNode(e)||c.NodeGuards.isRestElementNode(e)}extract(e,t){const o=e.parentNode;return o&&c.NodeGuards.isVariableDeclaratorNode(o)&&c.NodeGuards.isIdentifierNode(o.id)?this.transformObjectExpressionNode(e,t,o.id):{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}transformObjectExpressionNode(e,t,o){const r=e.properties,[n,i]=this.extractPropertiesToExpressionStatements(r,t,o),s=d.NodeStatementUtils.getScopeOfNode(t);return this.filterExtractedObjectExpressionProperties(e,i),a.NodeAppender.insertAfter(s,n,t),{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}extractPropertiesToExpressionStatements(e,t,o){const n=e.length,i=[],a=[];for(let d=0;d!t.includes(o))}};l=r=n([i.injectable()],l),t.BasePropertiesExtractor=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(18),s=o(23),c=o(61),d=o(58),l=o(60),u=o(107),f=o(108),p=o(109),m=o(110),g=o(111),y=o(112),h=o(115),N=o(116),b=o(117),v=o(118),I=o(119),S=o(120),O=o(122),j=o(124),_=o(126),C=o(128),R=o(130),F=o(134),T=o(136),w=o(137),x=o(138),E=o(140),G=o(142),P=o(149),A=o(151),M=o(154),D=o(155);t.customNodesModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICustomNode).to(O.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(i.ServiceIdentifiers.ICustomNode).to(_.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(i.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(i.ServiceIdentifiers.ICustomNode).to(R.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(F.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(i.ServiceIdentifiers.ICustomNode).to(x.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(E.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(i.ServiceIdentifiers.ICustomNode).to(G.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(i.ServiceIdentifiers.ICustomNode).to(P.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(i.ServiceIdentifiers.ICustomNode).to(A.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.BinaryExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BlockStatementControlFlowFlatteningNode).whenTargetNamed(a.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(I.CallExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(S.ControlFlowStorageNode).whenTargetNamed(a.ControlFlowCustomNode.ControlFlowStorageNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(T.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(w.LogicalExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(D.StringLiteralNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(M.StringLiteralControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(b.BlockStatementDeadCodeInjectionNode).whenTargetNamed(d.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.ObjectExpressionVariableDeclarationHostNode).whenTargetNamed(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode),e(i.ServiceIdentifiers.ICustomNodeGroup).to(u.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(f.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(p.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(m.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(g.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(i.ServiceIdentifiers.Factory__ICustomNode).toFactory(r.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNode)),e(i.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions)),e(i.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(r.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNodeGroup)),e(i.ServiceIdentifiers.ICustomNodeFormatter).to(j.CustomNodeFormatter).inSingletonScope()})},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.ConsoleOutputDisableExpressionNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.disableConsoleOutput)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.ConsoleOutputDisableExpressionNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.ConsoleOutputCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19),S=o(4);let O=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionCallNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionNode,t=>{I.NodeAppender.append(e,t.getNode())}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionIntervalNode,t=>{const o=S.NodeGuards.isSwitchCaseNode(e)?e.consequent.length:e.body.length,r=this.randomGenerator.getRandomInteger(0,o);I.NodeAppender.insertAtIndex(e,t.getNode(),r)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.debugProtection)return;const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),o=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionNode),r=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionCallNode),n=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);o.initialize(e),r.initialize(e,t),n.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(N.CustomNode.DebugProtectionFunctionNode,o),this.customNodes.set(N.CustomNode.DebugProtectionFunctionCallNode,r),this.options.debugProtectionInterval&&this.customNodes.set(N.CustomNode.DebugProtectionFunctionIntervalNode,n),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,i)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],O.prototype,"customNodes",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.DebugProtectionCustomNodeGroup=O},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DomainLockNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.domainLock.length)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.DomainLockNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.DomainLockNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.DomainLockCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.SelfDefendingUnicodeNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.selfDefending)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.SelfDefendingUnicodeNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.SelfDefendingCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=o(26),g=o(5),y=o(2),h=o(3),N=o(35),b=o(7),v=o(23),I=o(22),S=o(27),O=o(19);let j=class extends S.AbstractCustomNodeGroup{constructor(e,t,o,r,n){super(o,r,n),this.appendEvent=I.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e,this.stringArrayStorage=t}appendCustomNodes(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(v.CustomNode.StringArrayNode,t=>{O.NodeAppender.prepend(e,t.getNode())}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayCallsWrapper,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayRotateFunctionNode,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}))}initialize(){if(this.customNodes=new Map,!this.options.stringArray)return;const e=this.customNodeFactory(v.CustomNode.StringArrayNode),t=this.customNodeFactory(v.CustomNode.StringArrayCallsWrapper),o=this.customNodeFactory(v.CustomNode.StringArrayRotateFunctionNode),r=this.stringArrayStorage.getStorageName(),n=this.stringArrayStorage.getStorageCallsWrapperName(),i=this.stringArrayStorage.getRotationAmount();e.initialize(this.stringArrayStorage,r),t.initialize(r,n),o.initialize(r,i),this.customNodes.set(v.CustomNode.StringArrayNode,e),this.customNodes.set(v.CustomNode.StringArrayCallsWrapper,t),this.options.rotateStringArray&&this.customNodes.set(v.CustomNode.StringArrayRotateFunctionNode,o)}};d([b.initializable(),l("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],j.prototype,"customNodes",void 0),j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.Factory__ICustomNode)),u(1,f.inject(p.ServiceIdentifiers.IStringArrayStorage)),u(2,f.inject(p.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u(3,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(4,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==m.TCustomNodeFactory&&m.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.IStringArrayStorage&&N.IStringArrayStorage)?i:Object,"function"==typeof(a=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.StringArrayCustomNodeGroup=j},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8);let N=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.properties=e}getNodeStructure(e){return[h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()),h.NodeFactory.objectExpressionNode(this.properties))],"const")]}};N=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.ObjectExpressionVariableDeclarationHostNode=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n let that;\n \n try {\n const getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n const getGlobal = function () {\n let globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n const that = getGlobal();\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.binaryExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BinaryExpressionFunctionNode=b},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(4),v=o(6);let I=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=o}getNodeStructure(e){const t=this.randomGenerator.getRandomString(6),o=this.randomGenerator.getRandomString(6),r=N.NodeFactory.blockStatementNode([N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(t),N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join("|")),N.NodeFactory.identifierNode("split")),[N.NodeFactory.literalNode("|")]))],"const"),N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(o),N.NodeFactory.literalNode(0))],"let"),N.NodeFactory.whileStatementNode(N.NodeFactory.literalNode(!0),N.NodeFactory.blockStatementNode([N.NodeFactory.switchStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(t),N.NodeFactory.updateExpressionNode("++",N.NodeFactory.identifierNode(o)),!0),this.shuffledKeys.map((e,t)=>{const o=this.blockStatementBody[e],r=[o];return b.NodeGuards.isReturnStatementNode(o)||r.push(N.NodeFactory.continueStatement()),N.NodeFactory.switchCaseNode(N.NodeFactory.literalNode(String(t)),r)})),N.NodeFactory.breakStatement()]))]);return v.NodeUtils.parentizeAst(r),[r]}};s([y.initializable(),c("design:type",Array)],I.prototype,"blockStatementBody",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"originalKeysIndexesInShuffledArray",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"shuffledKeys",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.BlockStatementControlFlowFlatteningNode=I},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.blockStatementNode=e,this.deadCodeInjectionRootAstHostNode=t}getNodeStructure(e){const t=this.randomGenerator.getMathRandom()>.5,o=this.randomGenerator.getMathRandom()>.5,r=t?"===":"!==",n=this.randomGenerator.getRandomString(5),i=o?n:this.randomGenerator.getRandomString(5),[a,s]=t===o?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],c=h.NodeFactory.blockStatementNode([h.NodeFactory.ifStatementNode(h.NodeFactory.binaryExpressionNode(r,h.NodeFactory.literalNode(n),h.NodeFactory.literalNode(i)),a,s)]);return N.NodeUtils.parentizeAst(c),[c]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BlockStatementDeadCodeInjectionNode=b},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(7),N=o(10),b=o(8),v=o(6);let I=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o,r){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.callee=o,this.expressionArguments=r}getNodeStructure(){const e=b.NodeFactory.expressionStatementNode(b.NodeFactory.callExpressionNode(b.NodeFactory.memberExpressionNode(b.NodeFactory.identifierNode(this.controlFlowStorageName),b.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.callee,...this.expressionArguments]));return v.NodeUtils.parentizeAst(e),[e]}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof ESTree&&ESTree.Expression)?r:Object)],I.prototype,"callee",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageName",void 0),c([h.initializable(),d("design:type",Array)],I.prototype,"expressionArguments",void 0),I=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],I),t.CallExpressionControlFlowStorageCallNode=I},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.expressionArguments=e}getNodeStructure(e){const t=N.NodeFactory.identifierNode("callee"),o=[],r=this.expressionArguments.length;for(let e=0;e=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(121),m=o(5),g=o(2),y=o(3),h=o(9),N=o(7),b=o(10),v=o(8),I=o(4),S=o(6);let O=class extends b.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.controlFlowStorage=e}getNodeStructure(e){const t=Array.from(this.controlFlowStorage.getStorage()).map(([e,t])=>{const o=t.getNode()[0];if(!I.NodeGuards.isExpressionStatementNode(o))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return v.NodeFactory.propertyNode(v.NodeFactory.identifierNode(e),o.expression)});let o=v.NodeFactory.variableDeclarationNode([v.NodeFactory.variableDeclaratorNode(v.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()),v.NodeFactory.objectExpressionNode(t))],"const");return o=S.NodeUtils.parentizeAst(o),[o]}};c([N.initializable(),d("design:type","function"==typeof(r=void 0!==p.TControlFlowStorage&&p.TControlFlowStorage)?r:Object)],O.prototype,"controlFlowStorage",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.ControlFlowStorageNode=O},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(20),h=o(123),N=o(47),b=o(7),v=o(10),I=o(6);let S=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():N.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(h.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([b.initializable(),c("design:type",String)],S.prototype,"callsControllerFunctionName",void 0),S=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],S),t.ConsoleOutputDisableExpressionNode=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n const c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.table = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.table = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=s(o(13)),f=c(o(125)),p=o(62),m=o(4);let g=class{constructor(e){this.prevailingKindOfVariables=e.getPrevailingKind()}formatTemplate(e,t){return f.default(e,t)}formatStructure(e){for(const t of e)u.replace(t,{enter:e=>{if(m.NodeGuards.isVariableDeclarationNode(e))return"var"===this.prevailingKindOfVariables&&(e.kind="var"),e}});return e}};g=n([d.injectable(),a(0,d.inject(l.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),i("design:paramtypes",["function"==typeof(r=void 0!==p.IPrevailingKindOfVariablesAnalyzer&&p.IPrevailingKindOfVariablesAnalyzer)?r:Object])],g),t.CustomNodeFormatter=g},function(e,t){e.exports=require("string-template")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(127),N=o(10),b=o(6);let v=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"callsControllerFunctionName",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionCallNode=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(\n this,\n function () {\n const regExp1 = new RegExp('function *\\\\( *\\\\)');\n const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');\n \n const result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n }\n )();\n })();\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(129),N=o(10),b=o(6);let v=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionIntervalNode=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(20),h=o(7),N=o(131),b=o(132),v=o(133),I=o(10),S=o(6);let O=class extends I.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?N.DebuggerTemplate():b.DebuggerTemplateNoEval();return this.customNodeFormatter.formatTemplate(v.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([h.initializable(),c("design:type",String)],O.prototype,"debugProtectionFunctionName",void 0),O=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],O),t.DebugProtectionFunctionNode=O},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n const func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(48),g=o(2),y=o(3),h=o(9),N=o(20),b=o(7),v=o(135),I=o(47),S=o(10),O=o(6);let j=class extends S.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.cryptUtils=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.domainLock.join(";"),[t,o]=this.cryptUtils.hideString(e,3*e.length),r=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():I.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(v.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:o,domains:t,globalVariableTemplate:r,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([b.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.ICryptUtils)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.ICryptUtils&&m.ICryptUtils)?s:Object])],j),t.DomainLockNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n const func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (let i = 0; i < 1000; i--) {\n const isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n const regExp = new RegExp("[{diff}]", "g");\n const domains = "{domains}".replace(regExp, "").split(";");\n let document;\n let domain;\n let location;\n let hostname;\n\n for (let d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (let d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n\n if (!("~" > domain)) {\n for (let d2 in that[document]) {\n if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) {\n location = d2;\n \n break;\n }\n }\n\n for (let d3 in that[document][location]) {\n if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) {\n hostname = d3;\n \n break;\n }\n }\n }\n \n if (!document || !that[document]) {\n return;\n }\n \n const documentDomain = that[document][domain];\n const documentLocationHostName = !!that[document][location] && that[document][location][hostname];\n const currentDomain = documentDomain || documentLocationHostName;\n \n if (!currentDomain) {\n return;\n }\n \n let ok = false;\n \n for (let i = 0; i < domains.length; i++) {\n const domain = domains[i];\n const position = currentDomain.length - domain.length;\n const lastIndex = currentDomain.indexOf(domain, position);\n const endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o,r){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=o,this.rightValue=r}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.ExpressionWithOperatorControlFlowStorageCallNode=v},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.logicalExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionFunctionNode=b},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(22),h=o(7),N=o(139),b=o(36),v=o(10),I=o(25),S=o(6),O=o(9);let j=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.appendEvent===y.ObfuscationEvent.AfterObfuscation?I.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed})).getObfuscatedCode():this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([h.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),c([h.initializable(),d("design:type","function"==typeof(r=void 0!==y.ObfuscationEvent&&y.ObfuscationEvent)?r:Object)],j.prototype,"appendEvent",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==O.ICustomNodeFormatter&&O.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],j),t.NodeCallsControllerFunctionNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n const {singleNodeCallControllerFunctionName} = (function(){\n let firstCall = true;\n \n return function (context, fn){\n const rfn = firstCall ? function(){\n if(fn){\n const res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(7),b=o(36),v=o(141),I=o(10),S=o(25),O=o(6);let j=class extends I.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return S.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],j),t.SelfDefendingUnicodeNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return !regExp.test(func1.toString());\n };\n \n const test2 = function () {\n const regExp = new RegExp('${e.encode("(\\\\[x|u](\\w){2,4})+",!0)}');\n \n return regExp.test(func2.toString());\n };\n \n const recursiveFunc1 = function (string) {\n const i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n const recursiveFunc2 = function (string) {\n const i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+"")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n `}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(20),b=o(24),v=o(7),I=o(36),S=o(143),O=o(47),j=o(144),_=o(145),C=o(146),R=o(147),F=o(148),T=o(10),w=o(25),x=o(6);let E=class extends T.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}getNodeStructure(e){return x.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.getDecodeStringArrayTemplate();return w.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(R.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),Object.assign(Object.assign({},I.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}getDecodeStringArrayTemplate(){const e=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():O.GlobalVariableNoEvalTemplate(),t=this.customNodeFormatter.formatTemplate(S.AtobTemplate(),{globalVariableTemplate:e});let o="",r="";switch(this.options.selfDefending&&(r=this.customNodeFormatter.formatTemplate(_.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case b.StringArrayEncoding.Rc4:o=this.customNodeFormatter.formatTemplate(F.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:j.Rc4Template(),selfDefendingCode:r,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case b.StringArrayEncoding.Base64:o=this.customNodeFormatter.formatTemplate(C.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:r,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return o}};c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayName",void 0),c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayCallsWrapperName",void 0),E=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],E),t.StringArrayCallsWrapper=E},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n const str = String(input).replace(/=+$/, '');\n let output = '';\n for (\n let bc = 0, bs, buffer, idx = 0;\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n }\n );\n })();\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n const rc4 = function (str, key) {\n let s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (let k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n let i;\n \t \n\t for (i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (let y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){const o=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6),i=e.getRandomString(6),a=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),d=e.getRandomString(6),l=e.getRandomString(6);return`\n const StatesClass = function (${o}) {\n this.${o} = ${o};\n this.${r} = [1, 0, 0];\n this.${n} = function(){return 'newState';};\n this.${i} = '${t.encode("\\w+ *\\(\\) *{\\w+ *",!0)}';\n this.${a} = '${t.encode("['|\"].+['|\"];? *}",!0)}';\n };\n \n StatesClass.prototype.${s} = function () {\n const regExp = new RegExp(this.${i} + this.${a});\n const expression = regExp.test(this.${n}.toString())\n ? --this.${r}[1]\n : --this.${r}[0];\n \n return this.${c}(expression);\n };\n \n StatesClass.prototype.${c} = function (${l}) {\n if (!Boolean(~${l})) {\n return ${l};\n }\n \n return this.${d}(this.${o});\n };\n\n StatesClass.prototype.${d} = function (${o}) {\n for (let i = 0, len = this.${r}.length; i < len; i++) {\n this.${r}.push(Math.round(Math.random()));\n len = this.${r}.length;\n }\n \n return ${o}(this.${r}[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).${s}();\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){const t=e.getRandomString(6),o=e.getRandomString(6),r=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.${o} = function (str) {\n const string = atob(str);\n let newStringChars = [];\n \n for (let i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.${r} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${r}[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.${o}(value);\n {stringArrayCallsWrapperName}.${r}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n const {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n let value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){const t=e.getRandomString(6),o=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.${o} = rc4;\n \n {stringArrayCallsWrapperName}.${r} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${r}[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.${n} === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.${n} = true;\n }\n \n value = {stringArrayCallsWrapperName}.${o}(value, key);\n {stringArrayCallsWrapperName}.${r}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(35),N=o(7),b=o(150),v=o(10),I=o(6);let S=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.stringArrayStorage=e,this.stringArrayName=t}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(b.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}};c([N.initializable(),d("design:type","function"==typeof(r=void 0!==h.IStringArrayStorage&&h.IStringArrayStorage)?r:Object)],S.prototype,"stringArrayStorage",void 0),c([N.initializable(),d("design:type",String)],S.prototype,"stringArrayName",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],S),t.StringArrayNode=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n const {stringArrayName} = [{stringArray}];\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(7),b=o(36),v=o(152),I=o(153),S=o(10),O=o(25),j=o(6),_=o(37);let C=class extends S.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayRotationAmount=t}getNodeStructure(e){return j.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate();let o="";return o=this.options.selfDefending?this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):`${t}(++${e})`,O.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(I.StringArrayRotateFunctionTemplate(),{code:o,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotationAmount:_.NumberUtils.toHex(this.stringArrayRotationAmount),whileFunctionName:t}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],C.prototype,"stringArrayName",void 0),c([N.initializable(),d("design:type",Number)],C.prototype,"stringArrayRotationAmount",void 0),C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.StringArrayRotateFunctionNode=C},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const selfDefendingFunc = function () {\n const object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n let updatedCookie = name + "=" + value;\n let i = 0;\n \n for (let i = 0, len = options.length; i < len; i++) {\n const propName = options[i];\n \n updatedCookie += "; " + propName;\n \n const propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += "=" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n const matches = document(new RegExp(\n "(?:^|; )" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + "=([^;]*)"\n ));\n \n const func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n let cookie = '';\n const result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n const {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotationAmount});\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.StringLiteralControlFlowStorageCallNode=v},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8);let b=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.literalValue=e}getNodeStructure(e){return[N.NodeFactory.expressionStatementNode(N.NodeFactory.literalNode(this.literalValue))]}};s([y.initializable(),c("design:type",String)],b.prototype,"literalValue",void 0),b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.StringLiteralNode=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0);t.finalizingTransformersModule=new r.ContainerModule(e=>{})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(31),a=o(158),s=o(159),c=o(160);t.generatorsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(a.DictionaryIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(c.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(n.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(){let e=null;return t=>o=>{if(e)return e;let r;switch(o.identifierNamesGenerator){case i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return e=r,r}}())})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(34),p=o(2),m=o(3),g=o(49);let y=r=class extends g.AbstractIdentifierNamesGenerator{constructor(e,t,o){super(e,t),this.arrayUtils=o,this.identifierNamesSet=new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)),this.identifiersIterator=this.identifierNamesSet.values()}static incrementIdentifierName(e){let t="",o=!1;for(const r of e)o||r!==r.toUpperCase()?o||r!==r.toLowerCase()?t+=r:(t+=r.toUpperCase(),o=!0):t+=r.toLowerCase();return o?t:null}generate(){if(!this.identifierNamesSet.size)throw new Error("Too many identifiers in the code, add more words to identifiers dictionary");const e=this.identifiersIterator.next();return e.done?(this.identifierNamesSet=new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])),this.identifiersIterator=this.identifierNamesSet.values(),this.generate()):e.value}generateWithPrefix(){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate()}`.replace("__","_")}getInitialIdentifierNames(e){const t=e.filter(Boolean).map(e=>e.toLowerCase());return this.arrayUtils.shuffle(t)}getIncrementedIdentifierNames(e){const t=[];for(const o of e){const e=r.incrementIdentifierName(o);e&&t.push(e)}return this.arrayUtils.shuffle(t)}};y=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(1,l.inject(u.ServiceIdentifiers.IOptions)),d(2,l.inject(u.ServiceIdentifiers.IArrayUtils)),c("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object,"function"==typeof(a=void 0!==f.IArrayUtils&&f.IArrayUtils)?a:Object])],y),t.DictionaryIdentifierNamesGenerator=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(49),m=o(37),g=o(30);let y=r=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.randomVariableNameSet=new Set}generate(e){const t=this.randomGenerator.getRandomInteger(1e4,99999999),o=m.NumberUtils.toHex(t),n=g.Utils.hexadecimalPrefix.length+1,i=e?e-n:r.baseIdentifierNameLength,a=o.substr(0,i),s=`_${g.Utils.hexadecimalPrefix}${a}`;return this.randomVariableNameSet.has(s)?this.generate(e):(this.randomVariableNameSet.add(s),s)}generateWithPrefix(e){const t=this.generate(e);return`${this.options.identifiersPrefix}${t}`.replace("__","_")}};y.baseIdentifierNameLength=6,y=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],y),t.HexadecimalIdentifierNamesGenerator=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(49);let m=r=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.previousMangledName=r.initMangledNameCharacter}generate(e){const t=this.generateNewMangledName(this.previousMangledName);return this.previousMangledName=t,t}generateWithPrefix(e){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate(e)}`}isValidIdentifierName(e){return super.isValidIdentifierName(e)&&!r.reservedNamesSet.has(e)}generateNewMangledName(e){let t=(e=>{const t=r.nameSequence,o=t.length,n=e.length,i=e=>"0".repeat(e);let a=n-1;do{const r=e[a],s=t.indexOf(r);if(s!==o-1){return e.substring(0,a)+t[s+1]+i(n-(a+1))}--a}while(a>=0);return`a${i(n)}`})(e);return this.isValidIdentifierName(t)||(t=this.generateNewMangledName(t)),t}};m.initMangledNameCharacter="9",m.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),m.reservedNamesSet=new Set(["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"]),m=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MangledIdentifierNamesGenerator=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1);t.nodeTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.Factory__INodeTransformer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeTransformer))})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(38),s=o(63),c=o(21),d=o(163),l=o(164),u=o(165),f=o(167),p=o(169),m=o(170),g=o(171);t.obfuscatingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(u.LabeledStatementTransformer).whenTargetNamed(c.NodeTransformer.LabeledStatementTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.LiteralTransformer).whenTargetNamed(c.NodeTransformer.LiteralTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ScopeIdentifiersTransformer).whenTargetNamed(c.NodeTransformer.ScopeIdentifiersTransformer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(l.BooleanLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(p.NumberLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(m.StringLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(d.BaseIdentifierObfuscatingReplacer).whenTargetNamed(a.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),e(i.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObfuscatingReplacer)),e(i.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer))})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(5),u=o(2),f=o(39),p=o(8);let m=class extends f.AbstractObfuscatingReplacer{constructor(e,t){super(t),this.blockScopesMap=new Map,this.identifierNamesGenerator=e(t)}replace(e,t){let o=e.name;if(this.blockScopesMap.has(t)){const e=this.blockScopesMap.get(t);e.has(o)&&(o=e.get(o))}return p.NodeFactory.identifierNode(o)}storeGlobalName(e,t){const o=e.name;if(this.isReservedName(o))return;const r=this.identifierNamesGenerator.generateWithPrefix();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(o,r)}storeLocalName(e,t){const o=e.name;if(this.isReservedName(o))return;const r=this.identifierNamesGenerator.generate();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(o,r)}preserveName(e){this.identifierNamesGenerator.preserveName(e)}isReservedName(e){return!!this.options.reservedNames.length&&this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==l.TIdentifierNamesGeneratorFactory&&l.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==u.IOptions&&u.IOptions)?n:Object])],m),t.BaseIdentifierObfuscatingReplacer=m},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(39),f=o(8);let p=r=class extends u.AbstractObfuscatingReplacer{constructor(e){super(e)}static getTrueUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",r.getFalseUnaryExpressionNode())}static getFalseUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",f.NodeFactory.arrayExpressionNode())}replace(e){const t=e.value;if("boolean"!=typeof t)throw new Error("`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value");return t?r.getTrueUnaryExpressionNode():r.getFalseUnaryExpressionNode()}};p=r=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.BooleanLiteralObfuscatingReplacer=p},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(50),m=o(2),g=o(3),y=o(38),h=o(11),N=o(12),b=o(4),v=o(166);let I=class extends N.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.identifierObfuscatingReplacer=e(y.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case h.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&b.NodeGuards.isLabeledStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const o=v.NodeLexicalScopeUtils.getLexicalScope(e);return o?(this.storeLabeledStatementName(e,o),this.replaceLabeledStatementName(e,o),e):e}storeLabeledStatementName(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label,t)}replaceLabeledStatementName(e,t){f.replace(e,{enter:(e,o)=>{if(o&&b.NodeGuards.isLabelIdentifierNode(e,o)){const o=this.identifierObfuscatingReplacer.replace(e,t);e.name=o.name}}})}};I=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(2,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierObfuscatingReplacerFactory&&p.TIdentifierObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==m.IOptions&&m.IOptions)?i:Object])],I),t.LabeledStatementTransformer=I},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static getLexicalScope(e){return n.getLexicalScopesRecursive(e,1)[0]}static getLexicalScopes(e){return n.getLexicalScopesRecursive(e)}static getLexicalScopesRecursive(e,t=1/0,o=[],i=0){if(o.length>=t)return o;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithLexicalScope(e)&&o.push(e),e!==a?n.getLexicalScopesRecursive(a,t,o,++i):o}}t.NodeLexicalScopeUtils=n},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(168),m=o(29),g=o(2),y=o(3),h=o(64),N=o(63),b=o(11),v=o(12),I=o(8),S=o(4),O=o(44),j=o(15),_=o(6);let C=class extends v.AbstractNodeTransformer{constructor(e,t,o,r,n){super(t,o),this.literalObfuscatingReplacerFactory=e,this.stringArrayStorageAnalyzer=r,this.escapeSequenceEncoder=n}getVisitor(e){switch(e){case b.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(S.NodeGuards.isProgramNode(e)&&this.analyzeNode(e),t&&S.NodeGuards.isLiteralNode(e)&&!j.NodeMetadata.isReplacedLiteral(e))return this.transformNode(e,t)}};case b.TransformationStage.Finalizing:return{enter:(e,t)=>{if(t&&S.NodeGuards.isLiteralNode(e))return this.encodeLiteralNodeToEscapeSequence(e,t)}};default:return null}}analyzeNode(e){this.stringArrayStorageAnalyzer.analyze(e)}transformNode(e,t){if(O.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;let o;switch(typeof e.value){case"boolean":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e);break;case"number":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e);break;case"string":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e);break;default:o=e}return _.NodeUtils.parentizeNode(o,t),o}encodeLiteralNodeToEscapeSequence(e,t){return"string"!=typeof e.value?e:I.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(e.value,this.options.unicodeEscapeSequence))}};C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IObfuscatingReplacer)),l(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(2,u.inject(f.ServiceIdentifiers.IOptions)),l(3,u.inject(f.ServiceIdentifiers.IStringArrayStorageAnalyzer)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TLiteralObfuscatingReplacerFactory&&p.TLiteralObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==g.IOptions&&g.IOptions)?i:Object,"function"==typeof(a=void 0!==h.IStringArrayStorageAnalyzer&&h.IStringArrayStorageAnalyzer)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.LiteralTransformer=C},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(2),l=o(39),u=o(8),f=o(37),p=o(30);let m=class extends l.AbstractObfuscatingReplacer{constructor(e){super(e),this.numberLiteralCache=new Map}replace(e){const t=e.value;if("number"!=typeof t)throw new Error("`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value");let o;return this.numberLiteralCache.has(t)?o=this.numberLiteralCache.get(t):(o=f.NumberUtils.isCeil(t)?`${p.Utils.hexadecimalPrefix}${f.NumberUtils.toHex(t)}`:String(t),this.numberLiteralCache.set(t,o)),u.NodeFactory.literalNode(t,o)}};m=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IOptions&&d.IOptions)?r:Object])],m),t.NumberLiteralObfuscatingReplacer=m},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(2),p=o(35),m=o(64),g=o(7),y=o(24),h=o(39),N=o(15),b=o(8),v=o(37),I=o(30);let S=r=class extends h.AbstractObfuscatingReplacer{constructor(e,t,o){super(o),this.nodesCache=new Map,this.stringArrayStorage=e,this.stringArrayStorageAnalyzer=t}static getHexadecimalLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}static getRc4KeyLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}initialize(){this.stringArrayStorageCallsWrapperName=this.stringArrayStorage.getStorageCallsWrapperName(),this.options.shuffleStringArray&&this.stringArrayStorage.shuffleStorage(),this.options.rotateStringArray&&this.stringArrayStorage.rotateStorage()}replace(e){const t=e.value;if("string"!=typeof t)throw new Error("`StringLiteralObfuscatingReplacer` should accept only literals with `string` value");const o=this.stringArrayStorageAnalyzer.getItemDataForLiteralNode(e),r=`${t}-${Boolean(o)}`;if(this.nodesCache.has(r)&&this.options.stringArrayEncoding!==y.StringArrayEncoding.Rc4)return this.nodesCache.get(r);const n=o?this.replaceWithStringArrayCallNode(o):this.replaceWithLiteralNode(t);return this.nodesCache.set(r,n),n}replaceWithLiteralNode(e){return b.NodeFactory.literalNode(e)}replaceWithStringArrayCallNode(e){const{index:t,decodeKey:o}=e,n=`${I.Utils.hexadecimalPrefix}${v.NumberUtils.toHex(t)}`,i=[r.getHexadecimalLiteralNode(n)];o&&i.push(r.getRc4KeyLiteralNode(o));const a=b.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName);return b.NodeFactory.callExpressionNode(a,i)}};s([g.initializable(),c("design:type",String)],S.prototype,"stringArrayStorageCallsWrapperName",void 0),s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],S.prototype,"initialize",null),S=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IStringArrayStorage)),d(1,l.inject(u.ServiceIdentifiers.IStringArrayStorageAnalyzer)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==p.IStringArrayStorage&&p.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==m.IStringArrayStorageAnalyzer&&m.IStringArrayStorageAnalyzer)?i:Object,"function"==typeof(a=void 0!==f.IOptions&&f.IOptions)?a:Object])],S),t.StringLiteralObfuscatingReplacer=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(50),y=o(2),h=o(3),N=o(172),b=o(38),v=o(11),I=o(12),S=o(4),O=o(15);let j=r=class extends I.AbstractNodeTransformer{constructor(e,t,o,r){super(t,o),this.lexicalScopesWithObjectPatternWithoutDeclarationMap=new Map,this.identifierObfuscatingReplacer=e(b.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),this.scopeAnalyzer=r}getVisitor(e){switch(e){case v.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&S.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.transformNode(e,t)}};default:return null}}analyzeNode(e,t){this.scopeAnalyzer.analyze(e)}transformNode(e,t){const o=this.scopeAnalyzer.acquireScope(e);return this.traverseScopeVariables(o),e}traverseScopeVariables(e){const t=e.variableScope,o=S.NodeGuards.isNodeWithBlockLexicalScope(t.block)?t.block:null,n=r.globalScopeNames.includes(t.type);if(o){for(const t of e.variables)if(t.name!==r.argumentsVariableName){if(!this.options.renameGlobals&&n){if(!t.defs.every(e=>"ImportBinding"===e.type||"CatchClause"===e.type))continue}this.transformScopeVariableIdentifiers(t,o,n)}for(const t of e.childScopes)this.traverseScopeVariables(t)}}transformScopeVariableIdentifiers(e,t,o){for(const r of e.identifiers)this.isReplaceableIdentifierNode(r,t,e)&&(this.storeIdentifierName(r,t,o),this.replaceIdentifierName(r,t,e))}storeIdentifierName(e,t,o){o?this.identifierObfuscatingReplacer.storeGlobalName(e,t):this.identifierObfuscatingReplacer.storeLocalName(e,t)}replaceIdentifierName(e,t,o){const r=this.identifierObfuscatingReplacer.replace(e,t);e.name=r.name,o.references.forEach(t=>{t.identifier.name=e.name})}isReplaceableIdentifierNode(e,t,o){const r=e.parentNode;return!(!r||O.NodeMetadata.isIgnoredNode(e)||this.isProhibitedPropertyNode(e,r)||this.isProhibitedClassDeclarationNameIdentifierNode(o,e,r)||this.isProhibitedExportNamedClassDeclarationIdentifierNode(e,r)||this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,r)||this.isProhibitedExportNamedVariableDeclarationIdentifierNode(e,r)||this.isProhibitedImportSpecifierNode(e,r)||this.isProhibitedVariableNameUsedInObjectPatternNode(o,e,t)||S.NodeGuards.isLabelIdentifierNode(e,r))}isProhibitedClassDeclarationNameIdentifierNode(e,t,o){return S.NodeGuards.isClassDeclarationNode(e.scope.block)&&S.NodeGuards.isClassDeclarationNode(o)&&o.id===t}isProhibitedExportNamedClassDeclarationIdentifierNode(e,t){return S.NodeGuards.isClassDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,t){return S.NodeGuards.isFunctionDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedVariableDeclarationIdentifierNode(e,t){return S.NodeGuards.isVariableDeclaratorNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isVariableDeclarationNode(t.parentNode)&&!!t.parentNode.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode.parentNode)}isProhibitedImportSpecifierNode(e,t){return S.NodeGuards.isImportSpecifierNode(t)&&t.imported.name===t.local.name}isProhibitedPropertyNode(e,t){const o=S.NodeGuards.isPropertyNode(t)&&!t.computed&&t.key===e,r=S.NodeGuards.isAssignmentPatternNode(t)&&t.left===e&&!!t.parentNode&&S.NodeGuards.isPropertyNode(t.parentNode)&&t.left===t.parentNode.key;return o||r}isProhibitedVariableNameUsedInObjectPatternNode(e,t,o){let r=this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(o);if(!1===r)return!1;if(!e.defs.some(e=>"var"===e.kind))return!1;let n=!1;return m.traverse(o,{enter:(e,o)=>{if(S.NodeGuards.isObjectPatternNode(e)&&o&&S.NodeGuards.isAssignmentExpressionNode(o)){r=!0;const o=e.properties;for(const e of o)if(!e.computed&&e.shorthand&&S.NodeGuards.isIdentifierNode(e.key)&&t.name===e.key.name)return n=!0,m.VisitorOption.Break}}}),this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(o,null!=r&&r),n}};j.argumentsVariableName="arguments",j.globalScopeNames=["global","module"],j=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),l(1,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(2,f.inject(p.ServiceIdentifiers.IOptions)),l(3,f.inject(p.ServiceIdentifiers.IScopeAnalyzer)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierObfuscatingReplacerFactory&&g.TIdentifierObfuscatingReplacerFactory)?n:Object,"function"==typeof(i=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.IOptions&&y.IOptions)?a:Object,"function"==typeof(s=void 0!==N.IScopeAnalyzer&&N.IScopeAnalyzer)?s:Object])],j),t.ScopeIdentifiersTransformer=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(174),a=o(181);t.optionsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IOptions).to(i.Options).inSingletonScope(),e(n.ServiceIdentifiers.IOptionsNormalizer).to(a.OptionsNormalizer).inSingletonScope()})},function(e,t,o){"use strict";var r,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=o(28),m=o(0),g=o(1),y=o(65),h=o(175),N=o(176),b=o(177),v=o(31),I=o(20),S=o(32),O=o(24),j=o(40),_=o(178),C=o(179);let R=r=class{constructor(e,t){Object.assign(this,j.DEFAULT_PRESET,e);const o=y.validateSync(this,r.validatorOptions);if(o.length)throw new ReferenceError(`Validation failed. errors:\n${_.ValidationErrorsFormatter.format(o)}`);Object.assign(this,t.normalize(this))}};R.validatorOptions={validationError:{target:!1}},l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"compact",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"controlFlowFlattening",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"controlFlowFlatteningThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"deadCodeInjection",void 0),l([y.IsNumber(),u("design:type",Number)],R.prototype,"deadCodeInjectionThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtection",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtectionInterval",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"disableConsoleOutput",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),C.IsAllowedForObfuscationTargets([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval]),u("design:type",Array)],R.prototype,"domainLock",void 0),l([y.IsIn([v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,v.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,v.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]),u("design:type","function"==typeof(n=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?n:Object)],R.prototype,"identifierNamesGenerator",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"identifiersPrefix",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),y.ValidateIf(e=>e.identifierNamesGenerator===v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),y.ArrayNotEmpty(),u("design:type",Array)],R.prototype,"identifiersDictionary",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFileName",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFilePath",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"log",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"renameGlobals",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedNames",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedStrings",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"rotateStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"selfDefending",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"shuffleStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"sourceMap",void 0),l([y.IsString(),y.ValidateIf(e=>Boolean(e.sourceMapBaseUrl)),y.IsUrl({require_protocol:!0,require_tld:!1,require_valid_protocol:!0}),u("design:type",String)],R.prototype,"sourceMapBaseUrl",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"sourceMapFileName",void 0),l([y.IsIn([S.SourceMapMode.Inline,S.SourceMapMode.Separate]),u("design:type","function"==typeof(i=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?i:Object)],R.prototype,"sourceMapMode",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"splitStrings",void 0),l([y.IsNumber(),y.ValidateIf(e=>Boolean(e.splitStrings)),y.Min(1),u("design:type",Number)],R.prototype,"splitStringsChunkLength",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"stringArray",void 0),l([y.IsIn([!0,!1,O.StringArrayEncoding.Base64,O.StringArrayEncoding.Rc4]),u("design:type","function"==typeof(a=void 0!==N.TStringArrayEncoding&&N.TStringArrayEncoding)?a:Object)],R.prototype,"stringArrayEncoding",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"stringArrayThreshold",void 0),l([y.IsIn([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval,I.ObfuscationTarget.Node]),u("design:type","function"==typeof(s=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?s:Object)],R.prototype,"target",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"transformObjectKeys",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"unicodeEscapeSequence",void 0),R=r=l([m.injectable(),f(0,m.inject(g.ServiceIdentifiers.TInputOptions)),f(1,m.inject(g.ServiceIdentifiers.IOptionsNormalizer)),u("design:paramtypes",["function"==typeof(c=void 0!==h.TInputOptions&&h.TInputOptions)?c:Object,"function"==typeof(d=void 0!==b.IOptionsNormalizer&&b.IOptionsNormalizer)?d:Object])],R),t.Options=R},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static format(e){return e.reduce((e,t)=>[...e,r.formatWithNestedConstraints(t)],[]).join("\n")}static formatWithNestedConstraints(e){const t=e.constraints;return`${`\`${e.property}\` errors:\n`}${Object.keys(t).map(e=>` - ${t[e]}\n`).join()}`}}t.ValidationErrorsFormatter=r},function(e,t,o){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=o(65),i=r(o(180)),a=o(41),s=o(40);t.IsAllowedForObfuscationTargets=function(e,t){return(o,r)=>{n.registerDecorator({propertyName:r,constraints:[e],name:"IsAllowedForObfuscationTargets",options:t,target:o.constructor,validator:{validate(t,o){const n=o.object,a=s.DEFAULT_PRESET[r];return i.default(t,a)||e.includes(n.target)},defaultMessage:t=>`This option allowed only for obfuscation targets: ${e.join(`${a.StringSeparator.Comma} `)}`}})}}},function(e,t){e.exports=require("fast-deep-equal")},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(182),s=o(183),c=o(184),d=o(185),l=o(186),u=o(187),f=o(188),p=o(189),m=o(190),g=o(191),y=o(192),h=o(193),N=o(194);let b=r=class{normalize(e){let t=Object.assign({},e);for(const e of r.normalizerRules)t=e(t);return t}};b.normalizerRules=[a.ControlFlowFlatteningThresholdRule,s.DeadCodeInjectionRule,c.DeadCodeInjectionThresholdRule,d.DomainLockRule,l.InputFileNameRule,u.SeedRule,f.SelfDefendingRule,p.SourceMapBaseUrlRule,m.SourceMapFileNameRule,g.SplitStringsChunkLengthRule,y.StringArrayRule,h.StringArrayEncodingRule,N.StringArrayThresholdRule],b=r=n([i.injectable()],b),t.OptionsNormalizer=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControlFlowFlatteningThresholdRule=e=>(0===e.controlFlowFlatteningThreshold&&(e=Object.assign(Object.assign({},e),{controlFlowFlattening:!1,controlFlowFlatteningThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(40);t.DeadCodeInjectionRule=e=>(e.deadCodeInjection&&((e=Object.assign(Object.assign({},e),{deadCodeInjection:!0,stringArray:!0})).stringArrayThreshold||(e=Object.assign(Object.assign({},e),{stringArray:!0,stringArrayThreshold:r.DEFAULT_PRESET.stringArrayThreshold}))),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeadCodeInjectionThresholdRule=e=>(0===e.deadCodeInjectionThreshold&&(e=Object.assign(Object.assign({},e),{deadCodeInjection:!1,deadCodeInjectionThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(30);t.DomainLockRule=e=>{if(e.domainLock.length){const t=[];for(const o of e.domainLock)t.push(r.Utils.extractDomainFrom(o));e=Object.assign(Object.assign({},e),{domainLock:t})}return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(41);t.InputFileNameRule=e=>{let{inputFileName:t}=e;return t&&(t=t.replace(/^\/+/,"").split(r.StringSeparator.Dot).slice(0,-1).join(r.StringSeparator.Dot)||t,e=Object.assign(Object.assign({},e),{inputFileName:`${t}.js`})),e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeedRule=e=>{if(e.seed)return Object.assign(Object.assign({},e),{seed:e.seed});return Object.assign(Object.assign({},e),{seed:(t=0,o=999999999,Math.floor(Math.random()*(o-t+1)+t))});var t,o}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingRule=e=>(e.selfDefending&&(e=Object.assign(Object.assign({},e),{compact:!0,selfDefending:!0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapBaseUrlRule=e=>{const{sourceMapBaseUrl:t}=e;return e.sourceMapFileName?(t&&!t.endsWith("/")&&(e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:`${t}/`})),e):e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:""})}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(41);t.SourceMapFileNameRule=e=>{let{sourceMapFileName:t}=e;if(t){t=t.replace(/^\/+/,"").replace(/(?:\.js)?(?:\.map)?$/,"");let o=t.split(r.StringSeparator.Dot);const n=o.length,i=o[n-1];n>1&&i.length<=3&&(o=o.slice(0,-1)),t=o.join(r.StringSeparator.Dot),e=Object.assign(Object.assign({},e),{sourceMapFileName:`${t}.js.map`})}return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SplitStringsChunkLengthRule=e=>e=0===e.splitStringsChunkLength?Object.assign(Object.assign({},e),{splitStrings:!1,splitStringsChunkLength:0}):Object.assign(Object.assign({},e),{splitStringsChunkLength:Math.floor(e.splitStringsChunkLength)})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRule=e=>(e.stringArray||(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,shuffleStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(24);t.StringArrayEncodingRule=e=>(!0===e.stringArrayEncoding&&(e=Object.assign(Object.assign({},e),{stringArrayEncoding:r.StringArrayEncoding.Base64})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayThresholdRule=e=>(0===e.stringArrayThreshold&&(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(21),s=o(66),c=o(196),d=o(197),l=o(67),u=o(198),f=o(202),p=o(204),m=o(205),g=o(207),y=o(208),h=o(209);t.preparingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.CommentsTransformer).whenTargetNamed(a.NodeTransformer.CommentsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.CustomNodesTransformer).whenTargetNamed(a.NodeTransformer.CustomNodesTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.EvalCallExpressionTransformer).whenTargetNamed(a.NodeTransformer.EvalCallExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.MetadataTransformer).whenTargetNamed(a.NodeTransformer.MetadataTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.ObfuscatingGuardsTransformer).whenTargetNamed(a.NodeTransformer.ObfuscatingGuardsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ParentificationTransformer).whenTargetNamed(a.NodeTransformer.ParentificationTransformer),e(i.ServiceIdentifiers.INodeGuard).to(c.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.BlackListObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(l.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ConditionalCommentObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(y.ReservedStringObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ReservedStringObfuscatingGuard),e(i.ServiceIdentifiers.Factory__INodeGuard).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeGuard)),e(i.ServiceIdentifiers.INodeTransformer).to(h.VariablePreserveTransformer).whenTargetNamed(a.NodeTransformer.VariablePreserveTransformer)})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=o(4);let c=r=class{constructor(){this.blackListGuardsLength=r.blackListGuards.length}check(e){for(let t=0;t=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(2),m=o(3),g=o(11),y=o(12),h=o(4),N=o(67);let b=r=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case g.TransformationStage.Initializing:return{leave:e=>{if(h.NodeGuards.isProgramNode(e))return this.transformNode(e)}};default:return null}}transformNode(e){if(!e.comments||!e.comments.length)return e;const t=this.transformComments(e.comments);return 0===t.length?e:e.body.length?(f.traverse(e,{enter:o=>{if(o===e)return;const r=t.findIndex(e=>e.range&&o.range&&e.range[0]0&&(e.trailingComments=t.reverse()),e):(e.leadingComments=t,e)}transformComments(e){return e.filter(e=>r.preservedWords.some(t=>e.value.includes(t))||N.ConditionalCommentObfuscatingGuard.isConditionalComment(e)).reverse()}};b.preservedWords=["@license","@preserve"],b=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],b),t.CommentsTransformer=b},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=o(199),g=o(200),y=o(2),h=o(3),N=o(201),b=o(62),v=o(22),I=o(11),S=o(12),O=o(4);let j=class extends S.AbstractNodeTransformer{constructor(e,t,o,r,n,i){super(n,i),this.callsGraphData=[],this.callsGraphAnalyzer=e,this.prevailingKindOfVariablesAnalyzer=t,this.obfuscationEventEmitter=o,this.customNodeGroupStorage=r}getVisitor(e){switch(e){case I.TransformationStage.Preparing:return{leave:(e,t)=>{if(O.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.appendCustomNodesBeforeObfuscation(e,t),this.transformNode(e,t)}};case I.TransformationStage.Finalizing:return{leave:(e,t)=>{O.NodeGuards.isProgramNode(e)&&this.appendCustomNodesAfterObfuscation(e,t)}};default:return null}}analyzeNode(e,t){this.callsGraphData=this.callsGraphAnalyzer.analyze(e),this.prevailingKindOfVariablesAnalyzer.analyze(e)}transformNode(e,t){return e}appendCustomNodesBeforeObfuscation(e,t){this.customNodeGroupStorage.getStorage().forEach(e=>{e.initialize(),this.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(v.ObfuscationEvent.BeforeObfuscation,e,this.callsGraphData)}appendCustomNodesAfterObfuscation(e,t){this.obfuscationEventEmitter.emit(v.ObfuscationEvent.AfterObfuscation,e,this.callsGraphData)}};j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.ICallsGraphAnalyzer)),u(1,f.inject(p.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),u(2,f.inject(p.ServiceIdentifiers.IObfuscationEventEmitter)),u(3,f.inject(p.ServiceIdentifiers.TCustomNodeGroupStorage)),u(4,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(5,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(r=void 0!==N.ICallsGraphAnalyzer&&N.ICallsGraphAnalyzer)?r:Object,"function"==typeof(n=void 0!==b.IPrevailingKindOfVariablesAnalyzer&&b.IPrevailingKindOfVariablesAnalyzer)?n:Object,"function"==typeof(i=void 0!==g.IObfuscationEventEmitter&&g.IObfuscationEventEmitter)?i:Object,"function"==typeof(a=void 0!==m.TCustomNodeGroupStorage&&m.TCustomNodeGroupStorage)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.CustomNodesTransformer=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(203)),p=o(2),m=o(3),g=o(11),y=o(12),h=o(8),N=o(4),b=o(6);let v=r=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t),this.evalRootAstHostNodeSet=new Set}static extractEvalStringFromCallExpressionArgument(e){return N.NodeGuards.isLiteralNode(e)?r.extractEvalStringFromLiteralNode(e):N.NodeGuards.isTemplateLiteralNode(e)?r.extractEvalStringFromTemplateLiteralNode(e):null}static extractEvalStringFromLiteralNode(e){return"string"==typeof e.value?e.value:null}static extractEvalStringFromTemplateLiteralNode(e){const t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(t&&N.NodeGuards.isCallExpressionNode(e)&&N.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return this.transformNode(e,t)}};case g.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:(e,t)=>{if(t&&this.isEvalRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}transformNode(e,t){const o=e.arguments[0];if(!o)return e;const n=r.extractEvalStringFromCallExpressionArgument(o);if(!n)return e;let i;try{i=b.NodeUtils.convertCodeToStructure(n)}catch(t){return e}const a=h.NodeFactory.functionExpressionNode([],h.NodeFactory.blockStatementNode(i));return this.evalRootAstHostNodeSet.add(a),a}restoreNode(e,t){const o=e.body.body,r=b.NodeUtils.convertStructureToCode(o);return h.NodeFactory.callExpressionNode(h.NodeFactory.identifierNode("eval"),[h.NodeFactory.literalNode(f.default(r))])}isEvalRootAstHostNode(e){return N.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}};v=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],v),t.EvalCallExpressionTransformer=v},function(e,t){e.exports=require("js-string-escape")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(4),g=o(15);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return g.NodeMetadata.set(e,{ignoredNode:!1}),m.NodeGuards.isLiteralNode(e)&&g.NodeMetadata.set(e,{replacedLiteral:!1}),e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MetadataTransformer=y},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(206),p=o(2),m=o(3),g=o(66),y=o(11),h=o(12),N=o(15);let b=r=class extends h.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.obfuscatingGuards=r.obfuscatingGuardsList.map(e)}getVisitor(e){switch(e){case y.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){const o=this.obfuscatingGuards.every(t=>t.check(e));return N.NodeMetadata.set(e,{ignoredNode:!o}),e}};b.obfuscatingGuardsList=[g.ObfuscatingGuard.BlackListObfuscatingGuard,g.ObfuscatingGuard.ConditionalCommentObfuscatingGuard,g.ObfuscatingGuard.ReservedStringObfuscatingGuard],b=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__INodeGuard)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TObfuscatingGuardFactory&&f.TObfuscatingGuardFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.ObfuscatingGuardsTransformer=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(6);let g=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return m.NodeUtils.parentizeNode(e,t)}};g=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],g),t.ParentificationTransformer=g},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(2),d=o(1),l=o(4);let u=class{constructor(e){this.options=e}check(e){return!this.options.reservedStrings.length||!l.NodeGuards.isLiteralNode(e)||"string"!=typeof e.value||!this.isReservedString(e.value)}isReservedString(e){return this.options.reservedStrings.some(t=>null!==new RegExp(t,"g").exec(e))}};u=n([s.injectable(),a(0,s.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==c.IOptions&&c.IOptions)?r:Object])],u),t.ReservedStringObfuscatingGuard=u},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(50),u=o(2),f=o(3),p=o(38),m=o(1),g=o(11),y=o(12),h=o(4);let N=class extends y.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(h.NodeGuards.isIdentifierNode(e)&&t&&(h.NodeGuards.parentNodeIsPropertyNode(e,t)||h.NodeGuards.parentNodeIsMemberExpressionNode(e,t)||h.NodeGuards.parentNodeIsMethodDefinitionNode(e,t)||h.NodeGuards.isLabelIdentifierNode(e,t)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return this.identifierObfuscatingReplacer.preserveName(e.name),e}};N=a([d.injectable(),c(0,d.inject(m.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,d.inject(m.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(m.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==l.TIdentifierObfuscatingReplacerFactory&&l.TIdentifierObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.VariablePreserveTransformer=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(211),a=o(212),s=o(214);t.storagesModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.TCustomNodeGroupStorage).to(a.CustomNodeGroupStorage).inSingletonScope(),e(n.ServiceIdentifiers.IStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(n.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(i.ControlFlowStorage),e(n.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(e=>()=>{const t=new(e.container.get(n.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(n.ServiceIdentifiers.IRandomGenerator),e.container.get(n.ServiceIdentifiers.IOptions));return t.initialize(),t})})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(51);let p=class extends f.MapStorage{constructor(e,t){super(e,t)}};p=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.ControlFlowStorage=p},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(213),p=o(2),m=o(3),g=o(61),y=o(51);let h=r=class extends y.MapStorage{constructor(e,t,o){super(t,o),this.customNodeGroupFactory=e}initialize(){super.initialize(),r.customNodeGroupsList.forEach(e=>{const t=this.customNodeGroupFactory(e);this.storage.set(e,t)})}};h.customNodeGroupsList=[g.CustomNodeGroup.ConsoleOutputCustomNodeGroup,g.CustomNodeGroup.DebugProtectionCustomNodeGroup,g.CustomNodeGroup.DomainLockCustomNodeGroup,g.CustomNodeGroup.SelfDefendingCustomNodeGroup,g.CustomNodeGroup.StringArrayCustomNodeGroup],s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],h.prototype,"initialize",null),h=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__ICustomNodeGroup)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TCustomNodeGroupFactory&&f.TCustomNodeGroupFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.CustomNodeGroupStorage=h},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=o(5),y=o(34),h=o(48),N=o(29),b=o(2),v=o(3),I=o(7),S=o(24),O=o(51);let j=r=class extends O.MapStorage{constructor(e,t,o,n,i,a){super(o,n),this.rc4EncodedValuesSourcesCache=new Map,this.rotationAmount=0,this.identifierNamesGenerator=e(n),this.arrayUtils=t,this.cryptUtils=i,this.escapeSequenceEncoder=a,this.rc4Keys=this.randomGenerator.getRandomGenerator().n(()=>this.randomGenerator.getRandomGenerator().string({length:r.rc4KeyLength}),r.rc4KeysCount)}initialize(){super.initialize();const e=this.identifierNamesGenerator.generate(r.stringArrayNameLength),t=this.identifierNamesGenerator.generate(r.stringArrayNameLength);this.stringArrayStorageName=`${this.options.identifiersPrefix}${e}`,this.stringArrayStorageCallsWrapperName=`${this.options.identifiersPrefix}${t}`,this.rotationAmount=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(r.minimumRotationAmount,r.maximumRotationAmount):0}get(e){return this.getOrSetIfDoesNotExist(e)}getRotationAmount(){return this.rotationAmount}getStorageId(){return this.stringArrayStorageName}getStorageName(){return this.getStorageId()}getStorageCallsWrapperName(){return this.stringArrayStorageCallsWrapperName}rotateStorage(){this.getLength()&&(this.storage=new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()),this.rotationAmount)))}shuffleStorage(){this.storage=new Map(this.arrayUtils.shuffle(Array.from(this.storage.entries())).map(([e,t],o)=>(t.index=o,[e,t])).sort(([,e],[,t])=>e.index-t.index))}toString(){return Array.from(this.storage.values()).map(e=>`'${this.escapeSequenceEncoder.encode(e.encodedValue,this.options.unicodeEscapeSequence)}'`).toString()}getOrSetIfDoesNotExist(e){const{encodedValue:t,decodeKey:o}=this.getEncodedValue(e),r=this.storage.get(t);if(r)return r;const n={encodedValue:t,decodeKey:o,value:e,index:this.getLength()};return this.storage.set(t,n),n}getEncodedValue(e){var t;switch(this.options.stringArrayEncoding){case S.StringArrayEncoding.Rc4:{const o=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),r=this.cryptUtils.btoa(this.cryptUtils.rc4(e,o)),n=null!==(t=this.rc4EncodedValuesSourcesCache.get(r))&&void 0!==t?t:[];let i=n.length;return(!i||!n.includes(e))&&(n.push(e),i++),this.rc4EncodedValuesSourcesCache.set(r,n),i>1?this.getEncodedValue(e):{encodedValue:r,decodeKey:o}}case S.StringArrayEncoding.Base64:{const t=null;return{encodedValue:this.cryptUtils.btoa(e),decodeKey:t}}default:return{encodedValue:e,decodeKey:null}}}};j.minimumRotationAmount=100,j.maximumRotationAmount=500,j.rc4KeyLength=4,j.rc4KeysCount=50,j.stringArrayNameLength=7,l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageName",void 0),l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageCallsWrapperName",void 0),l([p.postConstruct(),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],j.prototype,"initialize",null),j=r=l([p.injectable(),f(0,p.inject(m.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),f(1,p.inject(m.ServiceIdentifiers.IArrayUtils)),f(2,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f(3,p.inject(m.ServiceIdentifiers.IOptions)),f(4,p.inject(m.ServiceIdentifiers.ICryptUtils)),f(5,p.inject(m.ServiceIdentifiers.IEscapeSequenceEncoder)),u("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==b.IOptions&&b.IOptions)?s:Object,"function"==typeof(c=void 0!==h.ICryptUtils&&h.ICryptUtils)?c:Object,"function"==typeof(d=void 0!==N.IEscapeSequenceEncoder&&N.IEscapeSequenceEncoder)?d:Object])],j),t.StringArrayStorage=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(216),a=o(217),s=o(221),c=o(222),d=o(223),l=o(68);t.utilsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IArrayUtils).to(i.ArrayUtils).inSingletonScope(),e(n.ServiceIdentifiers.IRandomGenerator).to(l.RandomGenerator).inSingletonScope(),e(n.ServiceIdentifiers.ICryptUtils).to(a.CryptUtils).inSingletonScope(),e(n.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope(),e(n.ServiceIdentifiers.ILevelledTopologicalSorter).to(c.LevelledTopologicalSorter),e(n.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder).to(d.NodeTransformerNamesGroupsBuilder).inSingletonScope()})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(3);let l=class{constructor(e){this.randomGenerator=e}createWithRange(e){const t=[];for(let o=0;on&&(r=i,n=e),o[i]=e}return r}rotate(e,t){if(!e.length)throw new ReferenceError("Cannot rotate empty array.");if(t<=0)return e;const o=e;let r;for(;t--;)r=o.pop(),r&&o.unshift(r);return o}shuffle(e){const t=[...e];for(let e=t.length;e;e--){const o=Math.floor(this.randomGenerator.getMathRandom()*e);[t[e-1],t[o]]=[t[o],t[e-1]]}return t}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IRandomGenerator&&d.IRandomGenerator)?r:Object])],l),t.ArrayUtils=l},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(3),l=o(68),u=o(30);let f=class{constructor(e){this.randomGenerator=e}btoa(e){let t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(`${u.Utils.hexadecimalPrefix}${t}`,16)));for(let o,r,n=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|n)||(i="=",n%1);t+=i.charAt(63&o>>8-n%1*8)){if(r=e.charCodeAt(n+=.75),r>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|r}return t}hideString(e,t){let o=this.randomGenerator.getRandomGenerator().string({length:t,pool:l.RandomGenerator.randomGeneratorPool}).replace(new RegExp(`[${r=e,r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}]`,"g"),"");var r;const n=o.split("");return this.randomGenerator.getRandomGenerator().shuffle(n),o=n.join(""),[((e,t)=>{let o=-1,r=-1,n="";for(;o=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.stringsCache=new Map}encode(e,t){const o=`${e}-${String(t)}`;if(this.stringsCache.has(o))return this.stringsCache.get(o);const r=new RegExp("[\\s\\S]","g"),n=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const c=e.replace(r,e=>t||n.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(o,c),this.stringsCache.set(`${c}-${String(t)}`,c),c}};n=r([o(0).injectable()],n),t.EscapeSequenceEncoder=n},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],o={};for(const r of e)void 0===o[r]&&this.visit(t,o,r);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const o of t){for(let t=o.length-1;t>=0;t-=1)o[t]===e&&o.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const o of e)this.hasPrecedents(o)||t.push(o);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const o=this.graph.get(t);return o&&!o.includes(e)&&o.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,o){const r=t[o];if("visiting"===r)throw new Error(`Detected cycle involving node: ${o}`);if(r)return;t[o]="visiting";const n=this.getPrecedents(o);for(const o of n)this.visit(e,t,o);t[o]="ok",e.push(o)}};n=r([o(0).injectable()],n),t.LevelledTopologicalSorter=n},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(224);let l=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),o=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of o)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const o=[];for(const r of e){const e=t[r].runAfter;if(e&&e.length)for(const n of e){void 0===t[n]?o.push([r,null]):o.push([n,r])}else o.push([r,null])}return o}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.ILevelledTopologicalSorter)),i("design:paramtypes",["function"==typeof(r=void 0!==d.ILevelledTopologicalSorter&&d.ILevelledTopologicalSorter)?r:Object])],l),t.NodeTransformerNamesGroupsBuilder=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=f(o(46)),y=o(226),h=o(227),N=o(2),b=o(3),v=o(57),I=o(228),S=o(21),O=o(11),j=o(43),_=o(55),C=o(4);let R=r=class{constructor(e,t,o,r,n){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=o,this.logger=r,this.options=n}obfuscate(e){const t=Date.now();this.logger.info(I.LoggingMessage.Version,"0.24.5"),this.logger.info(I.LoggingMessage.ObfuscationStarted),this.logger.info(I.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const o=this.parseCode(e),r=this.transformAstTree(o),n=this.generateCode(e,r),i=(Date.now()-t)/1e3;return this.logger.success(I.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(n)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return _.ASTParserFacade.parse(t,r.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,O.TransformationStage.Initializing),!C.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,O.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,O.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,O.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,O.TransformationStage.Converting),e=this.runTransformationStage(e,O.TransformationStage.Obfuscating),e=this.runTransformationStage(e,O.TransformationStage.Finalizing)):(this.logger.warn(I.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const o=Object.assign({},r.escodegenParams);this.options.sourceMap&&(o.sourceMap=this.options.inputFileName||"sourceMap",o.sourceContent=e);const n=g.generate(t,Object.assign(Object.assign({},o),{format:{compact:this.options.compact}}));return n.map=n.map?n.map.toString():"",n}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(I.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,r.transformersList,t)}};R.parseOptions={ecmaVersion:j.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},R.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},R.transformersList=[S.NodeTransformer.BlockStatementControlFlowTransformer,S.NodeTransformer.CommentsTransformer,S.NodeTransformer.CustomNodesTransformer,S.NodeTransformer.DeadCodeInjectionTransformer,S.NodeTransformer.EvalCallExpressionTransformer,S.NodeTransformer.FunctionControlFlowTransformer,S.NodeTransformer.LabeledStatementTransformer,S.NodeTransformer.LiteralTransformer,S.NodeTransformer.MemberExpressionTransformer,S.NodeTransformer.MetadataTransformer,S.NodeTransformer.MethodDefinitionTransformer,S.NodeTransformer.ObfuscatingGuardsTransformer,S.NodeTransformer.ObjectExpressionKeysTransformer,S.NodeTransformer.ObjectExpressionTransformer,S.NodeTransformer.ParentificationTransformer,S.NodeTransformer.ScopeIdentifiersTransformer,S.NodeTransformer.SplitStringTransformer,S.NodeTransformer.TemplateLiteralTransformer,S.NodeTransformer.VariablePreserveTransformer],R=r=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.ITransformersRunner)),u(1,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(2,p.inject(m.ServiceIdentifiers.Factory__IObfuscatedCode)),u(3,p.inject(m.ServiceIdentifiers.ILogger)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==v.ITransformersRunner&&v.ITransformersRunner)?n:Object,"function"==typeof(i=void 0!==b.IRandomGenerator&&b.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.TObfuscatedCodeFactory&&y.TObfuscatedCodeFactory)?a:Object,"function"==typeof(s=void 0!==h.ILogger&&h.ILogger)?s:Object,"function"==typeof(c=void 0!==N.IOptions&&N.IOptions)?c:Object])],R),t.JavaScriptObfuscator=R},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(230));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=r([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t){e.exports=require("eventemitter3")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(48),u=o(7),f=o(32),p=o(2);let m=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case f.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case f.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};i([u.initializable(),a("design:type",String)],m.prototype,"obfuscatedCode",void 0),i([u.initializable(),a("design:type",String)],m.prototype,"sourceMap",void 0),m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.ICryptUtils)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==l.ICryptUtils&&l.ICryptUtils)?r:Object,"function"==typeof(n=void 0!==p.IOptions&&p.IOptions)?n:Object])],m),t.ObfuscatedCode=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(234),p=o(235),m=o(236),g=o(4),y=o(15);let h=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,o){if(!t.length)return e;let r,n;this.cachedNodeTransformersData.has(t)?[r,n]=this.cachedNodeTransformersData.get(t):(r=this.buildNormalizedNodeTransformers(t),n=this.nodeTransformerNamesGroupsBuilder.build(r),this.cachedNodeTransformersData.set(t,[r,n]));for(const t of n){const n=[],i=[];for(const e of t){const t=r[e].getVisitor(o);t&&(t.enter&&n.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(n.length||i.length)&&u.replace(e,{enter:this.mergeVisitorsForDirection(n,m.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,m.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const o=e.length;return o?(r,n)=>{if(y.NodeMetadata.isIgnoredNode(r))return u.VisitorOption.Skip;for(let i=0;ie}};h=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__INodeTransformer)),s(1,d.inject(l.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),a("design:paramtypes",["function"==typeof(r=void 0!==f.TNodeTransformerFactory&&f.TNodeTransformerFactory)?r:Object,"function"==typeof(n=void 0!==p.INodeTransformerNamesGroupsBuilder&&p.INodeTransformerNamesGroupsBuilder)?n:Object])],h),t.TransformersRunner=h},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=d(o(243)),u=d(o(238)),f=o(244),p=o(7),m=o(40),g=o(245),y=o(246),h=o(247),N=o(248),b=o(249),v=o(250),I=o(251),S=o(25),O=o(253),j=o(255);class _{constructor(e){this.rawArguments=e,this.arguments=e.slice(2)}static buildOptions(e,t){const o=_.filterOptions(e),r=e.config,n=r?u.resolve(r,"."):"",i=n?I.CLIUtils.getUserConfig(n):{},a=u.basename(t),s=t;return Object.assign(Object.assign(Object.assign(Object.assign({},m.DEFAULT_PRESET),i),o),{inputFileName:a,inputFilePath:s})}static filterOptions(e){const t={};return Object.keys(e).forEach(o=>{void 0!==e[o]&&(t[o]=e[o])}),t}initialize(){this.inputPath=u.normalize(this.arguments[0]||""),this.commands=new l.Command,this.configureCommands(),this.configureHelp(),this.inputCLIOptions=this.commands.opts(),this.sourceCodeReader=new j.SourceCodeReader(this.inputPath,this.inputCLIOptions),this.obfuscatedCodeWriter=new O.ObfuscatedCodeWriter(this.inputPath,this.inputCLIOptions)}run(){if(!this.arguments.length||this.arguments.includes("--help"))return void this.commands.outputHelp();const e=this.sourceCodeReader.readSourceCode();this.processSourceCodeData(e)}configureCommands(){this.commands.usage(" [options]").version(null!=="0.24.5"?"0.24.5":"unknown","-v, --version").option("-o, --output ","Output path for obfuscated code").option("--compact ","Disable one line output code compacting",y.BooleanSanitizer).option("--config ","Name of js / json config file").option("--control-flow-flattening ","Enables control flow flattening",y.BooleanSanitizer).option("--control-flow-flattening-threshold ","The probability that the control flow flattening transformation will be applied to the node",parseFloat).option("--dead-code-injection ","Enables dead code injection",y.BooleanSanitizer).option("--dead-code-injection-threshold ","The probability that the dead code injection transformation will be applied to the node",parseFloat).option("--debug-protection ","Disable browser Debug panel (can cause DevTools enabled browser freeze)",y.BooleanSanitizer).option("--debug-protection-interval ","Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)",y.BooleanSanitizer).option("--disable-console-output ","Allow console.log, console.info, console.error and console.warn messages output into browser console",y.BooleanSanitizer).option("--domain-lock (comma separated, without whitespaces)","Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)",g.ArraySanitizer).option("--exclude (comma separated, without whitespaces)","A filename or glob which indicates files to exclude from obfuscation",g.ArraySanitizer).option("--identifier-names-generator ","Sets identifier names generator. Values: hexadecimal, mangled, dictionary. Default: hexadecimal",h.IdentifierNamesGeneratorSanitizer).option("--identifiers-prefix ","Sets prefix for all global identifiers.").option("--identifiers-dictionary (comma separated, without whitespaces)","Identifiers dictionary (comma separated) for `--identifier-names-generator dictionary` option",g.ArraySanitizer).option("--log ","Enables logging of the information to the console",y.BooleanSanitizer).option("--reserved-names (comma separated, without whitespaces)","Disables obfuscation and generation of identifiers, which being matched by passed RegExp patterns (comma separated)",g.ArraySanitizer).option("--reserved-strings (comma separated, without whitespaces)","Disables transformation of string literals, which being matched by passed RegExp patterns (comma separated)",g.ArraySanitizer).option("--rename-globals ","Allows to enable obfuscation of global variable and function names with declaration.",y.BooleanSanitizer).option("--rotate-string-array ","Enable rotation of string array values during obfuscation",y.BooleanSanitizer).option("--seed ","Sets seed for random generator. This is useful for creating repeatable results.",parseFloat).option("--self-defending ","Disables self-defending for obfuscated code",y.BooleanSanitizer).option("--shuffle-string-array ","Randomly shuffles string array items",y.BooleanSanitizer).option("--source-map ","Enables source map generation",y.BooleanSanitizer).option("--source-map-base-url ","Sets base url to the source map import url when `--source-map-mode=separate`").option("--source-map-file-name ","Sets file name for output source map when `--source-map-mode=separate`").option("--source-map-mode ","Specify source map output mode. Values: inline, separate. Default: separate",b.SourceMapModeSanitizer).option("--split-strings ","Splits literal strings into chunks with length of `splitStringsChunkLength` option value",y.BooleanSanitizer).option("--split-strings-chunk-length ","Sets chunk length of `splitStrings` option",parseFloat).option("--string-array ","Disables gathering of all literal strings into an array and replacing every literal string with an array call",y.BooleanSanitizer).option("--string-array-encoding ","Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed. Values: true, false, base64, rc4. Default: false",v.StringArrayEncodingSanitizer).option("--string-array-threshold ","The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)",parseFloat).option("--target ","Allows to set target environment for obfuscated code. Values: browser, browser-no-eval, node. Default: browser",N.ObfuscationTargetSanitizer).option("--transform-object-keys ","Enables transformation of object keys",y.BooleanSanitizer).option("--unicode-escape-sequence ","Allows to enable/disable string conversion to unicode escape sequence",y.BooleanSanitizer).parse(this.rawArguments)}configureHelp(){this.commands.on("--help",()=>{console.log(" Examples:\n"),console.log(" %> javascript-obfuscator input_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_directory_name --compact true --self-defending false"),console.log("")})}processSourceCodeData(e){e.forEach(({filePath:e,content:t},o)=>{const r=this.obfuscatedCodeWriter.getOutputCodePath(e);this.processSourceCode(t,e,r,o)})}processSourceCode(e,t,o,r){var n;let i=_.buildOptions(this.inputCLIOptions,t);if(null!==r){const e=`${null!==(n=this.inputCLIOptions.identifiersPrefix)&&void 0!==n?n:_.baseIdentifiersPrefix}${r}`;i=Object.assign(Object.assign({},i),{identifiersPrefix:e})}i.sourceMap?this.processSourceCodeWithSourceMap(e,o,i):this.processSourceCodeWithoutSourceMap(e,o,i)}processSourceCodeWithoutSourceMap(e,t,o){const r=S.JavaScriptObfuscator.obfuscate(e,o).getObfuscatedCode();this.obfuscatedCodeWriter.writeFile(t,r)}processSourceCodeWithSourceMap(e,t,o){var r;const n=this.obfuscatedCodeWriter.getOutputSourceMapPath(t,null!==(r=o.sourceMapFileName)&&void 0!==r?r:"");o=Object.assign(Object.assign({},o),{sourceMapFileName:u.basename(n)});const i=S.JavaScriptObfuscator.obfuscate(e,o);this.obfuscatedCodeWriter.writeFile(t,i.getObfuscatedCode()),"separate"===o.sourceMapMode&&i.getSourceMap()&&this.obfuscatedCodeWriter.writeFile(n,i.getSourceMap())}}_.encoding="utf8",_.obfuscatedFilePrefix="-obfuscated",_.baseIdentifiersPrefix="a",s([p.initializable(),c("design:type","function"==typeof(r=void 0!==l&&l.CommanderStatic)?r:Object)],_.prototype,"commands",void 0),s([p.initializable(),c("design:type","function"==typeof(n=void 0!==f.TInputCLIOptions&&f.TInputCLIOptions)?n:Object)],_.prototype,"inputCLIOptions",void 0),s([p.initializable(),c("design:type",String)],_.prototype,"inputPath",void 0),s([p.initializable(),c("design:type","function"==typeof(i=void 0!==j.SourceCodeReader&&j.SourceCodeReader)?i:Object)],_.prototype,"sourceCodeReader",void 0),s([p.initializable(),c("design:type","function"==typeof(a=void 0!==O.ObfuscatedCodeWriter&&O.ObfuscatedCodeWriter)?a:Object)],_.prototype,"obfuscatedCodeWriter",void 0),t.JavaScriptObfuscatorCLI=_},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("fs")},,function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(242);e.exports=r.JavaScriptObfuscatorCLI},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(69);const r=o(237);t.JavaScriptObfuscatorCLI=class{static obfuscate(e){const t=new r.JavaScriptObfuscatorCLI(e);t.initialize(),t.run()}}},function(e,t){e.exports=require("commander")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArraySanitizer=e=>{if(e.endsWith(","))throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1','value2'");return e.split(",").map(e=>e.trim())}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=e=>"true"===e||"1"===e},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31);t.IdentifierNamesGeneratorSanitizer=e=>{if(!Object.keys(r.IdentifierNamesGenerator).some(t=>r.IdentifierNamesGenerator[t]===e))throw new ReferenceError("Invalid value of `--identifier-names-generator` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(20);t.ObfuscationTargetSanitizer=e=>{if(!Object.keys(r.ObfuscationTarget).some(t=>r.ObfuscationTarget[t]===e))throw new ReferenceError("Invalid value of `--target` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(32);t.SourceMapModeSanitizer=e=>{if(!Object.keys(r.SourceMapMode).some(t=>r.SourceMapMode[t]===e))throw new ReferenceError("Invalid value of `--source-map-mode` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(24);t.StringArrayEncodingSanitizer=e=>{switch(e){case"true":case"1":case r.StringArrayEncoding.Base64:return!0;case r.StringArrayEncoding.Rc4:return r.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CLIUtils=class{static getUserConfig(e){let t;try{t=o(252)(e)}catch(o){try{t=require(e)}catch(e){throw new ReferenceError("Given config path must be a valid `.js` or `.json` file path")}}return t}}},function(e,t){function o(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}o.keys=function(){return[]},o.resolve=o,e.exports=o,o.id=252},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(239)),i=r(o(254)),a=r(o(238)),s=o(41),c=o(237);t.ObfuscatedCodeWriter=class{constructor(e,t){this.inputPath=e,this.options=t}getOutputCodePath(e){const t=this.options.output?a.normalize(this.options.output):null;if(!t)return a.normalize(e).split(s.StringSeparator.Dot).map((e,t)=>0===t?`${e}${c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix}`:e).join(s.StringSeparator.Dot);const o=n.lstatSync(this.inputPath).isDirectory(),r=""===a.extname(t);if(o){if(r)return a.join(t,e);throw new Error("Output path for directory obfuscation should be a directory path")}return r?a.join(t,a.basename(e)):t}getOutputSourceMapPath(e,t=""){return t&&(e=`${e.substring(0,e.lastIndexOf("/"))}/${t}`),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e=`${e.split(s.StringSeparator.Dot)[0]}.js.map`,e}writeFile(e,t){i.sync(a.dirname(e)),n.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}},function(e,t){e.exports=require("mkdirp")},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(o(239)),a=r(o(238)),s=n(o(256)),c=o(71),d=o(237),l=o(70);class u{constructor(e,t){this.inputPath=e,this.options=t}static isExcludedPath(e,t=[]){if(!t.length)return!1;const o=a.basename(e),r=!!s.default([e],t).length;return t.some(t=>e.includes(t)||o.includes(t))||r}static isDirectoryPath(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}static isFilePath(e){try{return i.statSync(e).isFile()}catch(e){return!1}}static isValidDirectory(e,t=[]){return!u.isExcludedPath(e,t)}static isValidFile(e,t=[]){return u.availableInputExtensions.includes(a.extname(e))&&!e.includes(d.JavaScriptObfuscatorCLI.obfuscatedFilePrefix)&&!u.isExcludedPath(e,t)}static logFilePath(e){const t=a.normalize(e);l.Logger.log(l.Logger.colorInfo,c.LoggingPrefix.CLI,`Obfuscating file: ${t}...`)}static readFile(e){return u.logFilePath(e),{filePath:e,content:i.readFileSync(e,d.JavaScriptObfuscatorCLI.encoding)}}readSourceCode(){if(u.isFilePath(this.inputPath)&&u.isValidFile(this.inputPath,this.options.exclude))return[u.readFile(this.inputPath)];if(u.isDirectoryPath(this.inputPath)&&u.isValidDirectory(this.inputPath,this.options.exclude))return this.readDirectoryRecursive(this.inputPath);const e=u.availableInputExtensions.map(e=>`\`${e}\``).join(", ");throw new ReferenceError(`Given input path must be a valid ${e} file or directory path`)}readDirectoryRecursive(e,t=[]){return i.readdirSync(e,d.JavaScriptObfuscatorCLI.encoding).forEach(o=>{const r=`${e}/${o}`;if(u.isDirectoryPath(r)&&u.isValidDirectory(r,this.options.exclude))t.push(...this.readDirectoryRecursive(r));else if(u.isFilePath(r)&&u.isValidFile(r,this.options.exclude)){const e=u.readFile(r);t.push(e)}else;}),t}}t.SourceCodeReader=u,u.availableInputExtensions=[".js"]},function(e,t){e.exports=require("multimatch")}]); //# sourceMappingURL=index.cli.js.map \ No newline at end of file diff --git a/package.json b/package.json index ed9db872..1fad267f 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "chalk": "3.0.0", "chance": "1.1.4", "class-validator": "0.11.0", - "commander": "4.1.0", + "commander": "4.1.1", "escodegen": "1.13.0", "eslint-scope": "5.0.0", "estraverse": "4.3.0", @@ -60,16 +60,16 @@ "@types/sinon": "7.5.1", "@types/string-template": "1.0.2", "@types/webpack-env": "1.15.1", - "@typescript-eslint/eslint-plugin": "2.18.0", - "@typescript-eslint/parser": "2.18.0", + "@typescript-eslint/eslint-plugin": "2.19.0", + "@typescript-eslint/parser": "2.19.0", "chai": "4.2.0", "coveralls": "3.0.9", "eslint": "6.8.0", - "eslint-plugin-import": "2.20.0", + "eslint-plugin-import": "2.20.1", "eslint-plugin-jsdoc": "21.0.0", "eslint-plugin-no-null": "1.0.2", "eslint-plugin-prefer-arrow": "1.1.7", - "eslint-plugin-unicorn": "15.0.1", + "eslint-plugin-unicorn": "16.0.0", "fork-ts-checker-notifier-webpack-plugin": "2.0.0", "fork-ts-checker-webpack-plugin": "4.0.3", "mocha": "7.0.1", diff --git a/src/cli/JavaScriptObfuscatorCLI.ts b/src/cli/JavaScriptObfuscatorCLI.ts index 2ef88021..ef065705 100644 --- a/src/cli/JavaScriptObfuscatorCLI.ts +++ b/src/cli/JavaScriptObfuscatorCLI.ts @@ -21,6 +21,7 @@ import { StringArrayEncodingSanitizer } from './sanitizers/StringArrayEncodingSa import { CLIUtils } from './utils/CLIUtils'; import { JavaScriptObfuscator } from '../JavaScriptObfuscatorFacade'; +import { ObfuscatedCodeWriter } from './utils/ObfuscatedCodeWriter'; import { SourceCodeReader } from './utils/SourceCodeReader'; export class JavaScriptObfuscatorCLI implements IInitializable { @@ -67,6 +68,18 @@ export class JavaScriptObfuscatorCLI implements IInitializable { @initializable() private inputPath!: string; + /** + * @type {SourceCodeReader} + */ + @initializable() + private sourceCodeReader!: SourceCodeReader; + + /** + * @type {ObfuscatedCodeWriter} + */ + @initializable() + private obfuscatedCodeWriter!: ObfuscatedCodeWriter; + /** * @param {string[]} argv */ @@ -91,8 +104,6 @@ export class JavaScriptObfuscatorCLI implements IInitializable { const inputFileName: string = path.basename(inputCodePath); const inputFilePath: string = inputCodePath; - console.log(inputFilePath, inputFileName); - return { ...DEFAULT_PRESET, ...configFileOptions, @@ -122,50 +133,6 @@ export class JavaScriptObfuscatorCLI implements IInitializable { return filteredOptions; } - /** - * @param {string} sourceCode - * @param {string} outputCodePath - * @param {TInputOptions} options - */ - private static processSourceCodeWithoutSourceMap ( - sourceCode: string, - outputCodePath: string, - options: TInputOptions - ): void { - const obfuscatedCode: string = JavaScriptObfuscator.obfuscate(sourceCode, options).getObfuscatedCode(); - - CLIUtils.writeFile(outputCodePath, obfuscatedCode); - } - - /** - * @param {string} sourceCode - * @param {string} outputCodePath - * @param {TInputOptions} options - */ - private static processSourceCodeWithSourceMap ( - sourceCode: string, - outputCodePath: string, - options: TInputOptions - ): void { - const outputSourceMapPath: string = CLIUtils.getOutputSourceMapPath( - outputCodePath, - options.sourceMapFileName ?? '' - ); - - options = { - ...options, - sourceMapFileName: path.basename(outputSourceMapPath) - }; - - const obfuscatedCode: IObfuscatedCode = JavaScriptObfuscator.obfuscate(sourceCode, options); - - CLIUtils.writeFile(outputCodePath, obfuscatedCode.getObfuscatedCode()); - - if (options.sourceMapMode === 'separate' && obfuscatedCode.getSourceMap()) { - CLIUtils.writeFile(outputSourceMapPath, obfuscatedCode.getSourceMap()); - } - } - public initialize (): void { this.inputPath = path.normalize(this.arguments[0] || ''); this.commands = (new commander.Command()); @@ -174,6 +141,14 @@ export class JavaScriptObfuscatorCLI implements IInitializable { this.configureHelp(); this.inputCLIOptions = this.commands.opts(); + this.sourceCodeReader = new SourceCodeReader( + this.inputPath, + this.inputCLIOptions + ); + this.obfuscatedCodeWriter = new ObfuscatedCodeWriter( + this.inputPath, + this.inputCLIOptions + ); } public run (): void { @@ -185,8 +160,7 @@ export class JavaScriptObfuscatorCLI implements IInitializable { return; } - const sourceCodeData: IFileData[] = new SourceCodeReader(this.inputCLIOptions) - .readSourceCode(this.inputPath); + const sourceCodeData: IFileData[] = this.sourceCodeReader.readSourceCode(); this.processSourceCodeData(sourceCodeData); } @@ -390,7 +364,7 @@ export class JavaScriptObfuscatorCLI implements IInitializable { */ private processSourceCodeData (sourceCodeData: IFileData[]): void { sourceCodeData.forEach(({ filePath, content }: IFileData, index: number) => { - const outputCodePath: string = CLIUtils.getOutputCodePath(filePath, this.inputCLIOptions.output); + const outputCodePath: string = this.obfuscatedCodeWriter.getOutputCodePath(filePath); this.processSourceCode(content, filePath, outputCodePath, index); }); @@ -425,9 +399,53 @@ export class JavaScriptObfuscatorCLI implements IInitializable { } if (options.sourceMap) { - JavaScriptObfuscatorCLI.processSourceCodeWithSourceMap(sourceCode, outputCodePath, options); + this.processSourceCodeWithSourceMap(sourceCode, outputCodePath, options); } else { - JavaScriptObfuscatorCLI.processSourceCodeWithoutSourceMap(sourceCode, outputCodePath, options); + this.processSourceCodeWithoutSourceMap(sourceCode, outputCodePath, options); + } + } + + /** + * @param {string} sourceCode + * @param {string} outputCodePath + * @param {TInputOptions} options + */ + private processSourceCodeWithoutSourceMap ( + sourceCode: string, + outputCodePath: string, + options: TInputOptions + ): void { + const obfuscatedCode: string = JavaScriptObfuscator.obfuscate(sourceCode, options).getObfuscatedCode(); + + this.obfuscatedCodeWriter.writeFile(outputCodePath, obfuscatedCode); + } + + /** + * @param {string} sourceCode + * @param {string} outputCodePath + * @param {TInputOptions} options + */ + private processSourceCodeWithSourceMap ( + sourceCode: string, + outputCodePath: string, + options: TInputOptions + ): void { + const outputSourceMapPath: string = this.obfuscatedCodeWriter.getOutputSourceMapPath( + outputCodePath, + options.sourceMapFileName ?? '' + ); + + options = { + ...options, + sourceMapFileName: path.basename(outputSourceMapPath) + }; + + const obfuscatedCode: IObfuscatedCode = JavaScriptObfuscator.obfuscate(sourceCode, options); + + this.obfuscatedCodeWriter.writeFile(outputCodePath, obfuscatedCode.getObfuscatedCode()); + + if (options.sourceMapMode === 'separate' && obfuscatedCode.getSourceMap()) { + this.obfuscatedCodeWriter.writeFile(outputSourceMapPath, obfuscatedCode.getSourceMap()); } } } diff --git a/src/cli/utils/CLIUtils.ts b/src/cli/utils/CLIUtils.ts index d9b52ac3..0ec6efbd 100644 --- a/src/cli/utils/CLIUtils.ts +++ b/src/cli/utils/CLIUtils.ts @@ -1,62 +1,6 @@ -import * as fs from 'fs'; -import * as mkdirp from 'mkdirp'; -import * as path from 'path'; - import { TObject } from '../../types/TObject'; -import { StringSeparator } from '../../enums/StringSeparator'; - -import { JavaScriptObfuscatorCLI } from '../JavaScriptObfuscatorCLI'; - export class CLIUtils { - /** - * @param {string} inputPath - * @param {string | null} baseOutputPath - * @returns {string} - */ - public static getOutputCodePath (inputPath: string, baseOutputPath?: string | null): string { - const normalizedBaseOutputPath: string | null = baseOutputPath - ? path.normalize(baseOutputPath) - : null; - - if (!normalizedBaseOutputPath) { - return path - .normalize(inputPath) - .split(StringSeparator.Dot) - .map((value: string, index: number) => { - return index === 0 ? `${value}${JavaScriptObfuscatorCLI.obfuscatedFilePrefix}` : value; - }) - .join(StringSeparator.Dot); - } - - const isDirectoryPath: boolean = path.extname(normalizedBaseOutputPath) === ''; - - return isDirectoryPath - ? path.join(normalizedBaseOutputPath, inputPath) - : normalizedBaseOutputPath; - } - - /** - * @param {string} outputCodePath - * @param {string} sourceMapFileName - * @returns {string} - */ - public static getOutputSourceMapPath (outputCodePath: string, sourceMapFileName: string = ''): string { - if (sourceMapFileName) { - outputCodePath = `${outputCodePath.substring( - 0, outputCodePath.lastIndexOf('/') - )}/${sourceMapFileName}`; - } - - if (!/\.js\.map$/.test(outputCodePath)) { - outputCodePath = `${outputCodePath.split(StringSeparator.Dot)[0]}.js.map`; - } else if (/\.js$/.test(outputCodePath)) { - outputCodePath += '.map'; - } - - return outputCodePath; - } - /** * @param {string} configPath * @returns {TObject} @@ -76,16 +20,4 @@ export class CLIUtils { return config; } - - /** - * @param {string} outputPath - * @param {string} data - */ - public static writeFile (outputPath: string, data: string): void { - mkdirp.sync(path.dirname(outputPath)); - - fs.writeFileSync(outputPath, data, { - encoding: JavaScriptObfuscatorCLI.encoding - }); - } } diff --git a/src/cli/utils/ObfuscatedCodeWriter.ts b/src/cli/utils/ObfuscatedCodeWriter.ts new file mode 100644 index 00000000..013ecdef --- /dev/null +++ b/src/cli/utils/ObfuscatedCodeWriter.ts @@ -0,0 +1,104 @@ +import * as fs from 'fs'; +import * as mkdirp from 'mkdirp'; +import * as path from 'path'; + +import { TInputCLIOptions } from '../../types/options/TInputCLIOptions'; + +import { StringSeparator } from '../../enums/StringSeparator'; + +import { JavaScriptObfuscatorCLI } from '../JavaScriptObfuscatorCLI'; + +export class ObfuscatedCodeWriter { + /** + * @type {string} + */ + private readonly inputPath: string; + + /** + * @type {TInputCLIOptions} + */ + private readonly options: TInputCLIOptions; + + /** + * @param {string} inputPath + * @param {TInputCLIOptions} options + */ + public constructor ( + inputPath: string, + options: TInputCLIOptions + ) { + this.inputPath = inputPath; + this.options = options; + } + + /** + * @param {string} filePath + * @returns {string} + */ + public getOutputCodePath (filePath: string): string { + const normalizedRawOutputPath: string | null = this.options.output + ? path.normalize(this.options.output) + : null; + + if (!normalizedRawOutputPath) { + return path + .normalize(filePath) + .split(StringSeparator.Dot) + .map((value: string, index: number) => { + return index === 0 ? `${value}${JavaScriptObfuscatorCLI.obfuscatedFilePrefix}` : value; + }) + .join(StringSeparator.Dot); + } + + const rawInputPathStats: fs.Stats = fs.lstatSync(this.inputPath); + const isDirectoryRawInputPath: boolean = rawInputPathStats.isDirectory(); + const isDirectoryRawOutputPath: boolean = path.extname(normalizedRawOutputPath) === ''; + + if (isDirectoryRawInputPath) { + if (isDirectoryRawOutputPath) { + return path.join(normalizedRawOutputPath, filePath); + } else { + throw new Error('Output path for directory obfuscation should be a directory path'); + } + } else { + if (isDirectoryRawOutputPath) { + return path.join(normalizedRawOutputPath, path.basename(filePath)); + } else { + return normalizedRawOutputPath; + } + } + } + + /** + * @param {string} outputCodePath + * @param {string} sourceMapFileName + * @returns {string} + */ + public getOutputSourceMapPath (outputCodePath: string, sourceMapFileName: string = ''): string { + if (sourceMapFileName) { + outputCodePath = `${outputCodePath.substring( + 0, outputCodePath.lastIndexOf('/') + )}/${sourceMapFileName}`; + } + + if (!/\.js\.map$/.test(outputCodePath)) { + outputCodePath = `${outputCodePath.split(StringSeparator.Dot)[0]}.js.map`; + } else if (/\.js$/.test(outputCodePath)) { + outputCodePath += '.map'; + } + + return outputCodePath; + } + + /** + * @param {string} outputPath + * @param {string} data + */ + public writeFile (outputPath: string, data: string): void { + mkdirp.sync(path.dirname(outputPath)); + + fs.writeFileSync(outputPath, data, { + encoding: JavaScriptObfuscatorCLI.encoding + }); + } +} diff --git a/src/cli/utils/SourceCodeReader.ts b/src/cli/utils/SourceCodeReader.ts index fcc015b0..a9d2a9a7 100644 --- a/src/cli/utils/SourceCodeReader.ts +++ b/src/cli/utils/SourceCodeReader.ts @@ -19,15 +19,25 @@ export class SourceCodeReader { '.js' ]; + /** + * @type {string} + */ + private readonly inputPath: string; + /** * @type {TInputCLIOptions} */ private readonly options: TInputCLIOptions; /** + * @param {string} inputPath * @param {TInputCLIOptions} options */ - public constructor (options: TInputCLIOptions) { + public constructor ( + inputPath: string, + options: TInputCLIOptions + ) { + this.inputPath = inputPath; this.options = options; } @@ -74,6 +84,26 @@ export class SourceCodeReader { } } + /** + * @param {string} directoryPath + * @param {string[]} excludePatterns + * @returns {boolean} + */ + private static isValidDirectory (directoryPath: string, excludePatterns: string[] = []): boolean { + return !SourceCodeReader.isExcludedPath(directoryPath, excludePatterns); + } + + /** + * @param {string} filePath + * @param {string[]} excludePatterns + * @returns {boolean} + */ + private static isValidFile (filePath: string, excludePatterns: string[] = []): boolean { + return SourceCodeReader.availableInputExtensions.includes(path.extname(filePath)) + && !filePath.includes(JavaScriptObfuscatorCLI.obfuscatedFilePrefix) + && !SourceCodeReader.isExcludedPath(filePath, excludePatterns); + } + /** * @param {string} filePath */ @@ -88,16 +118,34 @@ export class SourceCodeReader { } /** - * @param {string} inputPath + * @param {string} filePath + * @returns {string} + */ + private static readFile (filePath: string): IFileData { + SourceCodeReader.logFilePath(filePath); + + return { + filePath, + content: fs.readFileSync(filePath, JavaScriptObfuscatorCLI.encoding) + }; + } + + /** * @returns {IFileData[]} */ - public readSourceCode (inputPath: string): IFileData[] { - if (SourceCodeReader.isFilePath(inputPath) && this.isValidFile(inputPath)) { - return [this.readFile(inputPath)]; + public readSourceCode (): IFileData[] { + if ( + SourceCodeReader.isFilePath(this.inputPath) + && SourceCodeReader.isValidFile(this.inputPath, this.options.exclude) + ) { + return [SourceCodeReader.readFile(this.inputPath)]; } - if (SourceCodeReader.isDirectoryPath(inputPath) && this.isValidDirectory(inputPath)) { - return this.readDirectoryRecursive(inputPath); + if ( + SourceCodeReader.isDirectoryPath(this.inputPath) + && SourceCodeReader.isValidDirectory(this.inputPath, this.options.exclude) + ) { + return this.readDirectoryRecursive(this.inputPath); } const availableFilePaths: string = SourceCodeReader @@ -118,46 +166,27 @@ export class SourceCodeReader { .forEach((fileName: string) => { const filePath: string = `${directoryPath}/${fileName}`; - if (SourceCodeReader.isDirectoryPath(filePath) && this.isValidDirectory(filePath)) { + if ( + SourceCodeReader.isDirectoryPath(filePath) + && SourceCodeReader.isValidDirectory(filePath, this.options.exclude) + ) { filesData.push(...this.readDirectoryRecursive(filePath)); - } else if (SourceCodeReader.isFilePath(filePath) && this.isValidFile(filePath)) { - const fileData: IFileData = this.readFile(filePath); + + return; + } + + if ( + SourceCodeReader.isFilePath(filePath) + && SourceCodeReader.isValidFile(filePath, this.options.exclude) + ) { + const fileData: IFileData = SourceCodeReader.readFile(filePath); filesData.push(fileData); + + return; } }); return filesData; } - - /** - * @param {string} filePath - * @returns {string} - */ - private readFile (filePath: string): IFileData { - SourceCodeReader.logFilePath(filePath); - - return { - filePath, - content: fs.readFileSync(filePath, JavaScriptObfuscatorCLI.encoding) - }; - } - - /** - * @param {string} directoryPath - * @returns {boolean} - */ - private isValidDirectory (directoryPath: string): boolean { - return !SourceCodeReader.isExcludedPath(directoryPath, this.options.exclude); - } - - /** - * @param {string} filePath - * @returns {boolean} - */ - private isValidFile (filePath: string): boolean { - return SourceCodeReader.availableInputExtensions.includes(path.extname(filePath)) - && !filePath.includes(JavaScriptObfuscatorCLI.obfuscatedFilePrefix) - && !SourceCodeReader.isExcludedPath(filePath, this.options.exclude); - } } diff --git a/test/index.spec.ts b/test/index.spec.ts index 4da1ce8c..dabdc074 100644 --- a/test/index.spec.ts +++ b/test/index.spec.ts @@ -16,6 +16,7 @@ import './unit-tests/cli/sanitizers/ObfuscationTargetSanitizer.spec'; import './unit-tests/cli/sanitizers/SourceMapModeSanitizer.spec'; import './unit-tests/cli/sanitizers/StringArrayEncodingSanitizer.spec'; import './unit-tests/cli/utils/CLIUtils.spec'; +import './unit-tests/cli/utils/ObfuscatedCodeWriter.spec'; import './unit-tests/cli/utils/SourceCodeReader.spec'; import './unit-tests/decorators/initializable/Initializable.spec'; import './unit-tests/generators/identifier-names-generators/DictionarylIdentifierNamesGenerator.spec'; diff --git a/test/unit-tests/cli/utils/CLIUtils.spec.ts b/test/unit-tests/cli/utils/CLIUtils.spec.ts index 503cd03a..3ba9cba2 100644 --- a/test/unit-tests/cli/utils/CLIUtils.spec.ts +++ b/test/unit-tests/cli/utils/CLIUtils.spec.ts @@ -5,35 +5,6 @@ import { TInputOptions } from '../../../../src/types/options/TInputOptions'; import { CLIUtils } from '../../../../src/cli/utils/CLIUtils'; describe('CLIUtils', () => { - describe('getOutputCodePath', () => { - describe('Variant #1: base input path', () => { - let expectedOutputPath: string = 'test/input/test-obfuscated.js', - inputPath: string = 'test/input/test.js'; - - it('should output path based on `inputPath`', () => { - assert.equal(CLIUtils.getOutputCodePath(inputPath), expectedOutputPath); - }); - }); - - describe('Variant #2: relative input path with dot', () => { - let expectedOutputPath: string = 'input-obfuscated.js', - inputPath: string = './input.js'; - - it('should output path based on `inputPath`', () => { - assert.equal(CLIUtils.getOutputCodePath(inputPath), expectedOutputPath); - }); - }); - }); - - describe('getOutputSourceMapPath', () => { - let expectedOutputSourceMapPath: string = 'test/output/test.js.map', - outputCodePath: string = 'test/output/test.js'; - - it('should return output path for source map', () => { - assert.equal(CLIUtils.getOutputSourceMapPath(outputCodePath), expectedOutputSourceMapPath); - }); - }); - describe('getUserConfig', () => { describe('Variant #1: valid config file path', () => { describe('Variant #1: js file with config', () => { diff --git a/test/unit-tests/cli/utils/ObfuscatedCodeWriter.spec.ts b/test/unit-tests/cli/utils/ObfuscatedCodeWriter.spec.ts new file mode 100644 index 00000000..20ef5db1 --- /dev/null +++ b/test/unit-tests/cli/utils/ObfuscatedCodeWriter.spec.ts @@ -0,0 +1,138 @@ +import { assert } from 'chai'; +import * as mkdirp from 'mkdirp'; +import * as rimraf from 'rimraf'; +import * as fs from "fs"; + +import { ObfuscatedCodeWriter } from '../../../../src/cli/utils/ObfuscatedCodeWriter'; + +describe('ObfuscatedCodeWriter', () => { + const tmpDirectoryPath: string = 'test/tmp'; + + describe('getOutputCodePath', () => { + before(() => { + mkdirp.sync(`${tmpDirectoryPath}/input/`); + fs.writeFileSync( + `${tmpDirectoryPath}/input/test-input.js`, + 'var foo = 1;' + ); + }); + + describe('Variant #1: raw input path is a file path, raw output path is a file path', () => { + const inputPath: string = `${tmpDirectoryPath}/input/test-input.js`; + const rawInputPath: string = `${tmpDirectoryPath}/input/test-input.js`; + const rawOutputPath: string = `${tmpDirectoryPath}/output/test-output.js`; + const expectedOutputCodePath: string = `${tmpDirectoryPath}/output/test-output.js`; + + let outputCodePath: string; + + before(() => { + const obfuscatedCodeWriter: ObfuscatedCodeWriter = new ObfuscatedCodeWriter( + rawInputPath, + { + output: rawOutputPath + } + ); + outputCodePath = obfuscatedCodeWriter.getOutputCodePath(inputPath); + }); + + it('should return output path that equals to passed output file path', () => { + assert.equal(outputCodePath, expectedOutputCodePath); + }); + }); + + describe('Variant #2: raw input path is a file path, raw output path is a directory path', () => { + const inputPath: string = `${tmpDirectoryPath}/input/test-input.js`; + const rawInputPath: string = `${tmpDirectoryPath}/input/test-input.js`; + const rawOutputPath: string = `${tmpDirectoryPath}/output`; + const expectedOutputCodePath: string = `${tmpDirectoryPath}/output/test-input.js`; + + let outputCodePath: string; + + before(() => { + const obfuscatedCodeWriter: ObfuscatedCodeWriter = new ObfuscatedCodeWriter( + rawInputPath, + { + output: rawOutputPath + } + ); + outputCodePath = obfuscatedCodeWriter.getOutputCodePath(inputPath); + }); + + it('should return output path that equals to passed output directory with file name from actual file path', () => { + assert.equal(outputCodePath, expectedOutputCodePath); + }); + }); + + describe('Variant #3: raw input path is a directory path, raw output path is a file path', () => { + const inputPath: string = `${tmpDirectoryPath}/input/test-input.js`; + const rawInputPath: string = `${tmpDirectoryPath}/input`; + const rawOutputPath: string = `${tmpDirectoryPath}/output/test-output.js`; + + let testFunc: () => string; + + before(() => { + const obfuscatedCodeWriter: ObfuscatedCodeWriter = new ObfuscatedCodeWriter( + rawInputPath, + { + output: rawOutputPath + } + ); + testFunc = () => obfuscatedCodeWriter.getOutputCodePath(inputPath); + }); + + it('should throw an error if output path is a file path', () => { + assert.throws(testFunc, Error); + }); + }); + + describe('Variant #4: raw input path is a directory path, raw output path is a directory path', () => { + const inputPath: string = `${tmpDirectoryPath}/input/test-input.js`; + const rawInputPath: string = `${tmpDirectoryPath}/input`; + const rawOutputPath: string = `${tmpDirectoryPath}/output`; + const expectedOutputCodePath: string = `${tmpDirectoryPath}/output/${tmpDirectoryPath}/input/test-input.js`; + + let outputCodePath: string; + + before(() => { + const obfuscatedCodeWriter: ObfuscatedCodeWriter = new ObfuscatedCodeWriter( + rawInputPath, + { + output: rawOutputPath + } + ); + outputCodePath = obfuscatedCodeWriter.getOutputCodePath(inputPath); + }); + + it('should return output path that contains raw output path and actual file input path', () => { + assert.equal(outputCodePath, expectedOutputCodePath); + }); + }); + + after(() => { + rimraf.sync(tmpDirectoryPath); + }); + }); + + describe('getOutputSourceMapPath', () => { + const rawInputPath: string = `${tmpDirectoryPath}/input/test-input.js`; + const rawOutputPath: string = `${tmpDirectoryPath}/output/test-output.js`; + const outputCodePath: string = `${tmpDirectoryPath}/output/test-output.js`; + const expectedOutputSourceMapPath: string = `${tmpDirectoryPath}/output/test-output.js.map`; + + let outputSourceMapPath: string; + + before(() => { + const obfuscatedCodeWriter: ObfuscatedCodeWriter = new ObfuscatedCodeWriter( + rawInputPath, + { + output: rawOutputPath + } + ); + outputSourceMapPath = obfuscatedCodeWriter.getOutputSourceMapPath(outputCodePath); + }); + + it('should return output path for source map', () => { + assert.equal(outputSourceMapPath, expectedOutputSourceMapPath); + }); + }); +}); diff --git a/test/unit-tests/cli/utils/SourceCodeReader.spec.ts b/test/unit-tests/cli/utils/SourceCodeReader.spec.ts index ddc83849..c69c9cf7 100644 --- a/test/unit-tests/cli/utils/SourceCodeReader.spec.ts +++ b/test/unit-tests/cli/utils/SourceCodeReader.spec.ts @@ -32,7 +32,7 @@ describe('SourceCodeReader', () => { before(() => { fs.writeFileSync(inputPath, fileContent); - filesData = new SourceCodeReader({}).readSourceCode(inputPath); + filesData = new SourceCodeReader(inputPath, {}).readSourceCode(); }); it('should return valid files data', () => { @@ -51,7 +51,7 @@ describe('SourceCodeReader', () => { let testFunc: () => void; before(() => { - testFunc = () => new SourceCodeReader({}).readSourceCode(inputPath); + testFunc = () => new SourceCodeReader(inputPath, {}).readSourceCode(); }); it('should throw an error if `inputPath` is not a valid path', () => { @@ -67,7 +67,7 @@ describe('SourceCodeReader', () => { before(() => { fs.writeFileSync(inputPath, fileContent); - testFunc = () => new SourceCodeReader({}).readSourceCode(inputPath); + testFunc = () => new SourceCodeReader(inputPath, {}).readSourceCode(); }); it('should throw an error if `inputPath` has invalid extension', () => { @@ -92,9 +92,12 @@ describe('SourceCodeReader', () => { before(() => { fs.writeFileSync(inputPath, fileContent); - filesData = new SourceCodeReader({ - exclude: ['**/foo.js'] - }).readSourceCode(inputPath); + filesData = new SourceCodeReader( + inputPath, + { + exclude: ['**/foo.js'] + } + ).readSourceCode(); }); it('should return valid files data', () => { @@ -115,9 +118,12 @@ describe('SourceCodeReader', () => { before(() => { fs.writeFileSync(inputPath, fileContent); - testFunc = () => new SourceCodeReader({ - exclude: [`**/${tmpFileName}`] - }).readSourceCode(inputPath); + testFunc = () => new SourceCodeReader( + inputPath, + { + exclude: [`**/${tmpFileName}`] + } + ).readSourceCode(); }); it('should throw an error if `inputPath` is the excluded file path', () => { @@ -137,9 +143,12 @@ describe('SourceCodeReader', () => { before(() => { fs.writeFileSync(inputPath, fileContent); - testFunc = () => new SourceCodeReader({ - exclude: [tmpFileName] - }).readSourceCode(inputPath); + testFunc = () => new SourceCodeReader( + inputPath, + { + exclude: [tmpFileName] + } + ).readSourceCode(); }); it('should throw an error if `inputPath` is the excluded file path', () => { @@ -159,9 +168,12 @@ describe('SourceCodeReader', () => { before(() => { fs.writeFileSync(inputPath, fileContent); - testFunc = () => new SourceCodeReader({ - exclude: [inputPath] - }).readSourceCode(inputPath); + testFunc = () => new SourceCodeReader( + inputPath, + { + exclude: [inputPath] + } + ).readSourceCode(); }); it('should throw an error if `inputPath` is the excluded file path', () => { @@ -205,7 +217,7 @@ describe('SourceCodeReader', () => { fs.writeFileSync(filePath2, fileContent); fs.writeFileSync(filePath3, fileContent); fs.writeFileSync(filePath4, fileContent); - result = new SourceCodeReader({}).readSourceCode(tmpDirectoryPath); + result = new SourceCodeReader(tmpDirectoryPath, {}).readSourceCode(); }); it('should return files data', () => { @@ -226,7 +238,7 @@ describe('SourceCodeReader', () => { let testFunc: () => void; before(() => { - testFunc = () => new SourceCodeReader({}).readSourceCode(inputPath); + testFunc = () => new SourceCodeReader(inputPath, {}).readSourceCode(); }); it('should throw an error if `inputPath` is not a valid path', () => { @@ -276,7 +288,7 @@ describe('SourceCodeReader', () => { fs.writeFileSync(filePath2, fileContent); fs.writeFileSync(filePath3, fileContent); fs.writeFileSync(filePath4, fileContent); - result = new SourceCodeReader({}).readSourceCode(tmpDirectoryPath); + result = new SourceCodeReader(tmpDirectoryPath, {}).readSourceCode(); }); it('should return files data', () => { @@ -322,9 +334,12 @@ describe('SourceCodeReader', () => { fs.writeFileSync(filePath2, fileContent); fs.writeFileSync(filePath3, fileContent); fs.writeFileSync(filePath4, fileContent); - result = new SourceCodeReader({ - exclude: ['**/hawk.js'] - }).readSourceCode(tmpDirectoryPath); + result = new SourceCodeReader( + tmpDirectoryPath, + { + exclude: ['**/hawk.js'] + } + ).readSourceCode(); }); it('should return files data', () => { @@ -368,12 +383,15 @@ describe('SourceCodeReader', () => { fs.writeFileSync(filePath2, fileContent); fs.writeFileSync(filePath3, fileContent); fs.writeFileSync(filePath4, fileContent); - result = new SourceCodeReader({ - exclude: [ - `**/${tmpFileName2}`, - `**/${tmpFileName4}` - ] - }).readSourceCode(tmpDirectoryPath); + result = new SourceCodeReader( + tmpDirectoryPath, + { + exclude: [ + `**/${tmpFileName2}`, + `**/${tmpFileName4}` + ] + } + ).readSourceCode(); }); it('should return files data', () => { @@ -416,12 +434,15 @@ describe('SourceCodeReader', () => { fs.writeFileSync(filePath2, fileContent); fs.writeFileSync(filePath3, fileContent); fs.writeFileSync(filePath4, fileContent); - result = new SourceCodeReader({ - exclude: [ - tmpFileName2, - tmpFileName4 - ] - }).readSourceCode(tmpDirectoryPath); + result = new SourceCodeReader( + tmpDirectoryPath, + { + exclude: [ + tmpFileName2, + tmpFileName4 + ] + } + ).readSourceCode(); }); it('should return files data', () => { @@ -464,12 +485,15 @@ describe('SourceCodeReader', () => { fs.writeFileSync(filePath2, fileContent); fs.writeFileSync(filePath3, fileContent); fs.writeFileSync(filePath4, fileContent); - result = new SourceCodeReader({ - exclude: [ - filePath2, - filePath4 - ] - }).readSourceCode(tmpDirectoryPath); + result = new SourceCodeReader( + tmpDirectoryPath, + { + exclude: [ + filePath2, + filePath4 + ] + } + ).readSourceCode(); }); it('should return files data', () => { @@ -501,9 +525,12 @@ describe('SourceCodeReader', () => { fs.writeFileSync(filePath2, fileContent); fs.writeFileSync(filePath3, fileContent); fs.writeFileSync(filePath4, fileContent); - testFunc = () => new SourceCodeReader({ - exclude: [tmpDirectoryPath] - }).readSourceCode(tmpDirectoryPath); + testFunc = () => new SourceCodeReader( + tmpDirectoryPath, + { + exclude: [tmpDirectoryPath] + } + ).readSourceCode(); }); it('should return files data', () => { @@ -535,7 +562,7 @@ describe('SourceCodeReader', () => { consoleLogSpy = sinon.spy(console, 'log'); fs.writeFileSync(inputPath, fileContent); - new SourceCodeReader({}).readSourceCode(inputPath); + new SourceCodeReader(inputPath, {}).readSourceCode(); consoleLogCallResult = consoleLogSpy.called; loggingMessageResult = consoleLogSpy.getCall(0).args[0]; diff --git a/yarn.lock b/yarn.lock index 6effffdd..4f43c218 100644 --- a/yarn.lock +++ b/yarn.lock @@ -323,40 +323,40 @@ resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.15.1.tgz#c8e84705e08eed430b5e15b39c65b0944e4d1422" integrity sha512-eWN5ElDTeBc5lRDh95SqA8x18D0ll2pWudU3uWiyfsRmIZcmUXpEsxPU+7+BsdCrO2vfLRC629u/MmjbmF+2tA== -"@typescript-eslint/eslint-plugin@2.18.0": - version "2.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.18.0.tgz#f8cf272dfb057ecf1ea000fea1e0b3f06a32f9cb" - integrity sha512-kuO8WQjV+RCZvAXVRJfXWiJ8iYEtfHlKgcqqqXg9uUkIolEHuUaMmm8/lcO4xwCOtaw6mY0gStn2Lg4/eUXXYQ== +"@typescript-eslint/eslint-plugin@2.19.0": + version "2.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.0.tgz#bf743448a4633e4b52bee0c40148ba072ab3adbd" + integrity sha512-u7IcQ9qwsB6U806LupZmINRnQjC+RJyv36sV/ugaFWMHTbFm/hlLTRx3gGYJgHisxcGSTnf+I/fPDieRMhPSQQ== dependencies: - "@typescript-eslint/experimental-utils" "2.18.0" + "@typescript-eslint/experimental-utils" "2.19.0" eslint-utils "^1.4.3" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.18.0": - version "2.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.18.0.tgz#e4eab839082030282496c1439bbf9fdf2a4f3da8" - integrity sha512-J6MopKPHuJYmQUkANLip7g9I82ZLe1naCbxZZW3O2sIxTiq/9YYoOELEKY7oPg0hJ0V/AQ225h2z0Yp+RRMXhw== +"@typescript-eslint/experimental-utils@2.19.0": + version "2.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.0.tgz#d5ca732f22c009e515ba09fcceb5f2127d841568" + integrity sha512-zwpg6zEOPbhB3+GaQfufzlMUOO6GXCNZq6skk+b2ZkZAIoBhVoanWK255BS1g5x9bMwHpLhX0Rpn5Fc3NdCZdg== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.18.0" + "@typescript-eslint/typescript-estree" "2.19.0" eslint-scope "^5.0.0" -"@typescript-eslint/parser@2.18.0": - version "2.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.18.0.tgz#d5f7fc1839abd4a985394e40e9d2454bd56aeb1f" - integrity sha512-SJJPxFMEYEWkM6pGfcnjLU+NJIPo+Ko1QrCBL+i0+zV30ggLD90huEmMMhKLHBpESWy9lVEeWlQibweNQzyc+A== +"@typescript-eslint/parser@2.19.0": + version "2.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.19.0.tgz#912160d9425395d09857dcd5382352bc98be11ae" + integrity sha512-s0jZoxAWjHnuidbbN7aA+BFVXn4TCcxEVGPV8lWMxZglSs3NRnFFAlL+aIENNmzB2/1jUJuySi6GiM6uACPmpg== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.18.0" - "@typescript-eslint/typescript-estree" "2.18.0" + "@typescript-eslint/experimental-utils" "2.19.0" + "@typescript-eslint/typescript-estree" "2.19.0" eslint-visitor-keys "^1.1.0" -"@typescript-eslint/typescript-estree@2.18.0": - version "2.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.18.0.tgz#cfbd16ed1b111166617d718619c19b62764c8460" - integrity sha512-gVHylf7FDb8VSi2ypFuEL3hOtoC4HkZZ5dOjXvVjoyKdRrvXAOPSzpNRnKMfaUUEiSLP8UF9j9X9EDLxC0lfZg== +"@typescript-eslint/typescript-estree@2.19.0": + version "2.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.0.tgz#6bd7310b9827e04756fe712909f26956aac4b196" + integrity sha512-n6/Xa37k0jQdwpUszffi19AlNbVCR0sdvCs3DmSKMD7wBttKY31lhD2fug5kMD91B2qW4mQldaTEc1PEzvGu8w== dependencies: debug "^4.1.1" eslint-visitor-keys "^1.1.0" @@ -1263,10 +1263,10 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.0.tgz#545983a0603fe425bc672d66c9e3c89c42121a83" - integrity sha512-NIQrwvv9V39FHgGFm36+U9SMQzbiHvU79k+iADraJTpmrFFfx7Ds0IvDoAdZsDrknlkRk14OYoWXb57uTh7/sw== +commander@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== commander@^2.20.0: version "2.20.3" @@ -1750,10 +1750,10 @@ eslint-module-utils@^2.4.1: debug "^2.6.9" pkg-dir "^2.0.0" -eslint-plugin-import@2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.0.tgz#d749a7263fb6c29980def8e960d380a6aa6aecaa" - integrity sha512-NK42oA0mUc8Ngn4kONOPsPB1XhbUvNHqF+g307dPV28aknPoiNnKLFd9em4nkswwepdF5ouieqv5Th/63U7YJQ== +eslint-plugin-import@2.20.1: + version "2.20.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz#802423196dcb11d9ce8435a5fc02a6d3b46939b3" + integrity sha512-qQHgFOTjguR+LnYRoToeZWT62XM55MBVXObHM6SKFd1VzDcX/vqT1kAz8ssqigh5eMj8qXcRoXXGZpPP6RfdCw== dependencies: array-includes "^3.0.3" array.prototype.flat "^1.2.1" @@ -1791,10 +1791,10 @@ eslint-plugin-prefer-arrow@1.1.7: resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.1.7.tgz#4534dd8d2e519cd579a951f95802137365d524a2" integrity sha512-epsA4g804mRovlOHSbeO1xxW7REGeUjULRME9MJTJDOVscNIA01AkR66TP4cmHDfD+w72EQ9cPhf37MbZiFI2w== -eslint-plugin-unicorn@15.0.1: - version "15.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-15.0.1.tgz#8379d1d6882f9f8631bec8025ac9e8fe89e43945" - integrity sha512-yahqrPGFUzwH5cnmnj+iPlgPapAiBIZ/ZNSDkhTVPgPCo7/mOEjJ2gDhEclrtQVBE9olmec4N+CKDnJuZ9XpRA== +eslint-plugin-unicorn@16.0.0: + version "16.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-16.0.0.tgz#5fc03d70b2944fa85099bf511c352b3d50201738" + integrity sha512-zqWMYzTopdixyqu0+3td4vIGmpBxwdBVeWBm3TzwnFMvHoAE6tTQ/w2Xv5RG/MklKkfQdHsRqa8CVsSpjSA4qQ== dependencies: ci-info "^2.0.0" clean-regexp "^1.0.0" @@ -1811,7 +1811,7 @@ eslint-plugin-unicorn@15.0.1: regexpp "^3.0.0" reserved-words "^0.1.2" safe-regex "^2.1.1" - semver "^6.3.0" + semver "^7.1.2" eslint-scope@5.0.0, eslint-scope@^5.0.0: version "5.0.0" @@ -4545,6 +4545,11 @@ semver@^6.0.0, semver@^6.1.2, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.1.2.tgz#847bae5bce68c5d08889824f02667199b70e3d87" + integrity sha512-BJs9T/H8sEVHbeigqzIEo57Iu/3DG6c4QoqTfbQB3BPA4zgzAomh/Fk9E7QtjWQ8mx2dgA9YCfSF4y9k9bHNpQ== + serialize-javascript@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" From 469dd4a0cf21c43f339ce596b0aee85c4447450f Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Fri, 7 Feb 2020 10:37:12 +0300 Subject: [PATCH 3/3] Updated changelog and version --- CHANGELOG.md | 4 ++++ dist/index.browser.js | 4 ++-- dist/index.cli.js | 2 +- dist/index.js | 2 +- package.json | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b085f702..6e57aaf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ Change Log +v0.24.6 +--- +* Added file path to the error message during directory obfuscation. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/513 + v0.24.5 --- * Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/542 diff --git a/dist/index.browser.js b/dist/index.browser.js index a327033b..596ba0e0 100644 --- a/dist/index.browser.js +++ b/dist/index.browser.js @@ -21,7 +21,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JavaScriptObfuscator=t():e.JavaScriptObfuscator=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=110)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11);t.METADATA_KEY=r;var o=n(112);t.Container=o.Container;var i=n(14);t.BindingScopeEnum=i.BindingScopeEnum,t.BindingTypeEnum=i.BindingTypeEnum,t.TargetTypeEnum=i.TargetTypeEnum;var a=n(128);t.AsyncContainerModule=a.AsyncContainerModule,t.ContainerModule=a.ContainerModule;var s=n(129);t.injectable=s.injectable;var u=n(130);t.tagged=u.tagged;var d=n(131);t.named=d.named;var l=n(69);t.inject=l.inject,t.LazyServiceIdentifer=l.LazyServiceIdentifer;var c=n(132);t.optional=c.optional;var p=n(133);t.unmanaged=p.unmanaged;var g=n(134);t.multiInject=g.multiInject;var h=n(135);t.targetName=h.targetName;var f=n(136);t.postConstruct=f.postConstruct;var m=n(67);t.MetadataReader=m.MetadataReader;var b=n(21);t.id=b.id;var y=n(18);t.decorate=y.decorate;var S=n(72);t.traverseAncerstors=S.traverseAncerstors,t.taggedConstraint=S.taggedConstraint,t.namedConstraint=S.namedConstraint,t.typeConstraint=S.typeConstraint;var _=n(30);t.getServiceIdentifierAsString=_.getServiceIdentifierAsString;var C=n(137);t.multiBindToService=C.multiBindToService},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("string"==typeof e||e instanceof String)){var t;throw t=null===e?"null":"object"===(t=r(e))&&e.constructor&&e.constructor.hasOwnProperty("name")?e.constructor.name:"a ".concat(t),new TypeError("Expected string but received ".concat(t,"."))}},e.exports=t.default,e.exports.default=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(37);class o{static isArrayPatternNode(e){return e.type===r.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===r.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===r.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===r.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===r.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===r.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===r.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===r.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===r.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===r.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===r.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===r.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===r.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return o.isFunctionDeclarationNode(e)||o.isFunctionExpressionNode(e)||o.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===r.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===r.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===r.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===r.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===r.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const n=o.isLabeledStatementNode(t)&&t.label===e,r=o.isContinueStatementNode(t)&&t.label===e,i=o.isBreakStatementNode(t)&&t.label===e;return n||r||i}static isLabeledStatementNode(e){return e.type===r.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===r.NodeType.Literal}static isMemberExpressionNode(e){return e.type===r.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===r.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return o.isProgramNode(e)||o.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return o.isNodeWithLexicalScope(e)||o.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return o.isProgramNode(e)||o.isBlockStatementNode(e)&&o.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return o.isProgramNode(e)||o.isBlockStatementNode(e)||o.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===r.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===r.NodeType.ObjectExpression}static isProgramNode(e){return e.type===r.NodeType.Program}static isPropertyNode(e){return e.type===r.NodeType.Property}static parentNodeIsPropertyNode(e,t){return o.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return o.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return o.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===r.NodeType.RestElement}static isReturnStatementNode(e){return e.type===r.NodeType.ReturnStatement}static isSuperNode(e){return e.type===r.NodeType.Super}static isSwitchCaseNode(e){return e.type===r.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===r.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===r.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===r.NodeType.UnaryExpression}static isUseStrictOperator(e){return o.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===r.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===r.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===r.NodeType.WhileStatement}}t.NodeGuards=o,o.nodesWithLexicalStatements=[r.NodeType.ArrowFunctionExpression,r.NodeType.FunctionDeclaration,r.NodeType.FunctionExpression,r.NodeType.MethodDefinition]},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(56)),i=r(n(7)),a=n(53),s=n(83),u=n(3),d=n(16);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:o.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),u.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+o.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return u.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(n=>{if("parentNode"===n)return;const r=e[n];let o;o=null===r||r instanceof RegExp?r:Array.isArray(r)?r.map(l.cloneRecursive):"object"==typeof r?l.cloneRecursive(r):r,t[n]=o}),t}}t.NodeUtils=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={configurable:!0,enumerable:!0};function o(e,t,n){Reflect.hasMetadata(e,n)||Reflect.defineMetadata(e,t,n)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(n,i)=>{const a=n[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return o("_initialized",!1,n),o("_initializablePropertiesSet",new Set,n),o("_wrappedMethodsSet",new Set,n),function(e,t){const n=Object.getOwnPropertyNames(e),o=[t,"constructor"];n.forEach(n=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(o.includes(n)||a.has(n)||s.has(n))return;if("function"!=typeof e[n])return;const u=null!==(i=Object.getOwnPropertyDescriptor(e,n))&&void 0!==i?i:r,d=u.value;Object.defineProperty(e,n,Object.assign(Object.assign({},u),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(n)})}(n,e),function(e,t,n){var o;const i=null!==(o=Object.getOwnPropertyDescriptor(e,t))&&void 0!==o?o:r,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[n],e}}))}(n,e,i),function(e,t){var n;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const o=`_${t.toString()}`,i=null!==(n=Object.getOwnPropertyDescriptor(e,o))&&void 0!==n?n:r;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[o])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[o]},set:function(e){this[o]=e}})),i}(n,i)}}},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(56)),i=n(37);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,n){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:n,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,n){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:n,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,n){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:n,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,n){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},n&&{alternate:n}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:o.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,n){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:n,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,n=!1){return{type:i.NodeType.MemberExpression,computed:n,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,n,r){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:n,computed:r,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,n=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:n,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,n=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:n,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,n){!function e(t){"use strict";var r,o,i,a,s,u;function d(e){var t,n,r={};for(t in e)e.hasOwnProperty(t)&&(n=e[t],r[t]="object"==typeof n&&null!==n?d(n):n);return r}function l(e,t){this.parent=e,this.key=t}function c(e,t,n,r){this.node=e,this.path=t,this.wrap=n,this.ref=r}function p(){}function g(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function f(e,t){return(new p).traverse(e,t)}function m(e,t){var n;return n=function(e,t){var n,r,o,i;for(r=e.length,o=0;r;)t(e[i=o+(n=r>>>1)])?r=n:(o=i+1,r-=n+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],n!==t.length&&(e.extendedRange[1]=t[n].range[0]),(n-=1)>=0&&(e.extendedRange[0]=t[n].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},i={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},o={Break:a={},Skip:s={},Remove:u={}},l.prototype.replace=function(e){this.parent[this.key]=e},l.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){var e,t,n,r,o;function i(e,t){if(Array.isArray(t))for(n=0,r=t.length;n=0;)if(b=i[l=m[p]])if(Array.isArray(b)){for(f=b.length;(f-=1)>=0;)if(b[f]){if(h(u,m[p]))o=new c(b[f],[l,f],"Property",null);else{if(!g(b[f]))continue;o=new c(b[f],[l,f],null,null)}n.push(o)}}else g(b)&&n.push(new c(b,l,null,null))}}else if(o=r.pop(),d=this.__execute(t.leave,o),this.__state===a||d===a)return},p.prototype.replace=function(e,t){var n,r,o,i,d,p,f,m,b,y,S,_,C;function N(e){var t,r,o,i;if(e.ref.remove())for(r=e.ref.key,i=e.ref.parent,t=n.length;t--;)if((o=n[t]).ref&&o.ref.parent===i){if(o.ref.key=0;)if(y=o[C=b[f]])if(Array.isArray(y)){for(m=y.length;(m-=1)>=0;)if(y[m]){if(h(i,b[f]))p=new c(y[m],[C,m],"Property",new l(y,m));else{if(!g(y[m]))continue;p=new c(y[m],[C,m],null,new l(y,m))}n.push(p)}}else g(y)&&n.push(new c(y,C,null,new l(o,C)))}}else if(p=r.pop(),void 0!==(d=this.__execute(t.leave,p))&&d!==a&&d!==s&&d!==u&&p.ref.replace(d),this.__state!==u&&d!==u||N(p),this.__state===a||d===a)return _.root;return _.root},t.version=n(140).version,t.Syntax=r,t.traverse=f,t.replace=function(e,t){return(new p).replace(e,t)},t.attachComments=function(e,t,n){var r,i,a,s,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!n.length){if(t.length){for(a=0,i=t.length;ae.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(s,1)):s+=1;return s===u.length?o.Break:u[s].extendedRange[0]>e.range[1]?o.Skip:void 0}}),s=0,f(e,{leave:function(e){for(var t;se.range[1]?o.Skip:void 0}}),e},t.VisitorKeys=i,t.VisitorOption=o,t.Controller=p,t.cloneEnvironment=function(){return e({})},t}(t)},function(e,t,n){"use strict";var r,o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(0),u=n(1),d=n(201),l=n(202);let c=r=class{constructor(e,t,n,r){this.cachedNode=null,this.identifierNamesGenerator=e(r),this.customNodeFormatter=t,this.randomGenerator=n,this.options=r}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(r.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};c.globalVariableTemplateFunctions=[d.GlobalVariableTemplate1(),l.GlobalVariableTemplate2()],c=r=o([s.injectable(),a(0,s.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),a(1,s.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),a(2,s.inject(u.ServiceIdentifiers.IRandomGenerator)),a(3,s.inject(u.ServiceIdentifiers.IOptions)),i("design:paramtypes",[Function,Object,Object,Object])],c),t.AbstractCustomNode=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(0),s=n(1);let u=class{constructor(e,t){this.randomGenerator=e,this.options=t}};u=r([a.injectable(),i(0,a.inject(s.ServiceIdentifiers.IRandomGenerator)),i(1,a.inject(s.ServiceIdentifiers.IOptions)),o("design:paramtypes",[Object,Object])],u),t.AbstractNodeTransformer=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NAMED_TAG="named",t.NAME_TAG="name",t.UNMANAGED_TAG="unmanaged",t.OPTIONAL_TAG="optional",t.INJECT_TAG="inject",t.MULTI_INJECT_TAG="multi_inject",t.TAGGED="inversify:tagged",t.TAGGED_PROP="inversify:tagged_props",t.PARAM_TYPES="inversify:paramtypes",t.DESIGN_PARAM_TYPES="design:paramtypes",t.POST_CONSTRUCT="post_construct"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",t.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",t.NULL_ARGUMENT="NULL argument",t.KEY_NOT_FOUND="Key Not Found",t.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",t.CANNOT_UNBIND="Could not unbind serviceIdentifier:",t.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",t.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",t.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",t.UNDEFINED_INJECT_ANNOTATION=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},t.CIRCULAR_DEPENDENCY="Circular dependency found:",t.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",t.INVALID_BINDING_TYPE="Invalid binding type:",t.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",t.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",t.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",t.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",t.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",t.ARGUMENTS_LENGTH_MISMATCH=function(){for(var e=[],t=0;t= than the number of constructor arguments of its base class."},t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",t.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",t.POST_CONSTRUCT_ERROR=function(){for(var e=[],t=0;t=t)return n;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(r.NodeGuards.isProgramNode(e)||r.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&n.push(e),e!==a?o.getParentNodesWithStatementsRecursive(a,t,n,++i):n}static getSiblingStatementByOffset(e,t){const n=o.getScopeOfNode(e),i=r.NodeGuards.isSwitchCaseNode(n)?n.consequent:n.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static set(e,t){var n;e.metadata=Object.assign(null!==(n=e.metadata)&&void 0!==n?n:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===r.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===r.get(e,"replacedLiteral")}}t.NodeMetadata=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),o=n(1),i=n(138),a=n(157),s=n(185),u=n(194),d=n(244),l=n(245),c=n(249),p=n(250),g=n(259),h=n(350),f=n(361),m=n(365),b=n(379),y=n(381),S=n(383),_=n(385),C=n(386),N=n(387);t.InversifyContainerFacade=class{constructor(){this.container=new r.Container}static getFactory(e){return t=>n=>t.container.getNamed(e,n)}static getCacheFactory(e){return t=>{const n=new Map;return r=>{if(n.has(r))return n.get(r);const o=t.container.getNamed(e,r);return n.set(r,o),o}}}static getConstructorFactory(e,...t){return n=>{const r=new Map,o=[];return i=>{if(t.forEach((e,t)=>{o[t]||(o[t]=n.container.get(e))}),r.has(i))return new(r.get(i))(...o);const a=n.container.getNamed(e,i);return r.set(i,a),new a(...o)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,n){this.container.bind(o.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new C.SourceCode(e,t)).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>n).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.ILogger).to(y.Logger).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.IJavaScriptObfuscator).to(b.JavaScriptObfuscator).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.ITransformersRunner).to(N.TransformersRunner).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.IObfuscatedCode).to(_.ObfuscatedCode),this.container.bind(o.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,n)=>{const r=e.container.get(o.ServiceIdentifiers.IObfuscatedCode);return r.initialize(t,n),r}),this.container.bind(o.ServiceIdentifiers.IObfuscationEventEmitter).to(S.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(u.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(c.nodeTransformersModule),this.container.load(p.obfuscatingTransformersModule),this.container.load(g.optionsModule),this.container.load(h.preparingTransformersModule),this.container.load(f.storagesModule),this.container.load(m.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),o=n(11);function i(e,t,n,o,i){var a={},s="number"==typeof i,u=void 0!==i&&s?i.toString():n;if(s&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(e,t)&&(a=Reflect.getMetadata(e,t));var d=a[u];if(Array.isArray(d))for(var l=0,c=d;l1&&r.callsGraph.length?o.getOptimalBlockScope(r.callsGraph,0,--n):r.callee}static insertBefore(e,t,n){const r=o.getScopeStatements(e).indexOf(n);o.insertAtIndex(e,t,r)}static insertAfter(e,t,n){const r=o.getScopeStatements(e).indexOf(n);o.insertAtIndex(e,t,r+1)}static insertAtIndex(e,t,n){t=o.parentizeScopeStatementsBeforeAppend(e,t),o.setScopeStatements(e,[...o.getScopeStatements(e).slice(0,n),...t,...o.getScopeStatements(e).slice(n)])}static prepend(e,t){t=o.parentizeScopeStatementsBeforeAppend(e,t),o.setScopeStatements(e,[...t,...o.getScopeStatements(e)])}static getScopeStatements(e){return r.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){r.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=0;t.id=function(){return r++}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(40);t.ObfuscationTarget=r.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},e.exports=t.default,e.exports.default=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.isValid=function(e){var t=this;return"isValid"!==e&&"getMessage"!==e&&-1!==Object.keys(this).map((function(e){return t[e]})).indexOf(e)},e.getMessage=function(e,t){var n=this,r=t?"each value in ":"";switch(e){case this.NESTED_VALIDATION:return r+"nested property $property must be either object or array";case this.IS_DEFINED:return r+"$property should not be null or undefined";case this.EQUALS:return r+"$property must be equal to $constraint1";case this.NOT_EQUALS:return r+"$property should not be equal to $constraint1";case this.IS_EMPTY:return r+"$property must be empty";case this.IS_NOT_EMPTY:return r+"$property should not be empty";case this.IS_IN:return r+"$property must be one of the following values: $constraint1";case this.IS_NOT_IN:return r+"$property should not be one of the following values: $constraint1";case this.IS_PORT:return r+"$property must be a port";case this.IS_BOOLEAN:return r+"$property must be a boolean value";case this.IS_DATE:return r+"$property must be a Date instance";case this.IS_NUMBER:return r+"$property must be a number conforming to the specified constraints";case this.IS_INT:return r+"$property must be an integer number";case this.IS_STRING:return r+"$property must be a string";case this.IS_DATE_STRING:return r+"$property must be a ISOString";case this.IS_ARRAY:return r+"$property must be an array";case this.IS_ENUM:return r+"$property must be a valid enum value";case this.IS_DIVISIBLE_BY:return r+"$property must be divisible by $constraint1";case this.IS_POSITIVE:return r+"$property must be a positive number";case this.IS_NEGATIVE:return r+"$property must be a negative number";case this.MIN:return r+"$property must not be less than $constraint1";case this.MAX:return r+"$property must not be greater than $constraint1";case this.MIN_DATE:return"minimal allowed date for "+r+"$property is $constraint1";case this.MAX_DATE:return"maximal allowed date for "+r+"$property is $constraint1";case this.IS_BOOLEAN_STRING:return r+"$property must be a boolean string";case this.IS_NUMBER_STRING:return r+"$property must be a number string";case this.CONTAINS:return r+"$property must contain a $constraint1 string";case this.NOT_CONTAINS:return r+"$property should not contain a $constraint1 string";case this.IS_ALPHA:return r+"$property must contain only letters (a-zA-Z)";case this.IS_ALPHANUMERIC:return r+"$property must contain only letters and numbers";case this.IS_DECIMAL:return r+"$property is not a valid decimal number.";case this.IS_ASCII:return r+"$property must contain only ASCII characters";case this.IS_BASE64:return r+"$property must be base64 encoded";case this.IS_BYTE_LENGTH:return r+"$property's byte length must fall into ($constraint1, $constraint2) range";case this.IS_CREDIT_CARD:return r+"$property must be a credit card";case this.IS_CURRENCY:return r+"$property must be a currency";case this.IS_EMAIL:return r+"$property must be an email";case this.IS_FQDN:return r+"$property must be a valid domain name";case this.IS_FULL_WIDTH:return r+"$property must contain a full-width characters";case this.IS_HALF_WIDTH:return r+"$property must contain a half-width characters";case this.IS_VARIABLE_WIDTH:return r+"$property must contain a full-width and half-width characters";case this.IS_HEX_COLOR:return r+"$property must be a hexadecimal color";case this.IS_HEXADECIMAL:return r+"$property must be a hexadecimal number";case this.IS_MAC_ADDRESS:return r+"$property must be a MAC Address";case this.IS_IP:return r+"$property must be an ip address";case this.IS_ISBN:return r+"$property must be an ISBN";case this.IS_ISIN:return r+"$property must be an ISIN (stock/security identifier)";case this.IS_ISO8601:return r+"$property must be a valid ISO 8601 date string";case this.IS_JSON:return r+"$property must be a json string";case this.IS_JWT:return r+"$property must be a jwt string";case this.IS_OBJECT:return r+"$property must be an object";case this.IS_NOT_EMPTY_OBJECT:return r+"$property must be a non-empty object";case this.IS_LOWERCASE:return r+"$property must be a lowercase string";case this.IS_MOBILE_PHONE:return r+"$property must be a phone number";case this.IS_PHONE_NUMBER:return r+"$property must be a valid phone number";case this.IS_ISO31661_ALPHA_2:return r+"$property must be a valid ISO31661 Alpha2 code";case this.IS_ISO31661_ALPHA_3:return r+"$property must be a valid ISO31661 Alpha3 code";case this.IS_LATLONG:return r+"$property must be a latitude,longitude string";case this.IS_LATITUDE:return r+"$property must be a latitude string or number";case this.IS_LONGITUDE:return r+"$property must be a longitude string or number";case this.IS_MONGO_ID:return r+"$property must be a mongodb id";case this.IS_MULTIBYTE:return r+"$property must contain one or more multibyte chars";case this.IS_SURROGATE_PAIR:return r+"$property must contain any surrogate pairs chars";case this.IS_URL:return r+"$property must be an URL address";case this.IS_UUID:return r+"$property must be an UUID";case this.IS_UPPERCASE:return r+"$property must be uppercase";case this.LENGTH:return function(e){var t=null!==e.constraints[0]&&void 0!==e.constraints[0],n=null!==e.constraints[1]&&void 0!==e.constraints[1];return t&&(!e.value||e.value.lengthe.constraints[1]?r+"$property must be shorter than or equal to $constraint2 characters":r+"$property must be longer than or equal to $constraint1 and shorter than or equal to $constraint2 characters"};case this.MIN_LENGTH:return r+"$property must be longer than or equal to $constraint1 characters";case this.MAX_LENGTH:return r+"$property must be shorter than or equal to $constraint1 characters";case this.MATCHES:return r+"$property must match $constraint1 regular expression";case this.IS_MILITARY_TIME:return r+"$property must be a valid representation of military time in the format HH:MM";case this.IS_HASH:return r+"$property must be a hash of type $constraint1";case this.IS_ISSN:return r+"$property must be a ISSN";case this.ARRAY_CONTAINS:return r+"$property must contain $constraint1 values";case this.ARRAY_NOT_CONTAINS:return r+"$property should not contain $constraint1 values";case this.ARRAY_NOT_EMPTY:return r+"$property should not be empty";case this.ARRAY_MIN_SIZE:return r+"$property must contain at least $constraint1 elements";case this.ARRAY_MAX_SIZE:return r+"$property must contain not more than $constraint1 elements";case this.ARRAY_UNIQUE:return r+"All $property's elements must be unique";case this.IS_INSTANCE:return function(e){return e.constraints[0]?r+"$property must be an instance of "+e.constraints[0].name:r+(n.IS_INSTANCE+" decorator expects and object as value, but got falsy value.")}}return""},e.CUSTOM_VALIDATION="customValidation",e.NESTED_VALIDATION="nestedValidation",e.PROMISE_VALIDATION="promiseValidation",e.CONDITIONAL_VALIDATION="conditionalValidation",e.WHITELIST="whitelistValidation",e.IS_DEFINED="isDefined",e.EQUALS="equals",e.NOT_EQUALS="notEquals",e.IS_EMPTY="isEmpty",e.IS_NOT_EMPTY="isNotEmpty",e.IS_IN="isIn",e.IS_NOT_IN="isNotIn",e.IS_BOOLEAN="isBoolean",e.IS_DATE="isDate",e.IS_NUMBER="isNumber",e.IS_LATLONG="isLatLong",e.IS_LATITUDE="isLatitude",e.IS_LONGITUDE="isLongitude",e.IS_STRING="isString",e.IS_DATE_STRING="isDateString",e.IS_ARRAY="isArray",e.IS_INT="isInt",e.IS_ENUM="isEnum",e.IS_DIVISIBLE_BY="isDivisibleBy",e.IS_POSITIVE="isPositive",e.IS_NEGATIVE="isNegative",e.MIN="min",e.MAX="max",e.MIN_DATE="minDate",e.MAX_DATE="maxDate",e.IS_BOOLEAN_STRING="isBooleanString",e.IS_NUMBER_STRING="isNumberString",e.CONTAINS="contains",e.NOT_CONTAINS="notContains",e.IS_ALPHA="isAlpha",e.IS_ALPHANUMERIC="isAlphanumeric",e.IS_DECIMAL="isDecimal",e.IS_ASCII="isAscii",e.IS_BASE64="isBase64",e.IS_BYTE_LENGTH="isByteLength",e.IS_CREDIT_CARD="isCreditCard",e.IS_CURRENCY="isCurrency",e.IS_EMAIL="isEmail",e.IS_FQDN="isFqdn",e.IS_FULL_WIDTH="isFullWidth",e.IS_HALF_WIDTH="isHalfWidth",e.IS_VARIABLE_WIDTH="isVariableWidth",e.IS_HEX_COLOR="isHexColor",e.IS_HEXADECIMAL="isHexadecimal",e.IS_MAC_ADDRESS="isMacAddress",e.IS_IP="isIp",e.IS_PORT="isPort",e.IS_ISBN="isIsbn",e.IS_ISIN="isIsin",e.IS_ISO8601="isIso8601",e.IS_JSON="isJson",e.IS_JWT="isJwt",e.IS_OBJECT="isObject",e.IS_NOT_EMPTY_OBJECT="isNotEmptyObject",e.IS_LOWERCASE="isLowercase",e.IS_MOBILE_PHONE="isMobilePhone",e.IS_PHONE_NUMBER="isPhoneNumber",e.IS_ISO31661_ALPHA_2="isISO31661Alpha2",e.IS_ISO31661_ALPHA_3="isISO31661Alpha3",e.IS_MONGO_ID="isMongoId",e.IS_MULTIBYTE="isMultibyte",e.IS_SURROGATE_PAIR="isSurrogatePair",e.IS_URL="isUrl",e.IS_UUID="isUuid",e.LENGTH="length",e.IS_UPPERCASE="isUppercase",e.MIN_LENGTH="minLength",e.MAX_LENGTH="maxLength",e.MATCHES="matches",e.IS_MILITARY_TIME="isMilitaryTime",e.IS_HASH="isHash",e.IS_ISSN="isISSN",e.ARRAY_CONTAINS="arrayContains",e.ARRAY_NOT_CONTAINS="arrayNotContains",e.ARRAY_NOT_EMPTY="arrayNotEmpty",e.ARRAY_MIN_SIZE="arrayMinSize",e.ARRAY_MAX_SIZE="arrayMaxSize",e.ARRAY_UNIQUE="arrayUnique",e.IS_INSTANCE="isInstance",e}();t.ValidationTypes=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,i=new(function(){function e(){this.instances=[]}return e.prototype.get=function(e){var t=this.instances.find((function(t){return t.type===e}));return t||(t={type:e,object:new e},this.instances.push(t)),t.object},e}());t.useContainer=function(e,t){r=e,o=t},t.getFromContainer=function(e){if(r)try{var t=r.get(e);if(t)return t;if(!o||!o.fallback)return t}catch(e){if(!o||!o.fallbackOnErrors)throw e}return i.get(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(111);const r=n(1),o=n(17);class i{static obfuscate(e,t={}){const n=new o.InversifyContainerFacade;n.load(e,"",t);const i=n.get(r.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return n.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.5"?"0.24.5":"unknown"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12);function o(e){return"function"==typeof e?e.name:"symbol"==typeof e?e.toString():e}function i(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}t.getServiceIdentifierAsString=o,t.listRegisteredBindingsForServiceIdentifier=function(e,t,n){var r="",o=n(e,t);return 0!==o.length&&(r="\nRegistered bindings:",o.forEach((function(e){var t="Object";null!==e.implementationType&&(t=i(e.implementationType)),r=r+"\n "+t,e.constraint.metaData&&(r=r+" - "+e.constraint.metaData)}))),r},t.circularDependencyToException=function e(t){t.childRequests.forEach((function(t){if(function e(t,n){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===n||e(t.parentRequest,n))}(t,t.serviceIdentifier)){var n=function(e){return function e(t,n){void 0===n&&(n=[]);var r=o(t.serviceIdentifier);return n.push(r),null!==t.parentRequest?e(t.parentRequest,n):n}(e).reverse().join(" --\x3e ")}(t);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}e(t)}))},t.listMetadataForTarget=function(e,t){if(t.isTagged()||t.isNamed()){var n="",r=t.getNamedTag(),o=t.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==o&&o.forEach((function(e){n+=e.toString()+"\n"}))," "+e+"\n "+e+" - "+n}return" "+e},t.getFunctionName=i},function(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var a,s=t.isAbsolute(n),u=n.split(/\/+/),d=0,l=u.length-1;l>=0;l--)"."===(a=u[l])?u.splice(l,1):".."===a?d++:d>0&&(""===a?(u.splice(l+1,d),d=0):(u.splice(l,2),d--));return""===(n=u.join("/"))&&(n=s?"/":"."),r?(r.path=n,i(r)):n}function s(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),s=o(e);if(s&&(e=s.path||"/"),n&&!n.scheme)return s&&(n.scheme=s.scheme),i(n);if(n||t.match(r))return t;if(s&&!s.host&&!s.path)return s.host=t,i(s);var u="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=u,i(s)):u}t.urlParse=o,t.urlGenerate=i,t.normalize=a,t.join=s,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function d(e){return e}function l(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function c(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=u?d:function(e){return l(e)?"$"+e:e},t.fromSetString=u?d:function(e){return l(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=c(e.source,t.source);return 0!==r?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)||n?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:0!==(r=e.generatedLine-t.generatedLine)?r:c(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)||n?r:0!==(r=c(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)?r:c(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=c(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:0!==(n=e.originalColumn-t.originalColumn)?n:c(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var u=r.path.lastIndexOf("/");u>=0&&(r.path=r.path.substring(0,u+1))}t=s(i(r),t)}return a(t)}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(0),s=n(1);let u=class{constructor(e,t,n){this.identifierNamesGenerator=e(n),this.randomGenerator=t,this.options=n}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const n=this.customNodes.get(e);n&&t(n)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};u=r([a.injectable(),i(0,a.inject(s.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),i(1,a.inject(s.ServiceIdentifiers.IRandomGenerator)),i(2,a.inject(s.ServiceIdentifiers.IOptions)),o("design:paramtypes",[Function,Object,Object])],u),t.AbstractCustomNodeGroup=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(40);t.StringArrayEncoding=r.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=r,r.hexadecimalPrefix="0x"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(261),o=function(){function e(){this.validationMetadatas=[],this.constraintMetadatas=[]}return Object.defineProperty(e.prototype,"hasValidationMetaData",{get:function(){return!!this.validationMetadatas.length},enumerable:!0,configurable:!0}),e.prototype.addValidationSchema=function(e){var t=this;(new r.ValidationSchemaToMetadataTransformer).transform(e).forEach((function(e){return t.addValidationMetadata(e)}))},e.prototype.addValidationMetadata=function(e){this.validationMetadatas.push(e)},e.prototype.addConstraintMetadata=function(e){this.constraintMetadatas.push(e)},e.prototype.groupByPropertyName=function(e){var t={};return e.forEach((function(e){t[e.propertyName]||(t[e.propertyName]=[]),t[e.propertyName].push(e)})),t},e.prototype.getTargetValidationMetadatas=function(e,t,n){var r=this.validationMetadatas.filter((function(r){return(r.target===e||r.target===t)&&(!!r.always||(!(n&&n.length>0)||r.groups&&!!r.groups.find((function(e){return-1!==n.indexOf(e)}))))})),o=this.validationMetadatas.filter((function(t){return"string"!=typeof t.target&&(t.target!==e&&((!(t.target instanceof Function)||e.prototype instanceof t.target)&&(!!t.always||(!(n&&n.length>0)||t.groups&&!!t.groups.find((function(e){return-1!==n.indexOf(e)}))))))})).filter((function(e){return!r.find((function(t){return t.propertyName===e.propertyName&&t.type===e.type}))}));return r.concat(o)},e.prototype.getTargetValidatorConstraints=function(e){return this.constraintMetadatas.filter((function(t){return t.target===e}))},e}();t.MetadataStorage=o},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,n){"use strict";(function(t){var r=n(147); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JavaScriptObfuscator=t():e.JavaScriptObfuscator=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=110)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11);t.METADATA_KEY=r;var o=n(112);t.Container=o.Container;var i=n(14);t.BindingScopeEnum=i.BindingScopeEnum,t.BindingTypeEnum=i.BindingTypeEnum,t.TargetTypeEnum=i.TargetTypeEnum;var a=n(128);t.AsyncContainerModule=a.AsyncContainerModule,t.ContainerModule=a.ContainerModule;var s=n(129);t.injectable=s.injectable;var u=n(130);t.tagged=u.tagged;var d=n(131);t.named=d.named;var l=n(69);t.inject=l.inject,t.LazyServiceIdentifer=l.LazyServiceIdentifer;var c=n(132);t.optional=c.optional;var p=n(133);t.unmanaged=p.unmanaged;var g=n(134);t.multiInject=g.multiInject;var h=n(135);t.targetName=h.targetName;var f=n(136);t.postConstruct=f.postConstruct;var m=n(67);t.MetadataReader=m.MetadataReader;var b=n(21);t.id=b.id;var y=n(18);t.decorate=y.decorate;var S=n(72);t.traverseAncerstors=S.traverseAncerstors,t.taggedConstraint=S.taggedConstraint,t.namedConstraint=S.namedConstraint,t.typeConstraint=S.typeConstraint;var _=n(30);t.getServiceIdentifierAsString=_.getServiceIdentifierAsString;var C=n(137);t.multiBindToService=C.multiBindToService},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("string"==typeof e||e instanceof String)){var t;throw t=null===e?"null":"object"===(t=r(e))&&e.constructor&&e.constructor.hasOwnProperty("name")?e.constructor.name:"a ".concat(t),new TypeError("Expected string but received ".concat(t,"."))}},e.exports=t.default,e.exports.default=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(37);class o{static isArrayPatternNode(e){return e.type===r.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===r.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===r.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===r.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===r.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===r.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===r.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===r.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===r.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===r.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===r.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===r.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===r.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return o.isFunctionDeclarationNode(e)||o.isFunctionExpressionNode(e)||o.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===r.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===r.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===r.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===r.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===r.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const n=o.isLabeledStatementNode(t)&&t.label===e,r=o.isContinueStatementNode(t)&&t.label===e,i=o.isBreakStatementNode(t)&&t.label===e;return n||r||i}static isLabeledStatementNode(e){return e.type===r.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===r.NodeType.Literal}static isMemberExpressionNode(e){return e.type===r.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===r.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return o.isProgramNode(e)||o.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return o.isNodeWithLexicalScope(e)||o.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return o.isProgramNode(e)||o.isBlockStatementNode(e)&&o.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return o.isProgramNode(e)||o.isBlockStatementNode(e)||o.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===r.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===r.NodeType.ObjectExpression}static isProgramNode(e){return e.type===r.NodeType.Program}static isPropertyNode(e){return e.type===r.NodeType.Property}static parentNodeIsPropertyNode(e,t){return o.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return o.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return o.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===r.NodeType.RestElement}static isReturnStatementNode(e){return e.type===r.NodeType.ReturnStatement}static isSuperNode(e){return e.type===r.NodeType.Super}static isSwitchCaseNode(e){return e.type===r.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===r.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===r.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===r.NodeType.UnaryExpression}static isUseStrictOperator(e){return o.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===r.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===r.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===r.NodeType.WhileStatement}}t.NodeGuards=o,o.nodesWithLexicalStatements=[r.NodeType.ArrowFunctionExpression,r.NodeType.FunctionDeclaration,r.NodeType.FunctionExpression,r.NodeType.MethodDefinition]},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(56)),i=r(n(7)),a=n(53),s=n(83),u=n(3),d=n(16);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:o.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),u.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+o.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return u.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(n=>{if("parentNode"===n)return;const r=e[n];let o;o=null===r||r instanceof RegExp?r:Array.isArray(r)?r.map(l.cloneRecursive):"object"==typeof r?l.cloneRecursive(r):r,t[n]=o}),t}}t.NodeUtils=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={configurable:!0,enumerable:!0};function o(e,t,n){Reflect.hasMetadata(e,n)||Reflect.defineMetadata(e,t,n)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(n,i)=>{const a=n[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return o("_initialized",!1,n),o("_initializablePropertiesSet",new Set,n),o("_wrappedMethodsSet",new Set,n),function(e,t){const n=Object.getOwnPropertyNames(e),o=[t,"constructor"];n.forEach(n=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(o.includes(n)||a.has(n)||s.has(n))return;if("function"!=typeof e[n])return;const u=null!==(i=Object.getOwnPropertyDescriptor(e,n))&&void 0!==i?i:r,d=u.value;Object.defineProperty(e,n,Object.assign(Object.assign({},u),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(n)})}(n,e),function(e,t,n){var o;const i=null!==(o=Object.getOwnPropertyDescriptor(e,t))&&void 0!==o?o:r,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[n],e}}))}(n,e,i),function(e,t){var n;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const o=`_${t.toString()}`,i=null!==(n=Object.getOwnPropertyDescriptor(e,o))&&void 0!==n?n:r;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[o])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[o]},set:function(e){this[o]=e}})),i}(n,i)}}},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(56)),i=n(37);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,n){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:n,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,n){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:n,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,n){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:n,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,n){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},n&&{alternate:n}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:o.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,n){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:n,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,n=!1){return{type:i.NodeType.MemberExpression,computed:n,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,n,r){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:n,computed:r,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,n=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:n,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,n=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:n,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,n){!function e(t){"use strict";var r,o,i,a,s,u;function d(e){var t,n,r={};for(t in e)e.hasOwnProperty(t)&&(n=e[t],r[t]="object"==typeof n&&null!==n?d(n):n);return r}function l(e,t){this.parent=e,this.key=t}function c(e,t,n,r){this.node=e,this.path=t,this.wrap=n,this.ref=r}function p(){}function g(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function f(e,t){return(new p).traverse(e,t)}function m(e,t){var n;return n=function(e,t){var n,r,o,i;for(r=e.length,o=0;r;)t(e[i=o+(n=r>>>1)])?r=n:(o=i+1,r-=n+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],n!==t.length&&(e.extendedRange[1]=t[n].range[0]),(n-=1)>=0&&(e.extendedRange[0]=t[n].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},i={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},o={Break:a={},Skip:s={},Remove:u={}},l.prototype.replace=function(e){this.parent[this.key]=e},l.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){var e,t,n,r,o;function i(e,t){if(Array.isArray(t))for(n=0,r=t.length;n=0;)if(b=i[l=m[p]])if(Array.isArray(b)){for(f=b.length;(f-=1)>=0;)if(b[f]){if(h(u,m[p]))o=new c(b[f],[l,f],"Property",null);else{if(!g(b[f]))continue;o=new c(b[f],[l,f],null,null)}n.push(o)}}else g(b)&&n.push(new c(b,l,null,null))}}else if(o=r.pop(),d=this.__execute(t.leave,o),this.__state===a||d===a)return},p.prototype.replace=function(e,t){var n,r,o,i,d,p,f,m,b,y,S,_,C;function N(e){var t,r,o,i;if(e.ref.remove())for(r=e.ref.key,i=e.ref.parent,t=n.length;t--;)if((o=n[t]).ref&&o.ref.parent===i){if(o.ref.key=0;)if(y=o[C=b[f]])if(Array.isArray(y)){for(m=y.length;(m-=1)>=0;)if(y[m]){if(h(i,b[f]))p=new c(y[m],[C,m],"Property",new l(y,m));else{if(!g(y[m]))continue;p=new c(y[m],[C,m],null,new l(y,m))}n.push(p)}}else g(y)&&n.push(new c(y,C,null,new l(o,C)))}}else if(p=r.pop(),void 0!==(d=this.__execute(t.leave,p))&&d!==a&&d!==s&&d!==u&&p.ref.replace(d),this.__state!==u&&d!==u||N(p),this.__state===a||d===a)return _.root;return _.root},t.version=n(140).version,t.Syntax=r,t.traverse=f,t.replace=function(e,t){return(new p).replace(e,t)},t.attachComments=function(e,t,n){var r,i,a,s,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!n.length){if(t.length){for(a=0,i=t.length;ae.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(s,1)):s+=1;return s===u.length?o.Break:u[s].extendedRange[0]>e.range[1]?o.Skip:void 0}}),s=0,f(e,{leave:function(e){for(var t;se.range[1]?o.Skip:void 0}}),e},t.VisitorKeys=i,t.VisitorOption=o,t.Controller=p,t.cloneEnvironment=function(){return e({})},t}(t)},function(e,t,n){"use strict";var r,o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(0),u=n(1),d=n(201),l=n(202);let c=r=class{constructor(e,t,n,r){this.cachedNode=null,this.identifierNamesGenerator=e(r),this.customNodeFormatter=t,this.randomGenerator=n,this.options=r}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(r.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};c.globalVariableTemplateFunctions=[d.GlobalVariableTemplate1(),l.GlobalVariableTemplate2()],c=r=o([s.injectable(),a(0,s.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),a(1,s.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),a(2,s.inject(u.ServiceIdentifiers.IRandomGenerator)),a(3,s.inject(u.ServiceIdentifiers.IOptions)),i("design:paramtypes",[Function,Object,Object,Object])],c),t.AbstractCustomNode=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(0),s=n(1);let u=class{constructor(e,t){this.randomGenerator=e,this.options=t}};u=r([a.injectable(),i(0,a.inject(s.ServiceIdentifiers.IRandomGenerator)),i(1,a.inject(s.ServiceIdentifiers.IOptions)),o("design:paramtypes",[Object,Object])],u),t.AbstractNodeTransformer=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NAMED_TAG="named",t.NAME_TAG="name",t.UNMANAGED_TAG="unmanaged",t.OPTIONAL_TAG="optional",t.INJECT_TAG="inject",t.MULTI_INJECT_TAG="multi_inject",t.TAGGED="inversify:tagged",t.TAGGED_PROP="inversify:tagged_props",t.PARAM_TYPES="inversify:paramtypes",t.DESIGN_PARAM_TYPES="design:paramtypes",t.POST_CONSTRUCT="post_construct"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",t.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",t.NULL_ARGUMENT="NULL argument",t.KEY_NOT_FOUND="Key Not Found",t.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",t.CANNOT_UNBIND="Could not unbind serviceIdentifier:",t.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",t.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",t.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",t.UNDEFINED_INJECT_ANNOTATION=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},t.CIRCULAR_DEPENDENCY="Circular dependency found:",t.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",t.INVALID_BINDING_TYPE="Invalid binding type:",t.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",t.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",t.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",t.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",t.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",t.ARGUMENTS_LENGTH_MISMATCH=function(){for(var e=[],t=0;t= than the number of constructor arguments of its base class."},t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",t.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",t.POST_CONSTRUCT_ERROR=function(){for(var e=[],t=0;t=t)return n;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(r.NodeGuards.isProgramNode(e)||r.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&n.push(e),e!==a?o.getParentNodesWithStatementsRecursive(a,t,n,++i):n}static getSiblingStatementByOffset(e,t){const n=o.getScopeOfNode(e),i=r.NodeGuards.isSwitchCaseNode(n)?n.consequent:n.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static set(e,t){var n;e.metadata=Object.assign(null!==(n=e.metadata)&&void 0!==n?n:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===r.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===r.get(e,"replacedLiteral")}}t.NodeMetadata=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),o=n(1),i=n(138),a=n(157),s=n(185),u=n(194),d=n(244),l=n(245),c=n(249),p=n(250),g=n(259),h=n(350),f=n(361),m=n(365),b=n(379),y=n(381),S=n(383),_=n(385),C=n(386),N=n(387);t.InversifyContainerFacade=class{constructor(){this.container=new r.Container}static getFactory(e){return t=>n=>t.container.getNamed(e,n)}static getCacheFactory(e){return t=>{const n=new Map;return r=>{if(n.has(r))return n.get(r);const o=t.container.getNamed(e,r);return n.set(r,o),o}}}static getConstructorFactory(e,...t){return n=>{const r=new Map,o=[];return i=>{if(t.forEach((e,t)=>{o[t]||(o[t]=n.container.get(e))}),r.has(i))return new(r.get(i))(...o);const a=n.container.getNamed(e,i);return r.set(i,a),new a(...o)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,n){this.container.bind(o.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new C.SourceCode(e,t)).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>n).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.ILogger).to(y.Logger).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.IJavaScriptObfuscator).to(b.JavaScriptObfuscator).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.ITransformersRunner).to(N.TransformersRunner).inSingletonScope(),this.container.bind(o.ServiceIdentifiers.IObfuscatedCode).to(_.ObfuscatedCode),this.container.bind(o.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,n)=>{const r=e.container.get(o.ServiceIdentifiers.IObfuscatedCode);return r.initialize(t,n),r}),this.container.bind(o.ServiceIdentifiers.IObfuscationEventEmitter).to(S.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(u.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(c.nodeTransformersModule),this.container.load(p.obfuscatingTransformersModule),this.container.load(g.optionsModule),this.container.load(h.preparingTransformersModule),this.container.load(f.storagesModule),this.container.load(m.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),o=n(11);function i(e,t,n,o,i){var a={},s="number"==typeof i,u=void 0!==i&&s?i.toString():n;if(s&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(e,t)&&(a=Reflect.getMetadata(e,t));var d=a[u];if(Array.isArray(d))for(var l=0,c=d;l1&&r.callsGraph.length?o.getOptimalBlockScope(r.callsGraph,0,--n):r.callee}static insertBefore(e,t,n){const r=o.getScopeStatements(e).indexOf(n);o.insertAtIndex(e,t,r)}static insertAfter(e,t,n){const r=o.getScopeStatements(e).indexOf(n);o.insertAtIndex(e,t,r+1)}static insertAtIndex(e,t,n){t=o.parentizeScopeStatementsBeforeAppend(e,t),o.setScopeStatements(e,[...o.getScopeStatements(e).slice(0,n),...t,...o.getScopeStatements(e).slice(n)])}static prepend(e,t){t=o.parentizeScopeStatementsBeforeAppend(e,t),o.setScopeStatements(e,[...t,...o.getScopeStatements(e)])}static getScopeStatements(e){return r.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){r.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=0;t.id=function(){return r++}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(40);t.ObfuscationTarget=r.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},e.exports=t.default,e.exports.default=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.isValid=function(e){var t=this;return"isValid"!==e&&"getMessage"!==e&&-1!==Object.keys(this).map((function(e){return t[e]})).indexOf(e)},e.getMessage=function(e,t){var n=this,r=t?"each value in ":"";switch(e){case this.NESTED_VALIDATION:return r+"nested property $property must be either object or array";case this.IS_DEFINED:return r+"$property should not be null or undefined";case this.EQUALS:return r+"$property must be equal to $constraint1";case this.NOT_EQUALS:return r+"$property should not be equal to $constraint1";case this.IS_EMPTY:return r+"$property must be empty";case this.IS_NOT_EMPTY:return r+"$property should not be empty";case this.IS_IN:return r+"$property must be one of the following values: $constraint1";case this.IS_NOT_IN:return r+"$property should not be one of the following values: $constraint1";case this.IS_PORT:return r+"$property must be a port";case this.IS_BOOLEAN:return r+"$property must be a boolean value";case this.IS_DATE:return r+"$property must be a Date instance";case this.IS_NUMBER:return r+"$property must be a number conforming to the specified constraints";case this.IS_INT:return r+"$property must be an integer number";case this.IS_STRING:return r+"$property must be a string";case this.IS_DATE_STRING:return r+"$property must be a ISOString";case this.IS_ARRAY:return r+"$property must be an array";case this.IS_ENUM:return r+"$property must be a valid enum value";case this.IS_DIVISIBLE_BY:return r+"$property must be divisible by $constraint1";case this.IS_POSITIVE:return r+"$property must be a positive number";case this.IS_NEGATIVE:return r+"$property must be a negative number";case this.MIN:return r+"$property must not be less than $constraint1";case this.MAX:return r+"$property must not be greater than $constraint1";case this.MIN_DATE:return"minimal allowed date for "+r+"$property is $constraint1";case this.MAX_DATE:return"maximal allowed date for "+r+"$property is $constraint1";case this.IS_BOOLEAN_STRING:return r+"$property must be a boolean string";case this.IS_NUMBER_STRING:return r+"$property must be a number string";case this.CONTAINS:return r+"$property must contain a $constraint1 string";case this.NOT_CONTAINS:return r+"$property should not contain a $constraint1 string";case this.IS_ALPHA:return r+"$property must contain only letters (a-zA-Z)";case this.IS_ALPHANUMERIC:return r+"$property must contain only letters and numbers";case this.IS_DECIMAL:return r+"$property is not a valid decimal number.";case this.IS_ASCII:return r+"$property must contain only ASCII characters";case this.IS_BASE64:return r+"$property must be base64 encoded";case this.IS_BYTE_LENGTH:return r+"$property's byte length must fall into ($constraint1, $constraint2) range";case this.IS_CREDIT_CARD:return r+"$property must be a credit card";case this.IS_CURRENCY:return r+"$property must be a currency";case this.IS_EMAIL:return r+"$property must be an email";case this.IS_FQDN:return r+"$property must be a valid domain name";case this.IS_FULL_WIDTH:return r+"$property must contain a full-width characters";case this.IS_HALF_WIDTH:return r+"$property must contain a half-width characters";case this.IS_VARIABLE_WIDTH:return r+"$property must contain a full-width and half-width characters";case this.IS_HEX_COLOR:return r+"$property must be a hexadecimal color";case this.IS_HEXADECIMAL:return r+"$property must be a hexadecimal number";case this.IS_MAC_ADDRESS:return r+"$property must be a MAC Address";case this.IS_IP:return r+"$property must be an ip address";case this.IS_ISBN:return r+"$property must be an ISBN";case this.IS_ISIN:return r+"$property must be an ISIN (stock/security identifier)";case this.IS_ISO8601:return r+"$property must be a valid ISO 8601 date string";case this.IS_JSON:return r+"$property must be a json string";case this.IS_JWT:return r+"$property must be a jwt string";case this.IS_OBJECT:return r+"$property must be an object";case this.IS_NOT_EMPTY_OBJECT:return r+"$property must be a non-empty object";case this.IS_LOWERCASE:return r+"$property must be a lowercase string";case this.IS_MOBILE_PHONE:return r+"$property must be a phone number";case this.IS_PHONE_NUMBER:return r+"$property must be a valid phone number";case this.IS_ISO31661_ALPHA_2:return r+"$property must be a valid ISO31661 Alpha2 code";case this.IS_ISO31661_ALPHA_3:return r+"$property must be a valid ISO31661 Alpha3 code";case this.IS_LATLONG:return r+"$property must be a latitude,longitude string";case this.IS_LATITUDE:return r+"$property must be a latitude string or number";case this.IS_LONGITUDE:return r+"$property must be a longitude string or number";case this.IS_MONGO_ID:return r+"$property must be a mongodb id";case this.IS_MULTIBYTE:return r+"$property must contain one or more multibyte chars";case this.IS_SURROGATE_PAIR:return r+"$property must contain any surrogate pairs chars";case this.IS_URL:return r+"$property must be an URL address";case this.IS_UUID:return r+"$property must be an UUID";case this.IS_UPPERCASE:return r+"$property must be uppercase";case this.LENGTH:return function(e){var t=null!==e.constraints[0]&&void 0!==e.constraints[0],n=null!==e.constraints[1]&&void 0!==e.constraints[1];return t&&(!e.value||e.value.lengthe.constraints[1]?r+"$property must be shorter than or equal to $constraint2 characters":r+"$property must be longer than or equal to $constraint1 and shorter than or equal to $constraint2 characters"};case this.MIN_LENGTH:return r+"$property must be longer than or equal to $constraint1 characters";case this.MAX_LENGTH:return r+"$property must be shorter than or equal to $constraint1 characters";case this.MATCHES:return r+"$property must match $constraint1 regular expression";case this.IS_MILITARY_TIME:return r+"$property must be a valid representation of military time in the format HH:MM";case this.IS_HASH:return r+"$property must be a hash of type $constraint1";case this.IS_ISSN:return r+"$property must be a ISSN";case this.ARRAY_CONTAINS:return r+"$property must contain $constraint1 values";case this.ARRAY_NOT_CONTAINS:return r+"$property should not contain $constraint1 values";case this.ARRAY_NOT_EMPTY:return r+"$property should not be empty";case this.ARRAY_MIN_SIZE:return r+"$property must contain at least $constraint1 elements";case this.ARRAY_MAX_SIZE:return r+"$property must contain not more than $constraint1 elements";case this.ARRAY_UNIQUE:return r+"All $property's elements must be unique";case this.IS_INSTANCE:return function(e){return e.constraints[0]?r+"$property must be an instance of "+e.constraints[0].name:r+(n.IS_INSTANCE+" decorator expects and object as value, but got falsy value.")}}return""},e.CUSTOM_VALIDATION="customValidation",e.NESTED_VALIDATION="nestedValidation",e.PROMISE_VALIDATION="promiseValidation",e.CONDITIONAL_VALIDATION="conditionalValidation",e.WHITELIST="whitelistValidation",e.IS_DEFINED="isDefined",e.EQUALS="equals",e.NOT_EQUALS="notEquals",e.IS_EMPTY="isEmpty",e.IS_NOT_EMPTY="isNotEmpty",e.IS_IN="isIn",e.IS_NOT_IN="isNotIn",e.IS_BOOLEAN="isBoolean",e.IS_DATE="isDate",e.IS_NUMBER="isNumber",e.IS_LATLONG="isLatLong",e.IS_LATITUDE="isLatitude",e.IS_LONGITUDE="isLongitude",e.IS_STRING="isString",e.IS_DATE_STRING="isDateString",e.IS_ARRAY="isArray",e.IS_INT="isInt",e.IS_ENUM="isEnum",e.IS_DIVISIBLE_BY="isDivisibleBy",e.IS_POSITIVE="isPositive",e.IS_NEGATIVE="isNegative",e.MIN="min",e.MAX="max",e.MIN_DATE="minDate",e.MAX_DATE="maxDate",e.IS_BOOLEAN_STRING="isBooleanString",e.IS_NUMBER_STRING="isNumberString",e.CONTAINS="contains",e.NOT_CONTAINS="notContains",e.IS_ALPHA="isAlpha",e.IS_ALPHANUMERIC="isAlphanumeric",e.IS_DECIMAL="isDecimal",e.IS_ASCII="isAscii",e.IS_BASE64="isBase64",e.IS_BYTE_LENGTH="isByteLength",e.IS_CREDIT_CARD="isCreditCard",e.IS_CURRENCY="isCurrency",e.IS_EMAIL="isEmail",e.IS_FQDN="isFqdn",e.IS_FULL_WIDTH="isFullWidth",e.IS_HALF_WIDTH="isHalfWidth",e.IS_VARIABLE_WIDTH="isVariableWidth",e.IS_HEX_COLOR="isHexColor",e.IS_HEXADECIMAL="isHexadecimal",e.IS_MAC_ADDRESS="isMacAddress",e.IS_IP="isIp",e.IS_PORT="isPort",e.IS_ISBN="isIsbn",e.IS_ISIN="isIsin",e.IS_ISO8601="isIso8601",e.IS_JSON="isJson",e.IS_JWT="isJwt",e.IS_OBJECT="isObject",e.IS_NOT_EMPTY_OBJECT="isNotEmptyObject",e.IS_LOWERCASE="isLowercase",e.IS_MOBILE_PHONE="isMobilePhone",e.IS_PHONE_NUMBER="isPhoneNumber",e.IS_ISO31661_ALPHA_2="isISO31661Alpha2",e.IS_ISO31661_ALPHA_3="isISO31661Alpha3",e.IS_MONGO_ID="isMongoId",e.IS_MULTIBYTE="isMultibyte",e.IS_SURROGATE_PAIR="isSurrogatePair",e.IS_URL="isUrl",e.IS_UUID="isUuid",e.LENGTH="length",e.IS_UPPERCASE="isUppercase",e.MIN_LENGTH="minLength",e.MAX_LENGTH="maxLength",e.MATCHES="matches",e.IS_MILITARY_TIME="isMilitaryTime",e.IS_HASH="isHash",e.IS_ISSN="isISSN",e.ARRAY_CONTAINS="arrayContains",e.ARRAY_NOT_CONTAINS="arrayNotContains",e.ARRAY_NOT_EMPTY="arrayNotEmpty",e.ARRAY_MIN_SIZE="arrayMinSize",e.ARRAY_MAX_SIZE="arrayMaxSize",e.ARRAY_UNIQUE="arrayUnique",e.IS_INSTANCE="isInstance",e}();t.ValidationTypes=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,i=new(function(){function e(){this.instances=[]}return e.prototype.get=function(e){var t=this.instances.find((function(t){return t.type===e}));return t||(t={type:e,object:new e},this.instances.push(t)),t.object},e}());t.useContainer=function(e,t){r=e,o=t},t.getFromContainer=function(e){if(r)try{var t=r.get(e);if(t)return t;if(!o||!o.fallback)return t}catch(e){if(!o||!o.fallbackOnErrors)throw e}return i.get(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(111);const r=n(1),o=n(17);class i{static obfuscate(e,t={}){const n=new o.InversifyContainerFacade;n.load(e,"",t);const i=n.get(r.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return n.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.6"?"0.24.6":"unknown"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12);function o(e){return"function"==typeof e?e.name:"symbol"==typeof e?e.toString():e}function i(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}t.getServiceIdentifierAsString=o,t.listRegisteredBindingsForServiceIdentifier=function(e,t,n){var r="",o=n(e,t);return 0!==o.length&&(r="\nRegistered bindings:",o.forEach((function(e){var t="Object";null!==e.implementationType&&(t=i(e.implementationType)),r=r+"\n "+t,e.constraint.metaData&&(r=r+" - "+e.constraint.metaData)}))),r},t.circularDependencyToException=function e(t){t.childRequests.forEach((function(t){if(function e(t,n){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===n||e(t.parentRequest,n))}(t,t.serviceIdentifier)){var n=function(e){return function e(t,n){void 0===n&&(n=[]);var r=o(t.serviceIdentifier);return n.push(r),null!==t.parentRequest?e(t.parentRequest,n):n}(e).reverse().join(" --\x3e ")}(t);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}e(t)}))},t.listMetadataForTarget=function(e,t){if(t.isTagged()||t.isNamed()){var n="",r=t.getNamedTag(),o=t.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==o&&o.forEach((function(e){n+=e.toString()+"\n"}))," "+e+"\n "+e+" - "+n}return" "+e},t.getFunctionName=i},function(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var a,s=t.isAbsolute(n),u=n.split(/\/+/),d=0,l=u.length-1;l>=0;l--)"."===(a=u[l])?u.splice(l,1):".."===a?d++:d>0&&(""===a?(u.splice(l+1,d),d=0):(u.splice(l,2),d--));return""===(n=u.join("/"))&&(n=s?"/":"."),r?(r.path=n,i(r)):n}function s(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),s=o(e);if(s&&(e=s.path||"/"),n&&!n.scheme)return s&&(n.scheme=s.scheme),i(n);if(n||t.match(r))return t;if(s&&!s.host&&!s.path)return s.host=t,i(s);var u="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=u,i(s)):u}t.urlParse=o,t.urlGenerate=i,t.normalize=a,t.join=s,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function d(e){return e}function l(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function c(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=u?d:function(e){return l(e)?"$"+e:e},t.fromSetString=u?d:function(e){return l(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=c(e.source,t.source);return 0!==r?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)||n?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:0!==(r=e.generatedLine-t.generatedLine)?r:c(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)||n?r:0!==(r=c(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)?r:c(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=c(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:0!==(n=e.originalColumn-t.originalColumn)?n:c(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var u=r.path.lastIndexOf("/");u>=0&&(r.path=r.path.substring(0,u+1))}t=s(i(r),t)}return a(t)}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(0),s=n(1);let u=class{constructor(e,t,n){this.identifierNamesGenerator=e(n),this.randomGenerator=t,this.options=n}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const n=this.customNodes.get(e);n&&t(n)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};u=r([a.injectable(),i(0,a.inject(s.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),i(1,a.inject(s.ServiceIdentifiers.IRandomGenerator)),i(2,a.inject(s.ServiceIdentifiers.IOptions)),o("design:paramtypes",[Function,Object,Object])],u),t.AbstractCustomNodeGroup=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(40);t.StringArrayEncoding=r.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=r,r.hexadecimalPrefix="0x"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(261),o=function(){function e(){this.validationMetadatas=[],this.constraintMetadatas=[]}return Object.defineProperty(e.prototype,"hasValidationMetaData",{get:function(){return!!this.validationMetadatas.length},enumerable:!0,configurable:!0}),e.prototype.addValidationSchema=function(e){var t=this;(new r.ValidationSchemaToMetadataTransformer).transform(e).forEach((function(e){return t.addValidationMetadata(e)}))},e.prototype.addValidationMetadata=function(e){this.validationMetadatas.push(e)},e.prototype.addConstraintMetadata=function(e){this.constraintMetadatas.push(e)},e.prototype.groupByPropertyName=function(e){var t={};return e.forEach((function(e){t[e.propertyName]||(t[e.propertyName]=[]),t[e.propertyName].push(e)})),t},e.prototype.getTargetValidationMetadatas=function(e,t,n){var r=this.validationMetadatas.filter((function(r){return(r.target===e||r.target===t)&&(!!r.always||(!(n&&n.length>0)||r.groups&&!!r.groups.find((function(e){return-1!==n.indexOf(e)}))))})),o=this.validationMetadatas.filter((function(t){return"string"!=typeof t.target&&(t.target!==e&&((!(t.target instanceof Function)||e.prototype instanceof t.target)&&(!!t.always||(!(n&&n.length>0)||t.groups&&!!t.groups.find((function(e){return-1!==n.indexOf(e)}))))))})).filter((function(e){return!r.find((function(t){return t.propertyName===e.propertyName&&t.type===e.type}))}));return r.concat(o)},e.prototype.getTargetValidatorConstraints=function(e){return this.constraintMetadatas.filter((function(t){return t.target===e}))},e}();t.MetadataStorage=o},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,n){"use strict";(function(t){var r=n(147); /*! * The buffer module from node.js, for the browser. * @@ -61,5 +61,5 @@ e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeo * @author Feross Aboukhadijeh * @license MIT */ -var r=n(373),o=n(374),i=n(375);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return j(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function d(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){for(var c=!0,p=0;po&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:d>223?3:d>191?2:1;if(o+c<=n)switch(c){case 1:d<128&&(l=d);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&d)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&d)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&d)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,c=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=c}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),d=this.slice(r,o),l=e.slice(t,n),c=0;co)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return S(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return C(this,e,t,n);case"latin1":case"binary":return N(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function $(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function x(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function w(e,t,n,r,i){return i||x(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return i||x(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||F(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):$(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):$(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);F(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);F(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):$(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):$(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return w(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return w(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(36))},function(e,t,n){"use strict";t.byteLength=function(e){var t=d(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=d(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,c=s>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<>1,l=-7,c=n?o-1:0,p=n?-1:1,g=e[t+c];for(c+=p,i=g&(1<<-l)-1,g>>=-l,l+=s;l>0;i=256*i+e[t+c],c+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+c],c+=p,l-=8);if(0===i)i=1-d;else{if(i===u)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,r),i-=d}return(g?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,d=8*i-o-1,l=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:i-1,h=r?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?p/u:p*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=l?(s=0,a=l):a+c>=1?(s=(t*u-1)*Math.pow(2,o),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,o),a=0));o>=8;e[n+g]=255&s,g+=h,s/=256,o-=8);for(a=a<0;e[n+g]=255&a,g+=h,a/=256,d-=8);e[n+g-h]|=128*f}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(t,"__esModule",{value:!0});let o=class{constructor(){this.stringsCache=new Map}encode(e,t){const n=`${e}-${String(t)}`;if(this.stringsCache.has(n))return this.stringsCache.get(n);const r=new RegExp("[\\s\\S]","g"),o=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const u=e.replace(r,e=>t||o.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(n,u),this.stringsCache.set(`${u}-${String(t)}`,u),u}};o=r([n(0).injectable()],o),t.EscapeSequenceEncoder=o},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(t,"__esModule",{value:!0});let o=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],n={};for(const r of e)void 0===n[r]&&this.visit(t,n,r);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const n of t){for(let t=n.length-1;t>=0;t-=1)n[t]===e&&n.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const n of e)this.hasPrecedents(n)||t.push(n);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const n=this.graph.get(t);return n&&!n.includes(e)&&n.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,n){const r=t[n];if("visiting"===r)throw new Error(`Detected cycle involving node: ${n}`);if(r)return;t[n]="visiting";const o=this.getPrecedents(n);for(const n of o)this.visit(e,t,n);t[n]="ok",e.push(n)}};o=r([n(0).injectable()],o),t.LevelledTopologicalSorter=o},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(0),s=n(1);let u=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),n=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of n)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const n=[];for(const r of e){const e=t[r].runAfter;if(e&&e.length)for(const o of e){void 0===t[o]?n.push([r,null]):n.push([o,r])}else n.push([r,null])}return n}};u=r([a.injectable(),i(0,a.inject(s.ServiceIdentifiers.ILevelledTopologicalSorter)),o("design:paramtypes",[Object])],u),t.NodeTransformerNamesGroupsBuilder=u},function(e,t,n){"use strict";var r,o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),d=n(1),l=s(n(56)),c=n(380),p=n(22),g=n(9),h=n(53),f=n(83),m=n(3);let b=r=class{constructor(e,t,n,r,o){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=n,this.logger=r,this.options=o}obfuscate(e){const t=Date.now();this.logger.info(c.LoggingMessage.Version,"0.24.5"),this.logger.info(c.LoggingMessage.ObfuscationStarted),this.logger.info(c.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const n=this.parseCode(e),r=this.transformAstTree(n),o=this.generateCode(e,r),i=(Date.now()-t)/1e3;return this.logger.success(c.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(o)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return f.ASTParserFacade.parse(t,r.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,g.TransformationStage.Initializing),!m.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,g.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,g.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,g.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,g.TransformationStage.Converting),e=this.runTransformationStage(e,g.TransformationStage.Obfuscating),e=this.runTransformationStage(e,g.TransformationStage.Finalizing)):(this.logger.warn(c.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const n=Object.assign({},r.escodegenParams);this.options.sourceMap&&(n.sourceMap=this.options.inputFileName||"sourceMap",n.sourceContent=e);const o=l.generate(t,Object.assign(Object.assign({},n),{format:{compact:this.options.compact}}));return o.map=o.map?o.map.toString():"",o}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(c.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,r.transformersList,t)}};b.parseOptions={ecmaVersion:h.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},b.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},b.transformersList=[p.NodeTransformer.BlockStatementControlFlowTransformer,p.NodeTransformer.CommentsTransformer,p.NodeTransformer.CustomNodesTransformer,p.NodeTransformer.DeadCodeInjectionTransformer,p.NodeTransformer.EvalCallExpressionTransformer,p.NodeTransformer.FunctionControlFlowTransformer,p.NodeTransformer.LabeledStatementTransformer,p.NodeTransformer.LiteralTransformer,p.NodeTransformer.MemberExpressionTransformer,p.NodeTransformer.MetadataTransformer,p.NodeTransformer.MethodDefinitionTransformer,p.NodeTransformer.ObfuscatingGuardsTransformer,p.NodeTransformer.ObjectExpressionKeysTransformer,p.NodeTransformer.ObjectExpressionTransformer,p.NodeTransformer.ParentificationTransformer,p.NodeTransformer.ScopeIdentifiersTransformer,p.NodeTransformer.SplitStringTransformer,p.NodeTransformer.TemplateLiteralTransformer,p.NodeTransformer.VariablePreserveTransformer],b=r=o([u.injectable(),a(0,u.inject(d.ServiceIdentifiers.ITransformersRunner)),a(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),a(2,u.inject(d.ServiceIdentifiers.Factory__IObfuscatedCode)),a(3,u.inject(d.ServiceIdentifiers.ILogger)),a(4,u.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",[Object,Object,Function,Object,Object])],b),t.JavaScriptObfuscator=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,n){"use strict";var r,o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),d=n(1),l=s(n(85)),c=n(382);let p=r=class{constructor(e){this.options=e}static log(e,t,n,r){const o=e(`\n${t} ${n}`);console.log(o,null!=r?r:"")}info(e,t){this.options.log&&r.log(r.colorInfo,c.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&r.log(r.colorSuccess,c.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&r.log(r.colorWarn,c.LoggingPrefix.Base,e,t)}};p.colorInfo=l.default.cyan,p.colorSuccess=l.default.green,p.colorWarn=l.default.yellow,p=r=o([u.injectable(),a(0,u.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",[Object])],p),t.Logger=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),a=o(n(384));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=r([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o="~";function i(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||e,i),u=o?o+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function d(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),d.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},d.prototype.listeners=function(e){var t=o?o+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,a=new Array(i);r=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(0),s=n(1),u=n(5),d=n(43);let l=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case d.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case d.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};r([u.initializable(),o("design:type",String)],l.prototype,"obfuscatedCode",void 0),r([u.initializable(),o("design:type",String)],l.prototype,"sourceMap",void 0),l=r([a.injectable(),i(0,a.inject(s.ServiceIdentifiers.ICryptUtils)),i(1,a.inject(s.ServiceIdentifiers.IOptions)),o("design:paramtypes",[Object,Object])],l),t.ObfuscatedCode=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const s=n(0),u=n(1),d=a(n(7)),l=n(388),c=n(3),p=n(16);let g=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,n){if(!t.length)return e;let r,o;this.cachedNodeTransformersData.has(t)?[r,o]=this.cachedNodeTransformersData.get(t):(r=this.buildNormalizedNodeTransformers(t),o=this.nodeTransformerNamesGroupsBuilder.build(r),this.cachedNodeTransformersData.set(t,[r,o]));for(const t of o){const o=[],i=[];for(const e of t){const t=r[e].getVisitor(n);t&&(t.enter&&o.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(o.length||i.length)&&d.replace(e,{enter:this.mergeVisitorsForDirection(o,l.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,l.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const n=e.length;return n?(r,o)=>{if(p.NodeMetadata.isIgnoredNode(r))return d.VisitorOption.Skip;for(let i=0;ie}};g=r([s.injectable(),i(0,s.inject(u.ServiceIdentifiers.Factory__INodeTransformer)),i(1,s.inject(u.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),o("design:paramtypes",[Function,Object])],g),t.TransformersRunner=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))}])})); +var r=n(373),o=n(374),i=n(375);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return j(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function d(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){for(var c=!0,p=0;po&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:d>223?3:d>191?2:1;if(o+c<=n)switch(c){case 1:d<128&&(l=d);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&d)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&d)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&d)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,c=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=c}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),d=this.slice(r,o),l=e.slice(t,n),c=0;co)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return S(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return C(this,e,t,n);case"latin1":case"binary":return N(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function $(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function x(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function w(e,t,n,r,i){return i||x(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return i||x(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||F(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):$(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):$(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);F(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);F(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):$(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):$(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return w(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return w(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(36))},function(e,t,n){"use strict";t.byteLength=function(e){var t=d(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=d(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,c=s>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<>1,l=-7,c=n?o-1:0,p=n?-1:1,g=e[t+c];for(c+=p,i=g&(1<<-l)-1,g>>=-l,l+=s;l>0;i=256*i+e[t+c],c+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+c],c+=p,l-=8);if(0===i)i=1-d;else{if(i===u)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,r),i-=d}return(g?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,d=8*i-o-1,l=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:i-1,h=r?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?p/u:p*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=l?(s=0,a=l):a+c>=1?(s=(t*u-1)*Math.pow(2,o),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,o),a=0));o>=8;e[n+g]=255&s,g+=h,s/=256,o-=8);for(a=a<0;e[n+g]=255&a,g+=h,a/=256,d-=8);e[n+g-h]|=128*f}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(t,"__esModule",{value:!0});let o=class{constructor(){this.stringsCache=new Map}encode(e,t){const n=`${e}-${String(t)}`;if(this.stringsCache.has(n))return this.stringsCache.get(n);const r=new RegExp("[\\s\\S]","g"),o=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const u=e.replace(r,e=>t||o.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(n,u),this.stringsCache.set(`${u}-${String(t)}`,u),u}};o=r([n(0).injectable()],o),t.EscapeSequenceEncoder=o},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(t,"__esModule",{value:!0});let o=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],n={};for(const r of e)void 0===n[r]&&this.visit(t,n,r);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const n of t){for(let t=n.length-1;t>=0;t-=1)n[t]===e&&n.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const n of e)this.hasPrecedents(n)||t.push(n);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const n=this.graph.get(t);return n&&!n.includes(e)&&n.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,n){const r=t[n];if("visiting"===r)throw new Error(`Detected cycle involving node: ${n}`);if(r)return;t[n]="visiting";const o=this.getPrecedents(n);for(const n of o)this.visit(e,t,n);t[n]="ok",e.push(n)}};o=r([n(0).injectable()],o),t.LevelledTopologicalSorter=o},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(0),s=n(1);let u=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),n=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of n)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const n=[];for(const r of e){const e=t[r].runAfter;if(e&&e.length)for(const o of e){void 0===t[o]?n.push([r,null]):n.push([o,r])}else n.push([r,null])}return n}};u=r([a.injectable(),i(0,a.inject(s.ServiceIdentifiers.ILevelledTopologicalSorter)),o("design:paramtypes",[Object])],u),t.NodeTransformerNamesGroupsBuilder=u},function(e,t,n){"use strict";var r,o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),d=n(1),l=s(n(56)),c=n(380),p=n(22),g=n(9),h=n(53),f=n(83),m=n(3);let b=r=class{constructor(e,t,n,r,o){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=n,this.logger=r,this.options=o}obfuscate(e){const t=Date.now();this.logger.info(c.LoggingMessage.Version,"0.24.6"),this.logger.info(c.LoggingMessage.ObfuscationStarted),this.logger.info(c.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const n=this.parseCode(e),r=this.transformAstTree(n),o=this.generateCode(e,r),i=(Date.now()-t)/1e3;return this.logger.success(c.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(o)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return f.ASTParserFacade.parse(t,r.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,g.TransformationStage.Initializing),!m.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,g.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,g.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,g.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,g.TransformationStage.Converting),e=this.runTransformationStage(e,g.TransformationStage.Obfuscating),e=this.runTransformationStage(e,g.TransformationStage.Finalizing)):(this.logger.warn(c.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const n=Object.assign({},r.escodegenParams);this.options.sourceMap&&(n.sourceMap=this.options.inputFileName||"sourceMap",n.sourceContent=e);const o=l.generate(t,Object.assign(Object.assign({},n),{format:{compact:this.options.compact}}));return o.map=o.map?o.map.toString():"",o}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(c.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,r.transformersList,t)}};b.parseOptions={ecmaVersion:h.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},b.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},b.transformersList=[p.NodeTransformer.BlockStatementControlFlowTransformer,p.NodeTransformer.CommentsTransformer,p.NodeTransformer.CustomNodesTransformer,p.NodeTransformer.DeadCodeInjectionTransformer,p.NodeTransformer.EvalCallExpressionTransformer,p.NodeTransformer.FunctionControlFlowTransformer,p.NodeTransformer.LabeledStatementTransformer,p.NodeTransformer.LiteralTransformer,p.NodeTransformer.MemberExpressionTransformer,p.NodeTransformer.MetadataTransformer,p.NodeTransformer.MethodDefinitionTransformer,p.NodeTransformer.ObfuscatingGuardsTransformer,p.NodeTransformer.ObjectExpressionKeysTransformer,p.NodeTransformer.ObjectExpressionTransformer,p.NodeTransformer.ParentificationTransformer,p.NodeTransformer.ScopeIdentifiersTransformer,p.NodeTransformer.SplitStringTransformer,p.NodeTransformer.TemplateLiteralTransformer,p.NodeTransformer.VariablePreserveTransformer],b=r=o([u.injectable(),a(0,u.inject(d.ServiceIdentifiers.ITransformersRunner)),a(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),a(2,u.inject(d.ServiceIdentifiers.Factory__IObfuscatedCode)),a(3,u.inject(d.ServiceIdentifiers.ILogger)),a(4,u.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",[Object,Object,Function,Object,Object])],b),t.JavaScriptObfuscator=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,n){"use strict";var r,o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),d=n(1),l=s(n(85)),c=n(382);let p=r=class{constructor(e){this.options=e}static log(e,t,n,r){const o=e(`\n${t} ${n}`);console.log(o,null!=r?r:"")}info(e,t){this.options.log&&r.log(r.colorInfo,c.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&r.log(r.colorSuccess,c.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&r.log(r.colorWarn,c.LoggingPrefix.Base,e,t)}};p.colorInfo=l.default.cyan,p.colorSuccess=l.default.green,p.colorWarn=l.default.yellow,p=r=o([u.injectable(),a(0,u.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",[Object])],p),t.Logger=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),a=o(n(384));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=r([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o="~";function i(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||e,i),u=o?o+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function d(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),d.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},d.prototype.listeners=function(e){var t=o?o+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,a=new Array(i);r=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(0),s=n(1),u=n(5),d=n(43);let l=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case d.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case d.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};r([u.initializable(),o("design:type",String)],l.prototype,"obfuscatedCode",void 0),r([u.initializable(),o("design:type",String)],l.prototype,"sourceMap",void 0),l=r([a.injectable(),i(0,a.inject(s.ServiceIdentifiers.ICryptUtils)),i(1,a.inject(s.ServiceIdentifiers.IOptions)),o("design:paramtypes",[Object,Object])],l),t.ObfuscatedCode=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const s=n(0),u=n(1),d=a(n(7)),l=n(388),c=n(3),p=n(16);let g=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,n){if(!t.length)return e;let r,o;this.cachedNodeTransformersData.has(t)?[r,o]=this.cachedNodeTransformersData.get(t):(r=this.buildNormalizedNodeTransformers(t),o=this.nodeTransformerNamesGroupsBuilder.build(r),this.cachedNodeTransformersData.set(t,[r,o]));for(const t of o){const o=[],i=[];for(const e of t){const t=r[e].getVisitor(n);t&&(t.enter&&o.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(o.length||i.length)&&d.replace(e,{enter:this.mergeVisitorsForDirection(o,l.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,l.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const n=e.length;return n?(r,o)=>{if(p.NodeMetadata.isIgnoredNode(r))return d.VisitorOption.Skip;for(let i=0;ie}};g=r([s.injectable(),i(0,s.inject(u.ServiceIdentifiers.Factory__INodeTransformer)),i(1,s.inject(u.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),o("design:paramtypes",[Function,Object])],g),t.TransformersRunner=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))}])})); //# sourceMappingURL=index.browser.js.map \ No newline at end of file diff --git a/dist/index.cli.js b/dist/index.cli.js index 4d030cf6..e24d0014 100644 --- a/dist/index.cli.js +++ b/dist/index.cli.js @@ -21,5 +21,5 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -require("source-map-support").install(),module.exports=function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=241)}([function(e,t){e.exports=require("inversify")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(33);class n{static isArrayPatternNode(e){return e.type===r.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===r.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===r.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===r.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===r.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===r.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===r.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===r.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===r.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===r.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===r.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===r.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===r.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return n.isFunctionDeclarationNode(e)||n.isFunctionExpressionNode(e)||n.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===r.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===r.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===r.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===r.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===r.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const o=n.isLabeledStatementNode(t)&&t.label===e,r=n.isContinueStatementNode(t)&&t.label===e,i=n.isBreakStatementNode(t)&&t.label===e;return o||r||i}static isLabeledStatementNode(e){return e.type===r.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===r.NodeType.Literal}static isMemberExpressionNode(e){return e.type===r.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===r.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return n.isProgramNode(e)||n.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return n.isNodeWithLexicalScope(e)||n.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return n.isProgramNode(e)||n.isBlockStatementNode(e)&&n.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return n.isProgramNode(e)||n.isBlockStatementNode(e)||n.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===r.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===r.NodeType.ObjectExpression}static isProgramNode(e){return e.type===r.NodeType.Program}static isPropertyNode(e){return e.type===r.NodeType.Property}static parentNodeIsPropertyNode(e,t){return n.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return n.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return n.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===r.NodeType.RestElement}static isReturnStatementNode(e){return e.type===r.NodeType.ReturnStatement}static isSuperNode(e){return e.type===r.NodeType.Super}static isSwitchCaseNode(e){return e.type===r.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===r.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===r.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===r.NodeType.UnaryExpression}static isUseStrictOperator(e){return n.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===r.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===r.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===r.NodeType.WhileStatement}}t.NodeGuards=n,n.nodesWithLexicalStatements=[r.NodeType.ArrowFunctionExpression,r.NodeType.FunctionDeclaration,r.NodeType.FunctionExpression,r.NodeType.MethodDefinition]},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(46)),i=r(o(13)),a=o(43),s=o(55),c=o(4),d=o(15);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:n.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),c.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+n.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return c.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(o=>{if("parentNode"===o)return;const r=e[o];let n;n=null===r||r instanceof RegExp?r:Array.isArray(r)?r.map(l.cloneRecursive):"object"==typeof r?l.cloneRecursive(r):r,t[o]=n}),t}}t.NodeUtils=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={configurable:!0,enumerable:!0};function n(e,t,o){Reflect.hasMetadata(e,o)||Reflect.defineMetadata(e,t,o)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(o,i)=>{const a=o[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return n("_initialized",!1,o),n("_initializablePropertiesSet",new Set,o),n("_wrappedMethodsSet",new Set,o),function(e,t){const o=Object.getOwnPropertyNames(e),n=[t,"constructor"];o.forEach(o=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(n.includes(o)||a.has(o)||s.has(o))return;if("function"!=typeof e[o])return;const c=null!==(i=Object.getOwnPropertyDescriptor(e,o))&&void 0!==i?i:r,d=c.value;Object.defineProperty(e,o,Object.assign(Object.assign({},c),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(o)})}(o,e),function(e,t,o){var n;const i=null!==(n=Object.getOwnPropertyDescriptor(e,t))&&void 0!==n?n:r,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[o],e}}))}(o,e,i),function(e,t){var o;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const n=`_${t.toString()}`,i=null!==(o=Object.getOwnPropertyDescriptor(e,n))&&void 0!==o?o:r;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[n])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[n]},set:function(e){this[n]=e}})),i}(o,i)}}},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(46)),i=o(33);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,o){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,o){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,o){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:o,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,o){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},o&&{alternate:o}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:n.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,o){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,o=!1){return{type:i.NodeType.MemberExpression,computed:o,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,o,r){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:o,computed:r,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,o=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:o,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,o=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:o,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(113),N=o(114);let b=r=class{constructor(e,t,o,r){this.cachedNode=null,this.identifierNamesGenerator=e(r),this.customNodeFormatter=t,this.randomGenerator=o,this.options=r}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(r.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};b.globalVariableTemplateFunctions=[h.GlobalVariableTemplate1(),N.GlobalVariableTemplate2()],b=r=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],b),t.AbstractCustomNode=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3);let f=class{constructor(e,t){this.randomGenerator=e,this.options=t}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractNodeTransformer=f},function(e,t){e.exports=require("estraverse")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static getParentNodeWithStatements(e){return n.getParentNodesWithStatementsRecursive(e,1)[0]}static getParentNodesWithStatements(e){return n.getParentNodesWithStatementsRecursive(e)}static getNextSiblingStatement(e){return n.getSiblingStatementByOffset(e,1)}static getPreviousSiblingStatement(e){return n.getSiblingStatementByOffset(e,-1)}static getRootStatementOfNode(e){if(r.NodeGuards.isProgramNode(e))throw new Error("Unable to find root statement for `Program` node");const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithStatements(t)?e:n.getRootStatementOfNode(t)}static getScopeOfNode(e){const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithStatements(t)?t:n.getScopeOfNode(t)}static getParentNodesWithStatementsRecursive(e,t=1/0,o=[],i=0){if(o.length>=t)return o;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(r.NodeGuards.isProgramNode(e)||r.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&o.push(e),e!==a?n.getParentNodesWithStatementsRecursive(a,t,o,++i):o}static getSiblingStatementByOffset(e,t){const o=n.getScopeOfNode(e),i=r.NodeGuards.isSwitchCaseNode(o)?o.consequent:o.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static set(e,t){var o;e.metadata=Object.assign(null!==(o=e.metadata)&&void 0!==o?o:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===r.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===r.get(e,"replacedLiteral")}}t.NodeMetadata=r},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(72),a=o(82),s=o(95),c=o(106),d=o(156),l=o(157),u=o(161),f=o(162),p=o(173),m=o(195),g=o(210),y=o(215),h=o(225),N=o(70),b=o(229),v=o(231),I=o(232),S=o(233);t.InversifyContainerFacade=class{constructor(){this.container=new r.Container}static getFactory(e){return t=>o=>t.container.getNamed(e,o)}static getCacheFactory(e){return t=>{const o=new Map;return r=>{if(o.has(r))return o.get(r);const n=t.container.getNamed(e,r);return o.set(r,n),n}}}static getConstructorFactory(e,...t){return o=>{const r=new Map,n=[];return i=>{if(t.forEach((e,t)=>{n[t]||(n[t]=o.container.get(e))}),r.has(i))return new(r.get(i))(...n);const a=o.container.getNamed(e,i);return r.set(i,a),new a(...n)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,o){this.container.bind(n.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new I.SourceCode(e,t)).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>o).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ILogger).to(N.Logger).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IJavaScriptObfuscator).to(h.JavaScriptObfuscator).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ITransformersRunner).to(S.TransformersRunner).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IObfuscatedCode).to(v.ObfuscatedCode),this.container.bind(n.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,o)=>{const r=e.container.get(n.ServiceIdentifiers.IObfuscatedCode);return r.initialize(t,o),r}),this.container.bind(n.ServiceIdentifiers.IObfuscationEventEmitter).to(b.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(c.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(u.nodeTransformersModule),this.container.load(f.obfuscatingTransformersModule),this.container.load(p.optionsModule),this.container.load(m.preparingTransformersModule),this.container.load(g.storagesModule),this.container.load(y.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static append(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e),...t])}static appendToOptimalBlockScope(e,t,o,r=0){const i=e.length?n.getOptimalBlockScope(e,r):t;n.prepend(i,o)}static getOptimalBlockScope(e,t,o=1/0){const r=e[t];if(o<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return o>1&&r.callsGraph.length?n.getOptimalBlockScope(r.callsGraph,0,--o):r.callee}static insertBefore(e,t,o){const r=n.getScopeStatements(e).indexOf(o);n.insertAtIndex(e,t,r)}static insertAfter(e,t,o){const r=n.getScopeStatements(e).indexOf(o);n.insertAtIndex(e,t,r+1)}static insertAtIndex(e,t,o){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e).slice(0,o),...t,...n.getScopeStatements(e).slice(o)])}static prepend(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...t,...n.getScopeStatements(e)])}static getScopeStatements(e){return r.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){r.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.ObfuscationTarget=r.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.StringArrayEncoding=r.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(69);const r=o(1),n=o(16);class i{static obfuscate(e,t={}){const o=new n.InversifyContainerFacade;o.load(e,"",t);const i=o.get(r.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return o.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.5"?"0.24.5":"unknown"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(5),f=o(2),p=o(3);let m=class{constructor(e,t,o){this.identifierNamesGenerator=e(o),this.randomGenerator=t,this.options=o}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const o=this.customNodes.get(e);o&&t(o)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==u.TIdentifierNamesGeneratorFactory&&u.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],m),t.AbstractCustomNodeGroup=m},function(e,t){e.exports=require("@gradecam/tsenum")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=r,r.hexadecimalPrefix="0x"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.IdentifierNamesGenerator=r.MakeEnum({DictionaryIdentifierNamesGenerator:"dictionary",HexadecimalIdentifierNamesGenerator:"hexadecimal",MangledIdentifierNamesGenerator:"mangled"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.SourceMapMode=r.MakeEnum({Inline:"inline",Separate:"separate"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31),n=o(20),i=o(32);t.NO_ADDITIONAL_NODES_PRESET=Object.freeze({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:r.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!1,seed:0,selfDefending:!1,shuffleStringArray:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:0,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NumberUtils=class{static toHex(e){return e.toString(16)}static isCeil(e){return e%1==0}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(2);let l=class{constructor(e){this.options=e}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IOptions&&d.IOptions)?r:Object])],l),t.AbstractObfuscatingReplacer=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31),n=o(20),i=o(32);t.DEFAULT_PRESET=Object.freeze({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:r.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!0,seed:0,selfDefending:!1,shuffleStringArray:!0,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:10,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Dot=".",e.Comma=","}(t.StringSeparator||(t.StringSeparator={}))},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{};n=r([o(0).injectable()],n),t.AbstractCalleeDataExtractor=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecmaVersion=11},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);t.NodeLiteralUtils=class{static isProhibitedLiteralNode(e,t){return!(!r.NodeGuards.isPropertyNode(t)||t.computed||t.key!==e)||!!r.NodeGuards.isImportDeclarationNode(t)}}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3);let g=r=class{constructor(e,t,o){this.replacerDataByControlFlowStorageId=new Map,this.controlFlowCustomNodeFactory=e,this.randomGenerator=t,this.options=o}static getStorageKeysByIdForCurrentStorage(e,t){let o;return o=e.has(t)?e.get(t):new Map,o}insertCustomNodeToControlFlowStorage(e,t,o,n){const i=t.getStorageId(),a=r.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,i),s=a.get(o);if(this.randomGenerator.getMathRandom(){const o=this.randomGenerator.getRandomString(e);return t.getStorage().has(o)?c(e):o},d=c(5);return a.set(o,[d]),this.replacerDataByControlFlowStorageId.set(i,a),t.set(d,e),d}};g=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],g),t.AbstractControlFlowReplacer=g},function(e,t){e.exports=require("escodegen")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n const that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3);let f=class{constructor(e,t){this.preservedNamesSet=new Set,this.randomGenerator=e,this.options=t}preserveName(e){this.preservedNamesSet.add(e)}isValidIdentifierName(e){return this.notReservedName(e)&&!this.preservedNamesSet.has(e)}notReservedName(e){return!this.options.reservedNames.length||!this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractIdentifierNamesGenerator=f},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(7);let m=class{constructor(e,t){this.randomGenerator=e,this.options=t}initialize(){this.storage=new Map,this.storageId=this.randomGenerator.getRandomString(6)}get(e){return this.storage.get(e)}getOrThrow(e){const t=this.get(e);if(!t)throw new Error(`No value found in map storage with key \`${e}\``);return t}getKeyOf(e){for(const[t,o]of this.storage)if(e===o)return t;return null}getLength(){return this.storage.size}getStorage(){return this.storage}getStorageId(){return this.storageId}has(e){return this.storage.has(e)}mergeWith(e,t=!1){this.storage=new Map([...this.storage,...e.getStorage()]),t&&(this.storageId=e.getStorageId())}set(e,t){this.storage.set(e,t)}};a([p.initializable(),s("design:type",String)],m.prototype,"storageId",void 0),a([p.initializable(),s("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],m.prototype,"storage",void 0),a([d.postConstruct(),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],m.prototype,"initialize",null),m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MapStorage=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(17),f=o(2),p=o(3),m=o(18),g=o(45),y=o(4);let h=class extends g.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}getControlFlowStorageCallNode(e,t,o,r){const n=this.controlFlowCustomNodeFactory(m.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);n.initialize(e,t,o,r);const i=n.getNode()[0];if(!i||!y.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};h=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==u.TControlFlowCustomNodeFactory&&u.TControlFlowCustomNodeFactory)?r:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],h),t.ExpressionWithOperatorControlFlowReplacer=h},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(o(85)),a=n(o(86)),s=n(o(56));class c{static parse(e,t){const o=c.sourceTypes.length;for(let r=0;r"),u=`...${i.substring(s,d).replace(/^\s+/,"")}...`;throw new Error(`ERROR in ${a}line ${o.line}: ${t}\n${l} ${u}`)}}t.ASTParserFacade=c,c.colorError=s.default.red,c.nearestSymbolsCount=15,c.sourceTypes=["script","module"]},function(e,t){e.exports=require("chalk")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BasePropertiesExtractor="BasePropertiesExtractor",e.ObjectExpressionToVariableDeclarationExtractor="ObjectExpressionToVariableDeclarationExtractor"}(t.ObjectExpressionExtractor||(t.ObjectExpressionExtractor={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ObjectExpressionVariableDeclarationHostNode="ObjectExpressionVariableDeclarationHostNode"}(t.ObjectExpressionKeysTransformerCustomNode||(t.ObjectExpressionKeysTransformerCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t){e.exports=require("class-validator")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListObfuscatingGuard="BlackListObfuscatingGuard",e.ConditionalCommentObfuscatingGuard="ConditionalCommentObfuscatingGuard",e.ReservedStringObfuscatingGuard="ReservedStringObfuscatingGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(4);let s=r=class{constructor(){this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}static isConditionalComment(e){return r.obfuscationEnableCommentRegExp.test(e.value)||r.obfuscationDisableCommentRegExp.test(e.value)}check(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!a.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;const t=e.leadingComments,o=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),o&&(this.obfuscationAllowedForNextNode=this.checkComments(o)),this.obfuscationAllowedForCurrentNode}checkComments(e){const t=e.length;let o=this.obfuscationAllowedForCurrentNode;for(let n=0;n=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(218)),m=o(219),g=o(2),y=o(220),h=o(7);let N=r=class{constructor(e,t){this.sourceCode=e,this.options=t}initialize(){this.randomGenerator=new m.Chance(this.getRawSeed())}getMathRandom(){return this.getRandomInteger(0,99999)/1e5}getRandomGenerator(){return this.randomGenerator}getRandomInteger(e,t){return this.getRandomGenerator().integer({min:e,max:t})}getRandomString(e,t=r.randomGeneratorPool){return this.getRandomGenerator().string({length:e,pool:t})}getInputSeed(){return this.options.seed.toString()}getRawSeed(){const e=this.getInputSeed();return`${e}`.split("|").length>1?e:`${e}|${p.default(this.sourceCode.getSourceCode())}`}};N.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s([h.initializable(),c("design:type","function"==typeof(n=void 0!==m.Chance&&m.Chance.Chance)?n:Object)],N.prototype,"randomGenerator",void 0),s([u.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],N.prototype,"initialize",null),N=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.ISourceCode)),d(1,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(i=void 0!==y.ISourceCode&&y.ISourceCode)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],N),t.RandomGenerator=N},function(e,t){e.exports=require("reflect-metadata")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(56)),f=o(2),p=o(71);let m=r=class{constructor(e){this.options=e}static log(e,t,o,r){const n=e(`\n${t} ${o}`);console.log(n,null!=r?r:"")}info(e,t){this.options.log&&r.log(r.colorInfo,p.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&r.log(r.colorSuccess,p.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&r.log(r.colorWarn,p.LoggingPrefix.Base,e,t)}};m.colorInfo=u.default.cyan,m.colorSuccess=u.default.green,m.colorWarn=u.default.yellow,m=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IOptions&&f.IOptions)?n:Object])],m),t.Logger=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(52),s=o(73),c=o(75),d=o(76),l=o(77),u=o(78),f=o(79),p=o(81);t.analyzersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICallsGraphAnalyzer).to(s.CallsGraphAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer).to(u.PrevailingKindOfVariablesAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IScopeAnalyzer).to(f.ScopeAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IStringArrayStorageAnalyzer).to(p.StringArrayStorageAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(d.FunctionExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(l.ObjectExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(74),p=o(52),m=o(4),g=o(14);let y=r=class{constructor(e){this.calleeDataExtractorFactory=e}static getLimitIndex(e){const t=e-1,o=r.limitThresholdActivationLength-1;let n=t;return t>o&&(n=Math.round(o+t*r.limitThreshold),n>t&&(n=t)),n}analyze(e){return this.analyzeRecursive(e.body)}analyzeRecursive(e){const t=r.getLimitIndex(e.length),o=[],n=e.length;for(let r=0;rt);r++){const t=e[r];u.traverse(t,{enter:r=>{if(m.NodeGuards.isCallExpressionNode(r))return t.parentNode!==g.NodeStatementUtils.getParentNodeWithStatements(r)?u.VisitorOption.Skip:void this.analyzeCallExpressionNode(o,e,r)}})}return o}analyzeCallExpressionNode(e,t,o){r.calleeDataExtractorsList.forEach(r=>{const n=this.calleeDataExtractorFactory(r).extract(t,o.callee);n&&e.push(Object.assign(Object.assign({},n),{callsGraph:this.analyzeRecursive(n.callee.body)}))})}};y.calleeDataExtractorsList=[p.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,p.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,p.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],y.limitThresholdActivationLength=25,y.limitThreshold=.002,y=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__ICalleeDataExtractor)),a("design:paramtypes",["function"==typeof(n=void 0!==f.TCalleeDataExtractorFactory&&f.TCalleeDataExtractorFactory)?n:Object])],y),t.CallsGraphAnalyzer=y},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(13)),s=o(42),c=o(4),d=o(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){if(!c.NodeGuards.isIdentifierNode(t))return null;const o=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name);return o?{callee:o,name:t.name}:null}getCalleeBlockStatement(e,t){let o=null;return a.traverse(e,{enter:e=>{if(c.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return o=e.body,a.VisitorOption.Break}}),o}};l=r([i.injectable()],l),t.FunctionDeclarationCalleeDataExtractor=l},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(13)),s=o(42),c=o(4),d=o(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){var o;let r=null;return c.NodeGuards.isIdentifierNode(t)&&(r=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name)),c.NodeGuards.isFunctionExpressionNode(t)&&(r=t.body),r?{callee:r,name:null!==(o=t.name)&&void 0!==o?o:null}:null}getCalleeBlockStatement(e,t){let o=null;return a.traverse(e,{enter:(e,r)=>{if(c.NodeGuards.isFunctionExpressionNode(e)&&r&&c.NodeGuards.isVariableDeclaratorNode(r)&&c.NodeGuards.isIdentifierNode(r.id)&&r.id.name===t)return o=e.body,a.VisitorOption.Break}}),o}};l=r([i.injectable()],l),t.FunctionExpressionCalleeDataExtractor=l},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=i(o(13)),c=o(42),d=o(4),l=o(14);let u=r=class extends c.AbstractCalleeDataExtractor{static isValidTargetPropertyNode(e,t){if(!e.key)return!1;const o=d.NodeGuards.isIdentifierNode(e.key)&&e.key.name===t,r=d.NodeGuards.isLiteralNode(e.key)&&Boolean(e.key.value)&&e.key.value===t;return o||r}extract(e,t){if(!d.NodeGuards.isMemberExpressionNode(t))return null;const o=this.createObjectMembersCallsChain([],t);if(!o.length)return null;const r=o[o.length-1],n=this.getCalleeBlockStatement(l.NodeStatementUtils.getParentNodeWithStatements(e[0]),o);return n?{callee:n,name:r}:null}createObjectMembersCallsChain(e,t){if(d.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!d.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return d.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(d.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}getCalleeBlockStatement(e,t){const o=t.shift();if(!o)return null;let r=null;return s.traverse(e,{enter:e=>{if(d.NodeGuards.isVariableDeclaratorNode(e)&&d.NodeGuards.isIdentifierNode(e.id)&&e.init&&d.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===o)return r=this.findCalleeBlockStatement(e.init.properties,t),s.VisitorOption.Break}}),r}findCalleeBlockStatement(e,t){const o=t.shift();if(!o)return null;for(const n of e)if(r.isValidTargetPropertyNode(n,o)){if(d.NodeGuards.isObjectExpressionNode(n.value))return this.findCalleeBlockStatement(n.value.properties,t);if(d.NodeGuards.isFunctionExpressionNode(n.value))return n.value.body}return null}};u=r=n([a.injectable()],u),t.ObjectExpressionCalleeDataExtractor=u},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(34),p=o(4);let m=r=class{constructor(e){this.prevailingKindOfVariables=r.defaultKindOfVariables,this.arrayUtils=e}analyze(e){var t;const o=[];u.traverse(e,{enter:e=>{p.NodeGuards.isVariableDeclarationNode(e)&&o.push(e.kind)}}),this.prevailingKindOfVariables=null!==(t=this.arrayUtils.findMostOccurringElement(o))&&void 0!==t?t:r.defaultKindOfVariables}getPrevailingKind(){return this.prevailingKindOfVariables}};m.defaultKindOfVariables="var",m=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IArrayUtils)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IArrayUtils&&f.IArrayUtils)?n:Object])],m),t.PrevailingKindOfVariablesAnalyzer=m},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=i(o(80)),c=i(o(13)),d=o(43),l=o(4);let u=r=class{constructor(){this.scopeManager=null}static attachMissingRanges(e){c.replace(e,{enter:e=>(e.range||(e.range=[r.emptyRangeValue,r.emptyRangeValue]),e)})}static isRootNode(e){return l.NodeGuards.isProgramNode(e)||e.parentNode===e}analyze(e){const t=r.sourceTypes.length;r.attachMissingRanges(e);for(let o=0;o{if("class"===e.type&&e.upper){if(!e.variables.length)return;const t=e.variables[0],o=e.upper.variables.find(e=>t.defs.some(e=>"ClassName"===e.type)&&e.name===t.name);null==o||o.references.push(...e.variables[0].references)}});for(const t of e.childScopes)this.sanitizeScopes(t)}};u.eslintScopeOptions={ecmaVersion:d.ecmaVersion,optimistic:!0},u.sourceTypes=["script","module"],u.emptyRangeValue=0,u=r=n([a.injectable()],u),t.ScopeAnalyzer=u},function(e,t){e.exports=require("eslint-scope")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(13)),m=o(2),g=o(3),y=o(35),h=o(4),N=o(15),b=o(44);let v=r=class{constructor(e,t,o){this.stringArrayStorageData=new Map,this.stringArrayStorage=e,this.randomGenerator=t,this.options=o}analyze(e){this.options.stringArray&&p.traverse(e,{enter:(e,t)=>{if(t)return N.NodeMetadata.isIgnoredNode(e)?p.VisitorOption.Skip:void(h.NodeGuards.isLiteralNode(e)&&this.analyzeLiteralNode(e,t))}})}getItemDataForLiteralNode(e){return this.stringArrayStorageData.get(e)}analyzeLiteralNode(e,t){"string"==typeof e.value&&(b.NodeLiteralUtils.isProhibitedLiteralNode(e,t)||this.shouldAddValueToStringArray(e.value)&&this.stringArrayStorageData.set(e,this.stringArrayStorage.getOrThrow(e.value)))}shouldAddValueToStringArray(e){return e.length>=r.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}};v.minimumLengthForStringArray=3,v=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.IStringArrayStorage)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==y.IStringArrayStorage&&y.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==m.IOptions&&m.IOptions)?a:Object])],v),t.StringArrayStorageAnalyzer=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(53),s=o(21),c=o(83),d=o(84),l=o(87),u=o(88),f=o(90),p=o(93),m=o(94);t.controlFlowTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(l.CallExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(i.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(54);let h=r=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.BinaryExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a,e.left,e.right)}};h.usingExistingIdentifierChance=.5,h=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.BinaryExpressionControlFlowReplacer=h},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(17),y=o(34),h=o(2),N=o(3),b=o(18),v=o(11),I=o(12),S=o(4),O=o(6);let j=r=class extends I.AbstractNodeTransformer{constructor(e,t,o,r){super(o,r),this.controlFlowCustomNodeFactory=e,this.arrayUtils=t}static isProhibitedStatementNode(e){const t=S.NodeGuards.isBreakStatementNode(e)||S.NodeGuards.isContinueStatementNode(e),o=S.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),r=S.NodeGuards.isClassDeclarationNode(e);return S.NodeGuards.isFunctionDeclarationNode(e)||t||o||r}static canTransformBlockStatementNode(e){let t=!0;return m.traverse(e,{enter:e=>{if(S.NodeGuards.isWhileStatementNode(e))return m.VisitorOption.Skip;r.isProhibitedStatementNode(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}getVisitor(e){switch(e){case v.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&S.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!r.canTransformBlockStatementNode(e))return e;const o=e.body,n=this.arrayUtils.createWithRange(o.length),i=this.arrayUtils.shuffle(n),a=n.map(e=>i.indexOf(e)),s=this.controlFlowCustomNodeFactory(b.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);s.initialize(o,i,a);const c=s.getNode()[0];return O.NodeUtils.parentizeNode(c,t),c}};j=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IControlFlowCustomNode)),l(1,f.inject(p.ServiceIdentifiers.IArrayUtils)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TControlFlowCustomNodeFactory&&g.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==h.IOptions&&h.IOptions)?s:Object])],j),t.BlockStatementControlFlowTransformer=j},function(e,t){e.exports=require("acorn")},function(e,t){e.exports=require("acorn-import-meta")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(45),h=o(4);let N=r=class extends y.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){const n=e.callee;if(!h.NodeGuards.isIdentifierNode(n))return e;const i=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionFunctionNode),s=e.arguments;a.initialize(s);const c=this.insertCustomNodeToControlFlowStorage(a,o,i,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),c,n,s)}getControlFlowStorageCallNode(e,t,o,r){const n=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);n.initialize(e,t,o,r);const i=n.getNode()[0];if(!i||!h.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};N.usingExistingIdentifierChance=.5,N=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.CallExpressionControlFlowReplacer=N},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(89),y=o(2),h=o(3),N=o(57),b=o(58),v=o(21),I=o(33),S=o(11),O=o(12),j=o(8),_=o(4),C=o(14),R=o(6);let F=r=class extends O.AbstractNodeTransformer{constructor(e,t,o,r){super(o,r),this.deadCodeInjectionRootAstHostNodeSet=new Set,this.collectedBlockStatements=[],this.collectedBlockStatementsTotalLength=0,this.deadCodeInjectionCustomNodeFactory=e,this.transformersRunner=t}static isProhibitedNodeInsideCollectedBlockStatement(e){return _.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e)||_.NodeGuards.isAwaitExpressionNode(e)||_.NodeGuards.isSuperNode(e)}static isScopeHoistingFunctionDeclaration(e){if(!_.NodeGuards.isFunctionDeclarationNode(e))return!1;const t=C.NodeStatementUtils.getScopeOfNode(e),o=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,r=o.indexOf(e);if(0===r)return!1;const n=o.slice(0,r),i=j.NodeFactory.blockStatementNode(n),a=e.id.name;let s=!1;return m.traverse(i,{enter:e=>{if(_.NodeGuards.isIdentifierNode(e)&&e.name===a)return s=!0,m.VisitorOption.Break}}),s}static isValidCollectedBlockStatementNode(e){if(!e.body.length)return!1;let t=0,o=!0;return m.traverse(e,{enter:e=>{if(_.NodeGuards.isBlockStatementNode(e)&&t++,t>r.maxNestedBlockStatementsCount||r.isProhibitedNodeInsideCollectedBlockStatement(e)||r.isScopeHoistingFunctionDeclaration(e))return o=!1,m.VisitorOption.Break}}),o}static isValidWrappedBlockStatementNode(e){if(!e.body.length)return!1;let t=!0;if(m.traverse(e,{enter:e=>{if(r.isScopeHoistingFunctionDeclaration(e))return t=!1,m.VisitorOption.Break}}),!t)return!1;return C.NodeStatementUtils.getParentNodeWithStatements(e).type!==I.NodeType.Program}getVisitor(e){switch(e){case S.TransformationStage.DeadCodeInjection:return{enter:(e,t)=>{if(t&&_.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),e},leave:(e,t)=>{if(t&&_.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};case S.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:(e,t)=>{if(t&&this.isDeadCodeInjectionRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}analyzeNode(e,t){m.traverse(e,{enter:e=>{if(!_.NodeGuards.isBlockStatementNode(e))return;const t=R.NodeUtils.clone(e);if(!r.isValidCollectedBlockStatementNode(t))return;const o=this.makeClonedBlockStatementNodeUnique(t);this.collectedBlockStatements.push(o)}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}transformNode(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!r.isValidWrappedBlockStatementNode(e))return e;const o=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,o),i=this.collectedBlockStatements.splice(n,1)[0];return i===e?e:this.replaceBlockStatementNode(e,i,t)}restoreNode(e,t){const o=e.body[0];if(!_.NodeGuards.isFunctionDeclarationNode(o))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return o.body}isDeadCodeInjectionRootAstHostNode(e){return _.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}makeClonedBlockStatementNodeUnique(e){const t=j.NodeFactory.functionExpressionNode([],e);return R.NodeUtils.parentizeNode(t,t),R.NodeUtils.parentizeNode(e,t),this.transformersRunner.transform(t,r.transformersToRenameBlockScopeIdentifiers,S.TransformationStage.Obfuscating).body}replaceBlockStatementNode(e,t,o){const n=j.NodeFactory.blockStatementNode([j.NodeFactory.functionDeclarationNode(r.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);const i=this.deadCodeInjectionCustomNodeFactory(b.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);i.initialize(e,n);const a=i.getNode()[0];return R.NodeUtils.parentizeNode(a,o),a}};F.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",F.maxNestedBlockStatementsCount=4,F.minCollectedBlockStatementsCount=5,F.transformersToRenameBlockScopeIdentifiers=[v.NodeTransformer.LabeledStatementTransformer,v.NodeTransformer.ScopeIdentifiersTransformer],F=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),l(1,f.inject(p.ServiceIdentifiers.ITransformersRunner)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TDeadNodeInjectionCustomNodeFactory&&g.TDeadNodeInjectionCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.ITransformersRunner&&N.ITransformersRunner)?i:Object,"function"==typeof(a=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==y.IOptions&&y.IOptions)?s:Object])],F),t.DeadCodeInjectionTransformer=F},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=f(o(13)),y=o(17),h=o(91),N=o(92),b=o(2),v=o(3),I=o(18),S=o(53),O=o(33),j=o(11),_=o(12),C=o(19),R=o(4),F=o(15),T=o(14),w=o(6);let x=r=class extends _.AbstractNodeTransformer{constructor(e,t,o,r,n){super(r,n),this.controlFlowData=new Map,this.visitedFunctionNodes=new Set,this.hostNodesWithControlFlowNode=new Set,this.controlFlowStorageFactory=e,this.controlFlowReplacerFactory=t,this.controlFlowCustomNodeFactory=o}getVisitor(e){switch(e){case j.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.visitedFunctionNodes.add(e),!R.NodeGuards.isBlockStatementNode(e.body))return e;const o=this.getHostNode(e.body),r=this.getControlFlowStorage(o);if(this.controlFlowData.set(o,r),this.transformFunctionBody(e.body,r),!r.getLength())return e;const n=this.controlFlowCustomNodeFactory(I.ControlFlowCustomNode.ControlFlowStorageNode);return n.initialize(r),C.NodeAppender.prepend(o,n.getNode()),this.hostNodesWithControlFlowNode.add(o),w.NodeUtils.parentizeAst(e),e}getControlFlowStorage(e){const t=this.controlFlowStorageFactory();if(this.controlFlowData.has(e)){this.hostNodesWithControlFlowNode.has(e)&&(R.NodeGuards.isSwitchCaseNode(e)?e.consequent.shift():e.body.shift());const o=this.controlFlowData.get(e);t.mergeWith(o,!0)}return t}getHostNode(e){const t=T.NodeStatementUtils.getParentNodesWithStatements(e);return 1===t.length?e:(t.pop(),t.length>r.hostNodeSearchMinDepth&&t.splice(0,r.hostNodeSearchMinDepth),t.length>r.hostNodeSearchMaxDepth&&(t.length=r.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}isVisitedFunctionNode(e){return(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}transformFunctionBody(e,t){g.replace(e,{enter:(e,o)=>{if(F.NodeMetadata.isIgnoredNode(e))return g.VisitorOption.Skip;if(this.isVisitedFunctionNode(e)||!o)return g.VisitorOption.Skip;if(!r.controlFlowReplacersMap.has(e.type))return e;if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold)return e;const n=r.controlFlowReplacersMap.get(e.type);return void 0===n?e:Object.assign(Object.assign({},this.controlFlowReplacerFactory(n).replace(e,o,t)),{parentNode:o})}})}};x.controlFlowReplacersMap=new Map([[O.NodeType.BinaryExpression,S.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[O.NodeType.CallExpression,S.ControlFlowReplacer.CallExpressionControlFlowReplacer],[O.NodeType.LogicalExpression,S.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[O.NodeType.Literal,S.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),x.hostNodeSearchMinDepth=0,x.hostNodeSearchMaxDepth=2,x=r=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),u(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),u(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==N.TControlFlowStorageFactory&&N.TControlFlowStorageFactory)?n:Object,"function"==typeof(i=void 0!==h.TControlFlowReplacerFactory&&h.TControlFlowReplacerFactory)?i:Object,"function"==typeof(a=void 0!==y.TControlFlowCustomNodeFactory&&y.TControlFlowCustomNodeFactory)?a:Object,"function"==typeof(s=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==b.IOptions&&b.IOptions)?c:Object])],x),t.FunctionControlFlowTransformer=x},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(54),h=o(4),N=o(6);let b=r=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){if(this.checkForProhibitedExpressions(e.left,e.right))return e;const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.LogicalExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a,e.left,e.right)}checkForProhibitedExpressions(e,t){return[e,t].some(e=>{let t;return t=h.NodeGuards.isUnaryExpressionNode(e)?N.NodeUtils.getUnaryExpressionArgumentNode(e):e,!(h.NodeGuards.isLiteralNode(t)||h.NodeGuards.isIdentifierNode(t)||h.NodeGuards.isObjectExpressionNode(t)||h.NodeGuards.isExpressionStatementNode(t))})}};b.usingExistingIdentifierChance=.5,b=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionControlFlowReplacer=b},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(45),h=o(4);let N=r=class extends y.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){if(h.NodeGuards.isPropertyNode(t)&&t.key===e)return e;if("string"!=typeof e.value||e.value.length<3)return e;const n=String(e.value),i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralNode);i.initialize(e.value);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a)}getControlFlowStorageCallNode(e,t){const o=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode);o.initialize(e,t);const r=o.getNode()[0];if(!r||!h.NodeGuards.isExpressionStatementNode(r))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return r.expression}};N.usingExistingIdentifierChance=1,N=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.StringLiteralControlFlowReplacer=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(16),i=o(1),a=o(21),s=o(59),c=o(96),d=o(98),l=o(99),u=o(100),f=o(102),p=o(103),m=o(104),g=o(105);t.convertingTransformersModule=new r.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.MemberExpressionTransformer).whenTargetNamed(a.NodeTransformer.MemberExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(l.MethodDefinitionTransformer).whenTargetNamed(a.NodeTransformer.MethodDefinitionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.ObjectExpressionKeysTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionKeysTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.ObjectExpressionTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.SplitStringTransformer).whenTargetNamed(a.NodeTransformer.SplitStringTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.TemplateLiteralTransformer).whenTargetNamed(a.NodeTransformer.TemplateLiteralTransformer),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(c.ObjectExpressionToVariableDeclarationExtractor).whenTargetNamed(s.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(g.BasePropertiesExtractor).whenTargetNamed(s.ObjectExpressionExtractor.BasePropertiesExtractor),e(i.ServiceIdentifiers.Factory__IObjectExpressionExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObjectExpressionExtractor))})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(97),l=o(60),u=o(19),f=o(4),p=o(14),m=o(6);let g=class{constructor(e){this.objectExpressionKeysTransformerCustomNodeFactory=e}extract(e,t){return this.transformObjectExpressionToVariableDeclaration(e,t)}transformObjectExpressionToVariableDeclaration(e,t){const o=e.properties,r=this.getObjectExpressionHostNode(o),n=this.getObjectExpressionIdentifierNode(r),i=this.getObjectExpressionNode(r),a=[r],s=p.NodeStatementUtils.getScopeOfNode(t);return u.NodeAppender.insertBefore(s,a,t),m.NodeUtils.parentizeAst(r),m.NodeUtils.parentizeNode(r,s),{nodeToReplace:n,objectExpressionHostStatement:r,objectExpressionNode:i}}getObjectExpressionHostNode(e){const t=this.objectExpressionKeysTransformerCustomNodeFactory(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode);t.initialize(e);const o=t.getNode()[0];if(!o||!f.NodeGuards.isVariableDeclarationNode(o))throw new Error("`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node");return o}getObjectExpressionIdentifierNode(e){const t=e.declarations[0].id;if(!f.NodeGuards.isIdentifierNode(t))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property");return t}getObjectExpressionNode(e){var t;const o=null!==(t=e.declarations[0].init)&&void 0!==t?t:null;if(!o||!f.NodeGuards.isObjectExpressionNode(o))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property");return o}};g=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)),i("design:paramtypes",["function"==typeof(r=void 0!==d.TObjectExpressionKeysTransformerCustomNodeFactory&&d.TObjectExpressionKeysTransformerCustomNodeFactory)?r:Object])],g),t.ObjectExpressionToVariableDeclarationExtractor=g},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(8),g=o(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isMemberExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(g.NodeGuards.isIdentifierNode(e.property)){if(e.computed)return e;e.computed=!0,e.property=m.NodeFactory.literalNode(e.property.name)}return e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MemberExpressionTransformer=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(11),m=o(12),g=o(8),y=o(4);let h=r=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&y.NodeGuards.isMethodDefinitionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return y.NodeGuards.isIdentifierNode(e.key)?this.replaceIdentifierKey(e,e.key):y.NodeGuards.isLiteralNode(e.key)?this.replaceLiteralKey(e,e.key):e}replaceIdentifierKey(e,t){return r.ignoredNames.includes(t.name)||e.computed||(e.computed=!0,e.key=g.NodeFactory.literalNode(t.name)),e}replaceLiteralKey(e,t){return"string"!=typeof t.value||r.ignoredNames.includes(t.value)||e.computed||(e.computed=!0),e}};h.ignoredNames=["constructor"],h=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.MethodDefinitionTransformer=h},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(13)),m=o(101),g=o(2),y=o(3),h=o(11),N=o(12),b=o(4),v=o(14),I=o(59);let S=r=class extends N.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.objectExpressionExtractorFactory=e}static isProhibitedHostStatement(e,t){return r.isReferencedIdentifierName(e,t)}static isReferencedIdentifierName(e,t){const o=[];let r=!1,n=!1;return p.traverse(t,{enter:t=>{t===e&&(n=!0),b.NodeGuards.isIdentifierNode(t)&&(n?o.includes(t.name)&&(r=!0):o.push(t.name))},leave:t=>{if(t===e)return n=!1,p.VisitorOption.Break}}),r}getVisitor(e){if(!this.options.transformObjectKeys)return null;switch(e){case h.TransformationStage.Converting:return{leave:(e,t)=>{if(t&&b.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(!e.properties.length)return e;const o=v.NodeStatementUtils.getRootStatementOfNode(e);return r.isProhibitedHostStatement(e,o)?e:this.applyObjectExpressionKeysExtractorsRecursive(r.objectExpressionExtractorNames,e,o)}applyObjectExpressionKeysExtractorsRecursive(e,t,o){const r=[...e],n=r.shift();if(!n)return t;const{nodeToReplace:i,objectExpressionHostStatement:a,objectExpressionNode:s}=this.objectExpressionExtractorFactory(n).extract(t,o);return this.applyObjectExpressionKeysExtractorsRecursive(r,s,a),i}};S.objectExpressionExtractorNames=[I.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor,I.ObjectExpressionExtractor.BasePropertiesExtractor],S=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.Factory__IObjectExpressionExtractor)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==m.TObjectExpressionExtractorFactory&&m.TObjectExpressionExtractorFactory)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],S),t.ObjectExpressionKeysTransformer=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(8),g=o(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return e.properties.forEach(e=>{e.key&&(e.computed?this.transformComputedProperty(e):this.transformBaseProperty(e))}),e}transformComputedProperty(e){g.NodeGuards.isLiteralNode(e.key)&&"string"==typeof e.key.value&&(e.key=m.NodeFactory.literalNode(e.key.value))}transformBaseProperty(e){e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=m.NodeFactory.literalNode(e.key.name))}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.ObjectExpressionTransformer=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(2),m=o(3),g=o(21),y=o(11),h=o(12),N=o(8),b=o(4),v=o(44),I=o(6);let S=r=class extends h.AbstractNodeTransformer{constructor(e,t){super(e,t),this.runAfter=[g.NodeTransformer.ObjectExpressionKeysTransformer,g.NodeTransformer.TemplateLiteralTransformer]}static chunkString(e,t){const o=Math.ceil(e.length/t),r=[];let n=0;for(let i=0;i{if(this.options.splitStrings)return t&&b.NodeGuards.isLiteralNode(e)?this.transformNode(e,t):void 0}};default:return null}}transformNode(e,t){if(v.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;const o=this.transformLiteralNodeByChunkLength(e,t,r.firstPassChunkLength);return f.replace(o,{enter:(e,t)=>{if(t&&b.NodeGuards.isLiteralNode(e))return this.transformLiteralNodeByChunkLength(e,t,this.options.splitStringsChunkLength)}})}transformLiteralNodeByChunkLength(e,t,o){if("string"!=typeof e.value)return e;if(o>=e.value.length)return e;const n=r.chunkString(e.value,o),i=this.transformStringChunksToBinaryExpressionNode(n);return I.NodeUtils.parentizeAst(i),I.NodeUtils.parentizeNode(i,t),i}transformStringChunksToBinaryExpressionNode(e){const t=e.shift(),o=e.shift();if(!t||!o)throw new Error("First and second chunks values should not be empty");const r=N.NodeFactory.binaryExpressionNode("+",N.NodeFactory.literalNode(t),N.NodeFactory.literalNode(o));return e.reduce((e,t)=>{const o=N.NodeFactory.literalNode(t);return N.NodeFactory.binaryExpressionNode("+",e,o)},r)}};S.firstPassChunkLength=1e3,S=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],S),t.SplitStringTransformer=S},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(11),m=o(12),g=o(8),y=o(4),h=o(6);let N=r=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}static isLiteralNodeWithStringValue(e){return!!e&&y.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}static isValidTemplateLiteralNode(e,t){return y.NodeGuards.isTemplateLiteralNode(e)&&!y.NodeGuards.isTaggedTemplateExpressionNode(t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&r.isValidTemplateLiteralNode(e,t))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const o=e.expressions;let n,i=[];if(e.quasis.forEach(e=>{i.push(g.NodeFactory.literalNode(e.value.cooked));const t=o.shift();t&&i.push(t)}),i=i.filter(e=>!(y.NodeGuards.isLiteralNode(e)&&""===e.value)),r.isLiteralNodeWithStringValue(i[0])||r.isLiteralNodeWithStringValue(i[1])||i.unshift(g.NodeFactory.literalNode("")),i.length>1){let e=g.NodeFactory.binaryExpressionNode("+",i.shift(),i.shift());i.forEach(t=>{e=g.NodeFactory.binaryExpressionNode("+",e,t)}),n=e}else n=i[0];return h.NodeUtils.parentizeAst(n),h.NodeUtils.parentizeNode(n,t),n}};N=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.TemplateLiteralTransformer=N},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(19),s=o(8),c=o(4),d=o(14);let l=r=class{static getPropertyNodeKeyName(e){const t=e.key;return!c.NodeGuards.isLiteralNode(t)||"string"!=typeof t.value&&"number"!=typeof t.value?c.NodeGuards.isIdentifierNode(t)?t.name:null:t.value.toString()}static isProhibitedPattern(e){return!e||c.NodeGuards.isObjectPatternNode(e)||c.NodeGuards.isArrayPatternNode(e)||c.NodeGuards.isAssignmentPatternNode(e)||c.NodeGuards.isRestElementNode(e)}extract(e,t){const o=e.parentNode;return o&&c.NodeGuards.isVariableDeclaratorNode(o)&&c.NodeGuards.isIdentifierNode(o.id)?this.transformObjectExpressionNode(e,t,o.id):{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}transformObjectExpressionNode(e,t,o){const r=e.properties,[n,i]=this.extractPropertiesToExpressionStatements(r,t,o),s=d.NodeStatementUtils.getScopeOfNode(t);return this.filterExtractedObjectExpressionProperties(e,i),a.NodeAppender.insertAfter(s,n,t),{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}extractPropertiesToExpressionStatements(e,t,o){const n=e.length,i=[],a=[];for(let d=0;d!t.includes(o))}};l=r=n([i.injectable()],l),t.BasePropertiesExtractor=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(18),s=o(23),c=o(61),d=o(58),l=o(60),u=o(107),f=o(108),p=o(109),m=o(110),g=o(111),y=o(112),h=o(115),N=o(116),b=o(117),v=o(118),I=o(119),S=o(120),O=o(122),j=o(124),_=o(126),C=o(128),R=o(130),F=o(134),T=o(136),w=o(137),x=o(138),E=o(140),G=o(142),P=o(149),A=o(151),M=o(154),D=o(155);t.customNodesModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICustomNode).to(O.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(i.ServiceIdentifiers.ICustomNode).to(_.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(i.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(i.ServiceIdentifiers.ICustomNode).to(R.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(F.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(i.ServiceIdentifiers.ICustomNode).to(x.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(E.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(i.ServiceIdentifiers.ICustomNode).to(G.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(i.ServiceIdentifiers.ICustomNode).to(P.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(i.ServiceIdentifiers.ICustomNode).to(A.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.BinaryExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BlockStatementControlFlowFlatteningNode).whenTargetNamed(a.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(I.CallExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(S.ControlFlowStorageNode).whenTargetNamed(a.ControlFlowCustomNode.ControlFlowStorageNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(T.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(w.LogicalExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(D.StringLiteralNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(M.StringLiteralControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(b.BlockStatementDeadCodeInjectionNode).whenTargetNamed(d.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.ObjectExpressionVariableDeclarationHostNode).whenTargetNamed(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode),e(i.ServiceIdentifiers.ICustomNodeGroup).to(u.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(f.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(p.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(m.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(g.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(i.ServiceIdentifiers.Factory__ICustomNode).toFactory(r.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNode)),e(i.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions)),e(i.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(r.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNodeGroup)),e(i.ServiceIdentifiers.ICustomNodeFormatter).to(j.CustomNodeFormatter).inSingletonScope()})},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.ConsoleOutputDisableExpressionNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.disableConsoleOutput)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.ConsoleOutputDisableExpressionNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.ConsoleOutputCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19),S=o(4);let O=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionCallNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionNode,t=>{I.NodeAppender.append(e,t.getNode())}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionIntervalNode,t=>{const o=S.NodeGuards.isSwitchCaseNode(e)?e.consequent.length:e.body.length,r=this.randomGenerator.getRandomInteger(0,o);I.NodeAppender.insertAtIndex(e,t.getNode(),r)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.debugProtection)return;const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),o=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionNode),r=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionCallNode),n=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);o.initialize(e),r.initialize(e,t),n.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(N.CustomNode.DebugProtectionFunctionNode,o),this.customNodes.set(N.CustomNode.DebugProtectionFunctionCallNode,r),this.options.debugProtectionInterval&&this.customNodes.set(N.CustomNode.DebugProtectionFunctionIntervalNode,n),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,i)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],O.prototype,"customNodes",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.DebugProtectionCustomNodeGroup=O},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DomainLockNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.domainLock.length)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.DomainLockNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.DomainLockNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.DomainLockCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.SelfDefendingUnicodeNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.selfDefending)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.SelfDefendingUnicodeNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.SelfDefendingCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=o(26),g=o(5),y=o(2),h=o(3),N=o(35),b=o(7),v=o(23),I=o(22),S=o(27),O=o(19);let j=class extends S.AbstractCustomNodeGroup{constructor(e,t,o,r,n){super(o,r,n),this.appendEvent=I.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e,this.stringArrayStorage=t}appendCustomNodes(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(v.CustomNode.StringArrayNode,t=>{O.NodeAppender.prepend(e,t.getNode())}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayCallsWrapper,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayRotateFunctionNode,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}))}initialize(){if(this.customNodes=new Map,!this.options.stringArray)return;const e=this.customNodeFactory(v.CustomNode.StringArrayNode),t=this.customNodeFactory(v.CustomNode.StringArrayCallsWrapper),o=this.customNodeFactory(v.CustomNode.StringArrayRotateFunctionNode),r=this.stringArrayStorage.getStorageName(),n=this.stringArrayStorage.getStorageCallsWrapperName(),i=this.stringArrayStorage.getRotationAmount();e.initialize(this.stringArrayStorage,r),t.initialize(r,n),o.initialize(r,i),this.customNodes.set(v.CustomNode.StringArrayNode,e),this.customNodes.set(v.CustomNode.StringArrayCallsWrapper,t),this.options.rotateStringArray&&this.customNodes.set(v.CustomNode.StringArrayRotateFunctionNode,o)}};d([b.initializable(),l("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],j.prototype,"customNodes",void 0),j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.Factory__ICustomNode)),u(1,f.inject(p.ServiceIdentifiers.IStringArrayStorage)),u(2,f.inject(p.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u(3,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(4,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==m.TCustomNodeFactory&&m.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.IStringArrayStorage&&N.IStringArrayStorage)?i:Object,"function"==typeof(a=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.StringArrayCustomNodeGroup=j},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8);let N=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.properties=e}getNodeStructure(e){return[h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()),h.NodeFactory.objectExpressionNode(this.properties))],"const")]}};N=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.ObjectExpressionVariableDeclarationHostNode=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n let that;\n \n try {\n const getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n const getGlobal = function () {\n let globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n const that = getGlobal();\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.binaryExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BinaryExpressionFunctionNode=b},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(4),v=o(6);let I=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=o}getNodeStructure(e){const t=this.randomGenerator.getRandomString(6),o=this.randomGenerator.getRandomString(6),r=N.NodeFactory.blockStatementNode([N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(t),N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join("|")),N.NodeFactory.identifierNode("split")),[N.NodeFactory.literalNode("|")]))],"const"),N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(o),N.NodeFactory.literalNode(0))],"let"),N.NodeFactory.whileStatementNode(N.NodeFactory.literalNode(!0),N.NodeFactory.blockStatementNode([N.NodeFactory.switchStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(t),N.NodeFactory.updateExpressionNode("++",N.NodeFactory.identifierNode(o)),!0),this.shuffledKeys.map((e,t)=>{const o=this.blockStatementBody[e],r=[o];return b.NodeGuards.isReturnStatementNode(o)||r.push(N.NodeFactory.continueStatement()),N.NodeFactory.switchCaseNode(N.NodeFactory.literalNode(String(t)),r)})),N.NodeFactory.breakStatement()]))]);return v.NodeUtils.parentizeAst(r),[r]}};s([y.initializable(),c("design:type",Array)],I.prototype,"blockStatementBody",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"originalKeysIndexesInShuffledArray",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"shuffledKeys",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.BlockStatementControlFlowFlatteningNode=I},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.blockStatementNode=e,this.deadCodeInjectionRootAstHostNode=t}getNodeStructure(e){const t=this.randomGenerator.getMathRandom()>.5,o=this.randomGenerator.getMathRandom()>.5,r=t?"===":"!==",n=this.randomGenerator.getRandomString(5),i=o?n:this.randomGenerator.getRandomString(5),[a,s]=t===o?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],c=h.NodeFactory.blockStatementNode([h.NodeFactory.ifStatementNode(h.NodeFactory.binaryExpressionNode(r,h.NodeFactory.literalNode(n),h.NodeFactory.literalNode(i)),a,s)]);return N.NodeUtils.parentizeAst(c),[c]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BlockStatementDeadCodeInjectionNode=b},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(7),N=o(10),b=o(8),v=o(6);let I=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o,r){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.callee=o,this.expressionArguments=r}getNodeStructure(){const e=b.NodeFactory.expressionStatementNode(b.NodeFactory.callExpressionNode(b.NodeFactory.memberExpressionNode(b.NodeFactory.identifierNode(this.controlFlowStorageName),b.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.callee,...this.expressionArguments]));return v.NodeUtils.parentizeAst(e),[e]}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof ESTree&&ESTree.Expression)?r:Object)],I.prototype,"callee",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageName",void 0),c([h.initializable(),d("design:type",Array)],I.prototype,"expressionArguments",void 0),I=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],I),t.CallExpressionControlFlowStorageCallNode=I},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.expressionArguments=e}getNodeStructure(e){const t=N.NodeFactory.identifierNode("callee"),o=[],r=this.expressionArguments.length;for(let e=0;e=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(121),m=o(5),g=o(2),y=o(3),h=o(9),N=o(7),b=o(10),v=o(8),I=o(4),S=o(6);let O=class extends b.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.controlFlowStorage=e}getNodeStructure(e){const t=Array.from(this.controlFlowStorage.getStorage()).map(([e,t])=>{const o=t.getNode()[0];if(!I.NodeGuards.isExpressionStatementNode(o))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return v.NodeFactory.propertyNode(v.NodeFactory.identifierNode(e),o.expression)});let o=v.NodeFactory.variableDeclarationNode([v.NodeFactory.variableDeclaratorNode(v.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()),v.NodeFactory.objectExpressionNode(t))],"const");return o=S.NodeUtils.parentizeAst(o),[o]}};c([N.initializable(),d("design:type","function"==typeof(r=void 0!==p.TControlFlowStorage&&p.TControlFlowStorage)?r:Object)],O.prototype,"controlFlowStorage",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.ControlFlowStorageNode=O},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(20),h=o(123),N=o(47),b=o(7),v=o(10),I=o(6);let S=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():N.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(h.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([b.initializable(),c("design:type",String)],S.prototype,"callsControllerFunctionName",void 0),S=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],S),t.ConsoleOutputDisableExpressionNode=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n const c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.table = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.table = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=s(o(13)),f=c(o(125)),p=o(62),m=o(4);let g=class{constructor(e){this.prevailingKindOfVariables=e.getPrevailingKind()}formatTemplate(e,t){return f.default(e,t)}formatStructure(e){for(const t of e)u.replace(t,{enter:e=>{if(m.NodeGuards.isVariableDeclarationNode(e))return"var"===this.prevailingKindOfVariables&&(e.kind="var"),e}});return e}};g=n([d.injectable(),a(0,d.inject(l.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),i("design:paramtypes",["function"==typeof(r=void 0!==p.IPrevailingKindOfVariablesAnalyzer&&p.IPrevailingKindOfVariablesAnalyzer)?r:Object])],g),t.CustomNodeFormatter=g},function(e,t){e.exports=require("string-template")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(127),N=o(10),b=o(6);let v=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"callsControllerFunctionName",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionCallNode=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(\n this,\n function () {\n const regExp1 = new RegExp('function *\\\\( *\\\\)');\n const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');\n \n const result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n }\n )();\n })();\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(129),N=o(10),b=o(6);let v=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionIntervalNode=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(20),h=o(7),N=o(131),b=o(132),v=o(133),I=o(10),S=o(6);let O=class extends I.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?N.DebuggerTemplate():b.DebuggerTemplateNoEval();return this.customNodeFormatter.formatTemplate(v.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([h.initializable(),c("design:type",String)],O.prototype,"debugProtectionFunctionName",void 0),O=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],O),t.DebugProtectionFunctionNode=O},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n const func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(48),g=o(2),y=o(3),h=o(9),N=o(20),b=o(7),v=o(135),I=o(47),S=o(10),O=o(6);let j=class extends S.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.cryptUtils=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.domainLock.join(";"),[t,o]=this.cryptUtils.hideString(e,3*e.length),r=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():I.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(v.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:o,domains:t,globalVariableTemplate:r,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([b.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.ICryptUtils)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.ICryptUtils&&m.ICryptUtils)?s:Object])],j),t.DomainLockNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n const func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (let i = 0; i < 1000; i--) {\n const isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n const regExp = new RegExp("[{diff}]", "g");\n const domains = "{domains}".replace(regExp, "").split(";");\n let document;\n let domain;\n let location;\n let hostname;\n\n for (let d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (let d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n\n if (!("~" > domain)) {\n for (let d2 in that[document]) {\n if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) {\n location = d2;\n \n break;\n }\n }\n\n for (let d3 in that[document][location]) {\n if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) {\n hostname = d3;\n \n break;\n }\n }\n }\n \n if (!document || !that[document]) {\n return;\n }\n \n const documentDomain = that[document][domain];\n const documentLocationHostName = !!that[document][location] && that[document][location][hostname];\n const currentDomain = documentDomain || documentLocationHostName;\n \n if (!currentDomain) {\n return;\n }\n \n let ok = false;\n \n for (let i = 0; i < domains.length; i++) {\n const domain = domains[i];\n const position = currentDomain.length - domain.length;\n const lastIndex = currentDomain.indexOf(domain, position);\n const endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o,r){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=o,this.rightValue=r}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.ExpressionWithOperatorControlFlowStorageCallNode=v},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.logicalExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionFunctionNode=b},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(22),h=o(7),N=o(139),b=o(36),v=o(10),I=o(25),S=o(6),O=o(9);let j=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.appendEvent===y.ObfuscationEvent.AfterObfuscation?I.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed})).getObfuscatedCode():this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([h.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),c([h.initializable(),d("design:type","function"==typeof(r=void 0!==y.ObfuscationEvent&&y.ObfuscationEvent)?r:Object)],j.prototype,"appendEvent",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==O.ICustomNodeFormatter&&O.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],j),t.NodeCallsControllerFunctionNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n const {singleNodeCallControllerFunctionName} = (function(){\n let firstCall = true;\n \n return function (context, fn){\n const rfn = firstCall ? function(){\n if(fn){\n const res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(7),b=o(36),v=o(141),I=o(10),S=o(25),O=o(6);let j=class extends I.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return S.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],j),t.SelfDefendingUnicodeNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return !regExp.test(func1.toString());\n };\n \n const test2 = function () {\n const regExp = new RegExp('${e.encode("(\\\\[x|u](\\w){2,4})+",!0)}');\n \n return regExp.test(func2.toString());\n };\n \n const recursiveFunc1 = function (string) {\n const i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n const recursiveFunc2 = function (string) {\n const i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+"")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n `}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(20),b=o(24),v=o(7),I=o(36),S=o(143),O=o(47),j=o(144),_=o(145),C=o(146),R=o(147),F=o(148),T=o(10),w=o(25),x=o(6);let E=class extends T.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}getNodeStructure(e){return x.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.getDecodeStringArrayTemplate();return w.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(R.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),Object.assign(Object.assign({},I.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}getDecodeStringArrayTemplate(){const e=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():O.GlobalVariableNoEvalTemplate(),t=this.customNodeFormatter.formatTemplate(S.AtobTemplate(),{globalVariableTemplate:e});let o="",r="";switch(this.options.selfDefending&&(r=this.customNodeFormatter.formatTemplate(_.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case b.StringArrayEncoding.Rc4:o=this.customNodeFormatter.formatTemplate(F.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:j.Rc4Template(),selfDefendingCode:r,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case b.StringArrayEncoding.Base64:o=this.customNodeFormatter.formatTemplate(C.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:r,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return o}};c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayName",void 0),c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayCallsWrapperName",void 0),E=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],E),t.StringArrayCallsWrapper=E},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n const str = String(input).replace(/=+$/, '');\n let output = '';\n for (\n let bc = 0, bs, buffer, idx = 0;\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n }\n );\n })();\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n const rc4 = function (str, key) {\n let s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (let k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n let i;\n \t \n\t for (i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (let y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){const o=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6),i=e.getRandomString(6),a=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),d=e.getRandomString(6),l=e.getRandomString(6);return`\n const StatesClass = function (${o}) {\n this.${o} = ${o};\n this.${r} = [1, 0, 0];\n this.${n} = function(){return 'newState';};\n this.${i} = '${t.encode("\\w+ *\\(\\) *{\\w+ *",!0)}';\n this.${a} = '${t.encode("['|\"].+['|\"];? *}",!0)}';\n };\n \n StatesClass.prototype.${s} = function () {\n const regExp = new RegExp(this.${i} + this.${a});\n const expression = regExp.test(this.${n}.toString())\n ? --this.${r}[1]\n : --this.${r}[0];\n \n return this.${c}(expression);\n };\n \n StatesClass.prototype.${c} = function (${l}) {\n if (!Boolean(~${l})) {\n return ${l};\n }\n \n return this.${d}(this.${o});\n };\n\n StatesClass.prototype.${d} = function (${o}) {\n for (let i = 0, len = this.${r}.length; i < len; i++) {\n this.${r}.push(Math.round(Math.random()));\n len = this.${r}.length;\n }\n \n return ${o}(this.${r}[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).${s}();\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){const t=e.getRandomString(6),o=e.getRandomString(6),r=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.${o} = function (str) {\n const string = atob(str);\n let newStringChars = [];\n \n for (let i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.${r} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${r}[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.${o}(value);\n {stringArrayCallsWrapperName}.${r}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n const {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n let value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){const t=e.getRandomString(6),o=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.${o} = rc4;\n \n {stringArrayCallsWrapperName}.${r} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${r}[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.${n} === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.${n} = true;\n }\n \n value = {stringArrayCallsWrapperName}.${o}(value, key);\n {stringArrayCallsWrapperName}.${r}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(35),N=o(7),b=o(150),v=o(10),I=o(6);let S=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.stringArrayStorage=e,this.stringArrayName=t}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(b.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}};c([N.initializable(),d("design:type","function"==typeof(r=void 0!==h.IStringArrayStorage&&h.IStringArrayStorage)?r:Object)],S.prototype,"stringArrayStorage",void 0),c([N.initializable(),d("design:type",String)],S.prototype,"stringArrayName",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],S),t.StringArrayNode=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n const {stringArrayName} = [{stringArray}];\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(7),b=o(36),v=o(152),I=o(153),S=o(10),O=o(25),j=o(6),_=o(37);let C=class extends S.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayRotationAmount=t}getNodeStructure(e){return j.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate();let o="";return o=this.options.selfDefending?this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):`${t}(++${e})`,O.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(I.StringArrayRotateFunctionTemplate(),{code:o,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotationAmount:_.NumberUtils.toHex(this.stringArrayRotationAmount),whileFunctionName:t}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],C.prototype,"stringArrayName",void 0),c([N.initializable(),d("design:type",Number)],C.prototype,"stringArrayRotationAmount",void 0),C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.StringArrayRotateFunctionNode=C},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const selfDefendingFunc = function () {\n const object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n let updatedCookie = name + "=" + value;\n let i = 0;\n \n for (let i = 0, len = options.length; i < len; i++) {\n const propName = options[i];\n \n updatedCookie += "; " + propName;\n \n const propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += "=" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n const matches = document(new RegExp(\n "(?:^|; )" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + "=([^;]*)"\n ));\n \n const func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n let cookie = '';\n const result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n const {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotationAmount});\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.StringLiteralControlFlowStorageCallNode=v},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8);let b=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.literalValue=e}getNodeStructure(e){return[N.NodeFactory.expressionStatementNode(N.NodeFactory.literalNode(this.literalValue))]}};s([y.initializable(),c("design:type",String)],b.prototype,"literalValue",void 0),b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.StringLiteralNode=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0);t.finalizingTransformersModule=new r.ContainerModule(e=>{})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(31),a=o(158),s=o(159),c=o(160);t.generatorsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(a.DictionaryIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(c.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(n.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(){let e=null;return t=>o=>{if(e)return e;let r;switch(o.identifierNamesGenerator){case i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return e=r,r}}())})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(34),p=o(2),m=o(3),g=o(49);let y=r=class extends g.AbstractIdentifierNamesGenerator{constructor(e,t,o){super(e,t),this.arrayUtils=o,this.identifierNamesSet=new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)),this.identifiersIterator=this.identifierNamesSet.values()}static incrementIdentifierName(e){let t="",o=!1;for(const r of e)o||r!==r.toUpperCase()?o||r!==r.toLowerCase()?t+=r:(t+=r.toUpperCase(),o=!0):t+=r.toLowerCase();return o?t:null}generate(){if(!this.identifierNamesSet.size)throw new Error("Too many identifiers in the code, add more words to identifiers dictionary");const e=this.identifiersIterator.next();return e.done?(this.identifierNamesSet=new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])),this.identifiersIterator=this.identifierNamesSet.values(),this.generate()):e.value}generateWithPrefix(){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate()}`.replace("__","_")}getInitialIdentifierNames(e){const t=e.filter(Boolean).map(e=>e.toLowerCase());return this.arrayUtils.shuffle(t)}getIncrementedIdentifierNames(e){const t=[];for(const o of e){const e=r.incrementIdentifierName(o);e&&t.push(e)}return this.arrayUtils.shuffle(t)}};y=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(1,l.inject(u.ServiceIdentifiers.IOptions)),d(2,l.inject(u.ServiceIdentifiers.IArrayUtils)),c("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object,"function"==typeof(a=void 0!==f.IArrayUtils&&f.IArrayUtils)?a:Object])],y),t.DictionaryIdentifierNamesGenerator=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(49),m=o(37),g=o(30);let y=r=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.randomVariableNameSet=new Set}generate(e){const t=this.randomGenerator.getRandomInteger(1e4,99999999),o=m.NumberUtils.toHex(t),n=g.Utils.hexadecimalPrefix.length+1,i=e?e-n:r.baseIdentifierNameLength,a=o.substr(0,i),s=`_${g.Utils.hexadecimalPrefix}${a}`;return this.randomVariableNameSet.has(s)?this.generate(e):(this.randomVariableNameSet.add(s),s)}generateWithPrefix(e){const t=this.generate(e);return`${this.options.identifiersPrefix}${t}`.replace("__","_")}};y.baseIdentifierNameLength=6,y=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],y),t.HexadecimalIdentifierNamesGenerator=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(49);let m=r=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.previousMangledName=r.initMangledNameCharacter}generate(e){const t=this.generateNewMangledName(this.previousMangledName);return this.previousMangledName=t,t}generateWithPrefix(e){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate(e)}`}isValidIdentifierName(e){return super.isValidIdentifierName(e)&&!r.reservedNamesSet.has(e)}generateNewMangledName(e){let t=(e=>{const t=r.nameSequence,o=t.length,n=e.length,i=e=>"0".repeat(e);let a=n-1;do{const r=e[a],s=t.indexOf(r);if(s!==o-1){return e.substring(0,a)+t[s+1]+i(n-(a+1))}--a}while(a>=0);return`a${i(n)}`})(e);return this.isValidIdentifierName(t)||(t=this.generateNewMangledName(t)),t}};m.initMangledNameCharacter="9",m.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),m.reservedNamesSet=new Set(["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"]),m=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MangledIdentifierNamesGenerator=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1);t.nodeTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.Factory__INodeTransformer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeTransformer))})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(38),s=o(63),c=o(21),d=o(163),l=o(164),u=o(165),f=o(167),p=o(169),m=o(170),g=o(171);t.obfuscatingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(u.LabeledStatementTransformer).whenTargetNamed(c.NodeTransformer.LabeledStatementTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.LiteralTransformer).whenTargetNamed(c.NodeTransformer.LiteralTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ScopeIdentifiersTransformer).whenTargetNamed(c.NodeTransformer.ScopeIdentifiersTransformer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(l.BooleanLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(p.NumberLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(m.StringLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(d.BaseIdentifierObfuscatingReplacer).whenTargetNamed(a.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),e(i.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObfuscatingReplacer)),e(i.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer))})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(5),u=o(2),f=o(39),p=o(8);let m=class extends f.AbstractObfuscatingReplacer{constructor(e,t){super(t),this.blockScopesMap=new Map,this.identifierNamesGenerator=e(t)}replace(e,t){let o=e.name;if(this.blockScopesMap.has(t)){const e=this.blockScopesMap.get(t);e.has(o)&&(o=e.get(o))}return p.NodeFactory.identifierNode(o)}storeGlobalName(e,t){const o=e.name;if(this.isReservedName(o))return;const r=this.identifierNamesGenerator.generateWithPrefix();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(o,r)}storeLocalName(e,t){const o=e.name;if(this.isReservedName(o))return;const r=this.identifierNamesGenerator.generate();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(o,r)}preserveName(e){this.identifierNamesGenerator.preserveName(e)}isReservedName(e){return!!this.options.reservedNames.length&&this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==l.TIdentifierNamesGeneratorFactory&&l.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==u.IOptions&&u.IOptions)?n:Object])],m),t.BaseIdentifierObfuscatingReplacer=m},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(39),f=o(8);let p=r=class extends u.AbstractObfuscatingReplacer{constructor(e){super(e)}static getTrueUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",r.getFalseUnaryExpressionNode())}static getFalseUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",f.NodeFactory.arrayExpressionNode())}replace(e){const t=e.value;if("boolean"!=typeof t)throw new Error("`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value");return t?r.getTrueUnaryExpressionNode():r.getFalseUnaryExpressionNode()}};p=r=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.BooleanLiteralObfuscatingReplacer=p},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(50),m=o(2),g=o(3),y=o(38),h=o(11),N=o(12),b=o(4),v=o(166);let I=class extends N.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.identifierObfuscatingReplacer=e(y.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case h.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&b.NodeGuards.isLabeledStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const o=v.NodeLexicalScopeUtils.getLexicalScope(e);return o?(this.storeLabeledStatementName(e,o),this.replaceLabeledStatementName(e,o),e):e}storeLabeledStatementName(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label,t)}replaceLabeledStatementName(e,t){f.replace(e,{enter:(e,o)=>{if(o&&b.NodeGuards.isLabelIdentifierNode(e,o)){const o=this.identifierObfuscatingReplacer.replace(e,t);e.name=o.name}}})}};I=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(2,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierObfuscatingReplacerFactory&&p.TIdentifierObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==m.IOptions&&m.IOptions)?i:Object])],I),t.LabeledStatementTransformer=I},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static getLexicalScope(e){return n.getLexicalScopesRecursive(e,1)[0]}static getLexicalScopes(e){return n.getLexicalScopesRecursive(e)}static getLexicalScopesRecursive(e,t=1/0,o=[],i=0){if(o.length>=t)return o;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithLexicalScope(e)&&o.push(e),e!==a?n.getLexicalScopesRecursive(a,t,o,++i):o}}t.NodeLexicalScopeUtils=n},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(168),m=o(29),g=o(2),y=o(3),h=o(64),N=o(63),b=o(11),v=o(12),I=o(8),S=o(4),O=o(44),j=o(15),_=o(6);let C=class extends v.AbstractNodeTransformer{constructor(e,t,o,r,n){super(t,o),this.literalObfuscatingReplacerFactory=e,this.stringArrayStorageAnalyzer=r,this.escapeSequenceEncoder=n}getVisitor(e){switch(e){case b.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(S.NodeGuards.isProgramNode(e)&&this.analyzeNode(e),t&&S.NodeGuards.isLiteralNode(e)&&!j.NodeMetadata.isReplacedLiteral(e))return this.transformNode(e,t)}};case b.TransformationStage.Finalizing:return{enter:(e,t)=>{if(t&&S.NodeGuards.isLiteralNode(e))return this.encodeLiteralNodeToEscapeSequence(e,t)}};default:return null}}analyzeNode(e){this.stringArrayStorageAnalyzer.analyze(e)}transformNode(e,t){if(O.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;let o;switch(typeof e.value){case"boolean":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e);break;case"number":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e);break;case"string":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e);break;default:o=e}return _.NodeUtils.parentizeNode(o,t),o}encodeLiteralNodeToEscapeSequence(e,t){return"string"!=typeof e.value?e:I.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(e.value,this.options.unicodeEscapeSequence))}};C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IObfuscatingReplacer)),l(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(2,u.inject(f.ServiceIdentifiers.IOptions)),l(3,u.inject(f.ServiceIdentifiers.IStringArrayStorageAnalyzer)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TLiteralObfuscatingReplacerFactory&&p.TLiteralObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==g.IOptions&&g.IOptions)?i:Object,"function"==typeof(a=void 0!==h.IStringArrayStorageAnalyzer&&h.IStringArrayStorageAnalyzer)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.LiteralTransformer=C},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(2),l=o(39),u=o(8),f=o(37),p=o(30);let m=class extends l.AbstractObfuscatingReplacer{constructor(e){super(e),this.numberLiteralCache=new Map}replace(e){const t=e.value;if("number"!=typeof t)throw new Error("`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value");let o;return this.numberLiteralCache.has(t)?o=this.numberLiteralCache.get(t):(o=f.NumberUtils.isCeil(t)?`${p.Utils.hexadecimalPrefix}${f.NumberUtils.toHex(t)}`:String(t),this.numberLiteralCache.set(t,o)),u.NodeFactory.literalNode(t,o)}};m=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IOptions&&d.IOptions)?r:Object])],m),t.NumberLiteralObfuscatingReplacer=m},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(2),p=o(35),m=o(64),g=o(7),y=o(24),h=o(39),N=o(15),b=o(8),v=o(37),I=o(30);let S=r=class extends h.AbstractObfuscatingReplacer{constructor(e,t,o){super(o),this.nodesCache=new Map,this.stringArrayStorage=e,this.stringArrayStorageAnalyzer=t}static getHexadecimalLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}static getRc4KeyLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}initialize(){this.stringArrayStorageCallsWrapperName=this.stringArrayStorage.getStorageCallsWrapperName(),this.options.shuffleStringArray&&this.stringArrayStorage.shuffleStorage(),this.options.rotateStringArray&&this.stringArrayStorage.rotateStorage()}replace(e){const t=e.value;if("string"!=typeof t)throw new Error("`StringLiteralObfuscatingReplacer` should accept only literals with `string` value");const o=this.stringArrayStorageAnalyzer.getItemDataForLiteralNode(e),r=`${t}-${Boolean(o)}`;if(this.nodesCache.has(r)&&this.options.stringArrayEncoding!==y.StringArrayEncoding.Rc4)return this.nodesCache.get(r);const n=o?this.replaceWithStringArrayCallNode(o):this.replaceWithLiteralNode(t);return this.nodesCache.set(r,n),n}replaceWithLiteralNode(e){return b.NodeFactory.literalNode(e)}replaceWithStringArrayCallNode(e){const{index:t,decodeKey:o}=e,n=`${I.Utils.hexadecimalPrefix}${v.NumberUtils.toHex(t)}`,i=[r.getHexadecimalLiteralNode(n)];o&&i.push(r.getRc4KeyLiteralNode(o));const a=b.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName);return b.NodeFactory.callExpressionNode(a,i)}};s([g.initializable(),c("design:type",String)],S.prototype,"stringArrayStorageCallsWrapperName",void 0),s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],S.prototype,"initialize",null),S=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IStringArrayStorage)),d(1,l.inject(u.ServiceIdentifiers.IStringArrayStorageAnalyzer)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==p.IStringArrayStorage&&p.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==m.IStringArrayStorageAnalyzer&&m.IStringArrayStorageAnalyzer)?i:Object,"function"==typeof(a=void 0!==f.IOptions&&f.IOptions)?a:Object])],S),t.StringLiteralObfuscatingReplacer=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(50),y=o(2),h=o(3),N=o(172),b=o(38),v=o(11),I=o(12),S=o(4),O=o(15);let j=r=class extends I.AbstractNodeTransformer{constructor(e,t,o,r){super(t,o),this.lexicalScopesWithObjectPatternWithoutDeclarationMap=new Map,this.identifierObfuscatingReplacer=e(b.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),this.scopeAnalyzer=r}getVisitor(e){switch(e){case v.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&S.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.transformNode(e,t)}};default:return null}}analyzeNode(e,t){this.scopeAnalyzer.analyze(e)}transformNode(e,t){const o=this.scopeAnalyzer.acquireScope(e);return this.traverseScopeVariables(o),e}traverseScopeVariables(e){const t=e.variableScope,o=S.NodeGuards.isNodeWithBlockLexicalScope(t.block)?t.block:null,n=r.globalScopeNames.includes(t.type);if(o){for(const t of e.variables)if(t.name!==r.argumentsVariableName){if(!this.options.renameGlobals&&n){if(!t.defs.every(e=>"ImportBinding"===e.type||"CatchClause"===e.type))continue}this.transformScopeVariableIdentifiers(t,o,n)}for(const t of e.childScopes)this.traverseScopeVariables(t)}}transformScopeVariableIdentifiers(e,t,o){for(const r of e.identifiers)this.isReplaceableIdentifierNode(r,t,e)&&(this.storeIdentifierName(r,t,o),this.replaceIdentifierName(r,t,e))}storeIdentifierName(e,t,o){o?this.identifierObfuscatingReplacer.storeGlobalName(e,t):this.identifierObfuscatingReplacer.storeLocalName(e,t)}replaceIdentifierName(e,t,o){const r=this.identifierObfuscatingReplacer.replace(e,t);e.name=r.name,o.references.forEach(t=>{t.identifier.name=e.name})}isReplaceableIdentifierNode(e,t,o){const r=e.parentNode;return!(!r||O.NodeMetadata.isIgnoredNode(e)||this.isProhibitedPropertyNode(e,r)||this.isProhibitedClassDeclarationNameIdentifierNode(o,e,r)||this.isProhibitedExportNamedClassDeclarationIdentifierNode(e,r)||this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,r)||this.isProhibitedExportNamedVariableDeclarationIdentifierNode(e,r)||this.isProhibitedImportSpecifierNode(e,r)||this.isProhibitedVariableNameUsedInObjectPatternNode(o,e,t)||S.NodeGuards.isLabelIdentifierNode(e,r))}isProhibitedClassDeclarationNameIdentifierNode(e,t,o){return S.NodeGuards.isClassDeclarationNode(e.scope.block)&&S.NodeGuards.isClassDeclarationNode(o)&&o.id===t}isProhibitedExportNamedClassDeclarationIdentifierNode(e,t){return S.NodeGuards.isClassDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,t){return S.NodeGuards.isFunctionDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedVariableDeclarationIdentifierNode(e,t){return S.NodeGuards.isVariableDeclaratorNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isVariableDeclarationNode(t.parentNode)&&!!t.parentNode.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode.parentNode)}isProhibitedImportSpecifierNode(e,t){return S.NodeGuards.isImportSpecifierNode(t)&&t.imported.name===t.local.name}isProhibitedPropertyNode(e,t){const o=S.NodeGuards.isPropertyNode(t)&&!t.computed&&t.key===e,r=S.NodeGuards.isAssignmentPatternNode(t)&&t.left===e&&!!t.parentNode&&S.NodeGuards.isPropertyNode(t.parentNode)&&t.left===t.parentNode.key;return o||r}isProhibitedVariableNameUsedInObjectPatternNode(e,t,o){let r=this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(o);if(!1===r)return!1;if(!e.defs.some(e=>"var"===e.kind))return!1;let n=!1;return m.traverse(o,{enter:(e,o)=>{if(S.NodeGuards.isObjectPatternNode(e)&&o&&S.NodeGuards.isAssignmentExpressionNode(o)){r=!0;const o=e.properties;for(const e of o)if(!e.computed&&e.shorthand&&S.NodeGuards.isIdentifierNode(e.key)&&t.name===e.key.name)return n=!0,m.VisitorOption.Break}}}),this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(o,null!=r&&r),n}};j.argumentsVariableName="arguments",j.globalScopeNames=["global","module"],j=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),l(1,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(2,f.inject(p.ServiceIdentifiers.IOptions)),l(3,f.inject(p.ServiceIdentifiers.IScopeAnalyzer)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierObfuscatingReplacerFactory&&g.TIdentifierObfuscatingReplacerFactory)?n:Object,"function"==typeof(i=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.IOptions&&y.IOptions)?a:Object,"function"==typeof(s=void 0!==N.IScopeAnalyzer&&N.IScopeAnalyzer)?s:Object])],j),t.ScopeIdentifiersTransformer=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(174),a=o(181);t.optionsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IOptions).to(i.Options).inSingletonScope(),e(n.ServiceIdentifiers.IOptionsNormalizer).to(a.OptionsNormalizer).inSingletonScope()})},function(e,t,o){"use strict";var r,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=o(28),m=o(0),g=o(1),y=o(65),h=o(175),N=o(176),b=o(177),v=o(31),I=o(20),S=o(32),O=o(24),j=o(40),_=o(178),C=o(179);let R=r=class{constructor(e,t){Object.assign(this,j.DEFAULT_PRESET,e);const o=y.validateSync(this,r.validatorOptions);if(o.length)throw new ReferenceError(`Validation failed. errors:\n${_.ValidationErrorsFormatter.format(o)}`);Object.assign(this,t.normalize(this))}};R.validatorOptions={validationError:{target:!1}},l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"compact",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"controlFlowFlattening",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"controlFlowFlatteningThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"deadCodeInjection",void 0),l([y.IsNumber(),u("design:type",Number)],R.prototype,"deadCodeInjectionThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtection",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtectionInterval",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"disableConsoleOutput",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),C.IsAllowedForObfuscationTargets([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval]),u("design:type",Array)],R.prototype,"domainLock",void 0),l([y.IsIn([v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,v.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,v.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]),u("design:type","function"==typeof(n=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?n:Object)],R.prototype,"identifierNamesGenerator",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"identifiersPrefix",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),y.ValidateIf(e=>e.identifierNamesGenerator===v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),y.ArrayNotEmpty(),u("design:type",Array)],R.prototype,"identifiersDictionary",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFileName",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFilePath",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"log",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"renameGlobals",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedNames",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedStrings",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"rotateStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"selfDefending",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"shuffleStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"sourceMap",void 0),l([y.IsString(),y.ValidateIf(e=>Boolean(e.sourceMapBaseUrl)),y.IsUrl({require_protocol:!0,require_tld:!1,require_valid_protocol:!0}),u("design:type",String)],R.prototype,"sourceMapBaseUrl",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"sourceMapFileName",void 0),l([y.IsIn([S.SourceMapMode.Inline,S.SourceMapMode.Separate]),u("design:type","function"==typeof(i=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?i:Object)],R.prototype,"sourceMapMode",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"splitStrings",void 0),l([y.IsNumber(),y.ValidateIf(e=>Boolean(e.splitStrings)),y.Min(1),u("design:type",Number)],R.prototype,"splitStringsChunkLength",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"stringArray",void 0),l([y.IsIn([!0,!1,O.StringArrayEncoding.Base64,O.StringArrayEncoding.Rc4]),u("design:type","function"==typeof(a=void 0!==N.TStringArrayEncoding&&N.TStringArrayEncoding)?a:Object)],R.prototype,"stringArrayEncoding",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"stringArrayThreshold",void 0),l([y.IsIn([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval,I.ObfuscationTarget.Node]),u("design:type","function"==typeof(s=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?s:Object)],R.prototype,"target",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"transformObjectKeys",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"unicodeEscapeSequence",void 0),R=r=l([m.injectable(),f(0,m.inject(g.ServiceIdentifiers.TInputOptions)),f(1,m.inject(g.ServiceIdentifiers.IOptionsNormalizer)),u("design:paramtypes",["function"==typeof(c=void 0!==h.TInputOptions&&h.TInputOptions)?c:Object,"function"==typeof(d=void 0!==b.IOptionsNormalizer&&b.IOptionsNormalizer)?d:Object])],R),t.Options=R},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static format(e){return e.reduce((e,t)=>[...e,r.formatWithNestedConstraints(t)],[]).join("\n")}static formatWithNestedConstraints(e){const t=e.constraints;return`${`\`${e.property}\` errors:\n`}${Object.keys(t).map(e=>` - ${t[e]}\n`).join()}`}}t.ValidationErrorsFormatter=r},function(e,t,o){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=o(65),i=r(o(180)),a=o(41),s=o(40);t.IsAllowedForObfuscationTargets=function(e,t){return(o,r)=>{n.registerDecorator({propertyName:r,constraints:[e],name:"IsAllowedForObfuscationTargets",options:t,target:o.constructor,validator:{validate(t,o){const n=o.object,a=s.DEFAULT_PRESET[r];return i.default(t,a)||e.includes(n.target)},defaultMessage:t=>`This option allowed only for obfuscation targets: ${e.join(`${a.StringSeparator.Comma} `)}`}})}}},function(e,t){e.exports=require("fast-deep-equal")},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(182),s=o(183),c=o(184),d=o(185),l=o(186),u=o(187),f=o(188),p=o(189),m=o(190),g=o(191),y=o(192),h=o(193),N=o(194);let b=r=class{normalize(e){let t=Object.assign({},e);for(const e of r.normalizerRules)t=e(t);return t}};b.normalizerRules=[a.ControlFlowFlatteningThresholdRule,s.DeadCodeInjectionRule,c.DeadCodeInjectionThresholdRule,d.DomainLockRule,l.InputFileNameRule,u.SeedRule,f.SelfDefendingRule,p.SourceMapBaseUrlRule,m.SourceMapFileNameRule,g.SplitStringsChunkLengthRule,y.StringArrayRule,h.StringArrayEncodingRule,N.StringArrayThresholdRule],b=r=n([i.injectable()],b),t.OptionsNormalizer=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControlFlowFlatteningThresholdRule=e=>(0===e.controlFlowFlatteningThreshold&&(e=Object.assign(Object.assign({},e),{controlFlowFlattening:!1,controlFlowFlatteningThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(40);t.DeadCodeInjectionRule=e=>(e.deadCodeInjection&&((e=Object.assign(Object.assign({},e),{deadCodeInjection:!0,stringArray:!0})).stringArrayThreshold||(e=Object.assign(Object.assign({},e),{stringArray:!0,stringArrayThreshold:r.DEFAULT_PRESET.stringArrayThreshold}))),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeadCodeInjectionThresholdRule=e=>(0===e.deadCodeInjectionThreshold&&(e=Object.assign(Object.assign({},e),{deadCodeInjection:!1,deadCodeInjectionThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(30);t.DomainLockRule=e=>{if(e.domainLock.length){const t=[];for(const o of e.domainLock)t.push(r.Utils.extractDomainFrom(o));e=Object.assign(Object.assign({},e),{domainLock:t})}return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(41);t.InputFileNameRule=e=>{let{inputFileName:t}=e;return t&&(t=t.replace(/^\/+/,"").split(r.StringSeparator.Dot).slice(0,-1).join(r.StringSeparator.Dot)||t,e=Object.assign(Object.assign({},e),{inputFileName:`${t}.js`})),e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeedRule=e=>{if(e.seed)return Object.assign(Object.assign({},e),{seed:e.seed});return Object.assign(Object.assign({},e),{seed:(t=0,o=999999999,Math.floor(Math.random()*(o-t+1)+t))});var t,o}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingRule=e=>(e.selfDefending&&(e=Object.assign(Object.assign({},e),{compact:!0,selfDefending:!0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapBaseUrlRule=e=>{const{sourceMapBaseUrl:t}=e;return e.sourceMapFileName?(t&&!t.endsWith("/")&&(e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:`${t}/`})),e):e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:""})}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(41);t.SourceMapFileNameRule=e=>{let{sourceMapFileName:t}=e;if(t){t=t.replace(/^\/+/,"").replace(/(?:\.js)?(?:\.map)?$/,"");let o=t.split(r.StringSeparator.Dot);const n=o.length,i=o[n-1];n>1&&i.length<=3&&(o=o.slice(0,-1)),t=o.join(r.StringSeparator.Dot),e=Object.assign(Object.assign({},e),{sourceMapFileName:`${t}.js.map`})}return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SplitStringsChunkLengthRule=e=>e=0===e.splitStringsChunkLength?Object.assign(Object.assign({},e),{splitStrings:!1,splitStringsChunkLength:0}):Object.assign(Object.assign({},e),{splitStringsChunkLength:Math.floor(e.splitStringsChunkLength)})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRule=e=>(e.stringArray||(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,shuffleStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(24);t.StringArrayEncodingRule=e=>(!0===e.stringArrayEncoding&&(e=Object.assign(Object.assign({},e),{stringArrayEncoding:r.StringArrayEncoding.Base64})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayThresholdRule=e=>(0===e.stringArrayThreshold&&(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(21),s=o(66),c=o(196),d=o(197),l=o(67),u=o(198),f=o(202),p=o(204),m=o(205),g=o(207),y=o(208),h=o(209);t.preparingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.CommentsTransformer).whenTargetNamed(a.NodeTransformer.CommentsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.CustomNodesTransformer).whenTargetNamed(a.NodeTransformer.CustomNodesTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.EvalCallExpressionTransformer).whenTargetNamed(a.NodeTransformer.EvalCallExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.MetadataTransformer).whenTargetNamed(a.NodeTransformer.MetadataTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.ObfuscatingGuardsTransformer).whenTargetNamed(a.NodeTransformer.ObfuscatingGuardsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ParentificationTransformer).whenTargetNamed(a.NodeTransformer.ParentificationTransformer),e(i.ServiceIdentifiers.INodeGuard).to(c.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.BlackListObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(l.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ConditionalCommentObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(y.ReservedStringObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ReservedStringObfuscatingGuard),e(i.ServiceIdentifiers.Factory__INodeGuard).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeGuard)),e(i.ServiceIdentifiers.INodeTransformer).to(h.VariablePreserveTransformer).whenTargetNamed(a.NodeTransformer.VariablePreserveTransformer)})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=o(4);let c=r=class{constructor(){this.blackListGuardsLength=r.blackListGuards.length}check(e){for(let t=0;t=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(2),m=o(3),g=o(11),y=o(12),h=o(4),N=o(67);let b=r=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case g.TransformationStage.Initializing:return{leave:e=>{if(h.NodeGuards.isProgramNode(e))return this.transformNode(e)}};default:return null}}transformNode(e){if(!e.comments||!e.comments.length)return e;const t=this.transformComments(e.comments);return 0===t.length?e:e.body.length?(f.traverse(e,{enter:o=>{if(o===e)return;const r=t.findIndex(e=>e.range&&o.range&&e.range[0]0&&(e.trailingComments=t.reverse()),e):(e.leadingComments=t,e)}transformComments(e){return e.filter(e=>r.preservedWords.some(t=>e.value.includes(t))||N.ConditionalCommentObfuscatingGuard.isConditionalComment(e)).reverse()}};b.preservedWords=["@license","@preserve"],b=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],b),t.CommentsTransformer=b},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=o(199),g=o(200),y=o(2),h=o(3),N=o(201),b=o(62),v=o(22),I=o(11),S=o(12),O=o(4);let j=class extends S.AbstractNodeTransformer{constructor(e,t,o,r,n,i){super(n,i),this.callsGraphData=[],this.callsGraphAnalyzer=e,this.prevailingKindOfVariablesAnalyzer=t,this.obfuscationEventEmitter=o,this.customNodeGroupStorage=r}getVisitor(e){switch(e){case I.TransformationStage.Preparing:return{leave:(e,t)=>{if(O.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.appendCustomNodesBeforeObfuscation(e,t),this.transformNode(e,t)}};case I.TransformationStage.Finalizing:return{leave:(e,t)=>{O.NodeGuards.isProgramNode(e)&&this.appendCustomNodesAfterObfuscation(e,t)}};default:return null}}analyzeNode(e,t){this.callsGraphData=this.callsGraphAnalyzer.analyze(e),this.prevailingKindOfVariablesAnalyzer.analyze(e)}transformNode(e,t){return e}appendCustomNodesBeforeObfuscation(e,t){this.customNodeGroupStorage.getStorage().forEach(e=>{e.initialize(),this.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(v.ObfuscationEvent.BeforeObfuscation,e,this.callsGraphData)}appendCustomNodesAfterObfuscation(e,t){this.obfuscationEventEmitter.emit(v.ObfuscationEvent.AfterObfuscation,e,this.callsGraphData)}};j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.ICallsGraphAnalyzer)),u(1,f.inject(p.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),u(2,f.inject(p.ServiceIdentifiers.IObfuscationEventEmitter)),u(3,f.inject(p.ServiceIdentifiers.TCustomNodeGroupStorage)),u(4,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(5,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(r=void 0!==N.ICallsGraphAnalyzer&&N.ICallsGraphAnalyzer)?r:Object,"function"==typeof(n=void 0!==b.IPrevailingKindOfVariablesAnalyzer&&b.IPrevailingKindOfVariablesAnalyzer)?n:Object,"function"==typeof(i=void 0!==g.IObfuscationEventEmitter&&g.IObfuscationEventEmitter)?i:Object,"function"==typeof(a=void 0!==m.TCustomNodeGroupStorage&&m.TCustomNodeGroupStorage)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.CustomNodesTransformer=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(203)),p=o(2),m=o(3),g=o(11),y=o(12),h=o(8),N=o(4),b=o(6);let v=r=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t),this.evalRootAstHostNodeSet=new Set}static extractEvalStringFromCallExpressionArgument(e){return N.NodeGuards.isLiteralNode(e)?r.extractEvalStringFromLiteralNode(e):N.NodeGuards.isTemplateLiteralNode(e)?r.extractEvalStringFromTemplateLiteralNode(e):null}static extractEvalStringFromLiteralNode(e){return"string"==typeof e.value?e.value:null}static extractEvalStringFromTemplateLiteralNode(e){const t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(t&&N.NodeGuards.isCallExpressionNode(e)&&N.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return this.transformNode(e,t)}};case g.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:(e,t)=>{if(t&&this.isEvalRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}transformNode(e,t){const o=e.arguments[0];if(!o)return e;const n=r.extractEvalStringFromCallExpressionArgument(o);if(!n)return e;let i;try{i=b.NodeUtils.convertCodeToStructure(n)}catch(t){return e}const a=h.NodeFactory.functionExpressionNode([],h.NodeFactory.blockStatementNode(i));return this.evalRootAstHostNodeSet.add(a),a}restoreNode(e,t){const o=e.body.body,r=b.NodeUtils.convertStructureToCode(o);return h.NodeFactory.callExpressionNode(h.NodeFactory.identifierNode("eval"),[h.NodeFactory.literalNode(f.default(r))])}isEvalRootAstHostNode(e){return N.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}};v=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],v),t.EvalCallExpressionTransformer=v},function(e,t){e.exports=require("js-string-escape")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(4),g=o(15);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return g.NodeMetadata.set(e,{ignoredNode:!1}),m.NodeGuards.isLiteralNode(e)&&g.NodeMetadata.set(e,{replacedLiteral:!1}),e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MetadataTransformer=y},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(206),p=o(2),m=o(3),g=o(66),y=o(11),h=o(12),N=o(15);let b=r=class extends h.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.obfuscatingGuards=r.obfuscatingGuardsList.map(e)}getVisitor(e){switch(e){case y.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){const o=this.obfuscatingGuards.every(t=>t.check(e));return N.NodeMetadata.set(e,{ignoredNode:!o}),e}};b.obfuscatingGuardsList=[g.ObfuscatingGuard.BlackListObfuscatingGuard,g.ObfuscatingGuard.ConditionalCommentObfuscatingGuard,g.ObfuscatingGuard.ReservedStringObfuscatingGuard],b=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__INodeGuard)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TObfuscatingGuardFactory&&f.TObfuscatingGuardFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.ObfuscatingGuardsTransformer=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(6);let g=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return m.NodeUtils.parentizeNode(e,t)}};g=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],g),t.ParentificationTransformer=g},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(2),d=o(1),l=o(4);let u=class{constructor(e){this.options=e}check(e){return!this.options.reservedStrings.length||!l.NodeGuards.isLiteralNode(e)||"string"!=typeof e.value||!this.isReservedString(e.value)}isReservedString(e){return this.options.reservedStrings.some(t=>null!==new RegExp(t,"g").exec(e))}};u=n([s.injectable(),a(0,s.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==c.IOptions&&c.IOptions)?r:Object])],u),t.ReservedStringObfuscatingGuard=u},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(50),u=o(2),f=o(3),p=o(38),m=o(1),g=o(11),y=o(12),h=o(4);let N=class extends y.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(h.NodeGuards.isIdentifierNode(e)&&t&&(h.NodeGuards.parentNodeIsPropertyNode(e,t)||h.NodeGuards.parentNodeIsMemberExpressionNode(e,t)||h.NodeGuards.parentNodeIsMethodDefinitionNode(e,t)||h.NodeGuards.isLabelIdentifierNode(e,t)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return this.identifierObfuscatingReplacer.preserveName(e.name),e}};N=a([d.injectable(),c(0,d.inject(m.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,d.inject(m.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(m.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==l.TIdentifierObfuscatingReplacerFactory&&l.TIdentifierObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.VariablePreserveTransformer=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(211),a=o(212),s=o(214);t.storagesModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.TCustomNodeGroupStorage).to(a.CustomNodeGroupStorage).inSingletonScope(),e(n.ServiceIdentifiers.IStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(n.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(i.ControlFlowStorage),e(n.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(e=>()=>{const t=new(e.container.get(n.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(n.ServiceIdentifiers.IRandomGenerator),e.container.get(n.ServiceIdentifiers.IOptions));return t.initialize(),t})})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(51);let p=class extends f.MapStorage{constructor(e,t){super(e,t)}};p=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.ControlFlowStorage=p},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(213),p=o(2),m=o(3),g=o(61),y=o(51);let h=r=class extends y.MapStorage{constructor(e,t,o){super(t,o),this.customNodeGroupFactory=e}initialize(){super.initialize(),r.customNodeGroupsList.forEach(e=>{const t=this.customNodeGroupFactory(e);this.storage.set(e,t)})}};h.customNodeGroupsList=[g.CustomNodeGroup.ConsoleOutputCustomNodeGroup,g.CustomNodeGroup.DebugProtectionCustomNodeGroup,g.CustomNodeGroup.DomainLockCustomNodeGroup,g.CustomNodeGroup.SelfDefendingCustomNodeGroup,g.CustomNodeGroup.StringArrayCustomNodeGroup],s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],h.prototype,"initialize",null),h=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__ICustomNodeGroup)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TCustomNodeGroupFactory&&f.TCustomNodeGroupFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.CustomNodeGroupStorage=h},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=o(5),y=o(34),h=o(48),N=o(29),b=o(2),v=o(3),I=o(7),S=o(24),O=o(51);let j=r=class extends O.MapStorage{constructor(e,t,o,n,i,a){super(o,n),this.rc4EncodedValuesSourcesCache=new Map,this.rotationAmount=0,this.identifierNamesGenerator=e(n),this.arrayUtils=t,this.cryptUtils=i,this.escapeSequenceEncoder=a,this.rc4Keys=this.randomGenerator.getRandomGenerator().n(()=>this.randomGenerator.getRandomGenerator().string({length:r.rc4KeyLength}),r.rc4KeysCount)}initialize(){super.initialize();const e=this.identifierNamesGenerator.generate(r.stringArrayNameLength),t=this.identifierNamesGenerator.generate(r.stringArrayNameLength);this.stringArrayStorageName=`${this.options.identifiersPrefix}${e}`,this.stringArrayStorageCallsWrapperName=`${this.options.identifiersPrefix}${t}`,this.rotationAmount=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(r.minimumRotationAmount,r.maximumRotationAmount):0}get(e){return this.getOrSetIfDoesNotExist(e)}getRotationAmount(){return this.rotationAmount}getStorageId(){return this.stringArrayStorageName}getStorageName(){return this.getStorageId()}getStorageCallsWrapperName(){return this.stringArrayStorageCallsWrapperName}rotateStorage(){this.getLength()&&(this.storage=new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()),this.rotationAmount)))}shuffleStorage(){this.storage=new Map(this.arrayUtils.shuffle(Array.from(this.storage.entries())).map(([e,t],o)=>(t.index=o,[e,t])).sort(([,e],[,t])=>e.index-t.index))}toString(){return Array.from(this.storage.values()).map(e=>`'${this.escapeSequenceEncoder.encode(e.encodedValue,this.options.unicodeEscapeSequence)}'`).toString()}getOrSetIfDoesNotExist(e){const{encodedValue:t,decodeKey:o}=this.getEncodedValue(e),r=this.storage.get(t);if(r)return r;const n={encodedValue:t,decodeKey:o,value:e,index:this.getLength()};return this.storage.set(t,n),n}getEncodedValue(e){var t;switch(this.options.stringArrayEncoding){case S.StringArrayEncoding.Rc4:{const o=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),r=this.cryptUtils.btoa(this.cryptUtils.rc4(e,o)),n=null!==(t=this.rc4EncodedValuesSourcesCache.get(r))&&void 0!==t?t:[];let i=n.length;return(!i||!n.includes(e))&&(n.push(e),i++),this.rc4EncodedValuesSourcesCache.set(r,n),i>1?this.getEncodedValue(e):{encodedValue:r,decodeKey:o}}case S.StringArrayEncoding.Base64:{const t=null;return{encodedValue:this.cryptUtils.btoa(e),decodeKey:t}}default:return{encodedValue:e,decodeKey:null}}}};j.minimumRotationAmount=100,j.maximumRotationAmount=500,j.rc4KeyLength=4,j.rc4KeysCount=50,j.stringArrayNameLength=7,l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageName",void 0),l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageCallsWrapperName",void 0),l([p.postConstruct(),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],j.prototype,"initialize",null),j=r=l([p.injectable(),f(0,p.inject(m.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),f(1,p.inject(m.ServiceIdentifiers.IArrayUtils)),f(2,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f(3,p.inject(m.ServiceIdentifiers.IOptions)),f(4,p.inject(m.ServiceIdentifiers.ICryptUtils)),f(5,p.inject(m.ServiceIdentifiers.IEscapeSequenceEncoder)),u("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==b.IOptions&&b.IOptions)?s:Object,"function"==typeof(c=void 0!==h.ICryptUtils&&h.ICryptUtils)?c:Object,"function"==typeof(d=void 0!==N.IEscapeSequenceEncoder&&N.IEscapeSequenceEncoder)?d:Object])],j),t.StringArrayStorage=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(216),a=o(217),s=o(221),c=o(222),d=o(223),l=o(68);t.utilsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IArrayUtils).to(i.ArrayUtils).inSingletonScope(),e(n.ServiceIdentifiers.IRandomGenerator).to(l.RandomGenerator).inSingletonScope(),e(n.ServiceIdentifiers.ICryptUtils).to(a.CryptUtils).inSingletonScope(),e(n.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope(),e(n.ServiceIdentifiers.ILevelledTopologicalSorter).to(c.LevelledTopologicalSorter),e(n.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder).to(d.NodeTransformerNamesGroupsBuilder).inSingletonScope()})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(3);let l=class{constructor(e){this.randomGenerator=e}createWithRange(e){const t=[];for(let o=0;on&&(r=i,n=e),o[i]=e}return r}rotate(e,t){if(!e.length)throw new ReferenceError("Cannot rotate empty array.");if(t<=0)return e;const o=e;let r;for(;t--;)r=o.pop(),r&&o.unshift(r);return o}shuffle(e){const t=[...e];for(let e=t.length;e;e--){const o=Math.floor(this.randomGenerator.getMathRandom()*e);[t[e-1],t[o]]=[t[o],t[e-1]]}return t}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IRandomGenerator&&d.IRandomGenerator)?r:Object])],l),t.ArrayUtils=l},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(3),l=o(68),u=o(30);let f=class{constructor(e){this.randomGenerator=e}btoa(e){let t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(`${u.Utils.hexadecimalPrefix}${t}`,16)));for(let o,r,n=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|n)||(i="=",n%1);t+=i.charAt(63&o>>8-n%1*8)){if(r=e.charCodeAt(n+=.75),r>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|r}return t}hideString(e,t){let o=this.randomGenerator.getRandomGenerator().string({length:t,pool:l.RandomGenerator.randomGeneratorPool}).replace(new RegExp(`[${r=e,r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}]`,"g"),"");var r;const n=o.split("");return this.randomGenerator.getRandomGenerator().shuffle(n),o=n.join(""),[((e,t)=>{let o=-1,r=-1,n="";for(;o=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.stringsCache=new Map}encode(e,t){const o=`${e}-${String(t)}`;if(this.stringsCache.has(o))return this.stringsCache.get(o);const r=new RegExp("[\\s\\S]","g"),n=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const c=e.replace(r,e=>t||n.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(o,c),this.stringsCache.set(`${c}-${String(t)}`,c),c}};n=r([o(0).injectable()],n),t.EscapeSequenceEncoder=n},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],o={};for(const r of e)void 0===o[r]&&this.visit(t,o,r);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const o of t){for(let t=o.length-1;t>=0;t-=1)o[t]===e&&o.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const o of e)this.hasPrecedents(o)||t.push(o);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const o=this.graph.get(t);return o&&!o.includes(e)&&o.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,o){const r=t[o];if("visiting"===r)throw new Error(`Detected cycle involving node: ${o}`);if(r)return;t[o]="visiting";const n=this.getPrecedents(o);for(const o of n)this.visit(e,t,o);t[o]="ok",e.push(o)}};n=r([o(0).injectable()],n),t.LevelledTopologicalSorter=n},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(224);let l=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),o=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of o)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const o=[];for(const r of e){const e=t[r].runAfter;if(e&&e.length)for(const n of e){void 0===t[n]?o.push([r,null]):o.push([n,r])}else o.push([r,null])}return o}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.ILevelledTopologicalSorter)),i("design:paramtypes",["function"==typeof(r=void 0!==d.ILevelledTopologicalSorter&&d.ILevelledTopologicalSorter)?r:Object])],l),t.NodeTransformerNamesGroupsBuilder=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=f(o(46)),y=o(226),h=o(227),N=o(2),b=o(3),v=o(57),I=o(228),S=o(21),O=o(11),j=o(43),_=o(55),C=o(4);let R=r=class{constructor(e,t,o,r,n){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=o,this.logger=r,this.options=n}obfuscate(e){const t=Date.now();this.logger.info(I.LoggingMessage.Version,"0.24.5"),this.logger.info(I.LoggingMessage.ObfuscationStarted),this.logger.info(I.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const o=this.parseCode(e),r=this.transformAstTree(o),n=this.generateCode(e,r),i=(Date.now()-t)/1e3;return this.logger.success(I.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(n)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return _.ASTParserFacade.parse(t,r.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,O.TransformationStage.Initializing),!C.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,O.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,O.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,O.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,O.TransformationStage.Converting),e=this.runTransformationStage(e,O.TransformationStage.Obfuscating),e=this.runTransformationStage(e,O.TransformationStage.Finalizing)):(this.logger.warn(I.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const o=Object.assign({},r.escodegenParams);this.options.sourceMap&&(o.sourceMap=this.options.inputFileName||"sourceMap",o.sourceContent=e);const n=g.generate(t,Object.assign(Object.assign({},o),{format:{compact:this.options.compact}}));return n.map=n.map?n.map.toString():"",n}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(I.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,r.transformersList,t)}};R.parseOptions={ecmaVersion:j.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},R.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},R.transformersList=[S.NodeTransformer.BlockStatementControlFlowTransformer,S.NodeTransformer.CommentsTransformer,S.NodeTransformer.CustomNodesTransformer,S.NodeTransformer.DeadCodeInjectionTransformer,S.NodeTransformer.EvalCallExpressionTransformer,S.NodeTransformer.FunctionControlFlowTransformer,S.NodeTransformer.LabeledStatementTransformer,S.NodeTransformer.LiteralTransformer,S.NodeTransformer.MemberExpressionTransformer,S.NodeTransformer.MetadataTransformer,S.NodeTransformer.MethodDefinitionTransformer,S.NodeTransformer.ObfuscatingGuardsTransformer,S.NodeTransformer.ObjectExpressionKeysTransformer,S.NodeTransformer.ObjectExpressionTransformer,S.NodeTransformer.ParentificationTransformer,S.NodeTransformer.ScopeIdentifiersTransformer,S.NodeTransformer.SplitStringTransformer,S.NodeTransformer.TemplateLiteralTransformer,S.NodeTransformer.VariablePreserveTransformer],R=r=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.ITransformersRunner)),u(1,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(2,p.inject(m.ServiceIdentifiers.Factory__IObfuscatedCode)),u(3,p.inject(m.ServiceIdentifiers.ILogger)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==v.ITransformersRunner&&v.ITransformersRunner)?n:Object,"function"==typeof(i=void 0!==b.IRandomGenerator&&b.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.TObfuscatedCodeFactory&&y.TObfuscatedCodeFactory)?a:Object,"function"==typeof(s=void 0!==h.ILogger&&h.ILogger)?s:Object,"function"==typeof(c=void 0!==N.IOptions&&N.IOptions)?c:Object])],R),t.JavaScriptObfuscator=R},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(230));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=r([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t){e.exports=require("eventemitter3")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(48),u=o(7),f=o(32),p=o(2);let m=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case f.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case f.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};i([u.initializable(),a("design:type",String)],m.prototype,"obfuscatedCode",void 0),i([u.initializable(),a("design:type",String)],m.prototype,"sourceMap",void 0),m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.ICryptUtils)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==l.ICryptUtils&&l.ICryptUtils)?r:Object,"function"==typeof(n=void 0!==p.IOptions&&p.IOptions)?n:Object])],m),t.ObfuscatedCode=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(234),p=o(235),m=o(236),g=o(4),y=o(15);let h=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,o){if(!t.length)return e;let r,n;this.cachedNodeTransformersData.has(t)?[r,n]=this.cachedNodeTransformersData.get(t):(r=this.buildNormalizedNodeTransformers(t),n=this.nodeTransformerNamesGroupsBuilder.build(r),this.cachedNodeTransformersData.set(t,[r,n]));for(const t of n){const n=[],i=[];for(const e of t){const t=r[e].getVisitor(o);t&&(t.enter&&n.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(n.length||i.length)&&u.replace(e,{enter:this.mergeVisitorsForDirection(n,m.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,m.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const o=e.length;return o?(r,n)=>{if(y.NodeMetadata.isIgnoredNode(r))return u.VisitorOption.Skip;for(let i=0;ie}};h=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__INodeTransformer)),s(1,d.inject(l.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),a("design:paramtypes",["function"==typeof(r=void 0!==f.TNodeTransformerFactory&&f.TNodeTransformerFactory)?r:Object,"function"==typeof(n=void 0!==p.INodeTransformerNamesGroupsBuilder&&p.INodeTransformerNamesGroupsBuilder)?n:Object])],h),t.TransformersRunner=h},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=d(o(243)),u=d(o(238)),f=o(244),p=o(7),m=o(40),g=o(245),y=o(246),h=o(247),N=o(248),b=o(249),v=o(250),I=o(251),S=o(25),O=o(253),j=o(255);class _{constructor(e){this.rawArguments=e,this.arguments=e.slice(2)}static buildOptions(e,t){const o=_.filterOptions(e),r=e.config,n=r?u.resolve(r,"."):"",i=n?I.CLIUtils.getUserConfig(n):{},a=u.basename(t),s=t;return Object.assign(Object.assign(Object.assign(Object.assign({},m.DEFAULT_PRESET),i),o),{inputFileName:a,inputFilePath:s})}static filterOptions(e){const t={};return Object.keys(e).forEach(o=>{void 0!==e[o]&&(t[o]=e[o])}),t}initialize(){this.inputPath=u.normalize(this.arguments[0]||""),this.commands=new l.Command,this.configureCommands(),this.configureHelp(),this.inputCLIOptions=this.commands.opts(),this.sourceCodeReader=new j.SourceCodeReader(this.inputPath,this.inputCLIOptions),this.obfuscatedCodeWriter=new O.ObfuscatedCodeWriter(this.inputPath,this.inputCLIOptions)}run(){if(!this.arguments.length||this.arguments.includes("--help"))return void this.commands.outputHelp();const e=this.sourceCodeReader.readSourceCode();this.processSourceCodeData(e)}configureCommands(){this.commands.usage(" [options]").version(null!=="0.24.5"?"0.24.5":"unknown","-v, --version").option("-o, --output ","Output path for obfuscated code").option("--compact ","Disable one line output code compacting",y.BooleanSanitizer).option("--config ","Name of js / json config file").option("--control-flow-flattening ","Enables control flow flattening",y.BooleanSanitizer).option("--control-flow-flattening-threshold ","The probability that the control flow flattening transformation will be applied to the node",parseFloat).option("--dead-code-injection ","Enables dead code injection",y.BooleanSanitizer).option("--dead-code-injection-threshold ","The probability that the dead code injection transformation will be applied to the node",parseFloat).option("--debug-protection ","Disable browser Debug panel (can cause DevTools enabled browser freeze)",y.BooleanSanitizer).option("--debug-protection-interval ","Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)",y.BooleanSanitizer).option("--disable-console-output ","Allow console.log, console.info, console.error and console.warn messages output into browser console",y.BooleanSanitizer).option("--domain-lock (comma separated, without whitespaces)","Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)",g.ArraySanitizer).option("--exclude (comma separated, without whitespaces)","A filename or glob which indicates files to exclude from obfuscation",g.ArraySanitizer).option("--identifier-names-generator ","Sets identifier names generator. Values: hexadecimal, mangled, dictionary. Default: hexadecimal",h.IdentifierNamesGeneratorSanitizer).option("--identifiers-prefix ","Sets prefix for all global identifiers.").option("--identifiers-dictionary (comma separated, without whitespaces)","Identifiers dictionary (comma separated) for `--identifier-names-generator dictionary` option",g.ArraySanitizer).option("--log ","Enables logging of the information to the console",y.BooleanSanitizer).option("--reserved-names (comma separated, without whitespaces)","Disables obfuscation and generation of identifiers, which being matched by passed RegExp patterns (comma separated)",g.ArraySanitizer).option("--reserved-strings (comma separated, without whitespaces)","Disables transformation of string literals, which being matched by passed RegExp patterns (comma separated)",g.ArraySanitizer).option("--rename-globals ","Allows to enable obfuscation of global variable and function names with declaration.",y.BooleanSanitizer).option("--rotate-string-array ","Enable rotation of string array values during obfuscation",y.BooleanSanitizer).option("--seed ","Sets seed for random generator. This is useful for creating repeatable results.",parseFloat).option("--self-defending ","Disables self-defending for obfuscated code",y.BooleanSanitizer).option("--shuffle-string-array ","Randomly shuffles string array items",y.BooleanSanitizer).option("--source-map ","Enables source map generation",y.BooleanSanitizer).option("--source-map-base-url ","Sets base url to the source map import url when `--source-map-mode=separate`").option("--source-map-file-name ","Sets file name for output source map when `--source-map-mode=separate`").option("--source-map-mode ","Specify source map output mode. Values: inline, separate. Default: separate",b.SourceMapModeSanitizer).option("--split-strings ","Splits literal strings into chunks with length of `splitStringsChunkLength` option value",y.BooleanSanitizer).option("--split-strings-chunk-length ","Sets chunk length of `splitStrings` option",parseFloat).option("--string-array ","Disables gathering of all literal strings into an array and replacing every literal string with an array call",y.BooleanSanitizer).option("--string-array-encoding ","Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed. Values: true, false, base64, rc4. Default: false",v.StringArrayEncodingSanitizer).option("--string-array-threshold ","The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)",parseFloat).option("--target ","Allows to set target environment for obfuscated code. Values: browser, browser-no-eval, node. Default: browser",N.ObfuscationTargetSanitizer).option("--transform-object-keys ","Enables transformation of object keys",y.BooleanSanitizer).option("--unicode-escape-sequence ","Allows to enable/disable string conversion to unicode escape sequence",y.BooleanSanitizer).parse(this.rawArguments)}configureHelp(){this.commands.on("--help",()=>{console.log(" Examples:\n"),console.log(" %> javascript-obfuscator input_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_directory_name --compact true --self-defending false"),console.log("")})}processSourceCodeData(e){e.forEach(({filePath:e,content:t},o)=>{const r=this.obfuscatedCodeWriter.getOutputCodePath(e);this.processSourceCode(t,e,r,o)})}processSourceCode(e,t,o,r){var n;let i=_.buildOptions(this.inputCLIOptions,t);if(null!==r){const e=`${null!==(n=this.inputCLIOptions.identifiersPrefix)&&void 0!==n?n:_.baseIdentifiersPrefix}${r}`;i=Object.assign(Object.assign({},i),{identifiersPrefix:e})}i.sourceMap?this.processSourceCodeWithSourceMap(e,o,i):this.processSourceCodeWithoutSourceMap(e,o,i)}processSourceCodeWithoutSourceMap(e,t,o){const r=S.JavaScriptObfuscator.obfuscate(e,o).getObfuscatedCode();this.obfuscatedCodeWriter.writeFile(t,r)}processSourceCodeWithSourceMap(e,t,o){var r;const n=this.obfuscatedCodeWriter.getOutputSourceMapPath(t,null!==(r=o.sourceMapFileName)&&void 0!==r?r:"");o=Object.assign(Object.assign({},o),{sourceMapFileName:u.basename(n)});const i=S.JavaScriptObfuscator.obfuscate(e,o);this.obfuscatedCodeWriter.writeFile(t,i.getObfuscatedCode()),"separate"===o.sourceMapMode&&i.getSourceMap()&&this.obfuscatedCodeWriter.writeFile(n,i.getSourceMap())}}_.encoding="utf8",_.obfuscatedFilePrefix="-obfuscated",_.baseIdentifiersPrefix="a",s([p.initializable(),c("design:type","function"==typeof(r=void 0!==l&&l.CommanderStatic)?r:Object)],_.prototype,"commands",void 0),s([p.initializable(),c("design:type","function"==typeof(n=void 0!==f.TInputCLIOptions&&f.TInputCLIOptions)?n:Object)],_.prototype,"inputCLIOptions",void 0),s([p.initializable(),c("design:type",String)],_.prototype,"inputPath",void 0),s([p.initializable(),c("design:type","function"==typeof(i=void 0!==j.SourceCodeReader&&j.SourceCodeReader)?i:Object)],_.prototype,"sourceCodeReader",void 0),s([p.initializable(),c("design:type","function"==typeof(a=void 0!==O.ObfuscatedCodeWriter&&O.ObfuscatedCodeWriter)?a:Object)],_.prototype,"obfuscatedCodeWriter",void 0),t.JavaScriptObfuscatorCLI=_},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("fs")},,function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(242);e.exports=r.JavaScriptObfuscatorCLI},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(69);const r=o(237);t.JavaScriptObfuscatorCLI=class{static obfuscate(e){const t=new r.JavaScriptObfuscatorCLI(e);t.initialize(),t.run()}}},function(e,t){e.exports=require("commander")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArraySanitizer=e=>{if(e.endsWith(","))throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1','value2'");return e.split(",").map(e=>e.trim())}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=e=>"true"===e||"1"===e},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31);t.IdentifierNamesGeneratorSanitizer=e=>{if(!Object.keys(r.IdentifierNamesGenerator).some(t=>r.IdentifierNamesGenerator[t]===e))throw new ReferenceError("Invalid value of `--identifier-names-generator` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(20);t.ObfuscationTargetSanitizer=e=>{if(!Object.keys(r.ObfuscationTarget).some(t=>r.ObfuscationTarget[t]===e))throw new ReferenceError("Invalid value of `--target` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(32);t.SourceMapModeSanitizer=e=>{if(!Object.keys(r.SourceMapMode).some(t=>r.SourceMapMode[t]===e))throw new ReferenceError("Invalid value of `--source-map-mode` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(24);t.StringArrayEncodingSanitizer=e=>{switch(e){case"true":case"1":case r.StringArrayEncoding.Base64:return!0;case r.StringArrayEncoding.Rc4:return r.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CLIUtils=class{static getUserConfig(e){let t;try{t=o(252)(e)}catch(o){try{t=require(e)}catch(e){throw new ReferenceError("Given config path must be a valid `.js` or `.json` file path")}}return t}}},function(e,t){function o(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}o.keys=function(){return[]},o.resolve=o,e.exports=o,o.id=252},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(239)),i=r(o(254)),a=r(o(238)),s=o(41),c=o(237);t.ObfuscatedCodeWriter=class{constructor(e,t){this.inputPath=e,this.options=t}getOutputCodePath(e){const t=this.options.output?a.normalize(this.options.output):null;if(!t)return a.normalize(e).split(s.StringSeparator.Dot).map((e,t)=>0===t?`${e}${c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix}`:e).join(s.StringSeparator.Dot);const o=n.lstatSync(this.inputPath).isDirectory(),r=""===a.extname(t);if(o){if(r)return a.join(t,e);throw new Error("Output path for directory obfuscation should be a directory path")}return r?a.join(t,a.basename(e)):t}getOutputSourceMapPath(e,t=""){return t&&(e=`${e.substring(0,e.lastIndexOf("/"))}/${t}`),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e=`${e.split(s.StringSeparator.Dot)[0]}.js.map`,e}writeFile(e,t){i.sync(a.dirname(e)),n.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}},function(e,t){e.exports=require("mkdirp")},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(o(239)),a=r(o(238)),s=n(o(256)),c=o(71),d=o(237),l=o(70);class u{constructor(e,t){this.inputPath=e,this.options=t}static isExcludedPath(e,t=[]){if(!t.length)return!1;const o=a.basename(e),r=!!s.default([e],t).length;return t.some(t=>e.includes(t)||o.includes(t))||r}static isDirectoryPath(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}static isFilePath(e){try{return i.statSync(e).isFile()}catch(e){return!1}}static isValidDirectory(e,t=[]){return!u.isExcludedPath(e,t)}static isValidFile(e,t=[]){return u.availableInputExtensions.includes(a.extname(e))&&!e.includes(d.JavaScriptObfuscatorCLI.obfuscatedFilePrefix)&&!u.isExcludedPath(e,t)}static logFilePath(e){const t=a.normalize(e);l.Logger.log(l.Logger.colorInfo,c.LoggingPrefix.CLI,`Obfuscating file: ${t}...`)}static readFile(e){return u.logFilePath(e),{filePath:e,content:i.readFileSync(e,d.JavaScriptObfuscatorCLI.encoding)}}readSourceCode(){if(u.isFilePath(this.inputPath)&&u.isValidFile(this.inputPath,this.options.exclude))return[u.readFile(this.inputPath)];if(u.isDirectoryPath(this.inputPath)&&u.isValidDirectory(this.inputPath,this.options.exclude))return this.readDirectoryRecursive(this.inputPath);const e=u.availableInputExtensions.map(e=>`\`${e}\``).join(", ");throw new ReferenceError(`Given input path must be a valid ${e} file or directory path`)}readDirectoryRecursive(e,t=[]){return i.readdirSync(e,d.JavaScriptObfuscatorCLI.encoding).forEach(o=>{const r=`${e}/${o}`;if(u.isDirectoryPath(r)&&u.isValidDirectory(r,this.options.exclude))t.push(...this.readDirectoryRecursive(r));else if(u.isFilePath(r)&&u.isValidFile(r,this.options.exclude)){const e=u.readFile(r);t.push(e)}else;}),t}}t.SourceCodeReader=u,u.availableInputExtensions=[".js"]},function(e,t){e.exports=require("multimatch")}]); +require("source-map-support").install(),module.exports=function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=241)}([function(e,t){e.exports=require("inversify")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(33);class n{static isArrayPatternNode(e){return e.type===r.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===r.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===r.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===r.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===r.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===r.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===r.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===r.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===r.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===r.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===r.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===r.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===r.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return n.isFunctionDeclarationNode(e)||n.isFunctionExpressionNode(e)||n.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===r.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===r.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===r.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===r.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===r.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const o=n.isLabeledStatementNode(t)&&t.label===e,r=n.isContinueStatementNode(t)&&t.label===e,i=n.isBreakStatementNode(t)&&t.label===e;return o||r||i}static isLabeledStatementNode(e){return e.type===r.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===r.NodeType.Literal}static isMemberExpressionNode(e){return e.type===r.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===r.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return n.isProgramNode(e)||n.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return n.isNodeWithLexicalScope(e)||n.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return n.isProgramNode(e)||n.isBlockStatementNode(e)&&n.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return n.isProgramNode(e)||n.isBlockStatementNode(e)||n.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===r.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===r.NodeType.ObjectExpression}static isProgramNode(e){return e.type===r.NodeType.Program}static isPropertyNode(e){return e.type===r.NodeType.Property}static parentNodeIsPropertyNode(e,t){return n.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return n.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return n.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===r.NodeType.RestElement}static isReturnStatementNode(e){return e.type===r.NodeType.ReturnStatement}static isSuperNode(e){return e.type===r.NodeType.Super}static isSwitchCaseNode(e){return e.type===r.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===r.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===r.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===r.NodeType.UnaryExpression}static isUseStrictOperator(e){return n.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===r.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===r.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===r.NodeType.WhileStatement}}t.NodeGuards=n,n.nodesWithLexicalStatements=[r.NodeType.ArrowFunctionExpression,r.NodeType.FunctionDeclaration,r.NodeType.FunctionExpression,r.NodeType.MethodDefinition]},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(46)),i=r(o(13)),a=o(43),s=o(55),c=o(4),d=o(15);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:n.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),c.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+n.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return c.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(o=>{if("parentNode"===o)return;const r=e[o];let n;n=null===r||r instanceof RegExp?r:Array.isArray(r)?r.map(l.cloneRecursive):"object"==typeof r?l.cloneRecursive(r):r,t[o]=n}),t}}t.NodeUtils=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={configurable:!0,enumerable:!0};function n(e,t,o){Reflect.hasMetadata(e,o)||Reflect.defineMetadata(e,t,o)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(o,i)=>{const a=o[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return n("_initialized",!1,o),n("_initializablePropertiesSet",new Set,o),n("_wrappedMethodsSet",new Set,o),function(e,t){const o=Object.getOwnPropertyNames(e),n=[t,"constructor"];o.forEach(o=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(n.includes(o)||a.has(o)||s.has(o))return;if("function"!=typeof e[o])return;const c=null!==(i=Object.getOwnPropertyDescriptor(e,o))&&void 0!==i?i:r,d=c.value;Object.defineProperty(e,o,Object.assign(Object.assign({},c),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(o)})}(o,e),function(e,t,o){var n;const i=null!==(n=Object.getOwnPropertyDescriptor(e,t))&&void 0!==n?n:r,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[o],e}}))}(o,e,i),function(e,t){var o;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const n=`_${t.toString()}`,i=null!==(o=Object.getOwnPropertyDescriptor(e,n))&&void 0!==o?o:r;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[n])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[n]},set:function(e){this[n]=e}})),i}(o,i)}}},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(46)),i=o(33);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,o){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,o){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,o){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:o,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,o){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},o&&{alternate:o}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:n.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,o){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:o,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,o=!1){return{type:i.NodeType.MemberExpression,computed:o,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,o,r){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:o,computed:r,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,o=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:o,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,o=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:o,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(113),N=o(114);let b=r=class{constructor(e,t,o,r){this.cachedNode=null,this.identifierNamesGenerator=e(r),this.customNodeFormatter=t,this.randomGenerator=o,this.options=r}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(r.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};b.globalVariableTemplateFunctions=[h.GlobalVariableTemplate1(),N.GlobalVariableTemplate2()],b=r=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],b),t.AbstractCustomNode=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3);let f=class{constructor(e,t){this.randomGenerator=e,this.options=t}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractNodeTransformer=f},function(e,t){e.exports=require("estraverse")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static getParentNodeWithStatements(e){return n.getParentNodesWithStatementsRecursive(e,1)[0]}static getParentNodesWithStatements(e){return n.getParentNodesWithStatementsRecursive(e)}static getNextSiblingStatement(e){return n.getSiblingStatementByOffset(e,1)}static getPreviousSiblingStatement(e){return n.getSiblingStatementByOffset(e,-1)}static getRootStatementOfNode(e){if(r.NodeGuards.isProgramNode(e))throw new Error("Unable to find root statement for `Program` node");const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithStatements(t)?e:n.getRootStatementOfNode(t)}static getScopeOfNode(e){const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithStatements(t)?t:n.getScopeOfNode(t)}static getParentNodesWithStatementsRecursive(e,t=1/0,o=[],i=0){if(o.length>=t)return o;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(r.NodeGuards.isProgramNode(e)||r.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&o.push(e),e!==a?n.getParentNodesWithStatementsRecursive(a,t,o,++i):o}static getSiblingStatementByOffset(e,t){const o=n.getScopeOfNode(e),i=r.NodeGuards.isSwitchCaseNode(o)?o.consequent:o.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static set(e,t){var o;e.metadata=Object.assign(null!==(o=e.metadata)&&void 0!==o?o:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===r.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===r.get(e,"replacedLiteral")}}t.NodeMetadata=r},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(72),a=o(82),s=o(95),c=o(106),d=o(156),l=o(157),u=o(161),f=o(162),p=o(173),m=o(195),g=o(210),y=o(215),h=o(225),N=o(70),b=o(229),v=o(231),I=o(232),S=o(233);t.InversifyContainerFacade=class{constructor(){this.container=new r.Container}static getFactory(e){return t=>o=>t.container.getNamed(e,o)}static getCacheFactory(e){return t=>{const o=new Map;return r=>{if(o.has(r))return o.get(r);const n=t.container.getNamed(e,r);return o.set(r,n),n}}}static getConstructorFactory(e,...t){return o=>{const r=new Map,n=[];return i=>{if(t.forEach((e,t)=>{n[t]||(n[t]=o.container.get(e))}),r.has(i))return new(r.get(i))(...n);const a=o.container.getNamed(e,i);return r.set(i,a),new a(...n)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,o){this.container.bind(n.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new I.SourceCode(e,t)).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>o).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ILogger).to(N.Logger).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IJavaScriptObfuscator).to(h.JavaScriptObfuscator).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ITransformersRunner).to(S.TransformersRunner).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IObfuscatedCode).to(v.ObfuscatedCode),this.container.bind(n.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,o)=>{const r=e.container.get(n.ServiceIdentifiers.IObfuscatedCode);return r.initialize(t,o),r}),this.container.bind(n.ServiceIdentifiers.IObfuscationEventEmitter).to(b.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(c.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(u.nodeTransformersModule),this.container.load(f.obfuscatingTransformersModule),this.container.load(p.optionsModule),this.container.load(m.preparingTransformersModule),this.container.load(g.storagesModule),this.container.load(y.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static append(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e),...t])}static appendToOptimalBlockScope(e,t,o,r=0){const i=e.length?n.getOptimalBlockScope(e,r):t;n.prepend(i,o)}static getOptimalBlockScope(e,t,o=1/0){const r=e[t];if(o<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return o>1&&r.callsGraph.length?n.getOptimalBlockScope(r.callsGraph,0,--o):r.callee}static insertBefore(e,t,o){const r=n.getScopeStatements(e).indexOf(o);n.insertAtIndex(e,t,r)}static insertAfter(e,t,o){const r=n.getScopeStatements(e).indexOf(o);n.insertAtIndex(e,t,r+1)}static insertAtIndex(e,t,o){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e).slice(0,o),...t,...n.getScopeStatements(e).slice(o)])}static prepend(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...t,...n.getScopeStatements(e)])}static getScopeStatements(e){return r.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){r.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.ObfuscationTarget=r.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.StringArrayEncoding=r.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(69);const r=o(1),n=o(16);class i{static obfuscate(e,t={}){const o=new n.InversifyContainerFacade;o.load(e,"",t);const i=o.get(r.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return o.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.6"?"0.24.6":"unknown"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(5),f=o(2),p=o(3);let m=class{constructor(e,t,o){this.identifierNamesGenerator=e(o),this.randomGenerator=t,this.options=o}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const o=this.customNodes.get(e);o&&t(o)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==u.TIdentifierNamesGeneratorFactory&&u.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],m),t.AbstractCustomNodeGroup=m},function(e,t){e.exports=require("@gradecam/tsenum")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=r,r.hexadecimalPrefix="0x"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.IdentifierNamesGenerator=r.MakeEnum({DictionaryIdentifierNamesGenerator:"dictionary",HexadecimalIdentifierNamesGenerator:"hexadecimal",MangledIdentifierNamesGenerator:"mangled"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(28);t.SourceMapMode=r.MakeEnum({Inline:"inline",Separate:"separate"})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31),n=o(20),i=o(32);t.NO_ADDITIONAL_NODES_PRESET=Object.freeze({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:r.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!1,seed:0,selfDefending:!1,shuffleStringArray:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:0,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NumberUtils=class{static toHex(e){return e.toString(16)}static isCeil(e){return e%1==0}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(2);let l=class{constructor(e){this.options=e}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IOptions&&d.IOptions)?r:Object])],l),t.AbstractObfuscatingReplacer=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31),n=o(20),i=o(32);t.DEFAULT_PRESET=Object.freeze({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:r.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!0,seed:0,selfDefending:!1,shuffleStringArray:!0,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:10,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Dot=".",e.Comma=","}(t.StringSeparator||(t.StringSeparator={}))},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{};n=r([o(0).injectable()],n),t.AbstractCalleeDataExtractor=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecmaVersion=11},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);t.NodeLiteralUtils=class{static isProhibitedLiteralNode(e,t){return!(!r.NodeGuards.isPropertyNode(t)||t.computed||t.key!==e)||!!r.NodeGuards.isImportDeclarationNode(t)}}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3);let g=r=class{constructor(e,t,o){this.replacerDataByControlFlowStorageId=new Map,this.controlFlowCustomNodeFactory=e,this.randomGenerator=t,this.options=o}static getStorageKeysByIdForCurrentStorage(e,t){let o;return o=e.has(t)?e.get(t):new Map,o}insertCustomNodeToControlFlowStorage(e,t,o,n){const i=t.getStorageId(),a=r.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,i),s=a.get(o);if(this.randomGenerator.getMathRandom(){const o=this.randomGenerator.getRandomString(e);return t.getStorage().has(o)?c(e):o},d=c(5);return a.set(o,[d]),this.replacerDataByControlFlowStorageId.set(i,a),t.set(d,e),d}};g=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],g),t.AbstractControlFlowReplacer=g},function(e,t){e.exports=require("escodegen")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n const that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3);let f=class{constructor(e,t){this.preservedNamesSet=new Set,this.randomGenerator=e,this.options=t}preserveName(e){this.preservedNamesSet.add(e)}isValidIdentifierName(e){return this.notReservedName(e)&&!this.preservedNamesSet.has(e)}notReservedName(e){return!this.options.reservedNames.length||!this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractIdentifierNamesGenerator=f},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(7);let m=class{constructor(e,t){this.randomGenerator=e,this.options=t}initialize(){this.storage=new Map,this.storageId=this.randomGenerator.getRandomString(6)}get(e){return this.storage.get(e)}getOrThrow(e){const t=this.get(e);if(!t)throw new Error(`No value found in map storage with key \`${e}\``);return t}getKeyOf(e){for(const[t,o]of this.storage)if(e===o)return t;return null}getLength(){return this.storage.size}getStorage(){return this.storage}getStorageId(){return this.storageId}has(e){return this.storage.has(e)}mergeWith(e,t=!1){this.storage=new Map([...this.storage,...e.getStorage()]),t&&(this.storageId=e.getStorageId())}set(e,t){this.storage.set(e,t)}};a([p.initializable(),s("design:type",String)],m.prototype,"storageId",void 0),a([p.initializable(),s("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],m.prototype,"storage",void 0),a([d.postConstruct(),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],m.prototype,"initialize",null),m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MapStorage=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(17),f=o(2),p=o(3),m=o(18),g=o(45),y=o(4);let h=class extends g.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}getControlFlowStorageCallNode(e,t,o,r){const n=this.controlFlowCustomNodeFactory(m.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);n.initialize(e,t,o,r);const i=n.getNode()[0];if(!i||!y.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};h=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==u.TControlFlowCustomNodeFactory&&u.TControlFlowCustomNodeFactory)?r:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],h),t.ExpressionWithOperatorControlFlowReplacer=h},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(o(85)),a=n(o(86)),s=n(o(56));class c{static parse(e,t){const o=c.sourceTypes.length;for(let r=0;r"),u=`...${i.substring(s,d).replace(/^\s+/,"")}...`;throw new Error(`ERROR in ${a}line ${o.line}: ${t}\n${l} ${u}`)}}t.ASTParserFacade=c,c.colorError=s.default.red,c.nearestSymbolsCount=15,c.sourceTypes=["script","module"]},function(e,t){e.exports=require("chalk")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BasePropertiesExtractor="BasePropertiesExtractor",e.ObjectExpressionToVariableDeclarationExtractor="ObjectExpressionToVariableDeclarationExtractor"}(t.ObjectExpressionExtractor||(t.ObjectExpressionExtractor={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ObjectExpressionVariableDeclarationHostNode="ObjectExpressionVariableDeclarationHostNode"}(t.ObjectExpressionKeysTransformerCustomNode||(t.ObjectExpressionKeysTransformerCustomNode={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t){e.exports=require("class-validator")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListObfuscatingGuard="BlackListObfuscatingGuard",e.ConditionalCommentObfuscatingGuard="ConditionalCommentObfuscatingGuard",e.ReservedStringObfuscatingGuard="ReservedStringObfuscatingGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(4);let s=r=class{constructor(){this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}static isConditionalComment(e){return r.obfuscationEnableCommentRegExp.test(e.value)||r.obfuscationDisableCommentRegExp.test(e.value)}check(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!a.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;const t=e.leadingComments,o=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),o&&(this.obfuscationAllowedForNextNode=this.checkComments(o)),this.obfuscationAllowedForCurrentNode}checkComments(e){const t=e.length;let o=this.obfuscationAllowedForCurrentNode;for(let n=0;n=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(218)),m=o(219),g=o(2),y=o(220),h=o(7);let N=r=class{constructor(e,t){this.sourceCode=e,this.options=t}initialize(){this.randomGenerator=new m.Chance(this.getRawSeed())}getMathRandom(){return this.getRandomInteger(0,99999)/1e5}getRandomGenerator(){return this.randomGenerator}getRandomInteger(e,t){return this.getRandomGenerator().integer({min:e,max:t})}getRandomString(e,t=r.randomGeneratorPool){return this.getRandomGenerator().string({length:e,pool:t})}getInputSeed(){return this.options.seed.toString()}getRawSeed(){const e=this.getInputSeed();return`${e}`.split("|").length>1?e:`${e}|${p.default(this.sourceCode.getSourceCode())}`}};N.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s([h.initializable(),c("design:type","function"==typeof(n=void 0!==m.Chance&&m.Chance.Chance)?n:Object)],N.prototype,"randomGenerator",void 0),s([u.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],N.prototype,"initialize",null),N=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.ISourceCode)),d(1,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(i=void 0!==y.ISourceCode&&y.ISourceCode)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],N),t.RandomGenerator=N},function(e,t){e.exports=require("reflect-metadata")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(56)),f=o(2),p=o(71);let m=r=class{constructor(e){this.options=e}static log(e,t,o,r){const n=e(`\n${t} ${o}`);console.log(n,null!=r?r:"")}info(e,t){this.options.log&&r.log(r.colorInfo,p.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&r.log(r.colorSuccess,p.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&r.log(r.colorWarn,p.LoggingPrefix.Base,e,t)}};m.colorInfo=u.default.cyan,m.colorSuccess=u.default.green,m.colorWarn=u.default.yellow,m=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IOptions&&f.IOptions)?n:Object])],m),t.Logger=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(52),s=o(73),c=o(75),d=o(76),l=o(77),u=o(78),f=o(79),p=o(81);t.analyzersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICallsGraphAnalyzer).to(s.CallsGraphAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer).to(u.PrevailingKindOfVariablesAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IScopeAnalyzer).to(f.ScopeAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IStringArrayStorageAnalyzer).to(p.StringArrayStorageAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(d.FunctionExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(l.ObjectExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(74),p=o(52),m=o(4),g=o(14);let y=r=class{constructor(e){this.calleeDataExtractorFactory=e}static getLimitIndex(e){const t=e-1,o=r.limitThresholdActivationLength-1;let n=t;return t>o&&(n=Math.round(o+t*r.limitThreshold),n>t&&(n=t)),n}analyze(e){return this.analyzeRecursive(e.body)}analyzeRecursive(e){const t=r.getLimitIndex(e.length),o=[],n=e.length;for(let r=0;rt);r++){const t=e[r];u.traverse(t,{enter:r=>{if(m.NodeGuards.isCallExpressionNode(r))return t.parentNode!==g.NodeStatementUtils.getParentNodeWithStatements(r)?u.VisitorOption.Skip:void this.analyzeCallExpressionNode(o,e,r)}})}return o}analyzeCallExpressionNode(e,t,o){r.calleeDataExtractorsList.forEach(r=>{const n=this.calleeDataExtractorFactory(r).extract(t,o.callee);n&&e.push(Object.assign(Object.assign({},n),{callsGraph:this.analyzeRecursive(n.callee.body)}))})}};y.calleeDataExtractorsList=[p.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,p.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,p.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],y.limitThresholdActivationLength=25,y.limitThreshold=.002,y=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__ICalleeDataExtractor)),a("design:paramtypes",["function"==typeof(n=void 0!==f.TCalleeDataExtractorFactory&&f.TCalleeDataExtractorFactory)?n:Object])],y),t.CallsGraphAnalyzer=y},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(13)),s=o(42),c=o(4),d=o(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){if(!c.NodeGuards.isIdentifierNode(t))return null;const o=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name);return o?{callee:o,name:t.name}:null}getCalleeBlockStatement(e,t){let o=null;return a.traverse(e,{enter:e=>{if(c.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return o=e.body,a.VisitorOption.Break}}),o}};l=r([i.injectable()],l),t.FunctionDeclarationCalleeDataExtractor=l},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(13)),s=o(42),c=o(4),d=o(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){var o;let r=null;return c.NodeGuards.isIdentifierNode(t)&&(r=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name)),c.NodeGuards.isFunctionExpressionNode(t)&&(r=t.body),r?{callee:r,name:null!==(o=t.name)&&void 0!==o?o:null}:null}getCalleeBlockStatement(e,t){let o=null;return a.traverse(e,{enter:(e,r)=>{if(c.NodeGuards.isFunctionExpressionNode(e)&&r&&c.NodeGuards.isVariableDeclaratorNode(r)&&c.NodeGuards.isIdentifierNode(r.id)&&r.id.name===t)return o=e.body,a.VisitorOption.Break}}),o}};l=r([i.injectable()],l),t.FunctionExpressionCalleeDataExtractor=l},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=i(o(13)),c=o(42),d=o(4),l=o(14);let u=r=class extends c.AbstractCalleeDataExtractor{static isValidTargetPropertyNode(e,t){if(!e.key)return!1;const o=d.NodeGuards.isIdentifierNode(e.key)&&e.key.name===t,r=d.NodeGuards.isLiteralNode(e.key)&&Boolean(e.key.value)&&e.key.value===t;return o||r}extract(e,t){if(!d.NodeGuards.isMemberExpressionNode(t))return null;const o=this.createObjectMembersCallsChain([],t);if(!o.length)return null;const r=o[o.length-1],n=this.getCalleeBlockStatement(l.NodeStatementUtils.getParentNodeWithStatements(e[0]),o);return n?{callee:n,name:r}:null}createObjectMembersCallsChain(e,t){if(d.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!d.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return d.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(d.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}getCalleeBlockStatement(e,t){const o=t.shift();if(!o)return null;let r=null;return s.traverse(e,{enter:e=>{if(d.NodeGuards.isVariableDeclaratorNode(e)&&d.NodeGuards.isIdentifierNode(e.id)&&e.init&&d.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===o)return r=this.findCalleeBlockStatement(e.init.properties,t),s.VisitorOption.Break}}),r}findCalleeBlockStatement(e,t){const o=t.shift();if(!o)return null;for(const n of e)if(r.isValidTargetPropertyNode(n,o)){if(d.NodeGuards.isObjectExpressionNode(n.value))return this.findCalleeBlockStatement(n.value.properties,t);if(d.NodeGuards.isFunctionExpressionNode(n.value))return n.value.body}return null}};u=r=n([a.injectable()],u),t.ObjectExpressionCalleeDataExtractor=u},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(34),p=o(4);let m=r=class{constructor(e){this.prevailingKindOfVariables=r.defaultKindOfVariables,this.arrayUtils=e}analyze(e){var t;const o=[];u.traverse(e,{enter:e=>{p.NodeGuards.isVariableDeclarationNode(e)&&o.push(e.kind)}}),this.prevailingKindOfVariables=null!==(t=this.arrayUtils.findMostOccurringElement(o))&&void 0!==t?t:r.defaultKindOfVariables}getPrevailingKind(){return this.prevailingKindOfVariables}};m.defaultKindOfVariables="var",m=r=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IArrayUtils)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IArrayUtils&&f.IArrayUtils)?n:Object])],m),t.PrevailingKindOfVariablesAnalyzer=m},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=i(o(80)),c=i(o(13)),d=o(43),l=o(4);let u=r=class{constructor(){this.scopeManager=null}static attachMissingRanges(e){c.replace(e,{enter:e=>(e.range||(e.range=[r.emptyRangeValue,r.emptyRangeValue]),e)})}static isRootNode(e){return l.NodeGuards.isProgramNode(e)||e.parentNode===e}analyze(e){const t=r.sourceTypes.length;r.attachMissingRanges(e);for(let o=0;o{if("class"===e.type&&e.upper){if(!e.variables.length)return;const t=e.variables[0],o=e.upper.variables.find(e=>t.defs.some(e=>"ClassName"===e.type)&&e.name===t.name);null==o||o.references.push(...e.variables[0].references)}});for(const t of e.childScopes)this.sanitizeScopes(t)}};u.eslintScopeOptions={ecmaVersion:d.ecmaVersion,optimistic:!0},u.sourceTypes=["script","module"],u.emptyRangeValue=0,u=r=n([a.injectable()],u),t.ScopeAnalyzer=u},function(e,t){e.exports=require("eslint-scope")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(13)),m=o(2),g=o(3),y=o(35),h=o(4),N=o(15),b=o(44);let v=r=class{constructor(e,t,o){this.stringArrayStorageData=new Map,this.stringArrayStorage=e,this.randomGenerator=t,this.options=o}analyze(e){this.options.stringArray&&p.traverse(e,{enter:(e,t)=>{if(t)return N.NodeMetadata.isIgnoredNode(e)?p.VisitorOption.Skip:void(h.NodeGuards.isLiteralNode(e)&&this.analyzeLiteralNode(e,t))}})}getItemDataForLiteralNode(e){return this.stringArrayStorageData.get(e)}analyzeLiteralNode(e,t){"string"==typeof e.value&&(b.NodeLiteralUtils.isProhibitedLiteralNode(e,t)||this.shouldAddValueToStringArray(e.value)&&this.stringArrayStorageData.set(e,this.stringArrayStorage.getOrThrow(e.value)))}shouldAddValueToStringArray(e){return e.length>=r.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}};v.minimumLengthForStringArray=3,v=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.IStringArrayStorage)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==y.IStringArrayStorage&&y.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==m.IOptions&&m.IOptions)?a:Object])],v),t.StringArrayStorageAnalyzer=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(53),s=o(21),c=o(83),d=o(84),l=o(87),u=o(88),f=o(90),p=o(93),m=o(94);t.controlFlowTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(l.CallExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(i.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(54);let h=r=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.BinaryExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a,e.left,e.right)}};h.usingExistingIdentifierChance=.5,h=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.BinaryExpressionControlFlowReplacer=h},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(17),y=o(34),h=o(2),N=o(3),b=o(18),v=o(11),I=o(12),S=o(4),O=o(6);let j=r=class extends I.AbstractNodeTransformer{constructor(e,t,o,r){super(o,r),this.controlFlowCustomNodeFactory=e,this.arrayUtils=t}static isProhibitedStatementNode(e){const t=S.NodeGuards.isBreakStatementNode(e)||S.NodeGuards.isContinueStatementNode(e),o=S.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),r=S.NodeGuards.isClassDeclarationNode(e);return S.NodeGuards.isFunctionDeclarationNode(e)||t||o||r}static canTransformBlockStatementNode(e){let t=!0;return m.traverse(e,{enter:e=>{if(S.NodeGuards.isWhileStatementNode(e))return m.VisitorOption.Skip;r.isProhibitedStatementNode(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}getVisitor(e){switch(e){case v.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&S.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!r.canTransformBlockStatementNode(e))return e;const o=e.body,n=this.arrayUtils.createWithRange(o.length),i=this.arrayUtils.shuffle(n),a=n.map(e=>i.indexOf(e)),s=this.controlFlowCustomNodeFactory(b.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);s.initialize(o,i,a);const c=s.getNode()[0];return O.NodeUtils.parentizeNode(c,t),c}};j=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IControlFlowCustomNode)),l(1,f.inject(p.ServiceIdentifiers.IArrayUtils)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TControlFlowCustomNodeFactory&&g.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==h.IOptions&&h.IOptions)?s:Object])],j),t.BlockStatementControlFlowTransformer=j},function(e,t){e.exports=require("acorn")},function(e,t){e.exports=require("acorn-import-meta")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(45),h=o(4);let N=r=class extends y.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){const n=e.callee;if(!h.NodeGuards.isIdentifierNode(n))return e;const i=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionFunctionNode),s=e.arguments;a.initialize(s);const c=this.insertCustomNodeToControlFlowStorage(a,o,i,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),c,n,s)}getControlFlowStorageCallNode(e,t,o,r){const n=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);n.initialize(e,t,o,r);const i=n.getNode()[0];if(!i||!h.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};N.usingExistingIdentifierChance=.5,N=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.CallExpressionControlFlowReplacer=N},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(89),y=o(2),h=o(3),N=o(57),b=o(58),v=o(21),I=o(33),S=o(11),O=o(12),j=o(8),_=o(4),C=o(14),R=o(6);let F=r=class extends O.AbstractNodeTransformer{constructor(e,t,o,r){super(o,r),this.deadCodeInjectionRootAstHostNodeSet=new Set,this.collectedBlockStatements=[],this.collectedBlockStatementsTotalLength=0,this.deadCodeInjectionCustomNodeFactory=e,this.transformersRunner=t}static isProhibitedNodeInsideCollectedBlockStatement(e){return _.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e)||_.NodeGuards.isAwaitExpressionNode(e)||_.NodeGuards.isSuperNode(e)}static isScopeHoistingFunctionDeclaration(e){if(!_.NodeGuards.isFunctionDeclarationNode(e))return!1;const t=C.NodeStatementUtils.getScopeOfNode(e),o=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,r=o.indexOf(e);if(0===r)return!1;const n=o.slice(0,r),i=j.NodeFactory.blockStatementNode(n),a=e.id.name;let s=!1;return m.traverse(i,{enter:e=>{if(_.NodeGuards.isIdentifierNode(e)&&e.name===a)return s=!0,m.VisitorOption.Break}}),s}static isValidCollectedBlockStatementNode(e){if(!e.body.length)return!1;let t=0,o=!0;return m.traverse(e,{enter:e=>{if(_.NodeGuards.isBlockStatementNode(e)&&t++,t>r.maxNestedBlockStatementsCount||r.isProhibitedNodeInsideCollectedBlockStatement(e)||r.isScopeHoistingFunctionDeclaration(e))return o=!1,m.VisitorOption.Break}}),o}static isValidWrappedBlockStatementNode(e){if(!e.body.length)return!1;let t=!0;if(m.traverse(e,{enter:e=>{if(r.isScopeHoistingFunctionDeclaration(e))return t=!1,m.VisitorOption.Break}}),!t)return!1;return C.NodeStatementUtils.getParentNodeWithStatements(e).type!==I.NodeType.Program}getVisitor(e){switch(e){case S.TransformationStage.DeadCodeInjection:return{enter:(e,t)=>{if(t&&_.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),e},leave:(e,t)=>{if(t&&_.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};case S.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:(e,t)=>{if(t&&this.isDeadCodeInjectionRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}analyzeNode(e,t){m.traverse(e,{enter:e=>{if(!_.NodeGuards.isBlockStatementNode(e))return;const t=R.NodeUtils.clone(e);if(!r.isValidCollectedBlockStatementNode(t))return;const o=this.makeClonedBlockStatementNodeUnique(t);this.collectedBlockStatements.push(o)}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}transformNode(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!r.isValidWrappedBlockStatementNode(e))return e;const o=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,o),i=this.collectedBlockStatements.splice(n,1)[0];return i===e?e:this.replaceBlockStatementNode(e,i,t)}restoreNode(e,t){const o=e.body[0];if(!_.NodeGuards.isFunctionDeclarationNode(o))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return o.body}isDeadCodeInjectionRootAstHostNode(e){return _.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}makeClonedBlockStatementNodeUnique(e){const t=j.NodeFactory.functionExpressionNode([],e);return R.NodeUtils.parentizeNode(t,t),R.NodeUtils.parentizeNode(e,t),this.transformersRunner.transform(t,r.transformersToRenameBlockScopeIdentifiers,S.TransformationStage.Obfuscating).body}replaceBlockStatementNode(e,t,o){const n=j.NodeFactory.blockStatementNode([j.NodeFactory.functionDeclarationNode(r.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);const i=this.deadCodeInjectionCustomNodeFactory(b.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);i.initialize(e,n);const a=i.getNode()[0];return R.NodeUtils.parentizeNode(a,o),a}};F.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",F.maxNestedBlockStatementsCount=4,F.minCollectedBlockStatementsCount=5,F.transformersToRenameBlockScopeIdentifiers=[v.NodeTransformer.LabeledStatementTransformer,v.NodeTransformer.ScopeIdentifiersTransformer],F=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),l(1,f.inject(p.ServiceIdentifiers.ITransformersRunner)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TDeadNodeInjectionCustomNodeFactory&&g.TDeadNodeInjectionCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.ITransformersRunner&&N.ITransformersRunner)?i:Object,"function"==typeof(a=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==y.IOptions&&y.IOptions)?s:Object])],F),t.DeadCodeInjectionTransformer=F},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=f(o(13)),y=o(17),h=o(91),N=o(92),b=o(2),v=o(3),I=o(18),S=o(53),O=o(33),j=o(11),_=o(12),C=o(19),R=o(4),F=o(15),T=o(14),w=o(6);let x=r=class extends _.AbstractNodeTransformer{constructor(e,t,o,r,n){super(r,n),this.controlFlowData=new Map,this.visitedFunctionNodes=new Set,this.hostNodesWithControlFlowNode=new Set,this.controlFlowStorageFactory=e,this.controlFlowReplacerFactory=t,this.controlFlowCustomNodeFactory=o}getVisitor(e){switch(e){case j.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.visitedFunctionNodes.add(e),!R.NodeGuards.isBlockStatementNode(e.body))return e;const o=this.getHostNode(e.body),r=this.getControlFlowStorage(o);if(this.controlFlowData.set(o,r),this.transformFunctionBody(e.body,r),!r.getLength())return e;const n=this.controlFlowCustomNodeFactory(I.ControlFlowCustomNode.ControlFlowStorageNode);return n.initialize(r),C.NodeAppender.prepend(o,n.getNode()),this.hostNodesWithControlFlowNode.add(o),w.NodeUtils.parentizeAst(e),e}getControlFlowStorage(e){const t=this.controlFlowStorageFactory();if(this.controlFlowData.has(e)){this.hostNodesWithControlFlowNode.has(e)&&(R.NodeGuards.isSwitchCaseNode(e)?e.consequent.shift():e.body.shift());const o=this.controlFlowData.get(e);t.mergeWith(o,!0)}return t}getHostNode(e){const t=T.NodeStatementUtils.getParentNodesWithStatements(e);return 1===t.length?e:(t.pop(),t.length>r.hostNodeSearchMinDepth&&t.splice(0,r.hostNodeSearchMinDepth),t.length>r.hostNodeSearchMaxDepth&&(t.length=r.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}isVisitedFunctionNode(e){return(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}transformFunctionBody(e,t){g.replace(e,{enter:(e,o)=>{if(F.NodeMetadata.isIgnoredNode(e))return g.VisitorOption.Skip;if(this.isVisitedFunctionNode(e)||!o)return g.VisitorOption.Skip;if(!r.controlFlowReplacersMap.has(e.type))return e;if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold)return e;const n=r.controlFlowReplacersMap.get(e.type);return void 0===n?e:Object.assign(Object.assign({},this.controlFlowReplacerFactory(n).replace(e,o,t)),{parentNode:o})}})}};x.controlFlowReplacersMap=new Map([[O.NodeType.BinaryExpression,S.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[O.NodeType.CallExpression,S.ControlFlowReplacer.CallExpressionControlFlowReplacer],[O.NodeType.LogicalExpression,S.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[O.NodeType.Literal,S.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),x.hostNodeSearchMinDepth=0,x.hostNodeSearchMaxDepth=2,x=r=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),u(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),u(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==N.TControlFlowStorageFactory&&N.TControlFlowStorageFactory)?n:Object,"function"==typeof(i=void 0!==h.TControlFlowReplacerFactory&&h.TControlFlowReplacerFactory)?i:Object,"function"==typeof(a=void 0!==y.TControlFlowCustomNodeFactory&&y.TControlFlowCustomNodeFactory)?a:Object,"function"==typeof(s=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==b.IOptions&&b.IOptions)?c:Object])],x),t.FunctionControlFlowTransformer=x},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(54),h=o(4),N=o(6);let b=r=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){if(this.checkForProhibitedExpressions(e.left,e.right))return e;const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.LogicalExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a,e.left,e.right)}checkForProhibitedExpressions(e,t){return[e,t].some(e=>{let t;return t=h.NodeGuards.isUnaryExpressionNode(e)?N.NodeUtils.getUnaryExpressionArgumentNode(e):e,!(h.NodeGuards.isLiteralNode(t)||h.NodeGuards.isIdentifierNode(t)||h.NodeGuards.isObjectExpressionNode(t)||h.NodeGuards.isExpressionStatementNode(t))})}};b.usingExistingIdentifierChance=.5,b=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionControlFlowReplacer=b},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(17),p=o(2),m=o(3),g=o(18),y=o(45),h=o(4);let N=r=class extends y.AbstractControlFlowReplacer{constructor(e,t,o){super(e,t,o)}replace(e,t,o){if(h.NodeGuards.isPropertyNode(t)&&t.key===e)return e;if("string"!=typeof e.value||e.value.length<3)return e;const n=String(e.value),i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralNode);i.initialize(e.value);const a=this.insertCustomNodeToControlFlowStorage(i,o,n,r.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(o.getStorageId(),a)}getControlFlowStorageCallNode(e,t){const o=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode);o.initialize(e,t);const r=o.getNode()[0];if(!r||!h.NodeGuards.isExpressionStatementNode(r))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return r.expression}};N.usingExistingIdentifierChance=1,N=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.StringLiteralControlFlowReplacer=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(16),i=o(1),a=o(21),s=o(59),c=o(96),d=o(98),l=o(99),u=o(100),f=o(102),p=o(103),m=o(104),g=o(105);t.convertingTransformersModule=new r.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.MemberExpressionTransformer).whenTargetNamed(a.NodeTransformer.MemberExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(l.MethodDefinitionTransformer).whenTargetNamed(a.NodeTransformer.MethodDefinitionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.ObjectExpressionKeysTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionKeysTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.ObjectExpressionTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.SplitStringTransformer).whenTargetNamed(a.NodeTransformer.SplitStringTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.TemplateLiteralTransformer).whenTargetNamed(a.NodeTransformer.TemplateLiteralTransformer),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(c.ObjectExpressionToVariableDeclarationExtractor).whenTargetNamed(s.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(g.BasePropertiesExtractor).whenTargetNamed(s.ObjectExpressionExtractor.BasePropertiesExtractor),e(i.ServiceIdentifiers.Factory__IObjectExpressionExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObjectExpressionExtractor))})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(97),l=o(60),u=o(19),f=o(4),p=o(14),m=o(6);let g=class{constructor(e){this.objectExpressionKeysTransformerCustomNodeFactory=e}extract(e,t){return this.transformObjectExpressionToVariableDeclaration(e,t)}transformObjectExpressionToVariableDeclaration(e,t){const o=e.properties,r=this.getObjectExpressionHostNode(o),n=this.getObjectExpressionIdentifierNode(r),i=this.getObjectExpressionNode(r),a=[r],s=p.NodeStatementUtils.getScopeOfNode(t);return u.NodeAppender.insertBefore(s,a,t),m.NodeUtils.parentizeAst(r),m.NodeUtils.parentizeNode(r,s),{nodeToReplace:n,objectExpressionHostStatement:r,objectExpressionNode:i}}getObjectExpressionHostNode(e){const t=this.objectExpressionKeysTransformerCustomNodeFactory(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode);t.initialize(e);const o=t.getNode()[0];if(!o||!f.NodeGuards.isVariableDeclarationNode(o))throw new Error("`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node");return o}getObjectExpressionIdentifierNode(e){const t=e.declarations[0].id;if(!f.NodeGuards.isIdentifierNode(t))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property");return t}getObjectExpressionNode(e){var t;const o=null!==(t=e.declarations[0].init)&&void 0!==t?t:null;if(!o||!f.NodeGuards.isObjectExpressionNode(o))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property");return o}};g=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)),i("design:paramtypes",["function"==typeof(r=void 0!==d.TObjectExpressionKeysTransformerCustomNodeFactory&&d.TObjectExpressionKeysTransformerCustomNodeFactory)?r:Object])],g),t.ObjectExpressionToVariableDeclarationExtractor=g},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(8),g=o(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isMemberExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(g.NodeGuards.isIdentifierNode(e.property)){if(e.computed)return e;e.computed=!0,e.property=m.NodeFactory.literalNode(e.property.name)}return e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MemberExpressionTransformer=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(11),m=o(12),g=o(8),y=o(4);let h=r=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&y.NodeGuards.isMethodDefinitionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return y.NodeGuards.isIdentifierNode(e.key)?this.replaceIdentifierKey(e,e.key):y.NodeGuards.isLiteralNode(e.key)?this.replaceLiteralKey(e,e.key):e}replaceIdentifierKey(e,t){return r.ignoredNames.includes(t.name)||e.computed||(e.computed=!0,e.key=g.NodeFactory.literalNode(t.name)),e}replaceLiteralKey(e,t){return"string"!=typeof t.value||r.ignoredNames.includes(t.value)||e.computed||(e.computed=!0),e}};h.ignoredNames=["constructor"],h=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.MethodDefinitionTransformer=h},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=l(o(13)),m=o(101),g=o(2),y=o(3),h=o(11),N=o(12),b=o(4),v=o(14),I=o(59);let S=r=class extends N.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.objectExpressionExtractorFactory=e}static isProhibitedHostStatement(e,t){return r.isReferencedIdentifierName(e,t)}static isReferencedIdentifierName(e,t){const o=[];let r=!1,n=!1;return p.traverse(t,{enter:t=>{t===e&&(n=!0),b.NodeGuards.isIdentifierNode(t)&&(n?o.includes(t.name)&&(r=!0):o.push(t.name))},leave:t=>{if(t===e)return n=!1,p.VisitorOption.Break}}),r}getVisitor(e){if(!this.options.transformObjectKeys)return null;switch(e){case h.TransformationStage.Converting:return{leave:(e,t)=>{if(t&&b.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(!e.properties.length)return e;const o=v.NodeStatementUtils.getRootStatementOfNode(e);return r.isProhibitedHostStatement(e,o)?e:this.applyObjectExpressionKeysExtractorsRecursive(r.objectExpressionExtractorNames,e,o)}applyObjectExpressionKeysExtractorsRecursive(e,t,o){const r=[...e],n=r.shift();if(!n)return t;const{nodeToReplace:i,objectExpressionHostStatement:a,objectExpressionNode:s}=this.objectExpressionExtractorFactory(n).extract(t,o);return this.applyObjectExpressionKeysExtractorsRecursive(r,s,a),i}};S.objectExpressionExtractorNames=[I.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor,I.ObjectExpressionExtractor.BasePropertiesExtractor],S=r=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.Factory__IObjectExpressionExtractor)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==m.TObjectExpressionExtractorFactory&&m.TObjectExpressionExtractorFactory)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],S),t.ObjectExpressionKeysTransformer=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(8),g=o(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return e.properties.forEach(e=>{e.key&&(e.computed?this.transformComputedProperty(e):this.transformBaseProperty(e))}),e}transformComputedProperty(e){g.NodeGuards.isLiteralNode(e.key)&&"string"==typeof e.key.value&&(e.key=m.NodeFactory.literalNode(e.key.value))}transformBaseProperty(e){e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=m.NodeFactory.literalNode(e.key.name))}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.ObjectExpressionTransformer=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(2),m=o(3),g=o(21),y=o(11),h=o(12),N=o(8),b=o(4),v=o(44),I=o(6);let S=r=class extends h.AbstractNodeTransformer{constructor(e,t){super(e,t),this.runAfter=[g.NodeTransformer.ObjectExpressionKeysTransformer,g.NodeTransformer.TemplateLiteralTransformer]}static chunkString(e,t){const o=Math.ceil(e.length/t),r=[];let n=0;for(let i=0;i{if(this.options.splitStrings)return t&&b.NodeGuards.isLiteralNode(e)?this.transformNode(e,t):void 0}};default:return null}}transformNode(e,t){if(v.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;const o=this.transformLiteralNodeByChunkLength(e,t,r.firstPassChunkLength);return f.replace(o,{enter:(e,t)=>{if(t&&b.NodeGuards.isLiteralNode(e))return this.transformLiteralNodeByChunkLength(e,t,this.options.splitStringsChunkLength)}})}transformLiteralNodeByChunkLength(e,t,o){if("string"!=typeof e.value)return e;if(o>=e.value.length)return e;const n=r.chunkString(e.value,o),i=this.transformStringChunksToBinaryExpressionNode(n);return I.NodeUtils.parentizeAst(i),I.NodeUtils.parentizeNode(i,t),i}transformStringChunksToBinaryExpressionNode(e){const t=e.shift(),o=e.shift();if(!t||!o)throw new Error("First and second chunks values should not be empty");const r=N.NodeFactory.binaryExpressionNode("+",N.NodeFactory.literalNode(t),N.NodeFactory.literalNode(o));return e.reduce((e,t)=>{const o=N.NodeFactory.literalNode(t);return N.NodeFactory.binaryExpressionNode("+",e,o)},r)}};S.firstPassChunkLength=1e3,S=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],S),t.SplitStringTransformer=S},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(11),m=o(12),g=o(8),y=o(4),h=o(6);let N=r=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}static isLiteralNodeWithStringValue(e){return!!e&&y.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}static isValidTemplateLiteralNode(e,t){return y.NodeGuards.isTemplateLiteralNode(e)&&!y.NodeGuards.isTaggedTemplateExpressionNode(t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&r.isValidTemplateLiteralNode(e,t))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const o=e.expressions;let n,i=[];if(e.quasis.forEach(e=>{i.push(g.NodeFactory.literalNode(e.value.cooked));const t=o.shift();t&&i.push(t)}),i=i.filter(e=>!(y.NodeGuards.isLiteralNode(e)&&""===e.value)),r.isLiteralNodeWithStringValue(i[0])||r.isLiteralNodeWithStringValue(i[1])||i.unshift(g.NodeFactory.literalNode("")),i.length>1){let e=g.NodeFactory.binaryExpressionNode("+",i.shift(),i.shift());i.forEach(t=>{e=g.NodeFactory.binaryExpressionNode("+",e,t)}),n=e}else n=i[0];return h.NodeUtils.parentizeAst(n),h.NodeUtils.parentizeNode(n,t),n}};N=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.TemplateLiteralTransformer=N},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(19),s=o(8),c=o(4),d=o(14);let l=r=class{static getPropertyNodeKeyName(e){const t=e.key;return!c.NodeGuards.isLiteralNode(t)||"string"!=typeof t.value&&"number"!=typeof t.value?c.NodeGuards.isIdentifierNode(t)?t.name:null:t.value.toString()}static isProhibitedPattern(e){return!e||c.NodeGuards.isObjectPatternNode(e)||c.NodeGuards.isArrayPatternNode(e)||c.NodeGuards.isAssignmentPatternNode(e)||c.NodeGuards.isRestElementNode(e)}extract(e,t){const o=e.parentNode;return o&&c.NodeGuards.isVariableDeclaratorNode(o)&&c.NodeGuards.isIdentifierNode(o.id)?this.transformObjectExpressionNode(e,t,o.id):{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}transformObjectExpressionNode(e,t,o){const r=e.properties,[n,i]=this.extractPropertiesToExpressionStatements(r,t,o),s=d.NodeStatementUtils.getScopeOfNode(t);return this.filterExtractedObjectExpressionProperties(e,i),a.NodeAppender.insertAfter(s,n,t),{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}extractPropertiesToExpressionStatements(e,t,o){const n=e.length,i=[],a=[];for(let d=0;d!t.includes(o))}};l=r=n([i.injectable()],l),t.BasePropertiesExtractor=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(18),s=o(23),c=o(61),d=o(58),l=o(60),u=o(107),f=o(108),p=o(109),m=o(110),g=o(111),y=o(112),h=o(115),N=o(116),b=o(117),v=o(118),I=o(119),S=o(120),O=o(122),j=o(124),_=o(126),C=o(128),R=o(130),F=o(134),T=o(136),w=o(137),x=o(138),E=o(140),G=o(142),P=o(149),A=o(151),M=o(154),D=o(155);t.customNodesModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICustomNode).to(O.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(i.ServiceIdentifiers.ICustomNode).to(_.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(i.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(i.ServiceIdentifiers.ICustomNode).to(R.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(F.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(i.ServiceIdentifiers.ICustomNode).to(x.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(E.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(i.ServiceIdentifiers.ICustomNode).to(G.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(i.ServiceIdentifiers.ICustomNode).to(P.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(i.ServiceIdentifiers.ICustomNode).to(A.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.BinaryExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BlockStatementControlFlowFlatteningNode).whenTargetNamed(a.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(I.CallExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(S.ControlFlowStorageNode).whenTargetNamed(a.ControlFlowCustomNode.ControlFlowStorageNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(T.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(w.LogicalExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(D.StringLiteralNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(M.StringLiteralControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(b.BlockStatementDeadCodeInjectionNode).whenTargetNamed(d.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.ObjectExpressionVariableDeclarationHostNode).whenTargetNamed(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode),e(i.ServiceIdentifiers.ICustomNodeGroup).to(u.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(f.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(p.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(m.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(g.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(i.ServiceIdentifiers.Factory__ICustomNode).toFactory(r.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNode)),e(i.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions)),e(i.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode).toFactory(r.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(r.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNodeGroup)),e(i.ServiceIdentifiers.ICustomNodeFormatter).to(j.CustomNodeFormatter).inSingletonScope()})},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.ConsoleOutputDisableExpressionNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.disableConsoleOutput)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.ConsoleOutputDisableExpressionNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.ConsoleOutputCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19),S=o(4);let O=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionCallNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionNode,t=>{I.NodeAppender.append(e,t.getNode())}),this.appendCustomNodeIfExist(N.CustomNode.DebugProtectionFunctionIntervalNode,t=>{const o=S.NodeGuards.isSwitchCaseNode(e)?e.consequent.length:e.body.length,r=this.randomGenerator.getRandomInteger(0,o);I.NodeAppender.insertAtIndex(e,t.getNode(),r)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.debugProtection)return;const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),o=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionNode),r=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionCallNode),n=this.customNodeFactory(N.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);o.initialize(e),r.initialize(e,t),n.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(N.CustomNode.DebugProtectionFunctionNode,o),this.customNodes.set(N.CustomNode.DebugProtectionFunctionCallNode,r),this.options.debugProtectionInterval&&this.customNodes.set(N.CustomNode.DebugProtectionFunctionIntervalNode,n),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,i)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],O.prototype,"customNodes",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.DebugProtectionCustomNodeGroup=O},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.DomainLockNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.domainLock.length)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.DomainLockNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.DomainLockNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.DomainLockCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(26),m=o(5),g=o(2),y=o(3),h=o(7),N=o(23),b=o(22),v=o(27),I=o(19);let S=class extends v.AbstractCustomNodeGroup{constructor(e,t,o,r){super(t,o,r),this.appendEvent=b.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const o=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(N.CustomNode.SelfDefendingUnicodeNode,r=>{I.NodeAppender.appendToOptimalBlockScope(t,e,r.getNode(),o)}),this.appendCustomNodeIfExist(N.CustomNode.NodeCallsControllerFunctionNode,r=>{const n=t.length?I.NodeAppender.getOptimalBlockScope(t,o,1):e;I.NodeAppender.prepend(n,r.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.selfDefending)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(N.CustomNode.SelfDefendingUnicodeNode),o=this.customNodeFactory(N.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),o.initialize(this.appendEvent,e),this.customNodes.set(N.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(N.CustomNode.NodeCallsControllerFunctionNode,o)}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.SelfDefendingCustomNodeGroup=S},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=o(26),g=o(5),y=o(2),h=o(3),N=o(35),b=o(7),v=o(23),I=o(22),S=o(27),O=o(19);let j=class extends S.AbstractCustomNodeGroup{constructor(e,t,o,r,n){super(o,r,n),this.appendEvent=I.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e,this.stringArrayStorage=t}appendCustomNodes(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(v.CustomNode.StringArrayNode,t=>{O.NodeAppender.prepend(e,t.getNode())}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayCallsWrapper,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(v.CustomNode.StringArrayRotateFunctionNode,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}))}initialize(){if(this.customNodes=new Map,!this.options.stringArray)return;const e=this.customNodeFactory(v.CustomNode.StringArrayNode),t=this.customNodeFactory(v.CustomNode.StringArrayCallsWrapper),o=this.customNodeFactory(v.CustomNode.StringArrayRotateFunctionNode),r=this.stringArrayStorage.getStorageName(),n=this.stringArrayStorage.getStorageCallsWrapperName(),i=this.stringArrayStorage.getRotationAmount();e.initialize(this.stringArrayStorage,r),t.initialize(r,n),o.initialize(r,i),this.customNodes.set(v.CustomNode.StringArrayNode,e),this.customNodes.set(v.CustomNode.StringArrayCallsWrapper,t),this.options.rotateStringArray&&this.customNodes.set(v.CustomNode.StringArrayRotateFunctionNode,o)}};d([b.initializable(),l("design:type","function"==typeof(r="undefined"!=typeof Map&&Map)?r:Object)],j.prototype,"customNodes",void 0),j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.Factory__ICustomNode)),u(1,f.inject(p.ServiceIdentifiers.IStringArrayStorage)),u(2,f.inject(p.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u(3,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(4,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==m.TCustomNodeFactory&&m.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==N.IStringArrayStorage&&N.IStringArrayStorage)?i:Object,"function"==typeof(a=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.StringArrayCustomNodeGroup=j},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8);let N=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.properties=e}getNodeStructure(e){return[h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()),h.NodeFactory.objectExpressionNode(this.properties))],"const")]}};N=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.ObjectExpressionVariableDeclarationHostNode=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n let that;\n \n try {\n const getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n const getGlobal = function () {\n let globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n const that = getGlobal();\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.binaryExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BinaryExpressionFunctionNode=b},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(4),v=o(6);let I=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=o}getNodeStructure(e){const t=this.randomGenerator.getRandomString(6),o=this.randomGenerator.getRandomString(6),r=N.NodeFactory.blockStatementNode([N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(t),N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join("|")),N.NodeFactory.identifierNode("split")),[N.NodeFactory.literalNode("|")]))],"const"),N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(o),N.NodeFactory.literalNode(0))],"let"),N.NodeFactory.whileStatementNode(N.NodeFactory.literalNode(!0),N.NodeFactory.blockStatementNode([N.NodeFactory.switchStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(t),N.NodeFactory.updateExpressionNode("++",N.NodeFactory.identifierNode(o)),!0),this.shuffledKeys.map((e,t)=>{const o=this.blockStatementBody[e],r=[o];return b.NodeGuards.isReturnStatementNode(o)||r.push(N.NodeFactory.continueStatement()),N.NodeFactory.switchCaseNode(N.NodeFactory.literalNode(String(t)),r)})),N.NodeFactory.breakStatement()]))]);return v.NodeUtils.parentizeAst(r),[r]}};s([y.initializable(),c("design:type",Array)],I.prototype,"blockStatementBody",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"originalKeysIndexesInShuffledArray",void 0),s([y.initializable(),c("design:type",Array)],I.prototype,"shuffledKeys",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.BlockStatementControlFlowFlatteningNode=I},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.blockStatementNode=e,this.deadCodeInjectionRootAstHostNode=t}getNodeStructure(e){const t=this.randomGenerator.getMathRandom()>.5,o=this.randomGenerator.getMathRandom()>.5,r=t?"===":"!==",n=this.randomGenerator.getRandomString(5),i=o?n:this.randomGenerator.getRandomString(5),[a,s]=t===o?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],c=h.NodeFactory.blockStatementNode([h.NodeFactory.ifStatementNode(h.NodeFactory.binaryExpressionNode(r,h.NodeFactory.literalNode(n),h.NodeFactory.literalNode(i)),a,s)]);return N.NodeUtils.parentizeAst(c),[c]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BlockStatementDeadCodeInjectionNode=b},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(7),N=o(10),b=o(8),v=o(6);let I=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o,r){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.callee=o,this.expressionArguments=r}getNodeStructure(){const e=b.NodeFactory.expressionStatementNode(b.NodeFactory.callExpressionNode(b.NodeFactory.memberExpressionNode(b.NodeFactory.identifierNode(this.controlFlowStorageName),b.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.callee,...this.expressionArguments]));return v.NodeUtils.parentizeAst(e),[e]}};c([h.initializable(),d("design:type","function"==typeof(r="undefined"!=typeof ESTree&&ESTree.Expression)?r:Object)],I.prototype,"callee",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),c([h.initializable(),d("design:type",String)],I.prototype,"controlFlowStorageName",void 0),c([h.initializable(),d("design:type",Array)],I.prototype,"expressionArguments",void 0),I=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],I),t.CallExpressionControlFlowStorageCallNode=I},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.expressionArguments=e}getNodeStructure(e){const t=N.NodeFactory.identifierNode("callee"),o=[],r=this.expressionArguments.length;for(let e=0;e=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(121),m=o(5),g=o(2),y=o(3),h=o(9),N=o(7),b=o(10),v=o(8),I=o(4),S=o(6);let O=class extends b.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.controlFlowStorage=e}getNodeStructure(e){const t=Array.from(this.controlFlowStorage.getStorage()).map(([e,t])=>{const o=t.getNode()[0];if(!I.NodeGuards.isExpressionStatementNode(o))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return v.NodeFactory.propertyNode(v.NodeFactory.identifierNode(e),o.expression)});let o=v.NodeFactory.variableDeclarationNode([v.NodeFactory.variableDeclaratorNode(v.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()),v.NodeFactory.objectExpressionNode(t))],"const");return o=S.NodeUtils.parentizeAst(o),[o]}};c([N.initializable(),d("design:type","function"==typeof(r=void 0!==p.TControlFlowStorage&&p.TControlFlowStorage)?r:Object)],O.prototype,"controlFlowStorage",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.ControlFlowStorageNode=O},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(20),h=o(123),N=o(47),b=o(7),v=o(10),I=o(6);let S=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():N.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(h.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([b.initializable(),c("design:type",String)],S.prototype,"callsControllerFunctionName",void 0),S=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],S),t.ConsoleOutputDisableExpressionNode=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n const c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.table = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.table = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=s(o(13)),f=c(o(125)),p=o(62),m=o(4);let g=class{constructor(e){this.prevailingKindOfVariables=e.getPrevailingKind()}formatTemplate(e,t){return f.default(e,t)}formatStructure(e){for(const t of e)u.replace(t,{enter:e=>{if(m.NodeGuards.isVariableDeclarationNode(e))return"var"===this.prevailingKindOfVariables&&(e.kind="var"),e}});return e}};g=n([d.injectable(),a(0,d.inject(l.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),i("design:paramtypes",["function"==typeof(r=void 0!==p.IPrevailingKindOfVariablesAnalyzer&&p.IPrevailingKindOfVariablesAnalyzer)?r:Object])],g),t.CustomNodeFormatter=g},function(e,t){e.exports=require("string-template")},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(127),N=o(10),b=o(6);let v=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"callsControllerFunctionName",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionCallNode=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(\n this,\n function () {\n const regExp1 = new RegExp('function *\\\\( *\\\\)');\n const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');\n \n const result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n }\n )();\n })();\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(129),N=o(10),b=o(6);let v=class extends N.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(h.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([y.initializable(),c("design:type",String)],v.prototype,"debugProtectionFunctionName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.DebugProtectionFunctionIntervalNode=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(20),h=o(7),N=o(131),b=o(132),v=o(133),I=o(10),S=o(6);let O=class extends I.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?N.DebuggerTemplate():b.DebuggerTemplateNoEval();return this.customNodeFormatter.formatTemplate(v.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([h.initializable(),c("design:type",String)],O.prototype,"debugProtectionFunctionName",void 0),O=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],O),t.DebugProtectionFunctionNode=O},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n const func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(48),g=o(2),y=o(3),h=o(9),N=o(20),b=o(7),v=o(135),I=o(47),S=o(10),O=o(6);let j=class extends S.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.cryptUtils=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.domainLock.join(";"),[t,o]=this.cryptUtils.hideString(e,3*e.length),r=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():I.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(v.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:o,domains:t,globalVariableTemplate:r,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([b.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.ICryptUtils)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.ICryptUtils&&m.ICryptUtils)?s:Object])],j),t.DomainLockNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n const func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (let i = 0; i < 1000; i--) {\n const isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n const regExp = new RegExp("[{diff}]", "g");\n const domains = "{domains}".replace(regExp, "").split(";");\n let document;\n let domain;\n let location;\n let hostname;\n\n for (let d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (let d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n\n if (!("~" > domain)) {\n for (let d2 in that[document]) {\n if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) {\n location = d2;\n \n break;\n }\n }\n\n for (let d3 in that[document][location]) {\n if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) {\n hostname = d3;\n \n break;\n }\n }\n }\n \n if (!document || !that[document]) {\n return;\n }\n \n const documentDomain = that[document][domain];\n const documentLocationHostName = !!that[document][location] && that[document][location][hostname];\n const currentDomain = documentDomain || documentLocationHostName;\n \n if (!currentDomain) {\n return;\n }\n \n let ok = false;\n \n for (let i = 0; i < domains.length; i++) {\n const domain = domains[i];\n const position = currentDomain.length - domain.length;\n const lastIndex = currentDomain.indexOf(domain, position);\n const endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t,o,r){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=o,this.rightValue=r}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.callExpressionNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.ExpressionWithOperatorControlFlowStorageCallNode=v},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(10),h=o(8),N=o(6);let b=class extends y.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.operator=e}getNodeStructure(e){const t=h.NodeFactory.expressionStatementNode(h.NodeFactory.functionExpressionNode([h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")],h.NodeFactory.blockStatementNode([h.NodeFactory.returnStatementNode(h.NodeFactory.logicalExpressionNode(this.operator,h.NodeFactory.identifierNode("x"),h.NodeFactory.identifierNode("y")))])));return N.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionFunctionNode=b},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(22),h=o(7),N=o(139),b=o(36),v=o(10),I=o(25),S=o(6),O=o(9);let j=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.appendEvent===y.ObfuscationEvent.AfterObfuscation?I.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed})).getObfuscatedCode():this.customNodeFormatter.formatTemplate(N.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([h.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),c([h.initializable(),d("design:type","function"==typeof(r=void 0!==y.ObfuscationEvent&&y.ObfuscationEvent)?r:Object)],j.prototype,"appendEvent",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==O.ICustomNodeFormatter&&O.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],j),t.NodeCallsControllerFunctionNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n const {singleNodeCallControllerFunctionName} = (function(){\n let firstCall = true;\n \n return function (context, fn){\n const rfn = firstCall ? function(){\n if(fn){\n const res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(7),b=o(36),v=o(141),I=o(10),S=o(25),O=o(6);let j=class extends I.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return S.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],j),t.SelfDefendingUnicodeNode=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return !regExp.test(func1.toString());\n };\n \n const test2 = function () {\n const regExp = new RegExp('${e.encode("(\\\\[x|u](\\w){2,4})+",!0)}');\n \n return regExp.test(func2.toString());\n };\n \n const recursiveFunc1 = function (string) {\n const i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n const recursiveFunc2 = function (string) {\n const i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+"")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n `}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(20),b=o(24),v=o(7),I=o(36),S=o(143),O=o(47),j=o(144),_=o(145),C=o(146),R=o(147),F=o(148),T=o(10),w=o(25),x=o(6);let E=class extends T.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}getNodeStructure(e){return x.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.getDecodeStringArrayTemplate();return w.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(R.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),Object.assign(Object.assign({},I.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}getDecodeStringArrayTemplate(){const e=this.options.target!==N.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():O.GlobalVariableNoEvalTemplate(),t=this.customNodeFormatter.formatTemplate(S.AtobTemplate(),{globalVariableTemplate:e});let o="",r="";switch(this.options.selfDefending&&(r=this.customNodeFormatter.formatTemplate(_.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case b.StringArrayEncoding.Rc4:o=this.customNodeFormatter.formatTemplate(F.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:j.Rc4Template(),selfDefendingCode:r,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case b.StringArrayEncoding.Base64:o=this.customNodeFormatter.formatTemplate(C.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:r,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return o}};c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayName",void 0),c([v.initializable(),d("design:type",String)],E.prototype,"stringArrayCallsWrapperName",void 0),E=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],E),t.StringArrayCallsWrapper=E},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n const str = String(input).replace(/=+$/, '');\n let output = '';\n for (\n let bc = 0, bs, buffer, idx = 0;\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n }\n );\n })();\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n const rc4 = function (str, key) {\n let s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (let k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n let i;\n \t \n\t for (i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (let y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){const o=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6),i=e.getRandomString(6),a=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),d=e.getRandomString(6),l=e.getRandomString(6);return`\n const StatesClass = function (${o}) {\n this.${o} = ${o};\n this.${r} = [1, 0, 0];\n this.${n} = function(){return 'newState';};\n this.${i} = '${t.encode("\\w+ *\\(\\) *{\\w+ *",!0)}';\n this.${a} = '${t.encode("['|\"].+['|\"];? *}",!0)}';\n };\n \n StatesClass.prototype.${s} = function () {\n const regExp = new RegExp(this.${i} + this.${a});\n const expression = regExp.test(this.${n}.toString())\n ? --this.${r}[1]\n : --this.${r}[0];\n \n return this.${c}(expression);\n };\n \n StatesClass.prototype.${c} = function (${l}) {\n if (!Boolean(~${l})) {\n return ${l};\n }\n \n return this.${d}(this.${o});\n };\n\n StatesClass.prototype.${d} = function (${o}) {\n for (let i = 0, len = this.${r}.length; i < len; i++) {\n this.${r}.push(Math.round(Math.random()));\n len = this.${r}.length;\n }\n \n return ${o}(this.${r}[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).${s}();\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){const t=e.getRandomString(6),o=e.getRandomString(6),r=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.${o} = function (str) {\n const string = atob(str);\n let newStringChars = [];\n \n for (let i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.${r} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${r}[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.${o}(value);\n {stringArrayCallsWrapperName}.${r}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n const {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n let value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){const t=e.getRandomString(6),o=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.${o} = rc4;\n \n {stringArrayCallsWrapperName}.${r} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${r}[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.${n} === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.${n} = true;\n }\n \n value = {stringArrayCallsWrapperName}.${o}(value, key);\n {stringArrayCallsWrapperName}.${r}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(2),g=o(3),y=o(9),h=o(35),N=o(7),b=o(150),v=o(10),I=o(6);let S=class extends v.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.stringArrayStorage=e,this.stringArrayName=t}getNodeStructure(e){return I.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(b.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}};c([N.initializable(),d("design:type","function"==typeof(r=void 0!==h.IStringArrayStorage&&h.IStringArrayStorage)?r:Object)],S.prototype,"stringArrayStorage",void 0),c([N.initializable(),d("design:type",String)],S.prototype,"stringArrayName",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],S),t.StringArrayNode=S},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n const {stringArrayName} = [{stringArray}];\n "}},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(5),m=o(29),g=o(2),y=o(3),h=o(9),N=o(7),b=o(36),v=o(152),I=o(153),S=o(10),O=o(25),j=o(6),_=o(37);let C=class extends S.AbstractCustomNode{constructor(e,t,o,r,n){super(e,t,o,r),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayRotationAmount=t}getNodeStructure(e){return j.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate();let o="";return o=this.options.selfDefending?this.customNodeFormatter.formatTemplate(v.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):`${t}(++${e})`,O.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(I.StringArrayRotateFunctionTemplate(),{code:o,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotationAmount:_.NumberUtils.toHex(this.stringArrayRotationAmount),whileFunctionName:t}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}};c([N.initializable(),d("design:type",String)],C.prototype,"stringArrayName",void 0),c([N.initializable(),d("design:type",Number)],C.prototype,"stringArrayRotationAmount",void 0),C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==h.ICustomNodeFormatter&&h.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.StringArrayRotateFunctionNode=C},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const selfDefendingFunc = function () {\n const object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n let updatedCookie = name + "=" + value;\n let i = 0;\n \n for (let i = 0, len = options.length; i < len; i++) {\n const propName = options[i];\n \n updatedCookie += "; " + propName;\n \n const propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += "=" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n const matches = document(new RegExp(\n "(?:^|; )" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + "=([^;]*)"\n ));\n \n const func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n let cookie = '';\n const result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n `}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n const {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotationAmount});\n "}},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8),b=o(6);let v=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}getNodeStructure(){const e=N.NodeFactory.expressionStatementNode(N.NodeFactory.memberExpressionNode(N.NodeFactory.identifierNode(this.controlFlowStorageName),N.NodeFactory.identifierNode(this.controlFlowStorageKey)));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],v.prototype,"controlFlowStorageName",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.StringLiteralControlFlowStorageCallNode=v},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(5),p=o(2),m=o(3),g=o(9),y=o(7),h=o(10),N=o(8);let b=class extends h.AbstractCustomNode{constructor(e,t,o,r){super(e,t,o,r)}initialize(e){this.literalValue=e}getNodeStructure(e){return[N.NodeFactory.expressionStatementNode(N.NodeFactory.literalNode(this.literalValue))]}};s([y.initializable(),c("design:type",String)],b.prototype,"literalValue",void 0),b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(r=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.StringLiteralNode=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0);t.finalizingTransformersModule=new r.ContainerModule(e=>{})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(31),a=o(158),s=o(159),c=o(160);t.generatorsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(a.DictionaryIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(c.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(n.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(){let e=null;return t=>o=>{if(e)return e;let r;switch(o.identifierNamesGenerator){case i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:r=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return e=r,r}}())})},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(34),p=o(2),m=o(3),g=o(49);let y=r=class extends g.AbstractIdentifierNamesGenerator{constructor(e,t,o){super(e,t),this.arrayUtils=o,this.identifierNamesSet=new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)),this.identifiersIterator=this.identifierNamesSet.values()}static incrementIdentifierName(e){let t="",o=!1;for(const r of e)o||r!==r.toUpperCase()?o||r!==r.toLowerCase()?t+=r:(t+=r.toUpperCase(),o=!0):t+=r.toLowerCase();return o?t:null}generate(){if(!this.identifierNamesSet.size)throw new Error("Too many identifiers in the code, add more words to identifiers dictionary");const e=this.identifiersIterator.next();return e.done?(this.identifierNamesSet=new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])),this.identifiersIterator=this.identifierNamesSet.values(),this.generate()):e.value}generateWithPrefix(){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate()}`.replace("__","_")}getInitialIdentifierNames(e){const t=e.filter(Boolean).map(e=>e.toLowerCase());return this.arrayUtils.shuffle(t)}getIncrementedIdentifierNames(e){const t=[];for(const o of e){const e=r.incrementIdentifierName(o);e&&t.push(e)}return this.arrayUtils.shuffle(t)}};y=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(1,l.inject(u.ServiceIdentifiers.IOptions)),d(2,l.inject(u.ServiceIdentifiers.IArrayUtils)),c("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object,"function"==typeof(a=void 0!==f.IArrayUtils&&f.IArrayUtils)?a:Object])],y),t.DictionaryIdentifierNamesGenerator=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(49),m=o(37),g=o(30);let y=r=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.randomVariableNameSet=new Set}generate(e){const t=this.randomGenerator.getRandomInteger(1e4,99999999),o=m.NumberUtils.toHex(t),n=g.Utils.hexadecimalPrefix.length+1,i=e?e-n:r.baseIdentifierNameLength,a=o.substr(0,i),s=`_${g.Utils.hexadecimalPrefix}${a}`;return this.randomVariableNameSet.has(s)?this.generate(e):(this.randomVariableNameSet.add(s),s)}generateWithPrefix(e){const t=this.generate(e);return`${this.options.identifiersPrefix}${t}`.replace("__","_")}};y.baseIdentifierNameLength=6,y=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],y),t.HexadecimalIdentifierNamesGenerator=y},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=o(2),f=o(3),p=o(49);let m=r=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.previousMangledName=r.initMangledNameCharacter}generate(e){const t=this.generateNewMangledName(this.previousMangledName);return this.previousMangledName=t,t}generateWithPrefix(e){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate(e)}`}isValidIdentifierName(e){return super.isValidIdentifierName(e)&&!r.reservedNamesSet.has(e)}generateNewMangledName(e){let t=(e=>{const t=r.nameSequence,o=t.length,n=e.length,i=e=>"0".repeat(e);let a=n-1;do{const r=e[a],s=t.indexOf(r);if(s!==o-1){return e.substring(0,a)+t[s+1]+i(n-(a+1))}--a}while(a>=0);return`a${i(n)}`})(e);return this.isValidIdentifierName(t)||(t=this.generateNewMangledName(t)),t}};m.initMangledNameCharacter="9",m.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),m.reservedNamesSet=new Set(["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"]),m=r=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MangledIdentifierNamesGenerator=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1);t.nodeTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.Factory__INodeTransformer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeTransformer))})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(38),s=o(63),c=o(21),d=o(163),l=o(164),u=o(165),f=o(167),p=o(169),m=o(170),g=o(171);t.obfuscatingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(u.LabeledStatementTransformer).whenTargetNamed(c.NodeTransformer.LabeledStatementTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.LiteralTransformer).whenTargetNamed(c.NodeTransformer.LiteralTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ScopeIdentifiersTransformer).whenTargetNamed(c.NodeTransformer.ScopeIdentifiersTransformer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(l.BooleanLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(p.NumberLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(m.StringLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(d.BaseIdentifierObfuscatingReplacer).whenTargetNamed(a.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),e(i.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObfuscatingReplacer)),e(i.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer))})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(5),u=o(2),f=o(39),p=o(8);let m=class extends f.AbstractObfuscatingReplacer{constructor(e,t){super(t),this.blockScopesMap=new Map,this.identifierNamesGenerator=e(t)}replace(e,t){let o=e.name;if(this.blockScopesMap.has(t)){const e=this.blockScopesMap.get(t);e.has(o)&&(o=e.get(o))}return p.NodeFactory.identifierNode(o)}storeGlobalName(e,t){const o=e.name;if(this.isReservedName(o))return;const r=this.identifierNamesGenerator.generateWithPrefix();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(o,r)}storeLocalName(e,t){const o=e.name;if(this.isReservedName(o))return;const r=this.identifierNamesGenerator.generate();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(o,r)}preserveName(e){this.identifierNamesGenerator.preserveName(e)}isReservedName(e){return!!this.options.reservedNames.length&&this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==l.TIdentifierNamesGeneratorFactory&&l.TIdentifierNamesGeneratorFactory)?r:Object,"function"==typeof(n=void 0!==u.IOptions&&u.IOptions)?n:Object])],m),t.BaseIdentifierObfuscatingReplacer=m},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(39),f=o(8);let p=r=class extends u.AbstractObfuscatingReplacer{constructor(e){super(e)}static getTrueUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",r.getFalseUnaryExpressionNode())}static getFalseUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",f.NodeFactory.arrayExpressionNode())}replace(e){const t=e.value;if("boolean"!=typeof t)throw new Error("`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value");return t?r.getTrueUnaryExpressionNode():r.getFalseUnaryExpressionNode()}};p=r=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.BooleanLiteralObfuscatingReplacer=p},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(50),m=o(2),g=o(3),y=o(38),h=o(11),N=o(12),b=o(4),v=o(166);let I=class extends N.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.identifierObfuscatingReplacer=e(y.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case h.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&b.NodeGuards.isLabeledStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const o=v.NodeLexicalScopeUtils.getLexicalScope(e);return o?(this.storeLabeledStatementName(e,o),this.replaceLabeledStatementName(e,o),e):e}storeLabeledStatementName(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label,t)}replaceLabeledStatementName(e,t){f.replace(e,{enter:(e,o)=>{if(o&&b.NodeGuards.isLabelIdentifierNode(e,o)){const o=this.identifierObfuscatingReplacer.replace(e,t);e.name=o.name}}})}};I=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(2,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==p.TIdentifierObfuscatingReplacerFactory&&p.TIdentifierObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==m.IOptions&&m.IOptions)?i:Object])],I),t.LabeledStatementTransformer=I},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(4);class n{static getLexicalScope(e){return n.getLexicalScopesRecursive(e,1)[0]}static getLexicalScopes(e){return n.getLexicalScopesRecursive(e)}static getLexicalScopesRecursive(e,t=1/0,o=[],i=0){if(o.length>=t)return o;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return r.NodeGuards.isNodeWithLexicalScope(e)&&o.push(e),e!==a?n.getLexicalScopesRecursive(a,t,o,++i):o}}t.NodeLexicalScopeUtils=n},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(0),f=o(1),p=o(168),m=o(29),g=o(2),y=o(3),h=o(64),N=o(63),b=o(11),v=o(12),I=o(8),S=o(4),O=o(44),j=o(15),_=o(6);let C=class extends v.AbstractNodeTransformer{constructor(e,t,o,r,n){super(t,o),this.literalObfuscatingReplacerFactory=e,this.stringArrayStorageAnalyzer=r,this.escapeSequenceEncoder=n}getVisitor(e){switch(e){case b.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(S.NodeGuards.isProgramNode(e)&&this.analyzeNode(e),t&&S.NodeGuards.isLiteralNode(e)&&!j.NodeMetadata.isReplacedLiteral(e))return this.transformNode(e,t)}};case b.TransformationStage.Finalizing:return{enter:(e,t)=>{if(t&&S.NodeGuards.isLiteralNode(e))return this.encodeLiteralNodeToEscapeSequence(e,t)}};default:return null}}analyzeNode(e){this.stringArrayStorageAnalyzer.analyze(e)}transformNode(e,t){if(O.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;let o;switch(typeof e.value){case"boolean":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e);break;case"number":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e);break;case"string":o=this.literalObfuscatingReplacerFactory(N.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e);break;default:o=e}return _.NodeUtils.parentizeNode(o,t),o}encodeLiteralNodeToEscapeSequence(e,t){return"string"!=typeof e.value?e:I.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(e.value,this.options.unicodeEscapeSequence))}};C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IObfuscatingReplacer)),l(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(2,u.inject(f.ServiceIdentifiers.IOptions)),l(3,u.inject(f.ServiceIdentifiers.IStringArrayStorageAnalyzer)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(r=void 0!==p.TLiteralObfuscatingReplacerFactory&&p.TLiteralObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==g.IOptions&&g.IOptions)?i:Object,"function"==typeof(a=void 0!==h.IStringArrayStorageAnalyzer&&h.IStringArrayStorageAnalyzer)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.LiteralTransformer=C},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(2),l=o(39),u=o(8),f=o(37),p=o(30);let m=class extends l.AbstractObfuscatingReplacer{constructor(e){super(e),this.numberLiteralCache=new Map}replace(e){const t=e.value;if("number"!=typeof t)throw new Error("`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value");let o;return this.numberLiteralCache.has(t)?o=this.numberLiteralCache.get(t):(o=f.NumberUtils.isCeil(t)?`${p.Utils.hexadecimalPrefix}${f.NumberUtils.toHex(t)}`:String(t),this.numberLiteralCache.set(t,o)),u.NodeFactory.literalNode(t,o)}};m=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IOptions&&d.IOptions)?r:Object])],m),t.NumberLiteralObfuscatingReplacer=m},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(2),p=o(35),m=o(64),g=o(7),y=o(24),h=o(39),N=o(15),b=o(8),v=o(37),I=o(30);let S=r=class extends h.AbstractObfuscatingReplacer{constructor(e,t,o){super(o),this.nodesCache=new Map,this.stringArrayStorage=e,this.stringArrayStorageAnalyzer=t}static getHexadecimalLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}static getRc4KeyLiteralNode(e){const t=b.NodeFactory.literalNode(e);return N.NodeMetadata.set(t,{replacedLiteral:!0}),t}initialize(){this.stringArrayStorageCallsWrapperName=this.stringArrayStorage.getStorageCallsWrapperName(),this.options.shuffleStringArray&&this.stringArrayStorage.shuffleStorage(),this.options.rotateStringArray&&this.stringArrayStorage.rotateStorage()}replace(e){const t=e.value;if("string"!=typeof t)throw new Error("`StringLiteralObfuscatingReplacer` should accept only literals with `string` value");const o=this.stringArrayStorageAnalyzer.getItemDataForLiteralNode(e),r=`${t}-${Boolean(o)}`;if(this.nodesCache.has(r)&&this.options.stringArrayEncoding!==y.StringArrayEncoding.Rc4)return this.nodesCache.get(r);const n=o?this.replaceWithStringArrayCallNode(o):this.replaceWithLiteralNode(t);return this.nodesCache.set(r,n),n}replaceWithLiteralNode(e){return b.NodeFactory.literalNode(e)}replaceWithStringArrayCallNode(e){const{index:t,decodeKey:o}=e,n=`${I.Utils.hexadecimalPrefix}${v.NumberUtils.toHex(t)}`,i=[r.getHexadecimalLiteralNode(n)];o&&i.push(r.getRc4KeyLiteralNode(o));const a=b.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName);return b.NodeFactory.callExpressionNode(a,i)}};s([g.initializable(),c("design:type",String)],S.prototype,"stringArrayStorageCallsWrapperName",void 0),s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],S.prototype,"initialize",null),S=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IStringArrayStorage)),d(1,l.inject(u.ServiceIdentifiers.IStringArrayStorageAnalyzer)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==p.IStringArrayStorage&&p.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==m.IStringArrayStorageAnalyzer&&m.IStringArrayStorageAnalyzer)?i:Object,"function"==typeof(a=void 0!==f.IOptions&&f.IOptions)?a:Object])],S),t.StringLiteralObfuscatingReplacer=S},function(e,t,o){"use strict";var r,n,i,a,s,c=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=u(o(13)),g=o(50),y=o(2),h=o(3),N=o(172),b=o(38),v=o(11),I=o(12),S=o(4),O=o(15);let j=r=class extends I.AbstractNodeTransformer{constructor(e,t,o,r){super(t,o),this.lexicalScopesWithObjectPatternWithoutDeclarationMap=new Map,this.identifierObfuscatingReplacer=e(b.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),this.scopeAnalyzer=r}getVisitor(e){switch(e){case v.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&S.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.transformNode(e,t)}};default:return null}}analyzeNode(e,t){this.scopeAnalyzer.analyze(e)}transformNode(e,t){const o=this.scopeAnalyzer.acquireScope(e);return this.traverseScopeVariables(o),e}traverseScopeVariables(e){const t=e.variableScope,o=S.NodeGuards.isNodeWithBlockLexicalScope(t.block)?t.block:null,n=r.globalScopeNames.includes(t.type);if(o){for(const t of e.variables)if(t.name!==r.argumentsVariableName){if(!this.options.renameGlobals&&n){if(!t.defs.every(e=>"ImportBinding"===e.type||"CatchClause"===e.type))continue}this.transformScopeVariableIdentifiers(t,o,n)}for(const t of e.childScopes)this.traverseScopeVariables(t)}}transformScopeVariableIdentifiers(e,t,o){for(const r of e.identifiers)this.isReplaceableIdentifierNode(r,t,e)&&(this.storeIdentifierName(r,t,o),this.replaceIdentifierName(r,t,e))}storeIdentifierName(e,t,o){o?this.identifierObfuscatingReplacer.storeGlobalName(e,t):this.identifierObfuscatingReplacer.storeLocalName(e,t)}replaceIdentifierName(e,t,o){const r=this.identifierObfuscatingReplacer.replace(e,t);e.name=r.name,o.references.forEach(t=>{t.identifier.name=e.name})}isReplaceableIdentifierNode(e,t,o){const r=e.parentNode;return!(!r||O.NodeMetadata.isIgnoredNode(e)||this.isProhibitedPropertyNode(e,r)||this.isProhibitedClassDeclarationNameIdentifierNode(o,e,r)||this.isProhibitedExportNamedClassDeclarationIdentifierNode(e,r)||this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,r)||this.isProhibitedExportNamedVariableDeclarationIdentifierNode(e,r)||this.isProhibitedImportSpecifierNode(e,r)||this.isProhibitedVariableNameUsedInObjectPatternNode(o,e,t)||S.NodeGuards.isLabelIdentifierNode(e,r))}isProhibitedClassDeclarationNameIdentifierNode(e,t,o){return S.NodeGuards.isClassDeclarationNode(e.scope.block)&&S.NodeGuards.isClassDeclarationNode(o)&&o.id===t}isProhibitedExportNamedClassDeclarationIdentifierNode(e,t){return S.NodeGuards.isClassDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,t){return S.NodeGuards.isFunctionDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedVariableDeclarationIdentifierNode(e,t){return S.NodeGuards.isVariableDeclaratorNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isVariableDeclarationNode(t.parentNode)&&!!t.parentNode.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode.parentNode)}isProhibitedImportSpecifierNode(e,t){return S.NodeGuards.isImportSpecifierNode(t)&&t.imported.name===t.local.name}isProhibitedPropertyNode(e,t){const o=S.NodeGuards.isPropertyNode(t)&&!t.computed&&t.key===e,r=S.NodeGuards.isAssignmentPatternNode(t)&&t.left===e&&!!t.parentNode&&S.NodeGuards.isPropertyNode(t.parentNode)&&t.left===t.parentNode.key;return o||r}isProhibitedVariableNameUsedInObjectPatternNode(e,t,o){let r=this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(o);if(!1===r)return!1;if(!e.defs.some(e=>"var"===e.kind))return!1;let n=!1;return m.traverse(o,{enter:(e,o)=>{if(S.NodeGuards.isObjectPatternNode(e)&&o&&S.NodeGuards.isAssignmentExpressionNode(o)){r=!0;const o=e.properties;for(const e of o)if(!e.computed&&e.shorthand&&S.NodeGuards.isIdentifierNode(e.key)&&t.name===e.key.name)return n=!0,m.VisitorOption.Break}}}),this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(o,null!=r&&r),n}};j.argumentsVariableName="arguments",j.globalScopeNames=["global","module"],j=r=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),l(1,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(2,f.inject(p.ServiceIdentifiers.IOptions)),l(3,f.inject(p.ServiceIdentifiers.IScopeAnalyzer)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierObfuscatingReplacerFactory&&g.TIdentifierObfuscatingReplacerFactory)?n:Object,"function"==typeof(i=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.IOptions&&y.IOptions)?a:Object,"function"==typeof(s=void 0!==N.IScopeAnalyzer&&N.IScopeAnalyzer)?s:Object])],j),t.ScopeIdentifiersTransformer=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(174),a=o(181);t.optionsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IOptions).to(i.Options).inSingletonScope(),e(n.ServiceIdentifiers.IOptionsNormalizer).to(a.OptionsNormalizer).inSingletonScope()})},function(e,t,o){"use strict";var r,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=o(28),m=o(0),g=o(1),y=o(65),h=o(175),N=o(176),b=o(177),v=o(31),I=o(20),S=o(32),O=o(24),j=o(40),_=o(178),C=o(179);let R=r=class{constructor(e,t){Object.assign(this,j.DEFAULT_PRESET,e);const o=y.validateSync(this,r.validatorOptions);if(o.length)throw new ReferenceError(`Validation failed. errors:\n${_.ValidationErrorsFormatter.format(o)}`);Object.assign(this,t.normalize(this))}};R.validatorOptions={validationError:{target:!1}},l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"compact",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"controlFlowFlattening",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"controlFlowFlatteningThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"deadCodeInjection",void 0),l([y.IsNumber(),u("design:type",Number)],R.prototype,"deadCodeInjectionThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtection",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtectionInterval",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"disableConsoleOutput",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),C.IsAllowedForObfuscationTargets([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval]),u("design:type",Array)],R.prototype,"domainLock",void 0),l([y.IsIn([v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,v.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,v.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]),u("design:type","function"==typeof(n=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?n:Object)],R.prototype,"identifierNamesGenerator",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"identifiersPrefix",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),y.ValidateIf(e=>e.identifierNamesGenerator===v.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),y.ArrayNotEmpty(),u("design:type",Array)],R.prototype,"identifiersDictionary",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFileName",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFilePath",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"log",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"renameGlobals",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedNames",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedStrings",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"rotateStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"selfDefending",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"shuffleStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"sourceMap",void 0),l([y.IsString(),y.ValidateIf(e=>Boolean(e.sourceMapBaseUrl)),y.IsUrl({require_protocol:!0,require_tld:!1,require_valid_protocol:!0}),u("design:type",String)],R.prototype,"sourceMapBaseUrl",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"sourceMapFileName",void 0),l([y.IsIn([S.SourceMapMode.Inline,S.SourceMapMode.Separate]),u("design:type","function"==typeof(i=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?i:Object)],R.prototype,"sourceMapMode",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"splitStrings",void 0),l([y.IsNumber(),y.ValidateIf(e=>Boolean(e.splitStrings)),y.Min(1),u("design:type",Number)],R.prototype,"splitStringsChunkLength",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"stringArray",void 0),l([y.IsIn([!0,!1,O.StringArrayEncoding.Base64,O.StringArrayEncoding.Rc4]),u("design:type","function"==typeof(a=void 0!==N.TStringArrayEncoding&&N.TStringArrayEncoding)?a:Object)],R.prototype,"stringArrayEncoding",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"stringArrayThreshold",void 0),l([y.IsIn([I.ObfuscationTarget.Browser,I.ObfuscationTarget.BrowserNoEval,I.ObfuscationTarget.Node]),u("design:type","function"==typeof(s=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?s:Object)],R.prototype,"target",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"transformObjectKeys",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"unicodeEscapeSequence",void 0),R=r=l([m.injectable(),f(0,m.inject(g.ServiceIdentifiers.TInputOptions)),f(1,m.inject(g.ServiceIdentifiers.IOptionsNormalizer)),u("design:paramtypes",["function"==typeof(c=void 0!==h.TInputOptions&&h.TInputOptions)?c:Object,"function"==typeof(d=void 0!==b.IOptionsNormalizer&&b.IOptionsNormalizer)?d:Object])],R),t.Options=R},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{static format(e){return e.reduce((e,t)=>[...e,r.formatWithNestedConstraints(t)],[]).join("\n")}static formatWithNestedConstraints(e){const t=e.constraints;return`${`\`${e.property}\` errors:\n`}${Object.keys(t).map(e=>` - ${t[e]}\n`).join()}`}}t.ValidationErrorsFormatter=r},function(e,t,o){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=o(65),i=r(o(180)),a=o(41),s=o(40);t.IsAllowedForObfuscationTargets=function(e,t){return(o,r)=>{n.registerDecorator({propertyName:r,constraints:[e],name:"IsAllowedForObfuscationTargets",options:t,target:o.constructor,validator:{validate(t,o){const n=o.object,a=s.DEFAULT_PRESET[r];return i.default(t,a)||e.includes(n.target)},defaultMessage:t=>`This option allowed only for obfuscation targets: ${e.join(`${a.StringSeparator.Comma} `)}`}})}}},function(e,t){e.exports=require("fast-deep-equal")},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=o(182),s=o(183),c=o(184),d=o(185),l=o(186),u=o(187),f=o(188),p=o(189),m=o(190),g=o(191),y=o(192),h=o(193),N=o(194);let b=r=class{normalize(e){let t=Object.assign({},e);for(const e of r.normalizerRules)t=e(t);return t}};b.normalizerRules=[a.ControlFlowFlatteningThresholdRule,s.DeadCodeInjectionRule,c.DeadCodeInjectionThresholdRule,d.DomainLockRule,l.InputFileNameRule,u.SeedRule,f.SelfDefendingRule,p.SourceMapBaseUrlRule,m.SourceMapFileNameRule,g.SplitStringsChunkLengthRule,y.StringArrayRule,h.StringArrayEncodingRule,N.StringArrayThresholdRule],b=r=n([i.injectable()],b),t.OptionsNormalizer=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControlFlowFlatteningThresholdRule=e=>(0===e.controlFlowFlatteningThreshold&&(e=Object.assign(Object.assign({},e),{controlFlowFlattening:!1,controlFlowFlatteningThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(40);t.DeadCodeInjectionRule=e=>(e.deadCodeInjection&&((e=Object.assign(Object.assign({},e),{deadCodeInjection:!0,stringArray:!0})).stringArrayThreshold||(e=Object.assign(Object.assign({},e),{stringArray:!0,stringArrayThreshold:r.DEFAULT_PRESET.stringArrayThreshold}))),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeadCodeInjectionThresholdRule=e=>(0===e.deadCodeInjectionThreshold&&(e=Object.assign(Object.assign({},e),{deadCodeInjection:!1,deadCodeInjectionThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(30);t.DomainLockRule=e=>{if(e.domainLock.length){const t=[];for(const o of e.domainLock)t.push(r.Utils.extractDomainFrom(o));e=Object.assign(Object.assign({},e),{domainLock:t})}return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(41);t.InputFileNameRule=e=>{let{inputFileName:t}=e;return t&&(t=t.replace(/^\/+/,"").split(r.StringSeparator.Dot).slice(0,-1).join(r.StringSeparator.Dot)||t,e=Object.assign(Object.assign({},e),{inputFileName:`${t}.js`})),e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeedRule=e=>{if(e.seed)return Object.assign(Object.assign({},e),{seed:e.seed});return Object.assign(Object.assign({},e),{seed:(t=0,o=999999999,Math.floor(Math.random()*(o-t+1)+t))});var t,o}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingRule=e=>(e.selfDefending&&(e=Object.assign(Object.assign({},e),{compact:!0,selfDefending:!0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapBaseUrlRule=e=>{const{sourceMapBaseUrl:t}=e;return e.sourceMapFileName?(t&&!t.endsWith("/")&&(e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:`${t}/`})),e):e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:""})}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(41);t.SourceMapFileNameRule=e=>{let{sourceMapFileName:t}=e;if(t){t=t.replace(/^\/+/,"").replace(/(?:\.js)?(?:\.map)?$/,"");let o=t.split(r.StringSeparator.Dot);const n=o.length,i=o[n-1];n>1&&i.length<=3&&(o=o.slice(0,-1)),t=o.join(r.StringSeparator.Dot),e=Object.assign(Object.assign({},e),{sourceMapFileName:`${t}.js.map`})}return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SplitStringsChunkLengthRule=e=>e=0===e.splitStringsChunkLength?Object.assign(Object.assign({},e),{splitStrings:!1,splitStringsChunkLength:0}):Object.assign(Object.assign({},e),{splitStringsChunkLength:Math.floor(e.splitStringsChunkLength)})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRule=e=>(e.stringArray||(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,shuffleStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(24);t.StringArrayEncodingRule=e=>(!0===e.stringArrayEncoding&&(e=Object.assign(Object.assign({},e),{stringArrayEncoding:r.StringArrayEncoding.Base64})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayThresholdRule=e=>(0===e.stringArrayThreshold&&(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(16),n=o(0),i=o(1),a=o(21),s=o(66),c=o(196),d=o(197),l=o(67),u=o(198),f=o(202),p=o(204),m=o(205),g=o(207),y=o(208),h=o(209);t.preparingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.CommentsTransformer).whenTargetNamed(a.NodeTransformer.CommentsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.CustomNodesTransformer).whenTargetNamed(a.NodeTransformer.CustomNodesTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.EvalCallExpressionTransformer).whenTargetNamed(a.NodeTransformer.EvalCallExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.MetadataTransformer).whenTargetNamed(a.NodeTransformer.MetadataTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.ObfuscatingGuardsTransformer).whenTargetNamed(a.NodeTransformer.ObfuscatingGuardsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ParentificationTransformer).whenTargetNamed(a.NodeTransformer.ParentificationTransformer),e(i.ServiceIdentifiers.INodeGuard).to(c.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.BlackListObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(l.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ConditionalCommentObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(y.ReservedStringObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ReservedStringObfuscatingGuard),e(i.ServiceIdentifiers.Factory__INodeGuard).toFactory(r.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeGuard)),e(i.ServiceIdentifiers.INodeTransformer).to(h.VariablePreserveTransformer).whenTargetNamed(a.NodeTransformer.VariablePreserveTransformer)})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});const a=o(0),s=o(4);let c=r=class{constructor(){this.blackListGuardsLength=r.blackListGuards.length}check(e){for(let t=0;t=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(13)),p=o(2),m=o(3),g=o(11),y=o(12),h=o(4),N=o(67);let b=r=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case g.TransformationStage.Initializing:return{leave:e=>{if(h.NodeGuards.isProgramNode(e))return this.transformNode(e)}};default:return null}}transformNode(e){if(!e.comments||!e.comments.length)return e;const t=this.transformComments(e.comments);return 0===t.length?e:e.body.length?(f.traverse(e,{enter:o=>{if(o===e)return;const r=t.findIndex(e=>e.range&&o.range&&e.range[0]0&&(e.trailingComments=t.reverse()),e):(e.leadingComments=t,e)}transformComments(e){return e.filter(e=>r.preservedWords.some(t=>e.value.includes(t))||N.ConditionalCommentObfuscatingGuard.isConditionalComment(e)).reverse()}};b.preservedWords=["@license","@preserve"],b=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],b),t.CommentsTransformer=b},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=o(0),p=o(1),m=o(199),g=o(200),y=o(2),h=o(3),N=o(201),b=o(62),v=o(22),I=o(11),S=o(12),O=o(4);let j=class extends S.AbstractNodeTransformer{constructor(e,t,o,r,n,i){super(n,i),this.callsGraphData=[],this.callsGraphAnalyzer=e,this.prevailingKindOfVariablesAnalyzer=t,this.obfuscationEventEmitter=o,this.customNodeGroupStorage=r}getVisitor(e){switch(e){case I.TransformationStage.Preparing:return{leave:(e,t)=>{if(O.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.appendCustomNodesBeforeObfuscation(e,t),this.transformNode(e,t)}};case I.TransformationStage.Finalizing:return{leave:(e,t)=>{O.NodeGuards.isProgramNode(e)&&this.appendCustomNodesAfterObfuscation(e,t)}};default:return null}}analyzeNode(e,t){this.callsGraphData=this.callsGraphAnalyzer.analyze(e),this.prevailingKindOfVariablesAnalyzer.analyze(e)}transformNode(e,t){return e}appendCustomNodesBeforeObfuscation(e,t){this.customNodeGroupStorage.getStorage().forEach(e=>{e.initialize(),this.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(v.ObfuscationEvent.BeforeObfuscation,e,this.callsGraphData)}appendCustomNodesAfterObfuscation(e,t){this.obfuscationEventEmitter.emit(v.ObfuscationEvent.AfterObfuscation,e,this.callsGraphData)}};j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.ICallsGraphAnalyzer)),u(1,f.inject(p.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),u(2,f.inject(p.ServiceIdentifiers.IObfuscationEventEmitter)),u(3,f.inject(p.ServiceIdentifiers.TCustomNodeGroupStorage)),u(4,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(5,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(r=void 0!==N.ICallsGraphAnalyzer&&N.ICallsGraphAnalyzer)?r:Object,"function"==typeof(n=void 0!==b.IPrevailingKindOfVariablesAnalyzer&&b.IPrevailingKindOfVariablesAnalyzer)?n:Object,"function"==typeof(i=void 0!==g.IObfuscationEventEmitter&&g.IObfuscationEventEmitter)?i:Object,"function"==typeof(a=void 0!==m.TCustomNodeGroupStorage&&m.TCustomNodeGroupStorage)?a:Object,"function"==typeof(s=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.CustomNodesTransformer=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=d(o(203)),p=o(2),m=o(3),g=o(11),y=o(12),h=o(8),N=o(4),b=o(6);let v=r=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t),this.evalRootAstHostNodeSet=new Set}static extractEvalStringFromCallExpressionArgument(e){return N.NodeGuards.isLiteralNode(e)?r.extractEvalStringFromLiteralNode(e):N.NodeGuards.isTemplateLiteralNode(e)?r.extractEvalStringFromTemplateLiteralNode(e):null}static extractEvalStringFromLiteralNode(e){return"string"==typeof e.value?e.value:null}static extractEvalStringFromTemplateLiteralNode(e){const t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(t&&N.NodeGuards.isCallExpressionNode(e)&&N.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return this.transformNode(e,t)}};case g.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:(e,t)=>{if(t&&this.isEvalRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}transformNode(e,t){const o=e.arguments[0];if(!o)return e;const n=r.extractEvalStringFromCallExpressionArgument(o);if(!n)return e;let i;try{i=b.NodeUtils.convertCodeToStructure(n)}catch(t){return e}const a=h.NodeFactory.functionExpressionNode([],h.NodeFactory.blockStatementNode(i));return this.evalRootAstHostNodeSet.add(a),a}restoreNode(e,t){const o=e.body.body,r=b.NodeUtils.convertStructureToCode(o);return h.NodeFactory.callExpressionNode(h.NodeFactory.identifierNode("eval"),[h.NodeFactory.literalNode(f.default(r))])}isEvalRootAstHostNode(e){return N.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}};v=r=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],v),t.EvalCallExpressionTransformer=v},function(e,t){e.exports=require("js-string-escape")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(4),g=o(15);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return g.NodeMetadata.set(e,{ignoredNode:!1}),m.NodeGuards.isLiteralNode(e)&&g.NodeMetadata.set(e,{replacedLiteral:!1}),e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MetadataTransformer=y},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(206),p=o(2),m=o(3),g=o(66),y=o(11),h=o(12),N=o(15);let b=r=class extends h.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.obfuscatingGuards=r.obfuscatingGuardsList.map(e)}getVisitor(e){switch(e){case y.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){const o=this.obfuscatingGuards.every(t=>t.check(e));return N.NodeMetadata.set(e,{ignoredNode:!o}),e}};b.obfuscatingGuardsList=[g.ObfuscatingGuard.BlackListObfuscatingGuard,g.ObfuscatingGuard.ConditionalCommentObfuscatingGuard,g.ObfuscatingGuard.ReservedStringObfuscatingGuard],b=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__INodeGuard)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TObfuscatingGuardFactory&&f.TObfuscatingGuardFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.ObfuscatingGuardsTransformer=b},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(11),p=o(12),m=o(6);let g=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return m.NodeUtils.parentizeNode(e,t)}};g=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],g),t.ParentificationTransformer=g},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(2),d=o(1),l=o(4);let u=class{constructor(e){this.options=e}check(e){return!this.options.reservedStrings.length||!l.NodeGuards.isLiteralNode(e)||"string"!=typeof e.value||!this.isReservedString(e.value)}isReservedString(e){return this.options.reservedStrings.some(t=>null!==new RegExp(t,"g").exec(e))}};u=n([s.injectable(),a(0,s.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(r=void 0!==c.IOptions&&c.IOptions)?r:Object])],u),t.ReservedStringObfuscatingGuard=u},function(e,t,o){"use strict";var r,n,i,a=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(50),u=o(2),f=o(3),p=o(38),m=o(1),g=o(11),y=o(12),h=o(4);let N=class extends y.AbstractNodeTransformer{constructor(e,t,o){super(t,o),this.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(h.NodeGuards.isIdentifierNode(e)&&t&&(h.NodeGuards.parentNodeIsPropertyNode(e,t)||h.NodeGuards.parentNodeIsMemberExpressionNode(e,t)||h.NodeGuards.parentNodeIsMethodDefinitionNode(e,t)||h.NodeGuards.isLabelIdentifierNode(e,t)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return this.identifierObfuscatingReplacer.preserveName(e.name),e}};N=a([d.injectable(),c(0,d.inject(m.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,d.inject(m.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(m.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(r=void 0!==l.TIdentifierObfuscatingReplacerFactory&&l.TIdentifierObfuscatingReplacerFactory)?r:Object,"function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.VariablePreserveTransformer=N},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(211),a=o(212),s=o(214);t.storagesModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.TCustomNodeGroupStorage).to(a.CustomNodeGroupStorage).inSingletonScope(),e(n.ServiceIdentifiers.IStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(n.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(i.ControlFlowStorage),e(n.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(e=>()=>{const t=new(e.container.get(n.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(n.ServiceIdentifiers.IRandomGenerator),e.container.get(n.ServiceIdentifiers.IOptions));return t.initialize(),t})})},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(2),u=o(3),f=o(51);let p=class extends f.MapStorage{constructor(e,t){super(e,t)}};p=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?r:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.ControlFlowStorage=p},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(0),u=o(1),f=o(213),p=o(2),m=o(3),g=o(61),y=o(51);let h=r=class extends y.MapStorage{constructor(e,t,o){super(t,o),this.customNodeGroupFactory=e}initialize(){super.initialize(),r.customNodeGroupsList.forEach(e=>{const t=this.customNodeGroupFactory(e);this.storage.set(e,t)})}};h.customNodeGroupsList=[g.CustomNodeGroup.ConsoleOutputCustomNodeGroup,g.CustomNodeGroup.DebugProtectionCustomNodeGroup,g.CustomNodeGroup.DomainLockCustomNodeGroup,g.CustomNodeGroup.SelfDefendingCustomNodeGroup,g.CustomNodeGroup.StringArrayCustomNodeGroup],s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],h.prototype,"initialize",null),h=r=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__ICustomNodeGroup)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TCustomNodeGroupFactory&&f.TCustomNodeGroupFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.CustomNodeGroupStorage=h},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=o(5),y=o(34),h=o(48),N=o(29),b=o(2),v=o(3),I=o(7),S=o(24),O=o(51);let j=r=class extends O.MapStorage{constructor(e,t,o,n,i,a){super(o,n),this.rc4EncodedValuesSourcesCache=new Map,this.rotationAmount=0,this.identifierNamesGenerator=e(n),this.arrayUtils=t,this.cryptUtils=i,this.escapeSequenceEncoder=a,this.rc4Keys=this.randomGenerator.getRandomGenerator().n(()=>this.randomGenerator.getRandomGenerator().string({length:r.rc4KeyLength}),r.rc4KeysCount)}initialize(){super.initialize();const e=this.identifierNamesGenerator.generate(r.stringArrayNameLength),t=this.identifierNamesGenerator.generate(r.stringArrayNameLength);this.stringArrayStorageName=`${this.options.identifiersPrefix}${e}`,this.stringArrayStorageCallsWrapperName=`${this.options.identifiersPrefix}${t}`,this.rotationAmount=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(r.minimumRotationAmount,r.maximumRotationAmount):0}get(e){return this.getOrSetIfDoesNotExist(e)}getRotationAmount(){return this.rotationAmount}getStorageId(){return this.stringArrayStorageName}getStorageName(){return this.getStorageId()}getStorageCallsWrapperName(){return this.stringArrayStorageCallsWrapperName}rotateStorage(){this.getLength()&&(this.storage=new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()),this.rotationAmount)))}shuffleStorage(){this.storage=new Map(this.arrayUtils.shuffle(Array.from(this.storage.entries())).map(([e,t],o)=>(t.index=o,[e,t])).sort(([,e],[,t])=>e.index-t.index))}toString(){return Array.from(this.storage.values()).map(e=>`'${this.escapeSequenceEncoder.encode(e.encodedValue,this.options.unicodeEscapeSequence)}'`).toString()}getOrSetIfDoesNotExist(e){const{encodedValue:t,decodeKey:o}=this.getEncodedValue(e),r=this.storage.get(t);if(r)return r;const n={encodedValue:t,decodeKey:o,value:e,index:this.getLength()};return this.storage.set(t,n),n}getEncodedValue(e){var t;switch(this.options.stringArrayEncoding){case S.StringArrayEncoding.Rc4:{const o=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),r=this.cryptUtils.btoa(this.cryptUtils.rc4(e,o)),n=null!==(t=this.rc4EncodedValuesSourcesCache.get(r))&&void 0!==t?t:[];let i=n.length;return(!i||!n.includes(e))&&(n.push(e),i++),this.rc4EncodedValuesSourcesCache.set(r,n),i>1?this.getEncodedValue(e):{encodedValue:r,decodeKey:o}}case S.StringArrayEncoding.Base64:{const t=null;return{encodedValue:this.cryptUtils.btoa(e),decodeKey:t}}default:return{encodedValue:e,decodeKey:null}}}};j.minimumRotationAmount=100,j.maximumRotationAmount=500,j.rc4KeyLength=4,j.rc4KeysCount=50,j.stringArrayNameLength=7,l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageName",void 0),l([I.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageCallsWrapperName",void 0),l([p.postConstruct(),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],j.prototype,"initialize",null),j=r=l([p.injectable(),f(0,p.inject(m.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),f(1,p.inject(m.ServiceIdentifiers.IArrayUtils)),f(2,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f(3,p.inject(m.ServiceIdentifiers.IOptions)),f(4,p.inject(m.ServiceIdentifiers.ICryptUtils)),f(5,p.inject(m.ServiceIdentifiers.IEscapeSequenceEncoder)),u("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==v.IRandomGenerator&&v.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==b.IOptions&&b.IOptions)?s:Object,"function"==typeof(c=void 0!==h.ICryptUtils&&h.ICryptUtils)?c:Object,"function"==typeof(d=void 0!==N.IEscapeSequenceEncoder&&N.IEscapeSequenceEncoder)?d:Object])],j),t.StringArrayStorage=j},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(0),n=o(1),i=o(216),a=o(217),s=o(221),c=o(222),d=o(223),l=o(68);t.utilsModule=new r.ContainerModule(e=>{e(n.ServiceIdentifiers.IArrayUtils).to(i.ArrayUtils).inSingletonScope(),e(n.ServiceIdentifiers.IRandomGenerator).to(l.RandomGenerator).inSingletonScope(),e(n.ServiceIdentifiers.ICryptUtils).to(a.CryptUtils).inSingletonScope(),e(n.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope(),e(n.ServiceIdentifiers.ILevelledTopologicalSorter).to(c.LevelledTopologicalSorter),e(n.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder).to(d.NodeTransformerNamesGroupsBuilder).inSingletonScope()})},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(3);let l=class{constructor(e){this.randomGenerator=e}createWithRange(e){const t=[];for(let o=0;on&&(r=i,n=e),o[i]=e}return r}rotate(e,t){if(!e.length)throw new ReferenceError("Cannot rotate empty array.");if(t<=0)return e;const o=e;let r;for(;t--;)r=o.pop(),r&&o.unshift(r);return o}shuffle(e){const t=[...e];for(let e=t.length;e;e--){const o=Math.floor(this.randomGenerator.getMathRandom()*e);[t[e-1],t[o]]=[t[o],t[e-1]]}return t}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i("design:paramtypes",["function"==typeof(r=void 0!==d.IRandomGenerator&&d.IRandomGenerator)?r:Object])],l),t.ArrayUtils=l},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(3),l=o(68),u=o(30);let f=class{constructor(e){this.randomGenerator=e}btoa(e){let t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(`${u.Utils.hexadecimalPrefix}${t}`,16)));for(let o,r,n=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|n)||(i="=",n%1);t+=i.charAt(63&o>>8-n%1*8)){if(r=e.charCodeAt(n+=.75),r>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|r}return t}hideString(e,t){let o=this.randomGenerator.getRandomGenerator().string({length:t,pool:l.RandomGenerator.randomGeneratorPool}).replace(new RegExp(`[${r=e,r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}]`,"g"),"");var r;const n=o.split("");return this.randomGenerator.getRandomGenerator().shuffle(n),o=n.join(""),[((e,t)=>{let o=-1,r=-1,n="";for(;o=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.stringsCache=new Map}encode(e,t){const o=`${e}-${String(t)}`;if(this.stringsCache.has(o))return this.stringsCache.get(o);const r=new RegExp("[\\s\\S]","g"),n=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const c=e.replace(r,e=>t||n.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(o,c),this.stringsCache.set(`${c}-${String(t)}`,c),c}};n=r([o(0).injectable()],n),t.EscapeSequenceEncoder=n},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],o={};for(const r of e)void 0===o[r]&&this.visit(t,o,r);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const o of t){for(let t=o.length-1;t>=0;t-=1)o[t]===e&&o.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const o of e)this.hasPrecedents(o)||t.push(o);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const o=this.graph.get(t);return o&&!o.includes(e)&&o.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,o){const r=t[o];if("visiting"===r)throw new Error(`Detected cycle involving node: ${o}`);if(r)return;t[o]="visiting";const n=this.getPrecedents(o);for(const o of n)this.visit(e,t,o);t[o]="ok",e.push(o)}};n=r([o(0).injectable()],n),t.LevelledTopologicalSorter=n},function(e,t,o){"use strict";var r,n=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(0),c=o(1),d=o(224);let l=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),o=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of o)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const o=[];for(const r of e){const e=t[r].runAfter;if(e&&e.length)for(const n of e){void 0===t[n]?o.push([r,null]):o.push([n,r])}else o.push([r,null])}return o}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.ILevelledTopologicalSorter)),i("design:paramtypes",["function"==typeof(r=void 0!==d.ILevelledTopologicalSorter&&d.ILevelledTopologicalSorter)?r:Object])],l),t.NodeTransformerNamesGroupsBuilder=l},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";var r,n,i,a,s,c,d=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=o(0),m=o(1),g=f(o(46)),y=o(226),h=o(227),N=o(2),b=o(3),v=o(57),I=o(228),S=o(21),O=o(11),j=o(43),_=o(55),C=o(4);let R=r=class{constructor(e,t,o,r,n){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=o,this.logger=r,this.options=n}obfuscate(e){const t=Date.now();this.logger.info(I.LoggingMessage.Version,"0.24.6"),this.logger.info(I.LoggingMessage.ObfuscationStarted),this.logger.info(I.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const o=this.parseCode(e),r=this.transformAstTree(o),n=this.generateCode(e,r),i=(Date.now()-t)/1e3;return this.logger.success(I.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(n)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return _.ASTParserFacade.parse(t,r.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,O.TransformationStage.Initializing),!C.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,O.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,O.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,O.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,O.TransformationStage.Converting),e=this.runTransformationStage(e,O.TransformationStage.Obfuscating),e=this.runTransformationStage(e,O.TransformationStage.Finalizing)):(this.logger.warn(I.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const o=Object.assign({},r.escodegenParams);this.options.sourceMap&&(o.sourceMap=this.options.inputFileName||"sourceMap",o.sourceContent=e);const n=g.generate(t,Object.assign(Object.assign({},o),{format:{compact:this.options.compact}}));return n.map=n.map?n.map.toString():"",n}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(I.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,r.transformersList,t)}};R.parseOptions={ecmaVersion:j.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},R.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},R.transformersList=[S.NodeTransformer.BlockStatementControlFlowTransformer,S.NodeTransformer.CommentsTransformer,S.NodeTransformer.CustomNodesTransformer,S.NodeTransformer.DeadCodeInjectionTransformer,S.NodeTransformer.EvalCallExpressionTransformer,S.NodeTransformer.FunctionControlFlowTransformer,S.NodeTransformer.LabeledStatementTransformer,S.NodeTransformer.LiteralTransformer,S.NodeTransformer.MemberExpressionTransformer,S.NodeTransformer.MetadataTransformer,S.NodeTransformer.MethodDefinitionTransformer,S.NodeTransformer.ObfuscatingGuardsTransformer,S.NodeTransformer.ObjectExpressionKeysTransformer,S.NodeTransformer.ObjectExpressionTransformer,S.NodeTransformer.ParentificationTransformer,S.NodeTransformer.ScopeIdentifiersTransformer,S.NodeTransformer.SplitStringTransformer,S.NodeTransformer.TemplateLiteralTransformer,S.NodeTransformer.VariablePreserveTransformer],R=r=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.ITransformersRunner)),u(1,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(2,p.inject(m.ServiceIdentifiers.Factory__IObfuscatedCode)),u(3,p.inject(m.ServiceIdentifiers.ILogger)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==v.ITransformersRunner&&v.ITransformersRunner)?n:Object,"function"==typeof(i=void 0!==b.IRandomGenerator&&b.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.TObfuscatedCodeFactory&&y.TObfuscatedCodeFactory)?a:Object,"function"==typeof(s=void 0!==h.ILogger&&h.ILogger)?s:Object,"function"==typeof(c=void 0!==N.IOptions&&N.IOptions)?c:Object])],R),t.JavaScriptObfuscator=R},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,o){"use strict";var r=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(0),a=n(o(230));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=r([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t){e.exports=require("eventemitter3")},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=o(0),d=o(1),l=o(48),u=o(7),f=o(32),p=o(2);let m=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case f.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case f.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};i([u.initializable(),a("design:type",String)],m.prototype,"obfuscatedCode",void 0),i([u.initializable(),a("design:type",String)],m.prototype,"sourceMap",void 0),m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.ICryptUtils)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(r=void 0!==l.ICryptUtils&&l.ICryptUtils)?r:Object,"function"==typeof(n=void 0!==p.IOptions&&p.IOptions)?n:Object])],m),t.ObfuscatedCode=m},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,o){"use strict";var r,n,i=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(o,r){t(o,r,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=o(0),l=o(1),u=c(o(13)),f=o(234),p=o(235),m=o(236),g=o(4),y=o(15);let h=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,o){if(!t.length)return e;let r,n;this.cachedNodeTransformersData.has(t)?[r,n]=this.cachedNodeTransformersData.get(t):(r=this.buildNormalizedNodeTransformers(t),n=this.nodeTransformerNamesGroupsBuilder.build(r),this.cachedNodeTransformersData.set(t,[r,n]));for(const t of n){const n=[],i=[];for(const e of t){const t=r[e].getVisitor(o);t&&(t.enter&&n.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(n.length||i.length)&&u.replace(e,{enter:this.mergeVisitorsForDirection(n,m.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,m.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const o=e.length;return o?(r,n)=>{if(y.NodeMetadata.isIgnoredNode(r))return u.VisitorOption.Skip;for(let i=0;ie}};h=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__INodeTransformer)),s(1,d.inject(l.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),a("design:paramtypes",["function"==typeof(r=void 0!==f.TNodeTransformerFactory&&f.TNodeTransformerFactory)?r:Object,"function"==typeof(n=void 0!==p.INodeTransformerNamesGroupsBuilder&&p.INodeTransformerNamesGroupsBuilder)?n:Object])],h),t.TransformersRunner=h},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},function(e,t,o){"use strict";var r,n,i,a,s=this&&this.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=d(o(243)),u=d(o(238)),f=o(244),p=o(7),m=o(40),g=o(245),y=o(246),h=o(247),N=o(248),b=o(249),v=o(250),I=o(251),S=o(25),O=o(253),j=o(255);class _{constructor(e){this.rawArguments=e,this.arguments=e.slice(2)}static buildOptions(e,t){const o=_.filterOptions(e),r=e.config,n=r?u.resolve(r,"."):"",i=n?I.CLIUtils.getUserConfig(n):{},a=u.basename(t),s=t;return Object.assign(Object.assign(Object.assign(Object.assign({},m.DEFAULT_PRESET),i),o),{inputFileName:a,inputFilePath:s})}static filterOptions(e){const t={};return Object.keys(e).forEach(o=>{void 0!==e[o]&&(t[o]=e[o])}),t}initialize(){this.inputPath=u.normalize(this.arguments[0]||""),this.commands=new l.Command,this.configureCommands(),this.configureHelp(),this.inputCLIOptions=this.commands.opts(),this.sourceCodeReader=new j.SourceCodeReader(this.inputPath,this.inputCLIOptions),this.obfuscatedCodeWriter=new O.ObfuscatedCodeWriter(this.inputPath,this.inputCLIOptions)}run(){if(!this.arguments.length||this.arguments.includes("--help"))return void this.commands.outputHelp();const e=this.sourceCodeReader.readSourceCode();this.processSourceCodeData(e)}configureCommands(){this.commands.usage(" [options]").version(null!=="0.24.6"?"0.24.6":"unknown","-v, --version").option("-o, --output ","Output path for obfuscated code").option("--compact ","Disable one line output code compacting",y.BooleanSanitizer).option("--config ","Name of js / json config file").option("--control-flow-flattening ","Enables control flow flattening",y.BooleanSanitizer).option("--control-flow-flattening-threshold ","The probability that the control flow flattening transformation will be applied to the node",parseFloat).option("--dead-code-injection ","Enables dead code injection",y.BooleanSanitizer).option("--dead-code-injection-threshold ","The probability that the dead code injection transformation will be applied to the node",parseFloat).option("--debug-protection ","Disable browser Debug panel (can cause DevTools enabled browser freeze)",y.BooleanSanitizer).option("--debug-protection-interval ","Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)",y.BooleanSanitizer).option("--disable-console-output ","Allow console.log, console.info, console.error and console.warn messages output into browser console",y.BooleanSanitizer).option("--domain-lock (comma separated, without whitespaces)","Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)",g.ArraySanitizer).option("--exclude (comma separated, without whitespaces)","A filename or glob which indicates files to exclude from obfuscation",g.ArraySanitizer).option("--identifier-names-generator ","Sets identifier names generator. Values: hexadecimal, mangled, dictionary. Default: hexadecimal",h.IdentifierNamesGeneratorSanitizer).option("--identifiers-prefix ","Sets prefix for all global identifiers.").option("--identifiers-dictionary (comma separated, without whitespaces)","Identifiers dictionary (comma separated) for `--identifier-names-generator dictionary` option",g.ArraySanitizer).option("--log ","Enables logging of the information to the console",y.BooleanSanitizer).option("--reserved-names (comma separated, without whitespaces)","Disables obfuscation and generation of identifiers, which being matched by passed RegExp patterns (comma separated)",g.ArraySanitizer).option("--reserved-strings (comma separated, without whitespaces)","Disables transformation of string literals, which being matched by passed RegExp patterns (comma separated)",g.ArraySanitizer).option("--rename-globals ","Allows to enable obfuscation of global variable and function names with declaration.",y.BooleanSanitizer).option("--rotate-string-array ","Enable rotation of string array values during obfuscation",y.BooleanSanitizer).option("--seed ","Sets seed for random generator. This is useful for creating repeatable results.",parseFloat).option("--self-defending ","Disables self-defending for obfuscated code",y.BooleanSanitizer).option("--shuffle-string-array ","Randomly shuffles string array items",y.BooleanSanitizer).option("--source-map ","Enables source map generation",y.BooleanSanitizer).option("--source-map-base-url ","Sets base url to the source map import url when `--source-map-mode=separate`").option("--source-map-file-name ","Sets file name for output source map when `--source-map-mode=separate`").option("--source-map-mode ","Specify source map output mode. Values: inline, separate. Default: separate",b.SourceMapModeSanitizer).option("--split-strings ","Splits literal strings into chunks with length of `splitStringsChunkLength` option value",y.BooleanSanitizer).option("--split-strings-chunk-length ","Sets chunk length of `splitStrings` option",parseFloat).option("--string-array ","Disables gathering of all literal strings into an array and replacing every literal string with an array call",y.BooleanSanitizer).option("--string-array-encoding ","Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed. Values: true, false, base64, rc4. Default: false",v.StringArrayEncodingSanitizer).option("--string-array-threshold ","The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)",parseFloat).option("--target ","Allows to set target environment for obfuscated code. Values: browser, browser-no-eval, node. Default: browser",N.ObfuscationTargetSanitizer).option("--transform-object-keys ","Enables transformation of object keys",y.BooleanSanitizer).option("--unicode-escape-sequence ","Allows to enable/disable string conversion to unicode escape sequence",y.BooleanSanitizer).parse(this.rawArguments)}configureHelp(){this.commands.on("--help",()=>{console.log(" Examples:\n"),console.log(" %> javascript-obfuscator input_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_directory_name --compact true --self-defending false"),console.log("")})}processSourceCodeData(e){e.forEach(({filePath:e,content:t},o)=>{const r=this.obfuscatedCodeWriter.getOutputCodePath(e);this.processSourceCode(t,e,r,o)})}processSourceCode(e,t,o,r){var n;let i=_.buildOptions(this.inputCLIOptions,t);if(null!==r){const e=`${null!==(n=this.inputCLIOptions.identifiersPrefix)&&void 0!==n?n:_.baseIdentifiersPrefix}${r}`;i=Object.assign(Object.assign({},i),{identifiersPrefix:e})}i.sourceMap?this.processSourceCodeWithSourceMap(e,o,i):this.processSourceCodeWithoutSourceMap(e,o,i)}processSourceCodeWithoutSourceMap(e,t,o){const r=S.JavaScriptObfuscator.obfuscate(e,o).getObfuscatedCode();this.obfuscatedCodeWriter.writeFile(t,r)}processSourceCodeWithSourceMap(e,t,o){var r;const n=this.obfuscatedCodeWriter.getOutputSourceMapPath(t,null!==(r=o.sourceMapFileName)&&void 0!==r?r:"");o=Object.assign(Object.assign({},o),{sourceMapFileName:u.basename(n)});const i=S.JavaScriptObfuscator.obfuscate(e,o);this.obfuscatedCodeWriter.writeFile(t,i.getObfuscatedCode()),"separate"===o.sourceMapMode&&i.getSourceMap()&&this.obfuscatedCodeWriter.writeFile(n,i.getSourceMap())}}_.encoding="utf8",_.obfuscatedFilePrefix="-obfuscated",_.baseIdentifiersPrefix="a",s([p.initializable(),c("design:type","function"==typeof(r=void 0!==l&&l.CommanderStatic)?r:Object)],_.prototype,"commands",void 0),s([p.initializable(),c("design:type","function"==typeof(n=void 0!==f.TInputCLIOptions&&f.TInputCLIOptions)?n:Object)],_.prototype,"inputCLIOptions",void 0),s([p.initializable(),c("design:type",String)],_.prototype,"inputPath",void 0),s([p.initializable(),c("design:type","function"==typeof(i=void 0!==j.SourceCodeReader&&j.SourceCodeReader)?i:Object)],_.prototype,"sourceCodeReader",void 0),s([p.initializable(),c("design:type","function"==typeof(a=void 0!==O.ObfuscatedCodeWriter&&O.ObfuscatedCodeWriter)?a:Object)],_.prototype,"obfuscatedCodeWriter",void 0),t.JavaScriptObfuscatorCLI=_},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("fs")},,function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(242);e.exports=r.JavaScriptObfuscatorCLI},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(69);const r=o(237);t.JavaScriptObfuscatorCLI=class{static obfuscate(e){const t=new r.JavaScriptObfuscatorCLI(e);t.initialize(),t.run()}}},function(e,t){e.exports=require("commander")},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArraySanitizer=e=>{if(e.endsWith(","))throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1','value2'");return e.split(",").map(e=>e.trim())}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=e=>"true"===e||"1"===e},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(31);t.IdentifierNamesGeneratorSanitizer=e=>{if(!Object.keys(r.IdentifierNamesGenerator).some(t=>r.IdentifierNamesGenerator[t]===e))throw new ReferenceError("Invalid value of `--identifier-names-generator` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(20);t.ObfuscationTargetSanitizer=e=>{if(!Object.keys(r.ObfuscationTarget).some(t=>r.ObfuscationTarget[t]===e))throw new ReferenceError("Invalid value of `--target` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(32);t.SourceMapModeSanitizer=e=>{if(!Object.keys(r.SourceMapMode).some(t=>r.SourceMapMode[t]===e))throw new ReferenceError("Invalid value of `--source-map-mode` option");return e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(24);t.StringArrayEncodingSanitizer=e=>{switch(e){case"true":case"1":case r.StringArrayEncoding.Base64:return!0;case r.StringArrayEncoding.Rc4:return r.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CLIUtils=class{static getUserConfig(e){let t;try{t=o(252)(e)}catch(o){try{t=require(e)}catch(e){throw new ReferenceError("Given config path must be a valid `.js` or `.json` file path")}}return t}}},function(e,t){function o(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}o.keys=function(){return[]},o.resolve=o,e.exports=o,o.id=252},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=r(o(239)),i=r(o(254)),a=r(o(238)),s=o(41),c=o(237);t.ObfuscatedCodeWriter=class{constructor(e,t){this.inputPath=e,this.options=t}getOutputCodePath(e){const t=this.options.output?a.normalize(this.options.output):null;if(!t)return a.normalize(e).split(s.StringSeparator.Dot).map((e,t)=>0===t?`${e}${c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix}`:e).join(s.StringSeparator.Dot);const o=n.lstatSync(this.inputPath).isDirectory(),r=""===a.extname(t);if(o){if(r)return a.join(t,e);throw new Error("Output path for directory obfuscation should be a directory path")}return r?a.join(t,a.basename(e)):t}getOutputSourceMapPath(e,t=""){return t&&(e=`${e.substring(0,e.lastIndexOf("/"))}/${t}`),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e=`${e.split(s.StringSeparator.Dot)[0]}.js.map`,e}writeFile(e,t){i.sync(a.dirname(e)),n.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}},function(e,t){e.exports=require("mkdirp")},function(e,t,o){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(o(239)),a=r(o(238)),s=n(o(256)),c=o(71),d=o(237),l=o(70);class u{constructor(e,t){this.inputPath=e,this.options=t}static isExcludedPath(e,t=[]){if(!t.length)return!1;const o=a.basename(e),r=!!s.default([e],t).length;return t.some(t=>e.includes(t)||o.includes(t))||r}static isDirectoryPath(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}static isFilePath(e){try{return i.statSync(e).isFile()}catch(e){return!1}}static isValidDirectory(e,t=[]){return!u.isExcludedPath(e,t)}static isValidFile(e,t=[]){return u.availableInputExtensions.includes(a.extname(e))&&!e.includes(d.JavaScriptObfuscatorCLI.obfuscatedFilePrefix)&&!u.isExcludedPath(e,t)}static logFilePath(e){const t=a.normalize(e);l.Logger.log(l.Logger.colorInfo,c.LoggingPrefix.CLI,`Obfuscating file: ${t}...`)}static readFile(e){return u.logFilePath(e),{filePath:e,content:i.readFileSync(e,d.JavaScriptObfuscatorCLI.encoding)}}readSourceCode(){if(u.isFilePath(this.inputPath)&&u.isValidFile(this.inputPath,this.options.exclude))return[u.readFile(this.inputPath)];if(u.isDirectoryPath(this.inputPath)&&u.isValidDirectory(this.inputPath,this.options.exclude))return this.readDirectoryRecursive(this.inputPath);const e=u.availableInputExtensions.map(e=>`\`${e}\``).join(", ");throw new ReferenceError(`Given input path must be a valid ${e} file or directory path`)}readDirectoryRecursive(e,t=[]){return i.readdirSync(e,d.JavaScriptObfuscatorCLI.encoding).forEach(o=>{const r=`${e}/${o}`;if(u.isDirectoryPath(r)&&u.isValidDirectory(r,this.options.exclude))t.push(...this.readDirectoryRecursive(r));else if(u.isFilePath(r)&&u.isValidFile(r,this.options.exclude)){const e=u.readFile(r);t.push(e)}else;}),t}}t.SourceCodeReader=u,u.availableInputExtensions=[".js"]},function(e,t){e.exports=require("multimatch")}]); //# sourceMappingURL=index.cli.js.map \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index e8ab763a..96b23618 100644 --- a/dist/index.js +++ b/dist/index.js @@ -21,5 +21,5 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -require("source-map-support").install(),module.exports=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=240)}([function(e,t){e.exports=require("inversify")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(33);class n{static isArrayPatternNode(e){return e.type===o.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===o.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===o.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===o.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===o.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===o.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===o.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===o.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===o.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===o.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===o.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===o.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===o.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return n.isFunctionDeclarationNode(e)||n.isFunctionExpressionNode(e)||n.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===o.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===o.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===o.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===o.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===o.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const r=n.isLabeledStatementNode(t)&&t.label===e,o=n.isContinueStatementNode(t)&&t.label===e,i=n.isBreakStatementNode(t)&&t.label===e;return r||o||i}static isLabeledStatementNode(e){return e.type===o.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===o.NodeType.Literal}static isMemberExpressionNode(e){return e.type===o.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===o.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return n.isProgramNode(e)||n.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return n.isNodeWithLexicalScope(e)||n.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return n.isProgramNode(e)||n.isBlockStatementNode(e)&&n.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return n.isProgramNode(e)||n.isBlockStatementNode(e)||n.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===o.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===o.NodeType.ObjectExpression}static isProgramNode(e){return e.type===o.NodeType.Program}static isPropertyNode(e){return e.type===o.NodeType.Property}static parentNodeIsPropertyNode(e,t){return n.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return n.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return n.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===o.NodeType.RestElement}static isReturnStatementNode(e){return e.type===o.NodeType.ReturnStatement}static isSuperNode(e){return e.type===o.NodeType.Super}static isSwitchCaseNode(e){return e.type===o.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===o.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===o.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===o.NodeType.UnaryExpression}static isUseStrictOperator(e){return n.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===o.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===o.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===o.NodeType.WhileStatement}}t.NodeGuards=n,n.nodesWithLexicalStatements=[o.NodeType.ArrowFunctionExpression,o.NodeType.FunctionDeclaration,o.NodeType.FunctionExpression,o.NodeType.MethodDefinition]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(46)),i=o(r(13)),a=r(43),s=r(55),c=r(4),d=r(15);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:n.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),c.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+n.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return c.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(r=>{if("parentNode"===r)return;const o=e[r];let n;n=null===o||o instanceof RegExp?o:Array.isArray(o)?o.map(l.cloneRecursive):"object"==typeof o?l.cloneRecursive(o):o,t[r]=n}),t}}t.NodeUtils=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o={configurable:!0,enumerable:!0};function n(e,t,r){Reflect.hasMetadata(e,r)||Reflect.defineMetadata(e,t,r)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(r,i)=>{const a=r[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return n("_initialized",!1,r),n("_initializablePropertiesSet",new Set,r),n("_wrappedMethodsSet",new Set,r),function(e,t){const r=Object.getOwnPropertyNames(e),n=[t,"constructor"];r.forEach(r=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(n.includes(r)||a.has(r)||s.has(r))return;if("function"!=typeof e[r])return;const c=null!==(i=Object.getOwnPropertyDescriptor(e,r))&&void 0!==i?i:o,d=c.value;Object.defineProperty(e,r,Object.assign(Object.assign({},c),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(r)})}(r,e),function(e,t,r){var n;const i=null!==(n=Object.getOwnPropertyDescriptor(e,t))&&void 0!==n?n:o,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[r],e}}))}(r,e,i),function(e,t){var r;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const n=`_${t.toString()}`,i=null!==(r=Object.getOwnPropertyDescriptor(e,n))&&void 0!==r?r:o;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[n])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[n]},set:function(e){this[n]=e}})),i}(r,i)}}},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(46)),i=r(33);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,r){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,r){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,r){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:r,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,r){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},r&&{alternate:r}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:n.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,r){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,r=!1){return{type:i.NodeType.MemberExpression,computed:r,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,r,o){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:r,computed:o,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,r=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:r,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,r=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:r,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),N=r(113),h=r(114);let b=o=class{constructor(e,t,r,o){this.cachedNode=null,this.identifierNamesGenerator=e(o),this.customNodeFormatter=t,this.randomGenerator=r,this.options=o}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(o.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};b.globalVariableTemplateFunctions=[N.GlobalVariableTemplate1(),h.GlobalVariableTemplate2()],b=o=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],b),t.AbstractCustomNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3);let f=class{constructor(e,t){this.randomGenerator=e,this.options=t}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractNodeTransformer=f},function(e,t){e.exports=require("estraverse")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static getParentNodeWithStatements(e){return n.getParentNodesWithStatementsRecursive(e,1)[0]}static getParentNodesWithStatements(e){return n.getParentNodesWithStatementsRecursive(e)}static getNextSiblingStatement(e){return n.getSiblingStatementByOffset(e,1)}static getPreviousSiblingStatement(e){return n.getSiblingStatementByOffset(e,-1)}static getRootStatementOfNode(e){if(o.NodeGuards.isProgramNode(e))throw new Error("Unable to find root statement for `Program` node");const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithStatements(t)?e:n.getRootStatementOfNode(t)}static getScopeOfNode(e){const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithStatements(t)?t:n.getScopeOfNode(t)}static getParentNodesWithStatementsRecursive(e,t=1/0,r=[],i=0){if(r.length>=t)return r;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(o.NodeGuards.isProgramNode(e)||o.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&r.push(e),e!==a?n.getParentNodesWithStatementsRecursive(a,t,r,++i):r}static getSiblingStatementByOffset(e,t){const r=n.getScopeOfNode(e),i=o.NodeGuards.isSwitchCaseNode(r)?r.consequent:r.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static set(e,t){var r;e.metadata=Object.assign(null!==(r=e.metadata)&&void 0!==r?r:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===o.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===o.get(e,"replacedLiteral")}}t.NodeMetadata=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(72),a=r(82),s=r(95),c=r(106),d=r(156),l=r(157),u=r(161),f=r(162),p=r(173),m=r(195),g=r(210),y=r(215),N=r(225),h=r(70),b=r(229),I=r(231),v=r(232),S=r(233);t.InversifyContainerFacade=class{constructor(){this.container=new o.Container}static getFactory(e){return t=>r=>t.container.getNamed(e,r)}static getCacheFactory(e){return t=>{const r=new Map;return o=>{if(r.has(o))return r.get(o);const n=t.container.getNamed(e,o);return r.set(o,n),n}}}static getConstructorFactory(e,...t){return r=>{const o=new Map,n=[];return i=>{if(t.forEach((e,t)=>{n[t]||(n[t]=r.container.get(e))}),o.has(i))return new(o.get(i))(...n);const a=r.container.getNamed(e,i);return o.set(i,a),new a(...n)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,r){this.container.bind(n.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new v.SourceCode(e,t)).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>r).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ILogger).to(h.Logger).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IJavaScriptObfuscator).to(N.JavaScriptObfuscator).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ITransformersRunner).to(S.TransformersRunner).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IObfuscatedCode).to(I.ObfuscatedCode),this.container.bind(n.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,r)=>{const o=e.container.get(n.ServiceIdentifiers.IObfuscatedCode);return o.initialize(t,r),o}),this.container.bind(n.ServiceIdentifiers.IObfuscationEventEmitter).to(b.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(c.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(u.nodeTransformersModule),this.container.load(f.obfuscatingTransformersModule),this.container.load(p.optionsModule),this.container.load(m.preparingTransformersModule),this.container.load(g.storagesModule),this.container.load(y.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static append(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e),...t])}static appendToOptimalBlockScope(e,t,r,o=0){const i=e.length?n.getOptimalBlockScope(e,o):t;n.prepend(i,r)}static getOptimalBlockScope(e,t,r=1/0){const o=e[t];if(r<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return r>1&&o.callsGraph.length?n.getOptimalBlockScope(o.callsGraph,0,--r):o.callee}static insertBefore(e,t,r){const o=n.getScopeStatements(e).indexOf(r);n.insertAtIndex(e,t,o)}static insertAfter(e,t,r){const o=n.getScopeStatements(e).indexOf(r);n.insertAtIndex(e,t,o+1)}static insertAtIndex(e,t,r){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e).slice(0,r),...t,...n.getScopeStatements(e).slice(r)])}static prepend(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...t,...n.getScopeStatements(e)])}static getScopeStatements(e){return o.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){o.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.ObfuscationTarget=o.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.StringArrayEncoding=o.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(69);const o=r(1),n=r(16);class i{static obfuscate(e,t={}){const r=new n.InversifyContainerFacade;r.load(e,"",t);const i=r.get(o.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return r.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.5"?"0.24.5":"unknown"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(5),f=r(2),p=r(3);let m=class{constructor(e,t,r){this.identifierNamesGenerator=e(r),this.randomGenerator=t,this.options=r}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const r=this.customNodes.get(e);r&&t(r)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==u.TIdentifierNamesGeneratorFactory&&u.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],m),t.AbstractCustomNodeGroup=m},function(e,t){e.exports=require("@gradecam/tsenum")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=o,o.hexadecimalPrefix="0x"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.IdentifierNamesGenerator=o.MakeEnum({DictionaryIdentifierNamesGenerator:"dictionary",HexadecimalIdentifierNamesGenerator:"hexadecimal",MangledIdentifierNamesGenerator:"mangled"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.SourceMapMode=o.MakeEnum({Inline:"inline",Separate:"separate"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(31),n=r(20),i=r(32);t.NO_ADDITIONAL_NODES_PRESET=Object.freeze({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!1,seed:0,selfDefending:!1,shuffleStringArray:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:0,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NumberUtils=class{static toHex(e){return e.toString(16)}static isCeil(e){return e%1==0}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(2);let l=class{constructor(e){this.options=e}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IOptions&&d.IOptions)?o:Object])],l),t.AbstractObfuscatingReplacer=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(31),n=r(20),i=r(32);t.DEFAULT_PRESET=Object.freeze({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!0,seed:0,selfDefending:!1,shuffleStringArray:!0,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:10,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Dot=".",e.Comma=","}(t.StringSeparator||(t.StringSeparator={}))},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{};n=o([r(0).injectable()],n),t.AbstractCalleeDataExtractor=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecmaVersion=11},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);t.NodeLiteralUtils=class{static isProhibitedLiteralNode(e,t){return!(!o.NodeGuards.isPropertyNode(t)||t.computed||t.key!==e)||!!o.NodeGuards.isImportDeclarationNode(t)}}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3);let g=o=class{constructor(e,t,r){this.replacerDataByControlFlowStorageId=new Map,this.controlFlowCustomNodeFactory=e,this.randomGenerator=t,this.options=r}static getStorageKeysByIdForCurrentStorage(e,t){let r;return r=e.has(t)?e.get(t):new Map,r}insertCustomNodeToControlFlowStorage(e,t,r,n){const i=t.getStorageId(),a=o.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,i),s=a.get(r);if(this.randomGenerator.getMathRandom(){const r=this.randomGenerator.getRandomString(e);return t.getStorage().has(r)?c(e):r},d=c(5);return a.set(r,[d]),this.replacerDataByControlFlowStorageId.set(i,a),t.set(d,e),d}};g=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],g),t.AbstractControlFlowReplacer=g},function(e,t){e.exports=require("escodegen")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n const that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3);let f=class{constructor(e,t){this.preservedNamesSet=new Set,this.randomGenerator=e,this.options=t}preserveName(e){this.preservedNamesSet.add(e)}isValidIdentifierName(e){return this.notReservedName(e)&&!this.preservedNamesSet.has(e)}notReservedName(e){return!this.options.reservedNames.length||!this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractIdentifierNamesGenerator=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(7);let m=class{constructor(e,t){this.randomGenerator=e,this.options=t}initialize(){this.storage=new Map,this.storageId=this.randomGenerator.getRandomString(6)}get(e){return this.storage.get(e)}getOrThrow(e){const t=this.get(e);if(!t)throw new Error(`No value found in map storage with key \`${e}\``);return t}getKeyOf(e){for(const[t,r]of this.storage)if(e===r)return t;return null}getLength(){return this.storage.size}getStorage(){return this.storage}getStorageId(){return this.storageId}has(e){return this.storage.has(e)}mergeWith(e,t=!1){this.storage=new Map([...this.storage,...e.getStorage()]),t&&(this.storageId=e.getStorageId())}set(e,t){this.storage.set(e,t)}};a([p.initializable(),s("design:type",String)],m.prototype,"storageId",void 0),a([p.initializable(),s("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],m.prototype,"storage",void 0),a([d.postConstruct(),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],m.prototype,"initialize",null),m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MapStorage=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(17),f=r(2),p=r(3),m=r(18),g=r(45),y=r(4);let N=class extends g.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}getControlFlowStorageCallNode(e,t,r,o){const n=this.controlFlowCustomNodeFactory(m.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);n.initialize(e,t,r,o);const i=n.getNode()[0];if(!i||!y.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};N=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==u.TControlFlowCustomNodeFactory&&u.TControlFlowCustomNodeFactory)?o:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],N),t.ExpressionWithOperatorControlFlowReplacer=N},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(r(85)),a=n(r(86)),s=n(r(56));class c{static parse(e,t){const r=c.sourceTypes.length;for(let o=0;o"),u=`...${i.substring(s,d).replace(/^\s+/,"")}...`;throw new Error(`ERROR in ${a}line ${r.line}: ${t}\n${l} ${u}`)}}t.ASTParserFacade=c,c.colorError=s.default.red,c.nearestSymbolsCount=15,c.sourceTypes=["script","module"]},function(e,t){e.exports=require("chalk")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BasePropertiesExtractor="BasePropertiesExtractor",e.ObjectExpressionToVariableDeclarationExtractor="ObjectExpressionToVariableDeclarationExtractor"}(t.ObjectExpressionExtractor||(t.ObjectExpressionExtractor={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ObjectExpressionVariableDeclarationHostNode="ObjectExpressionVariableDeclarationHostNode"}(t.ObjectExpressionKeysTransformerCustomNode||(t.ObjectExpressionKeysTransformerCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t){e.exports=require("class-validator")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListObfuscatingGuard="BlackListObfuscatingGuard",e.ConditionalCommentObfuscatingGuard="ConditionalCommentObfuscatingGuard",e.ReservedStringObfuscatingGuard="ReservedStringObfuscatingGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(4);let s=o=class{constructor(){this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}static isConditionalComment(e){return o.obfuscationEnableCommentRegExp.test(e.value)||o.obfuscationDisableCommentRegExp.test(e.value)}check(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!a.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;const t=e.leadingComments,r=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),r&&(this.obfuscationAllowedForNextNode=this.checkComments(r)),this.obfuscationAllowedForCurrentNode}checkComments(e){const t=e.length;let r=this.obfuscationAllowedForCurrentNode;for(let n=0;n=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(218)),m=r(219),g=r(2),y=r(220),N=r(7);let h=o=class{constructor(e,t){this.sourceCode=e,this.options=t}initialize(){this.randomGenerator=new m.Chance(this.getRawSeed())}getMathRandom(){return this.getRandomInteger(0,99999)/1e5}getRandomGenerator(){return this.randomGenerator}getRandomInteger(e,t){return this.getRandomGenerator().integer({min:e,max:t})}getRandomString(e,t=o.randomGeneratorPool){return this.getRandomGenerator().string({length:e,pool:t})}getInputSeed(){return this.options.seed.toString()}getRawSeed(){const e=this.getInputSeed();return`${e}`.split("|").length>1?e:`${e}|${p.default(this.sourceCode.getSourceCode())}`}};h.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s([N.initializable(),c("design:type","function"==typeof(n=void 0!==m.Chance&&m.Chance.Chance)?n:Object)],h.prototype,"randomGenerator",void 0),s([u.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],h.prototype,"initialize",null),h=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.ISourceCode)),d(1,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(i=void 0!==y.ISourceCode&&y.ISourceCode)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],h),t.RandomGenerator=h},function(e,t){e.exports=require("reflect-metadata")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(56)),f=r(2),p=r(71);let m=o=class{constructor(e){this.options=e}static log(e,t,r,o){const n=e(`\n${t} ${r}`);console.log(n,null!=o?o:"")}info(e,t){this.options.log&&o.log(o.colorInfo,p.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&o.log(o.colorSuccess,p.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&o.log(o.colorWarn,p.LoggingPrefix.Base,e,t)}};m.colorInfo=u.default.cyan,m.colorSuccess=u.default.green,m.colorWarn=u.default.yellow,m=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IOptions&&f.IOptions)?n:Object])],m),t.Logger=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(52),s=r(73),c=r(75),d=r(76),l=r(77),u=r(78),f=r(79),p=r(81);t.analyzersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICallsGraphAnalyzer).to(s.CallsGraphAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer).to(u.PrevailingKindOfVariablesAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IScopeAnalyzer).to(f.ScopeAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IStringArrayStorageAnalyzer).to(p.StringArrayStorageAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(d.FunctionExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(l.ObjectExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(74),p=r(52),m=r(4),g=r(14);let y=o=class{constructor(e){this.calleeDataExtractorFactory=e}static getLimitIndex(e){const t=e-1,r=o.limitThresholdActivationLength-1;let n=t;return t>r&&(n=Math.round(r+t*o.limitThreshold),n>t&&(n=t)),n}analyze(e){return this.analyzeRecursive(e.body)}analyzeRecursive(e){const t=o.getLimitIndex(e.length),r=[],n=e.length;for(let o=0;ot);o++){const t=e[o];u.traverse(t,{enter:o=>{if(m.NodeGuards.isCallExpressionNode(o))return t.parentNode!==g.NodeStatementUtils.getParentNodeWithStatements(o)?u.VisitorOption.Skip:void this.analyzeCallExpressionNode(r,e,o)}})}return r}analyzeCallExpressionNode(e,t,r){o.calleeDataExtractorsList.forEach(o=>{const n=this.calleeDataExtractorFactory(o).extract(t,r.callee);n&&e.push(Object.assign(Object.assign({},n),{callsGraph:this.analyzeRecursive(n.callee.body)}))})}};y.calleeDataExtractorsList=[p.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,p.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,p.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],y.limitThresholdActivationLength=25,y.limitThreshold=.002,y=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__ICalleeDataExtractor)),a("design:paramtypes",["function"==typeof(n=void 0!==f.TCalleeDataExtractorFactory&&f.TCalleeDataExtractorFactory)?n:Object])],y),t.CallsGraphAnalyzer=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(13)),s=r(42),c=r(4),d=r(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){if(!c.NodeGuards.isIdentifierNode(t))return null;const r=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name);return r?{callee:r,name:t.name}:null}getCalleeBlockStatement(e,t){let r=null;return a.traverse(e,{enter:e=>{if(c.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return r=e.body,a.VisitorOption.Break}}),r}};l=o([i.injectable()],l),t.FunctionDeclarationCalleeDataExtractor=l},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(13)),s=r(42),c=r(4),d=r(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){var r;let o=null;return c.NodeGuards.isIdentifierNode(t)&&(o=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name)),c.NodeGuards.isFunctionExpressionNode(t)&&(o=t.body),o?{callee:o,name:null!==(r=t.name)&&void 0!==r?r:null}:null}getCalleeBlockStatement(e,t){let r=null;return a.traverse(e,{enter:(e,o)=>{if(c.NodeGuards.isFunctionExpressionNode(e)&&o&&c.NodeGuards.isVariableDeclaratorNode(o)&&c.NodeGuards.isIdentifierNode(o.id)&&o.id.name===t)return r=e.body,a.VisitorOption.Break}}),r}};l=o([i.injectable()],l),t.FunctionExpressionCalleeDataExtractor=l},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=i(r(13)),c=r(42),d=r(4),l=r(14);let u=o=class extends c.AbstractCalleeDataExtractor{static isValidTargetPropertyNode(e,t){if(!e.key)return!1;const r=d.NodeGuards.isIdentifierNode(e.key)&&e.key.name===t,o=d.NodeGuards.isLiteralNode(e.key)&&Boolean(e.key.value)&&e.key.value===t;return r||o}extract(e,t){if(!d.NodeGuards.isMemberExpressionNode(t))return null;const r=this.createObjectMembersCallsChain([],t);if(!r.length)return null;const o=r[r.length-1],n=this.getCalleeBlockStatement(l.NodeStatementUtils.getParentNodeWithStatements(e[0]),r);return n?{callee:n,name:o}:null}createObjectMembersCallsChain(e,t){if(d.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!d.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return d.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(d.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}getCalleeBlockStatement(e,t){const r=t.shift();if(!r)return null;let o=null;return s.traverse(e,{enter:e=>{if(d.NodeGuards.isVariableDeclaratorNode(e)&&d.NodeGuards.isIdentifierNode(e.id)&&e.init&&d.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===r)return o=this.findCalleeBlockStatement(e.init.properties,t),s.VisitorOption.Break}}),o}findCalleeBlockStatement(e,t){const r=t.shift();if(!r)return null;for(const n of e)if(o.isValidTargetPropertyNode(n,r)){if(d.NodeGuards.isObjectExpressionNode(n.value))return this.findCalleeBlockStatement(n.value.properties,t);if(d.NodeGuards.isFunctionExpressionNode(n.value))return n.value.body}return null}};u=o=n([a.injectable()],u),t.ObjectExpressionCalleeDataExtractor=u},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(34),p=r(4);let m=o=class{constructor(e){this.prevailingKindOfVariables=o.defaultKindOfVariables,this.arrayUtils=e}analyze(e){var t;const r=[];u.traverse(e,{enter:e=>{p.NodeGuards.isVariableDeclarationNode(e)&&r.push(e.kind)}}),this.prevailingKindOfVariables=null!==(t=this.arrayUtils.findMostOccurringElement(r))&&void 0!==t?t:o.defaultKindOfVariables}getPrevailingKind(){return this.prevailingKindOfVariables}};m.defaultKindOfVariables="var",m=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IArrayUtils)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IArrayUtils&&f.IArrayUtils)?n:Object])],m),t.PrevailingKindOfVariablesAnalyzer=m},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=i(r(80)),c=i(r(13)),d=r(43),l=r(4);let u=o=class{constructor(){this.scopeManager=null}static attachMissingRanges(e){c.replace(e,{enter:e=>(e.range||(e.range=[o.emptyRangeValue,o.emptyRangeValue]),e)})}static isRootNode(e){return l.NodeGuards.isProgramNode(e)||e.parentNode===e}analyze(e){const t=o.sourceTypes.length;o.attachMissingRanges(e);for(let r=0;r{if("class"===e.type&&e.upper){if(!e.variables.length)return;const t=e.variables[0],r=e.upper.variables.find(e=>t.defs.some(e=>"ClassName"===e.type)&&e.name===t.name);null==r||r.references.push(...e.variables[0].references)}});for(const t of e.childScopes)this.sanitizeScopes(t)}};u.eslintScopeOptions={ecmaVersion:d.ecmaVersion,optimistic:!0},u.sourceTypes=["script","module"],u.emptyRangeValue=0,u=o=n([a.injectable()],u),t.ScopeAnalyzer=u},function(e,t){e.exports=require("eslint-scope")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(13)),m=r(2),g=r(3),y=r(35),N=r(4),h=r(15),b=r(44);let I=o=class{constructor(e,t,r){this.stringArrayStorageData=new Map,this.stringArrayStorage=e,this.randomGenerator=t,this.options=r}analyze(e){this.options.stringArray&&p.traverse(e,{enter:(e,t)=>{if(t)return h.NodeMetadata.isIgnoredNode(e)?p.VisitorOption.Skip:void(N.NodeGuards.isLiteralNode(e)&&this.analyzeLiteralNode(e,t))}})}getItemDataForLiteralNode(e){return this.stringArrayStorageData.get(e)}analyzeLiteralNode(e,t){"string"==typeof e.value&&(b.NodeLiteralUtils.isProhibitedLiteralNode(e,t)||this.shouldAddValueToStringArray(e.value)&&this.stringArrayStorageData.set(e,this.stringArrayStorage.getOrThrow(e.value)))}shouldAddValueToStringArray(e){return e.length>=o.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}};I.minimumLengthForStringArray=3,I=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.IStringArrayStorage)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==y.IStringArrayStorage&&y.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==m.IOptions&&m.IOptions)?a:Object])],I),t.StringArrayStorageAnalyzer=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(53),s=r(21),c=r(83),d=r(84),l=r(87),u=r(88),f=r(90),p=r(93),m=r(94);t.controlFlowTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(l.CallExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(i.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(54);let N=o=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.BinaryExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}};N.usingExistingIdentifierChance=.5,N=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.BinaryExpressionControlFlowReplacer=N},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(17),y=r(34),N=r(2),h=r(3),b=r(18),I=r(11),v=r(12),S=r(4),O=r(6);let j=o=class extends v.AbstractNodeTransformer{constructor(e,t,r,o){super(r,o),this.controlFlowCustomNodeFactory=e,this.arrayUtils=t}static isProhibitedStatementNode(e){const t=S.NodeGuards.isBreakStatementNode(e)||S.NodeGuards.isContinueStatementNode(e),r=S.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),o=S.NodeGuards.isClassDeclarationNode(e);return S.NodeGuards.isFunctionDeclarationNode(e)||t||r||o}static canTransformBlockStatementNode(e){let t=!0;return m.traverse(e,{enter:e=>{if(S.NodeGuards.isWhileStatementNode(e))return m.VisitorOption.Skip;o.isProhibitedStatementNode(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}getVisitor(e){switch(e){case I.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&S.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!o.canTransformBlockStatementNode(e))return e;const r=e.body,n=this.arrayUtils.createWithRange(r.length),i=this.arrayUtils.shuffle(n),a=n.map(e=>i.indexOf(e)),s=this.controlFlowCustomNodeFactory(b.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);s.initialize(r,i,a);const c=s.getNode()[0];return O.NodeUtils.parentizeNode(c,t),c}};j=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IControlFlowCustomNode)),l(1,f.inject(p.ServiceIdentifiers.IArrayUtils)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TControlFlowCustomNodeFactory&&g.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==N.IOptions&&N.IOptions)?s:Object])],j),t.BlockStatementControlFlowTransformer=j},function(e,t){e.exports=require("acorn")},function(e,t){e.exports=require("acorn-import-meta")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(45),N=r(4);let h=o=class extends y.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){const n=e.callee;if(!N.NodeGuards.isIdentifierNode(n))return e;const i=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionFunctionNode),s=e.arguments;a.initialize(s);const c=this.insertCustomNodeToControlFlowStorage(a,r,i,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),c,n,s)}getControlFlowStorageCallNode(e,t,r,o){const n=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);n.initialize(e,t,r,o);const i=n.getNode()[0];if(!i||!N.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};h.usingExistingIdentifierChance=.5,h=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.CallExpressionControlFlowReplacer=h},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(89),y=r(2),N=r(3),h=r(57),b=r(58),I=r(21),v=r(33),S=r(11),O=r(12),j=r(8),_=r(4),C=r(14),R=r(6);let F=o=class extends O.AbstractNodeTransformer{constructor(e,t,r,o){super(r,o),this.deadCodeInjectionRootAstHostNodeSet=new Set,this.collectedBlockStatements=[],this.collectedBlockStatementsTotalLength=0,this.deadCodeInjectionCustomNodeFactory=e,this.transformersRunner=t}static isProhibitedNodeInsideCollectedBlockStatement(e){return _.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e)||_.NodeGuards.isAwaitExpressionNode(e)||_.NodeGuards.isSuperNode(e)}static isScopeHoistingFunctionDeclaration(e){if(!_.NodeGuards.isFunctionDeclarationNode(e))return!1;const t=C.NodeStatementUtils.getScopeOfNode(e),r=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,o=r.indexOf(e);if(0===o)return!1;const n=r.slice(0,o),i=j.NodeFactory.blockStatementNode(n),a=e.id.name;let s=!1;return m.traverse(i,{enter:e=>{if(_.NodeGuards.isIdentifierNode(e)&&e.name===a)return s=!0,m.VisitorOption.Break}}),s}static isValidCollectedBlockStatementNode(e){if(!e.body.length)return!1;let t=0,r=!0;return m.traverse(e,{enter:e=>{if(_.NodeGuards.isBlockStatementNode(e)&&t++,t>o.maxNestedBlockStatementsCount||o.isProhibitedNodeInsideCollectedBlockStatement(e)||o.isScopeHoistingFunctionDeclaration(e))return r=!1,m.VisitorOption.Break}}),r}static isValidWrappedBlockStatementNode(e){if(!e.body.length)return!1;let t=!0;if(m.traverse(e,{enter:e=>{if(o.isScopeHoistingFunctionDeclaration(e))return t=!1,m.VisitorOption.Break}}),!t)return!1;return C.NodeStatementUtils.getParentNodeWithStatements(e).type!==v.NodeType.Program}getVisitor(e){switch(e){case S.TransformationStage.DeadCodeInjection:return{enter:(e,t)=>{if(t&&_.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),e},leave:(e,t)=>{if(t&&_.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};case S.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:(e,t)=>{if(t&&this.isDeadCodeInjectionRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}analyzeNode(e,t){m.traverse(e,{enter:e=>{if(!_.NodeGuards.isBlockStatementNode(e))return;const t=R.NodeUtils.clone(e);if(!o.isValidCollectedBlockStatementNode(t))return;const r=this.makeClonedBlockStatementNodeUnique(t);this.collectedBlockStatements.push(r)}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}transformNode(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!o.isValidWrappedBlockStatementNode(e))return e;const r=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,r),i=this.collectedBlockStatements.splice(n,1)[0];return i===e?e:this.replaceBlockStatementNode(e,i,t)}restoreNode(e,t){const r=e.body[0];if(!_.NodeGuards.isFunctionDeclarationNode(r))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return r.body}isDeadCodeInjectionRootAstHostNode(e){return _.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}makeClonedBlockStatementNodeUnique(e){const t=j.NodeFactory.functionExpressionNode([],e);return R.NodeUtils.parentizeNode(t,t),R.NodeUtils.parentizeNode(e,t),this.transformersRunner.transform(t,o.transformersToRenameBlockScopeIdentifiers,S.TransformationStage.Obfuscating).body}replaceBlockStatementNode(e,t,r){const n=j.NodeFactory.blockStatementNode([j.NodeFactory.functionDeclarationNode(o.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);const i=this.deadCodeInjectionCustomNodeFactory(b.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);i.initialize(e,n);const a=i.getNode()[0];return R.NodeUtils.parentizeNode(a,r),a}};F.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",F.maxNestedBlockStatementsCount=4,F.minCollectedBlockStatementsCount=5,F.transformersToRenameBlockScopeIdentifiers=[I.NodeTransformer.LabeledStatementTransformer,I.NodeTransformer.ScopeIdentifiersTransformer],F=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),l(1,f.inject(p.ServiceIdentifiers.ITransformersRunner)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TDeadNodeInjectionCustomNodeFactory&&g.TDeadNodeInjectionCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==h.ITransformersRunner&&h.ITransformersRunner)?i:Object,"function"==typeof(a=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==y.IOptions&&y.IOptions)?s:Object])],F),t.DeadCodeInjectionTransformer=F},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=f(r(13)),y=r(17),N=r(91),h=r(92),b=r(2),I=r(3),v=r(18),S=r(53),O=r(33),j=r(11),_=r(12),C=r(19),R=r(4),F=r(15),T=r(14),x=r(6);let G=o=class extends _.AbstractNodeTransformer{constructor(e,t,r,o,n){super(o,n),this.controlFlowData=new Map,this.visitedFunctionNodes=new Set,this.hostNodesWithControlFlowNode=new Set,this.controlFlowStorageFactory=e,this.controlFlowReplacerFactory=t,this.controlFlowCustomNodeFactory=r}getVisitor(e){switch(e){case j.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.visitedFunctionNodes.add(e),!R.NodeGuards.isBlockStatementNode(e.body))return e;const r=this.getHostNode(e.body),o=this.getControlFlowStorage(r);if(this.controlFlowData.set(r,o),this.transformFunctionBody(e.body,o),!o.getLength())return e;const n=this.controlFlowCustomNodeFactory(v.ControlFlowCustomNode.ControlFlowStorageNode);return n.initialize(o),C.NodeAppender.prepend(r,n.getNode()),this.hostNodesWithControlFlowNode.add(r),x.NodeUtils.parentizeAst(e),e}getControlFlowStorage(e){const t=this.controlFlowStorageFactory();if(this.controlFlowData.has(e)){this.hostNodesWithControlFlowNode.has(e)&&(R.NodeGuards.isSwitchCaseNode(e)?e.consequent.shift():e.body.shift());const r=this.controlFlowData.get(e);t.mergeWith(r,!0)}return t}getHostNode(e){const t=T.NodeStatementUtils.getParentNodesWithStatements(e);return 1===t.length?e:(t.pop(),t.length>o.hostNodeSearchMinDepth&&t.splice(0,o.hostNodeSearchMinDepth),t.length>o.hostNodeSearchMaxDepth&&(t.length=o.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}isVisitedFunctionNode(e){return(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}transformFunctionBody(e,t){g.replace(e,{enter:(e,r)=>{if(F.NodeMetadata.isIgnoredNode(e))return g.VisitorOption.Skip;if(this.isVisitedFunctionNode(e)||!r)return g.VisitorOption.Skip;if(!o.controlFlowReplacersMap.has(e.type))return e;if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold)return e;const n=o.controlFlowReplacersMap.get(e.type);return void 0===n?e:Object.assign(Object.assign({},this.controlFlowReplacerFactory(n).replace(e,r,t)),{parentNode:r})}})}};G.controlFlowReplacersMap=new Map([[O.NodeType.BinaryExpression,S.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[O.NodeType.CallExpression,S.ControlFlowReplacer.CallExpressionControlFlowReplacer],[O.NodeType.LogicalExpression,S.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[O.NodeType.Literal,S.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),G.hostNodeSearchMinDepth=0,G.hostNodeSearchMaxDepth=2,G=o=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),u(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),u(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==h.TControlFlowStorageFactory&&h.TControlFlowStorageFactory)?n:Object,"function"==typeof(i=void 0!==N.TControlFlowReplacerFactory&&N.TControlFlowReplacerFactory)?i:Object,"function"==typeof(a=void 0!==y.TControlFlowCustomNodeFactory&&y.TControlFlowCustomNodeFactory)?a:Object,"function"==typeof(s=void 0!==I.IRandomGenerator&&I.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==b.IOptions&&b.IOptions)?c:Object])],G),t.FunctionControlFlowTransformer=G},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(54),N=r(4),h=r(6);let b=o=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){if(this.checkForProhibitedExpressions(e.left,e.right))return e;const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.LogicalExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}checkForProhibitedExpressions(e,t){return[e,t].some(e=>{let t;return t=N.NodeGuards.isUnaryExpressionNode(e)?h.NodeUtils.getUnaryExpressionArgumentNode(e):e,!(N.NodeGuards.isLiteralNode(t)||N.NodeGuards.isIdentifierNode(t)||N.NodeGuards.isObjectExpressionNode(t)||N.NodeGuards.isExpressionStatementNode(t))})}};b.usingExistingIdentifierChance=.5,b=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionControlFlowReplacer=b},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(45),N=r(4);let h=o=class extends y.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){if(N.NodeGuards.isPropertyNode(t)&&t.key===e)return e;if("string"!=typeof e.value||e.value.length<3)return e;const n=String(e.value),i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralNode);i.initialize(e.value);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a)}getControlFlowStorageCallNode(e,t){const r=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode);r.initialize(e,t);const o=r.getNode()[0];if(!o||!N.NodeGuards.isExpressionStatementNode(o))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return o.expression}};h.usingExistingIdentifierChance=1,h=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.StringLiteralControlFlowReplacer=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(16),i=r(1),a=r(21),s=r(59),c=r(96),d=r(98),l=r(99),u=r(100),f=r(102),p=r(103),m=r(104),g=r(105);t.convertingTransformersModule=new o.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.MemberExpressionTransformer).whenTargetNamed(a.NodeTransformer.MemberExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(l.MethodDefinitionTransformer).whenTargetNamed(a.NodeTransformer.MethodDefinitionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.ObjectExpressionKeysTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionKeysTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.ObjectExpressionTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.SplitStringTransformer).whenTargetNamed(a.NodeTransformer.SplitStringTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.TemplateLiteralTransformer).whenTargetNamed(a.NodeTransformer.TemplateLiteralTransformer),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(c.ObjectExpressionToVariableDeclarationExtractor).whenTargetNamed(s.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(g.BasePropertiesExtractor).whenTargetNamed(s.ObjectExpressionExtractor.BasePropertiesExtractor),e(i.ServiceIdentifiers.Factory__IObjectExpressionExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObjectExpressionExtractor))})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(97),l=r(60),u=r(19),f=r(4),p=r(14),m=r(6);let g=class{constructor(e){this.objectExpressionKeysTransformerCustomNodeFactory=e}extract(e,t){return this.transformObjectExpressionToVariableDeclaration(e,t)}transformObjectExpressionToVariableDeclaration(e,t){const r=e.properties,o=this.getObjectExpressionHostNode(r),n=this.getObjectExpressionIdentifierNode(o),i=this.getObjectExpressionNode(o),a=[o],s=p.NodeStatementUtils.getScopeOfNode(t);return u.NodeAppender.insertBefore(s,a,t),m.NodeUtils.parentizeAst(o),m.NodeUtils.parentizeNode(o,s),{nodeToReplace:n,objectExpressionHostStatement:o,objectExpressionNode:i}}getObjectExpressionHostNode(e){const t=this.objectExpressionKeysTransformerCustomNodeFactory(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode);t.initialize(e);const r=t.getNode()[0];if(!r||!f.NodeGuards.isVariableDeclarationNode(r))throw new Error("`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node");return r}getObjectExpressionIdentifierNode(e){const t=e.declarations[0].id;if(!f.NodeGuards.isIdentifierNode(t))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property");return t}getObjectExpressionNode(e){var t;const r=null!==(t=e.declarations[0].init)&&void 0!==t?t:null;if(!r||!f.NodeGuards.isObjectExpressionNode(r))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property");return r}};g=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)),i("design:paramtypes",["function"==typeof(o=void 0!==d.TObjectExpressionKeysTransformerCustomNodeFactory&&d.TObjectExpressionKeysTransformerCustomNodeFactory)?o:Object])],g),t.ObjectExpressionToVariableDeclarationExtractor=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(8),g=r(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isMemberExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(g.NodeGuards.isIdentifierNode(e.property)){if(e.computed)return e;e.computed=!0,e.property=m.NodeFactory.literalNode(e.property.name)}return e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MemberExpressionTransformer=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(11),m=r(12),g=r(8),y=r(4);let N=o=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&y.NodeGuards.isMethodDefinitionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return y.NodeGuards.isIdentifierNode(e.key)?this.replaceIdentifierKey(e,e.key):y.NodeGuards.isLiteralNode(e.key)?this.replaceLiteralKey(e,e.key):e}replaceIdentifierKey(e,t){return o.ignoredNames.includes(t.name)||e.computed||(e.computed=!0,e.key=g.NodeFactory.literalNode(t.name)),e}replaceLiteralKey(e,t){return"string"!=typeof t.value||o.ignoredNames.includes(t.value)||e.computed||(e.computed=!0),e}};N.ignoredNames=["constructor"],N=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.MethodDefinitionTransformer=N},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(13)),m=r(101),g=r(2),y=r(3),N=r(11),h=r(12),b=r(4),I=r(14),v=r(59);let S=o=class extends h.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.objectExpressionExtractorFactory=e}static isProhibitedHostStatement(e,t){return o.isReferencedIdentifierName(e,t)}static isReferencedIdentifierName(e,t){const r=[];let o=!1,n=!1;return p.traverse(t,{enter:t=>{t===e&&(n=!0),b.NodeGuards.isIdentifierNode(t)&&(n?r.includes(t.name)&&(o=!0):r.push(t.name))},leave:t=>{if(t===e)return n=!1,p.VisitorOption.Break}}),o}getVisitor(e){if(!this.options.transformObjectKeys)return null;switch(e){case N.TransformationStage.Converting:return{leave:(e,t)=>{if(t&&b.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(!e.properties.length)return e;const r=I.NodeStatementUtils.getRootStatementOfNode(e);return o.isProhibitedHostStatement(e,r)?e:this.applyObjectExpressionKeysExtractorsRecursive(o.objectExpressionExtractorNames,e,r)}applyObjectExpressionKeysExtractorsRecursive(e,t,r){const o=[...e],n=o.shift();if(!n)return t;const{nodeToReplace:i,objectExpressionHostStatement:a,objectExpressionNode:s}=this.objectExpressionExtractorFactory(n).extract(t,r);return this.applyObjectExpressionKeysExtractorsRecursive(o,s,a),i}};S.objectExpressionExtractorNames=[v.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor,v.ObjectExpressionExtractor.BasePropertiesExtractor],S=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.Factory__IObjectExpressionExtractor)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==m.TObjectExpressionExtractorFactory&&m.TObjectExpressionExtractorFactory)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],S),t.ObjectExpressionKeysTransformer=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(8),g=r(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return e.properties.forEach(e=>{e.key&&(e.computed?this.transformComputedProperty(e):this.transformBaseProperty(e))}),e}transformComputedProperty(e){g.NodeGuards.isLiteralNode(e.key)&&"string"==typeof e.key.value&&(e.key=m.NodeFactory.literalNode(e.key.value))}transformBaseProperty(e){e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=m.NodeFactory.literalNode(e.key.name))}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.ObjectExpressionTransformer=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(2),m=r(3),g=r(21),y=r(11),N=r(12),h=r(8),b=r(4),I=r(44),v=r(6);let S=o=class extends N.AbstractNodeTransformer{constructor(e,t){super(e,t),this.runAfter=[g.NodeTransformer.ObjectExpressionKeysTransformer,g.NodeTransformer.TemplateLiteralTransformer]}static chunkString(e,t){const r=Math.ceil(e.length/t),o=[];let n=0;for(let i=0;i{if(this.options.splitStrings)return t&&b.NodeGuards.isLiteralNode(e)?this.transformNode(e,t):void 0}};default:return null}}transformNode(e,t){if(I.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;const r=this.transformLiteralNodeByChunkLength(e,t,o.firstPassChunkLength);return f.replace(r,{enter:(e,t)=>{if(t&&b.NodeGuards.isLiteralNode(e))return this.transformLiteralNodeByChunkLength(e,t,this.options.splitStringsChunkLength)}})}transformLiteralNodeByChunkLength(e,t,r){if("string"!=typeof e.value)return e;if(r>=e.value.length)return e;const n=o.chunkString(e.value,r),i=this.transformStringChunksToBinaryExpressionNode(n);return v.NodeUtils.parentizeAst(i),v.NodeUtils.parentizeNode(i,t),i}transformStringChunksToBinaryExpressionNode(e){const t=e.shift(),r=e.shift();if(!t||!r)throw new Error("First and second chunks values should not be empty");const o=h.NodeFactory.binaryExpressionNode("+",h.NodeFactory.literalNode(t),h.NodeFactory.literalNode(r));return e.reduce((e,t)=>{const r=h.NodeFactory.literalNode(t);return h.NodeFactory.binaryExpressionNode("+",e,r)},o)}};S.firstPassChunkLength=1e3,S=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],S),t.SplitStringTransformer=S},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(11),m=r(12),g=r(8),y=r(4),N=r(6);let h=o=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}static isLiteralNodeWithStringValue(e){return!!e&&y.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}static isValidTemplateLiteralNode(e,t){return y.NodeGuards.isTemplateLiteralNode(e)&&!y.NodeGuards.isTaggedTemplateExpressionNode(t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&o.isValidTemplateLiteralNode(e,t))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const r=e.expressions;let n,i=[];if(e.quasis.forEach(e=>{i.push(g.NodeFactory.literalNode(e.value.cooked));const t=r.shift();t&&i.push(t)}),i=i.filter(e=>!(y.NodeGuards.isLiteralNode(e)&&""===e.value)),o.isLiteralNodeWithStringValue(i[0])||o.isLiteralNodeWithStringValue(i[1])||i.unshift(g.NodeFactory.literalNode("")),i.length>1){let e=g.NodeFactory.binaryExpressionNode("+",i.shift(),i.shift());i.forEach(t=>{e=g.NodeFactory.binaryExpressionNode("+",e,t)}),n=e}else n=i[0];return N.NodeUtils.parentizeAst(n),N.NodeUtils.parentizeNode(n,t),n}};h=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.TemplateLiteralTransformer=h},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(19),s=r(8),c=r(4),d=r(14);let l=o=class{static getPropertyNodeKeyName(e){const t=e.key;return!c.NodeGuards.isLiteralNode(t)||"string"!=typeof t.value&&"number"!=typeof t.value?c.NodeGuards.isIdentifierNode(t)?t.name:null:t.value.toString()}static isProhibitedPattern(e){return!e||c.NodeGuards.isObjectPatternNode(e)||c.NodeGuards.isArrayPatternNode(e)||c.NodeGuards.isAssignmentPatternNode(e)||c.NodeGuards.isRestElementNode(e)}extract(e,t){const r=e.parentNode;return r&&c.NodeGuards.isVariableDeclaratorNode(r)&&c.NodeGuards.isIdentifierNode(r.id)?this.transformObjectExpressionNode(e,t,r.id):{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}transformObjectExpressionNode(e,t,r){const o=e.properties,[n,i]=this.extractPropertiesToExpressionStatements(o,t,r),s=d.NodeStatementUtils.getScopeOfNode(t);return this.filterExtractedObjectExpressionProperties(e,i),a.NodeAppender.insertAfter(s,n,t),{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}extractPropertiesToExpressionStatements(e,t,r){const n=e.length,i=[],a=[];for(let d=0;d!t.includes(r))}};l=o=n([i.injectable()],l),t.BasePropertiesExtractor=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(18),s=r(23),c=r(61),d=r(58),l=r(60),u=r(107),f=r(108),p=r(109),m=r(110),g=r(111),y=r(112),N=r(115),h=r(116),b=r(117),I=r(118),v=r(119),S=r(120),O=r(122),j=r(124),_=r(126),C=r(128),R=r(130),F=r(134),T=r(136),x=r(137),G=r(138),E=r(140),w=r(142),P=r(149),A=r(151),M=r(154),D=r(155);t.customNodesModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICustomNode).to(O.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(i.ServiceIdentifiers.ICustomNode).to(_.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(i.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(i.ServiceIdentifiers.ICustomNode).to(R.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(F.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(i.ServiceIdentifiers.ICustomNode).to(G.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(E.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(i.ServiceIdentifiers.ICustomNode).to(w.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(i.ServiceIdentifiers.ICustomNode).to(P.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(i.ServiceIdentifiers.ICustomNode).to(A.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BinaryExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.BlockStatementControlFlowFlatteningNode).whenTargetNamed(a.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(I.CallExpressionControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(S.ControlFlowStorageNode).whenTargetNamed(a.ControlFlowCustomNode.ControlFlowStorageNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(T.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(x.LogicalExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(D.StringLiteralNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(M.StringLiteralControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(b.BlockStatementDeadCodeInjectionNode).whenTargetNamed(d.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.ObjectExpressionVariableDeclarationHostNode).whenTargetNamed(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode),e(i.ServiceIdentifiers.ICustomNodeGroup).to(u.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(f.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(p.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(m.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(g.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(i.ServiceIdentifiers.Factory__ICustomNode).toFactory(o.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNode)),e(i.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions)),e(i.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(o.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNodeGroup)),e(i.ServiceIdentifiers.ICustomNodeFormatter).to(j.CustomNodeFormatter).inSingletonScope()})},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19);let S=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.ConsoleOutputDisableExpressionNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.disableConsoleOutput)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(h.CustomNode.ConsoleOutputDisableExpressionNode),r=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(h.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,r)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.ConsoleOutputCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19),S=r(4);let O=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.DebugProtectionFunctionCallNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.DebugProtectionFunctionNode,t=>{v.NodeAppender.append(e,t.getNode())}),this.appendCustomNodeIfExist(h.CustomNode.DebugProtectionFunctionIntervalNode,t=>{const r=S.NodeGuards.isSwitchCaseNode(e)?e.consequent.length:e.body.length,o=this.randomGenerator.getRandomInteger(0,r);v.NodeAppender.insertAtIndex(e,t.getNode(),o)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.debugProtection)return;const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r=this.customNodeFactory(h.CustomNode.DebugProtectionFunctionNode),o=this.customNodeFactory(h.CustomNode.DebugProtectionFunctionCallNode),n=this.customNodeFactory(h.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);r.initialize(e),o.initialize(e,t),n.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(h.CustomNode.DebugProtectionFunctionNode,r),this.customNodes.set(h.CustomNode.DebugProtectionFunctionCallNode,o),this.options.debugProtectionInterval&&this.customNodes.set(h.CustomNode.DebugProtectionFunctionIntervalNode,n),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,i)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],O.prototype,"customNodes",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.DebugProtectionCustomNodeGroup=O},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19);let S=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.DomainLockNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.domainLock.length)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(h.CustomNode.DomainLockNode),r=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(h.CustomNode.DomainLockNode,t),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,r)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.DomainLockCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19);let S=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.SelfDefendingUnicodeNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.selfDefending)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(h.CustomNode.SelfDefendingUnicodeNode),r=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(h.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,r)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.SelfDefendingCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=r(26),g=r(5),y=r(2),N=r(3),h=r(35),b=r(7),I=r(23),v=r(22),S=r(27),O=r(19);let j=class extends S.AbstractCustomNodeGroup{constructor(e,t,r,o,n){super(r,o,n),this.appendEvent=v.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e,this.stringArrayStorage=t}appendCustomNodes(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(I.CustomNode.StringArrayNode,t=>{O.NodeAppender.prepend(e,t.getNode())}),this.appendCustomNodeIfExist(I.CustomNode.StringArrayCallsWrapper,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(I.CustomNode.StringArrayRotateFunctionNode,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}))}initialize(){if(this.customNodes=new Map,!this.options.stringArray)return;const e=this.customNodeFactory(I.CustomNode.StringArrayNode),t=this.customNodeFactory(I.CustomNode.StringArrayCallsWrapper),r=this.customNodeFactory(I.CustomNode.StringArrayRotateFunctionNode),o=this.stringArrayStorage.getStorageName(),n=this.stringArrayStorage.getStorageCallsWrapperName(),i=this.stringArrayStorage.getRotationAmount();e.initialize(this.stringArrayStorage,o),t.initialize(o,n),r.initialize(o,i),this.customNodes.set(I.CustomNode.StringArrayNode,e),this.customNodes.set(I.CustomNode.StringArrayCallsWrapper,t),this.options.rotateStringArray&&this.customNodes.set(I.CustomNode.StringArrayRotateFunctionNode,r)}};d([b.initializable(),l("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],j.prototype,"customNodes",void 0),j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.Factory__ICustomNode)),u(1,f.inject(p.ServiceIdentifiers.IStringArrayStorage)),u(2,f.inject(p.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u(3,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(4,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==m.TCustomNodeFactory&&m.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==h.IStringArrayStorage&&h.IStringArrayStorage)?i:Object,"function"==typeof(a=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?a:Object,"function"==typeof(s=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.StringArrayCustomNodeGroup=j},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8);let h=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.properties=e}getNodeStructure(e){return[N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()),N.NodeFactory.objectExpressionNode(this.properties))],"const")]}};h=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.ObjectExpressionVariableDeclarationHostNode=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n let that;\n \n try {\n const getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n const getGlobal = function () {\n let globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n const that = getGlobal();\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8),h=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.operator=e}getNodeStructure(e){const t=N.NodeFactory.expressionStatementNode(N.NodeFactory.functionExpressionNode([N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")],N.NodeFactory.blockStatementNode([N.NodeFactory.returnStatementNode(N.NodeFactory.binaryExpressionNode(this.operator,N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")))])));return h.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BinaryExpressionFunctionNode=b},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(4),I=r(6);let v=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=r}getNodeStructure(e){const t=this.randomGenerator.getRandomString(6),r=this.randomGenerator.getRandomString(6),o=h.NodeFactory.blockStatementNode([h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(t),h.NodeFactory.callExpressionNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join("|")),h.NodeFactory.identifierNode("split")),[h.NodeFactory.literalNode("|")]))],"const"),h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(r),h.NodeFactory.literalNode(0))],"let"),h.NodeFactory.whileStatementNode(h.NodeFactory.literalNode(!0),h.NodeFactory.blockStatementNode([h.NodeFactory.switchStatementNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.identifierNode(t),h.NodeFactory.updateExpressionNode("++",h.NodeFactory.identifierNode(r)),!0),this.shuffledKeys.map((e,t)=>{const r=this.blockStatementBody[e],o=[r];return b.NodeGuards.isReturnStatementNode(r)||o.push(h.NodeFactory.continueStatement()),h.NodeFactory.switchCaseNode(h.NodeFactory.literalNode(String(t)),o)})),h.NodeFactory.breakStatement()]))]);return I.NodeUtils.parentizeAst(o),[o]}};s([y.initializable(),c("design:type",Array)],v.prototype,"blockStatementBody",void 0),s([y.initializable(),c("design:type",Array)],v.prototype,"originalKeysIndexesInShuffledArray",void 0),s([y.initializable(),c("design:type",Array)],v.prototype,"shuffledKeys",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.BlockStatementControlFlowFlatteningNode=v},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8),h=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.blockStatementNode=e,this.deadCodeInjectionRootAstHostNode=t}getNodeStructure(e){const t=this.randomGenerator.getMathRandom()>.5,r=this.randomGenerator.getMathRandom()>.5,o=t?"===":"!==",n=this.randomGenerator.getRandomString(5),i=r?n:this.randomGenerator.getRandomString(5),[a,s]=t===r?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],c=N.NodeFactory.blockStatementNode([N.NodeFactory.ifStatementNode(N.NodeFactory.binaryExpressionNode(o,N.NodeFactory.literalNode(n),N.NodeFactory.literalNode(i)),a,s)]);return h.NodeUtils.parentizeAst(c),[c]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BlockStatementDeadCodeInjectionNode=b},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),N=r(7),h=r(10),b=r(8),I=r(6);let v=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r,o){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.callee=r,this.expressionArguments=o}getNodeStructure(){const e=b.NodeFactory.expressionStatementNode(b.NodeFactory.callExpressionNode(b.NodeFactory.memberExpressionNode(b.NodeFactory.identifierNode(this.controlFlowStorageName),b.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.callee,...this.expressionArguments]));return I.NodeUtils.parentizeAst(e),[e]}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof ESTree&&ESTree.Expression)?o:Object)],v.prototype,"callee",void 0),c([N.initializable(),d("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),c([N.initializable(),d("design:type",String)],v.prototype,"controlFlowStorageName",void 0),c([N.initializable(),d("design:type",Array)],v.prototype,"expressionArguments",void 0),v=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],v),t.CallExpressionControlFlowStorageCallNode=v},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.expressionArguments=e}getNodeStructure(e){const t=h.NodeFactory.identifierNode("callee"),r=[],o=this.expressionArguments.length;for(let e=0;e=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(121),m=r(5),g=r(2),y=r(3),N=r(9),h=r(7),b=r(10),I=r(8),v=r(4),S=r(6);let O=class extends b.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.controlFlowStorage=e}getNodeStructure(e){const t=Array.from(this.controlFlowStorage.getStorage()).map(([e,t])=>{const r=t.getNode()[0];if(!v.NodeGuards.isExpressionStatementNode(r))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return I.NodeFactory.propertyNode(I.NodeFactory.identifierNode(e),r.expression)});let r=I.NodeFactory.variableDeclarationNode([I.NodeFactory.variableDeclaratorNode(I.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()),I.NodeFactory.objectExpressionNode(t))],"const");return r=S.NodeUtils.parentizeAst(r),[r]}};c([h.initializable(),d("design:type","function"==typeof(o=void 0!==p.TControlFlowStorage&&p.TControlFlowStorage)?o:Object)],O.prototype,"controlFlowStorage",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.ControlFlowStorageNode=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(20),N=r(123),h=r(47),b=r(7),I=r(10),v=r(6);let S=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return v.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():h.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(N.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([b.initializable(),c("design:type",String)],S.prototype,"callsControllerFunctionName",void 0),S=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],S),t.ConsoleOutputDisableExpressionNode=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n const c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.table = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.table = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=s(r(13)),f=c(r(125)),p=r(62),m=r(4);let g=class{constructor(e){this.prevailingKindOfVariables=e.getPrevailingKind()}formatTemplate(e,t){return f.default(e,t)}formatStructure(e){for(const t of e)u.replace(t,{enter:e=>{if(m.NodeGuards.isVariableDeclarationNode(e))return"var"===this.prevailingKindOfVariables&&(e.kind="var"),e}});return e}};g=n([d.injectable(),a(0,d.inject(l.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),i("design:paramtypes",["function"==typeof(o=void 0!==p.IPrevailingKindOfVariablesAnalyzer&&p.IPrevailingKindOfVariablesAnalyzer)?o:Object])],g),t.CustomNodeFormatter=g},function(e,t){e.exports=require("string-template")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(127),h=r(10),b=r(6);let I=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(N.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([y.initializable(),c("design:type",String)],I.prototype,"callsControllerFunctionName",void 0),s([y.initializable(),c("design:type",String)],I.prototype,"debugProtectionFunctionName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.DebugProtectionFunctionCallNode=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(\n this,\n function () {\n const regExp1 = new RegExp('function *\\\\( *\\\\)');\n const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');\n \n const result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n }\n )();\n })();\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(129),h=r(10),b=r(6);let I=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(N.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([y.initializable(),c("design:type",String)],I.prototype,"debugProtectionFunctionName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.DebugProtectionFunctionIntervalNode=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(20),N=r(7),h=r(131),b=r(132),I=r(133),v=r(10),S=r(6);let O=class extends v.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?h.DebuggerTemplate():b.DebuggerTemplateNoEval();return this.customNodeFormatter.formatTemplate(I.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([N.initializable(),c("design:type",String)],O.prototype,"debugProtectionFunctionName",void 0),O=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],O),t.DebugProtectionFunctionNode=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n const func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(48),g=r(2),y=r(3),N=r(9),h=r(20),b=r(7),I=r(135),v=r(47),S=r(10),O=r(6);let j=class extends S.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.cryptUtils=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.domainLock.join(";"),[t,r]=this.cryptUtils.hideString(e,3*e.length),o=this.options.target!==h.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():v.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(I.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:r,domains:t,globalVariableTemplate:o,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([b.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.ICryptUtils)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.ICryptUtils&&m.ICryptUtils)?s:Object])],j),t.DomainLockNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n const func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (let i = 0; i < 1000; i--) {\n const isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n const regExp = new RegExp("[{diff}]", "g");\n const domains = "{domains}".replace(regExp, "").split(";");\n let document;\n let domain;\n let location;\n let hostname;\n\n for (let d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (let d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n\n if (!("~" > domain)) {\n for (let d2 in that[document]) {\n if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) {\n location = d2;\n \n break;\n }\n }\n\n for (let d3 in that[document][location]) {\n if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) {\n hostname = d3;\n \n break;\n }\n }\n }\n \n if (!document || !that[document]) {\n return;\n }\n \n const documentDomain = that[document][domain];\n const documentLocationHostName = !!that[document][location] && that[document][location][hostname];\n const currentDomain = documentDomain || documentLocationHostName;\n \n if (!currentDomain) {\n return;\n }\n \n let ok = false;\n \n for (let i = 0; i < domains.length; i++) {\n const domain = domains[i];\n const position = currentDomain.length - domain.length;\n const lastIndex = currentDomain.indexOf(domain, position);\n const endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r,o){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=r,this.rightValue=o}getNodeStructure(){const e=h.NodeFactory.expressionStatementNode(h.NodeFactory.callExpressionNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.identifierNode(this.controlFlowStorageName),h.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.ExpressionWithOperatorControlFlowStorageCallNode=I},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8),h=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.operator=e}getNodeStructure(e){const t=N.NodeFactory.expressionStatementNode(N.NodeFactory.functionExpressionNode([N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")],N.NodeFactory.blockStatementNode([N.NodeFactory.returnStatementNode(N.NodeFactory.logicalExpressionNode(this.operator,N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")))])));return h.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionFunctionNode=b},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(22),N=r(7),h=r(139),b=r(36),I=r(10),v=r(25),S=r(6),O=r(9);let j=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.appendEvent===y.ObfuscationEvent.AfterObfuscation?v.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(h.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed})).getObfuscatedCode():this.customNodeFormatter.formatTemplate(h.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([N.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),c([N.initializable(),d("design:type","function"==typeof(o=void 0!==y.ObfuscationEvent&&y.ObfuscationEvent)?o:Object)],j.prototype,"appendEvent",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==O.ICustomNodeFormatter&&O.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],j),t.NodeCallsControllerFunctionNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n const {singleNodeCallControllerFunctionName} = (function(){\n let firstCall = true;\n \n return function (context, fn){\n const rfn = firstCall ? function(){\n if(fn){\n const res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),N=r(9),h=r(7),b=r(36),I=r(141),v=r(10),S=r(25),O=r(6);let j=class extends v.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return S.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(I.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}};c([h.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],j),t.SelfDefendingUnicodeNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return !regExp.test(func1.toString());\n };\n \n const test2 = function () {\n const regExp = new RegExp('${e.encode("(\\\\[x|u](\\w){2,4})+",!0)}');\n \n return regExp.test(func2.toString());\n };\n \n const recursiveFunc1 = function (string) {\n const i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n const recursiveFunc2 = function (string) {\n const i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+"")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n `}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),N=r(9),h=r(20),b=r(24),I=r(7),v=r(36),S=r(143),O=r(47),j=r(144),_=r(145),C=r(146),R=r(147),F=r(148),T=r(10),x=r(25),G=r(6);let E=class extends T.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}getNodeStructure(e){return G.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.getDecodeStringArrayTemplate();return x.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(R.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),Object.assign(Object.assign({},v.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}getDecodeStringArrayTemplate(){const e=this.options.target!==h.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():O.GlobalVariableNoEvalTemplate(),t=this.customNodeFormatter.formatTemplate(S.AtobTemplate(),{globalVariableTemplate:e});let r="",o="";switch(this.options.selfDefending&&(o=this.customNodeFormatter.formatTemplate(_.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case b.StringArrayEncoding.Rc4:r=this.customNodeFormatter.formatTemplate(F.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:j.Rc4Template(),selfDefendingCode:o,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case b.StringArrayEncoding.Base64:r=this.customNodeFormatter.formatTemplate(C.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:o,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return r}};c([I.initializable(),d("design:type",String)],E.prototype,"stringArrayName",void 0),c([I.initializable(),d("design:type",String)],E.prototype,"stringArrayCallsWrapperName",void 0),E=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],E),t.StringArrayCallsWrapper=E},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n const str = String(input).replace(/=+$/, '');\n let output = '';\n for (\n let bc = 0, bs, buffer, idx = 0;\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n }\n );\n })();\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n const rc4 = function (str, key) {\n let s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (let k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n let i;\n \t \n\t for (i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (let y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){const r=e.getRandomString(6),o=e.getRandomString(6),n=e.getRandomString(6),i=e.getRandomString(6),a=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),d=e.getRandomString(6),l=e.getRandomString(6);return`\n const StatesClass = function (${r}) {\n this.${r} = ${r};\n this.${o} = [1, 0, 0];\n this.${n} = function(){return 'newState';};\n this.${i} = '${t.encode("\\w+ *\\(\\) *{\\w+ *",!0)}';\n this.${a} = '${t.encode("['|\"].+['|\"];? *}",!0)}';\n };\n \n StatesClass.prototype.${s} = function () {\n const regExp = new RegExp(this.${i} + this.${a});\n const expression = regExp.test(this.${n}.toString())\n ? --this.${o}[1]\n : --this.${o}[0];\n \n return this.${c}(expression);\n };\n \n StatesClass.prototype.${c} = function (${l}) {\n if (!Boolean(~${l})) {\n return ${l};\n }\n \n return this.${d}(this.${r});\n };\n\n StatesClass.prototype.${d} = function (${r}) {\n for (let i = 0, len = this.${o}.length; i < len; i++) {\n this.${o}.push(Math.round(Math.random()));\n len = this.${o}.length;\n }\n \n return ${r}(this.${o}[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).${s}();\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){const t=e.getRandomString(6),r=e.getRandomString(6),o=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.${r} = function (str) {\n const string = atob(str);\n let newStringChars = [];\n \n for (let i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.${o} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${o}[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.${r}(value);\n {stringArrayCallsWrapperName}.${o}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n const {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n let value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){const t=e.getRandomString(6),r=e.getRandomString(6),o=e.getRandomString(6),n=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.${r} = rc4;\n \n {stringArrayCallsWrapperName}.${o} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${o}[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.${n} === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.${n} = true;\n }\n \n value = {stringArrayCallsWrapperName}.${r}(value, key);\n {stringArrayCallsWrapperName}.${o}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),N=r(35),h=r(7),b=r(150),I=r(10),v=r(6);let S=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.stringArrayStorage=e,this.stringArrayName=t}getNodeStructure(e){return v.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(b.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}};c([h.initializable(),d("design:type","function"==typeof(o=void 0!==N.IStringArrayStorage&&N.IStringArrayStorage)?o:Object)],S.prototype,"stringArrayStorage",void 0),c([h.initializable(),d("design:type",String)],S.prototype,"stringArrayName",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],S),t.StringArrayNode=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n const {stringArrayName} = [{stringArray}];\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),N=r(9),h=r(7),b=r(36),I=r(152),v=r(153),S=r(10),O=r(25),j=r(6),_=r(37);let C=class extends S.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayRotationAmount=t}getNodeStructure(e){return j.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate();let r="";return r=this.options.selfDefending?this.customNodeFormatter.formatTemplate(I.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):`${t}(++${e})`,O.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(v.StringArrayRotateFunctionTemplate(),{code:r,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotationAmount:_.NumberUtils.toHex(this.stringArrayRotationAmount),whileFunctionName:t}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}};c([h.initializable(),d("design:type",String)],C.prototype,"stringArrayName",void 0),c([h.initializable(),d("design:type",Number)],C.prototype,"stringArrayRotationAmount",void 0),C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.StringArrayRotateFunctionNode=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const selfDefendingFunc = function () {\n const object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n let updatedCookie = name + "=" + value;\n let i = 0;\n \n for (let i = 0, len = options.length; i < len; i++) {\n const propName = options[i];\n \n updatedCookie += "; " + propName;\n \n const propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += "=" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n const matches = document(new RegExp(\n "(?:^|; )" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + "=([^;]*)"\n ));\n \n const func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n let cookie = '';\n const result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n const {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotationAmount});\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}getNodeStructure(){const e=h.NodeFactory.expressionStatementNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.identifierNode(this.controlFlowStorageName),h.NodeFactory.identifierNode(this.controlFlowStorageKey)));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.StringLiteralControlFlowStorageCallNode=I},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8);let b=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.literalValue=e}getNodeStructure(e){return[h.NodeFactory.expressionStatementNode(h.NodeFactory.literalNode(this.literalValue))]}};s([y.initializable(),c("design:type",String)],b.prototype,"literalValue",void 0),b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.StringLiteralNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0);t.finalizingTransformersModule=new o.ContainerModule(e=>{})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(31),a=r(158),s=r(159),c=r(160);t.generatorsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(a.DictionaryIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(c.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(n.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(){let e=null;return t=>r=>{if(e)return e;let o;switch(r.identifierNamesGenerator){case i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return e=o,o}}())})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(34),p=r(2),m=r(3),g=r(49);let y=o=class extends g.AbstractIdentifierNamesGenerator{constructor(e,t,r){super(e,t),this.arrayUtils=r,this.identifierNamesSet=new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)),this.identifiersIterator=this.identifierNamesSet.values()}static incrementIdentifierName(e){let t="",r=!1;for(const o of e)r||o!==o.toUpperCase()?r||o!==o.toLowerCase()?t+=o:(t+=o.toUpperCase(),r=!0):t+=o.toLowerCase();return r?t:null}generate(){if(!this.identifierNamesSet.size)throw new Error("Too many identifiers in the code, add more words to identifiers dictionary");const e=this.identifiersIterator.next();return e.done?(this.identifierNamesSet=new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])),this.identifiersIterator=this.identifierNamesSet.values(),this.generate()):e.value}generateWithPrefix(){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate()}`.replace("__","_")}getInitialIdentifierNames(e){const t=e.filter(Boolean).map(e=>e.toLowerCase());return this.arrayUtils.shuffle(t)}getIncrementedIdentifierNames(e){const t=[];for(const r of e){const e=o.incrementIdentifierName(r);e&&t.push(e)}return this.arrayUtils.shuffle(t)}};y=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(1,l.inject(u.ServiceIdentifiers.IOptions)),d(2,l.inject(u.ServiceIdentifiers.IArrayUtils)),c("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object,"function"==typeof(a=void 0!==f.IArrayUtils&&f.IArrayUtils)?a:Object])],y),t.DictionaryIdentifierNamesGenerator=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(49),m=r(37),g=r(30);let y=o=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.randomVariableNameSet=new Set}generate(e){const t=this.randomGenerator.getRandomInteger(1e4,99999999),r=m.NumberUtils.toHex(t),n=g.Utils.hexadecimalPrefix.length+1,i=e?e-n:o.baseIdentifierNameLength,a=r.substr(0,i),s=`_${g.Utils.hexadecimalPrefix}${a}`;return this.randomVariableNameSet.has(s)?this.generate(e):(this.randomVariableNameSet.add(s),s)}generateWithPrefix(e){const t=this.generate(e);return`${this.options.identifiersPrefix}${t}`.replace("__","_")}};y.baseIdentifierNameLength=6,y=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],y),t.HexadecimalIdentifierNamesGenerator=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(49);let m=o=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.previousMangledName=o.initMangledNameCharacter}generate(e){const t=this.generateNewMangledName(this.previousMangledName);return this.previousMangledName=t,t}generateWithPrefix(e){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate(e)}`}isValidIdentifierName(e){return super.isValidIdentifierName(e)&&!o.reservedNamesSet.has(e)}generateNewMangledName(e){let t=(e=>{const t=o.nameSequence,r=t.length,n=e.length,i=e=>"0".repeat(e);let a=n-1;do{const o=e[a],s=t.indexOf(o);if(s!==r-1){return e.substring(0,a)+t[s+1]+i(n-(a+1))}--a}while(a>=0);return`a${i(n)}`})(e);return this.isValidIdentifierName(t)||(t=this.generateNewMangledName(t)),t}};m.initMangledNameCharacter="9",m.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),m.reservedNamesSet=new Set(["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"]),m=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MangledIdentifierNamesGenerator=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1);t.nodeTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.Factory__INodeTransformer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeTransformer))})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(38),s=r(63),c=r(21),d=r(163),l=r(164),u=r(165),f=r(167),p=r(169),m=r(170),g=r(171);t.obfuscatingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(u.LabeledStatementTransformer).whenTargetNamed(c.NodeTransformer.LabeledStatementTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.LiteralTransformer).whenTargetNamed(c.NodeTransformer.LiteralTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ScopeIdentifiersTransformer).whenTargetNamed(c.NodeTransformer.ScopeIdentifiersTransformer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(l.BooleanLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(p.NumberLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(m.StringLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(d.BaseIdentifierObfuscatingReplacer).whenTargetNamed(a.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),e(i.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObfuscatingReplacer)),e(i.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer))})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(5),u=r(2),f=r(39),p=r(8);let m=class extends f.AbstractObfuscatingReplacer{constructor(e,t){super(t),this.blockScopesMap=new Map,this.identifierNamesGenerator=e(t)}replace(e,t){let r=e.name;if(this.blockScopesMap.has(t)){const e=this.blockScopesMap.get(t);e.has(r)&&(r=e.get(r))}return p.NodeFactory.identifierNode(r)}storeGlobalName(e,t){const r=e.name;if(this.isReservedName(r))return;const o=this.identifierNamesGenerator.generateWithPrefix();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(r,o)}storeLocalName(e,t){const r=e.name;if(this.isReservedName(r))return;const o=this.identifierNamesGenerator.generate();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(r,o)}preserveName(e){this.identifierNamesGenerator.preserveName(e)}isReservedName(e){return!!this.options.reservedNames.length&&this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==l.TIdentifierNamesGeneratorFactory&&l.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==u.IOptions&&u.IOptions)?n:Object])],m),t.BaseIdentifierObfuscatingReplacer=m},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(39),f=r(8);let p=o=class extends u.AbstractObfuscatingReplacer{constructor(e){super(e)}static getTrueUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",o.getFalseUnaryExpressionNode())}static getFalseUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",f.NodeFactory.arrayExpressionNode())}replace(e){const t=e.value;if("boolean"!=typeof t)throw new Error("`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value");return t?o.getTrueUnaryExpressionNode():o.getFalseUnaryExpressionNode()}};p=o=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.BooleanLiteralObfuscatingReplacer=p},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(50),m=r(2),g=r(3),y=r(38),N=r(11),h=r(12),b=r(4),I=r(166);let v=class extends h.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.identifierObfuscatingReplacer=e(y.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case N.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&b.NodeGuards.isLabeledStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const r=I.NodeLexicalScopeUtils.getLexicalScope(e);return r?(this.storeLabeledStatementName(e,r),this.replaceLabeledStatementName(e,r),e):e}storeLabeledStatementName(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label,t)}replaceLabeledStatementName(e,t){f.replace(e,{enter:(e,r)=>{if(r&&b.NodeGuards.isLabelIdentifierNode(e,r)){const r=this.identifierObfuscatingReplacer.replace(e,t);e.name=r.name}}})}};v=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(2,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierObfuscatingReplacerFactory&&p.TIdentifierObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==m.IOptions&&m.IOptions)?i:Object])],v),t.LabeledStatementTransformer=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static getLexicalScope(e){return n.getLexicalScopesRecursive(e,1)[0]}static getLexicalScopes(e){return n.getLexicalScopesRecursive(e)}static getLexicalScopesRecursive(e,t=1/0,r=[],i=0){if(r.length>=t)return r;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithLexicalScope(e)&&r.push(e),e!==a?n.getLexicalScopesRecursive(a,t,r,++i):r}}t.NodeLexicalScopeUtils=n},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(168),m=r(29),g=r(2),y=r(3),N=r(64),h=r(63),b=r(11),I=r(12),v=r(8),S=r(4),O=r(44),j=r(15),_=r(6);let C=class extends I.AbstractNodeTransformer{constructor(e,t,r,o,n){super(t,r),this.literalObfuscatingReplacerFactory=e,this.stringArrayStorageAnalyzer=o,this.escapeSequenceEncoder=n}getVisitor(e){switch(e){case b.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(S.NodeGuards.isProgramNode(e)&&this.analyzeNode(e),t&&S.NodeGuards.isLiteralNode(e)&&!j.NodeMetadata.isReplacedLiteral(e))return this.transformNode(e,t)}};case b.TransformationStage.Finalizing:return{enter:(e,t)=>{if(t&&S.NodeGuards.isLiteralNode(e))return this.encodeLiteralNodeToEscapeSequence(e,t)}};default:return null}}analyzeNode(e){this.stringArrayStorageAnalyzer.analyze(e)}transformNode(e,t){if(O.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;let r;switch(typeof e.value){case"boolean":r=this.literalObfuscatingReplacerFactory(h.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e);break;case"number":r=this.literalObfuscatingReplacerFactory(h.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e);break;case"string":r=this.literalObfuscatingReplacerFactory(h.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e);break;default:r=e}return _.NodeUtils.parentizeNode(r,t),r}encodeLiteralNodeToEscapeSequence(e,t){return"string"!=typeof e.value?e:v.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(e.value,this.options.unicodeEscapeSequence))}};C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IObfuscatingReplacer)),l(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(2,u.inject(f.ServiceIdentifiers.IOptions)),l(3,u.inject(f.ServiceIdentifiers.IStringArrayStorageAnalyzer)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TLiteralObfuscatingReplacerFactory&&p.TLiteralObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==g.IOptions&&g.IOptions)?i:Object,"function"==typeof(a=void 0!==N.IStringArrayStorageAnalyzer&&N.IStringArrayStorageAnalyzer)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.LiteralTransformer=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(2),l=r(39),u=r(8),f=r(37),p=r(30);let m=class extends l.AbstractObfuscatingReplacer{constructor(e){super(e),this.numberLiteralCache=new Map}replace(e){const t=e.value;if("number"!=typeof t)throw new Error("`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value");let r;return this.numberLiteralCache.has(t)?r=this.numberLiteralCache.get(t):(r=f.NumberUtils.isCeil(t)?`${p.Utils.hexadecimalPrefix}${f.NumberUtils.toHex(t)}`:String(t),this.numberLiteralCache.set(t,r)),u.NodeFactory.literalNode(t,r)}};m=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IOptions&&d.IOptions)?o:Object])],m),t.NumberLiteralObfuscatingReplacer=m},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(2),p=r(35),m=r(64),g=r(7),y=r(24),N=r(39),h=r(15),b=r(8),I=r(37),v=r(30);let S=o=class extends N.AbstractObfuscatingReplacer{constructor(e,t,r){super(r),this.nodesCache=new Map,this.stringArrayStorage=e,this.stringArrayStorageAnalyzer=t}static getHexadecimalLiteralNode(e){const t=b.NodeFactory.literalNode(e);return h.NodeMetadata.set(t,{replacedLiteral:!0}),t}static getRc4KeyLiteralNode(e){const t=b.NodeFactory.literalNode(e);return h.NodeMetadata.set(t,{replacedLiteral:!0}),t}initialize(){this.stringArrayStorageCallsWrapperName=this.stringArrayStorage.getStorageCallsWrapperName(),this.options.shuffleStringArray&&this.stringArrayStorage.shuffleStorage(),this.options.rotateStringArray&&this.stringArrayStorage.rotateStorage()}replace(e){const t=e.value;if("string"!=typeof t)throw new Error("`StringLiteralObfuscatingReplacer` should accept only literals with `string` value");const r=this.stringArrayStorageAnalyzer.getItemDataForLiteralNode(e),o=`${t}-${Boolean(r)}`;if(this.nodesCache.has(o)&&this.options.stringArrayEncoding!==y.StringArrayEncoding.Rc4)return this.nodesCache.get(o);const n=r?this.replaceWithStringArrayCallNode(r):this.replaceWithLiteralNode(t);return this.nodesCache.set(o,n),n}replaceWithLiteralNode(e){return b.NodeFactory.literalNode(e)}replaceWithStringArrayCallNode(e){const{index:t,decodeKey:r}=e,n=`${v.Utils.hexadecimalPrefix}${I.NumberUtils.toHex(t)}`,i=[o.getHexadecimalLiteralNode(n)];r&&i.push(o.getRc4KeyLiteralNode(r));const a=b.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName);return b.NodeFactory.callExpressionNode(a,i)}};s([g.initializable(),c("design:type",String)],S.prototype,"stringArrayStorageCallsWrapperName",void 0),s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],S.prototype,"initialize",null),S=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IStringArrayStorage)),d(1,l.inject(u.ServiceIdentifiers.IStringArrayStorageAnalyzer)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==p.IStringArrayStorage&&p.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==m.IStringArrayStorageAnalyzer&&m.IStringArrayStorageAnalyzer)?i:Object,"function"==typeof(a=void 0!==f.IOptions&&f.IOptions)?a:Object])],S),t.StringLiteralObfuscatingReplacer=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(50),y=r(2),N=r(3),h=r(172),b=r(38),I=r(11),v=r(12),S=r(4),O=r(15);let j=o=class extends v.AbstractNodeTransformer{constructor(e,t,r,o){super(t,r),this.lexicalScopesWithObjectPatternWithoutDeclarationMap=new Map,this.identifierObfuscatingReplacer=e(b.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),this.scopeAnalyzer=o}getVisitor(e){switch(e){case I.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&S.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.transformNode(e,t)}};default:return null}}analyzeNode(e,t){this.scopeAnalyzer.analyze(e)}transformNode(e,t){const r=this.scopeAnalyzer.acquireScope(e);return this.traverseScopeVariables(r),e}traverseScopeVariables(e){const t=e.variableScope,r=S.NodeGuards.isNodeWithBlockLexicalScope(t.block)?t.block:null,n=o.globalScopeNames.includes(t.type);if(r){for(const t of e.variables)if(t.name!==o.argumentsVariableName){if(!this.options.renameGlobals&&n){if(!t.defs.every(e=>"ImportBinding"===e.type||"CatchClause"===e.type))continue}this.transformScopeVariableIdentifiers(t,r,n)}for(const t of e.childScopes)this.traverseScopeVariables(t)}}transformScopeVariableIdentifiers(e,t,r){for(const o of e.identifiers)this.isReplaceableIdentifierNode(o,t,e)&&(this.storeIdentifierName(o,t,r),this.replaceIdentifierName(o,t,e))}storeIdentifierName(e,t,r){r?this.identifierObfuscatingReplacer.storeGlobalName(e,t):this.identifierObfuscatingReplacer.storeLocalName(e,t)}replaceIdentifierName(e,t,r){const o=this.identifierObfuscatingReplacer.replace(e,t);e.name=o.name,r.references.forEach(t=>{t.identifier.name=e.name})}isReplaceableIdentifierNode(e,t,r){const o=e.parentNode;return!(!o||O.NodeMetadata.isIgnoredNode(e)||this.isProhibitedPropertyNode(e,o)||this.isProhibitedClassDeclarationNameIdentifierNode(r,e,o)||this.isProhibitedExportNamedClassDeclarationIdentifierNode(e,o)||this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,o)||this.isProhibitedExportNamedVariableDeclarationIdentifierNode(e,o)||this.isProhibitedImportSpecifierNode(e,o)||this.isProhibitedVariableNameUsedInObjectPatternNode(r,e,t)||S.NodeGuards.isLabelIdentifierNode(e,o))}isProhibitedClassDeclarationNameIdentifierNode(e,t,r){return S.NodeGuards.isClassDeclarationNode(e.scope.block)&&S.NodeGuards.isClassDeclarationNode(r)&&r.id===t}isProhibitedExportNamedClassDeclarationIdentifierNode(e,t){return S.NodeGuards.isClassDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,t){return S.NodeGuards.isFunctionDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedVariableDeclarationIdentifierNode(e,t){return S.NodeGuards.isVariableDeclaratorNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isVariableDeclarationNode(t.parentNode)&&!!t.parentNode.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode.parentNode)}isProhibitedImportSpecifierNode(e,t){return S.NodeGuards.isImportSpecifierNode(t)&&t.imported.name===t.local.name}isProhibitedPropertyNode(e,t){const r=S.NodeGuards.isPropertyNode(t)&&!t.computed&&t.key===e,o=S.NodeGuards.isAssignmentPatternNode(t)&&t.left===e&&!!t.parentNode&&S.NodeGuards.isPropertyNode(t.parentNode)&&t.left===t.parentNode.key;return r||o}isProhibitedVariableNameUsedInObjectPatternNode(e,t,r){let o=this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(r);if(!1===o)return!1;if(!e.defs.some(e=>"var"===e.kind))return!1;let n=!1;return m.traverse(r,{enter:(e,r)=>{if(S.NodeGuards.isObjectPatternNode(e)&&r&&S.NodeGuards.isAssignmentExpressionNode(r)){o=!0;const r=e.properties;for(const e of r)if(!e.computed&&e.shorthand&&S.NodeGuards.isIdentifierNode(e.key)&&t.name===e.key.name)return n=!0,m.VisitorOption.Break}}}),this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(r,null!=o&&o),n}};j.argumentsVariableName="arguments",j.globalScopeNames=["global","module"],j=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),l(1,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(2,f.inject(p.ServiceIdentifiers.IOptions)),l(3,f.inject(p.ServiceIdentifiers.IScopeAnalyzer)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierObfuscatingReplacerFactory&&g.TIdentifierObfuscatingReplacerFactory)?n:Object,"function"==typeof(i=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.IOptions&&y.IOptions)?a:Object,"function"==typeof(s=void 0!==h.IScopeAnalyzer&&h.IScopeAnalyzer)?s:Object])],j),t.ScopeIdentifiersTransformer=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(174),a=r(181);t.optionsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IOptions).to(i.Options).inSingletonScope(),e(n.ServiceIdentifiers.IOptionsNormalizer).to(a.OptionsNormalizer).inSingletonScope()})},function(e,t,r){"use strict";var o,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=r(28),m=r(0),g=r(1),y=r(65),N=r(175),h=r(176),b=r(177),I=r(31),v=r(20),S=r(32),O=r(24),j=r(40),_=r(178),C=r(179);let R=o=class{constructor(e,t){Object.assign(this,j.DEFAULT_PRESET,e);const r=y.validateSync(this,o.validatorOptions);if(r.length)throw new ReferenceError(`Validation failed. errors:\n${_.ValidationErrorsFormatter.format(r)}`);Object.assign(this,t.normalize(this))}};R.validatorOptions={validationError:{target:!1}},l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"compact",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"controlFlowFlattening",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"controlFlowFlatteningThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"deadCodeInjection",void 0),l([y.IsNumber(),u("design:type",Number)],R.prototype,"deadCodeInjectionThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtection",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtectionInterval",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"disableConsoleOutput",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),C.IsAllowedForObfuscationTargets([v.ObfuscationTarget.Browser,v.ObfuscationTarget.BrowserNoEval]),u("design:type",Array)],R.prototype,"domainLock",void 0),l([y.IsIn([I.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,I.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,I.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]),u("design:type","function"==typeof(n=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?n:Object)],R.prototype,"identifierNamesGenerator",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"identifiersPrefix",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),y.ValidateIf(e=>e.identifierNamesGenerator===I.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),y.ArrayNotEmpty(),u("design:type",Array)],R.prototype,"identifiersDictionary",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFileName",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFilePath",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"log",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"renameGlobals",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedNames",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedStrings",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"rotateStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"selfDefending",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"shuffleStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"sourceMap",void 0),l([y.IsString(),y.ValidateIf(e=>Boolean(e.sourceMapBaseUrl)),y.IsUrl({require_protocol:!0,require_tld:!1,require_valid_protocol:!0}),u("design:type",String)],R.prototype,"sourceMapBaseUrl",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"sourceMapFileName",void 0),l([y.IsIn([S.SourceMapMode.Inline,S.SourceMapMode.Separate]),u("design:type","function"==typeof(i=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?i:Object)],R.prototype,"sourceMapMode",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"splitStrings",void 0),l([y.IsNumber(),y.ValidateIf(e=>Boolean(e.splitStrings)),y.Min(1),u("design:type",Number)],R.prototype,"splitStringsChunkLength",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"stringArray",void 0),l([y.IsIn([!0,!1,O.StringArrayEncoding.Base64,O.StringArrayEncoding.Rc4]),u("design:type","function"==typeof(a=void 0!==h.TStringArrayEncoding&&h.TStringArrayEncoding)?a:Object)],R.prototype,"stringArrayEncoding",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"stringArrayThreshold",void 0),l([y.IsIn([v.ObfuscationTarget.Browser,v.ObfuscationTarget.BrowserNoEval,v.ObfuscationTarget.Node]),u("design:type","function"==typeof(s=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?s:Object)],R.prototype,"target",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"transformObjectKeys",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"unicodeEscapeSequence",void 0),R=o=l([m.injectable(),f(0,m.inject(g.ServiceIdentifiers.TInputOptions)),f(1,m.inject(g.ServiceIdentifiers.IOptionsNormalizer)),u("design:paramtypes",["function"==typeof(c=void 0!==N.TInputOptions&&N.TInputOptions)?c:Object,"function"==typeof(d=void 0!==b.IOptionsNormalizer&&b.IOptionsNormalizer)?d:Object])],R),t.Options=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static format(e){return e.reduce((e,t)=>[...e,o.formatWithNestedConstraints(t)],[]).join("\n")}static formatWithNestedConstraints(e){const t=e.constraints;return`${`\`${e.property}\` errors:\n`}${Object.keys(t).map(e=>` - ${t[e]}\n`).join()}`}}t.ValidationErrorsFormatter=o},function(e,t,r){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(65),i=o(r(180)),a=r(41),s=r(40);t.IsAllowedForObfuscationTargets=function(e,t){return(r,o)=>{n.registerDecorator({propertyName:o,constraints:[e],name:"IsAllowedForObfuscationTargets",options:t,target:r.constructor,validator:{validate(t,r){const n=r.object,a=s.DEFAULT_PRESET[o];return i.default(t,a)||e.includes(n.target)},defaultMessage:t=>`This option allowed only for obfuscation targets: ${e.join(`${a.StringSeparator.Comma} `)}`}})}}},function(e,t){e.exports=require("fast-deep-equal")},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(182),s=r(183),c=r(184),d=r(185),l=r(186),u=r(187),f=r(188),p=r(189),m=r(190),g=r(191),y=r(192),N=r(193),h=r(194);let b=o=class{normalize(e){let t=Object.assign({},e);for(const e of o.normalizerRules)t=e(t);return t}};b.normalizerRules=[a.ControlFlowFlatteningThresholdRule,s.DeadCodeInjectionRule,c.DeadCodeInjectionThresholdRule,d.DomainLockRule,l.InputFileNameRule,u.SeedRule,f.SelfDefendingRule,p.SourceMapBaseUrlRule,m.SourceMapFileNameRule,g.SplitStringsChunkLengthRule,y.StringArrayRule,N.StringArrayEncodingRule,h.StringArrayThresholdRule],b=o=n([i.injectable()],b),t.OptionsNormalizer=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControlFlowFlatteningThresholdRule=e=>(0===e.controlFlowFlatteningThreshold&&(e=Object.assign(Object.assign({},e),{controlFlowFlattening:!1,controlFlowFlatteningThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(40);t.DeadCodeInjectionRule=e=>(e.deadCodeInjection&&((e=Object.assign(Object.assign({},e),{deadCodeInjection:!0,stringArray:!0})).stringArrayThreshold||(e=Object.assign(Object.assign({},e),{stringArray:!0,stringArrayThreshold:o.DEFAULT_PRESET.stringArrayThreshold}))),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeadCodeInjectionThresholdRule=e=>(0===e.deadCodeInjectionThreshold&&(e=Object.assign(Object.assign({},e),{deadCodeInjection:!1,deadCodeInjectionThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(30);t.DomainLockRule=e=>{if(e.domainLock.length){const t=[];for(const r of e.domainLock)t.push(o.Utils.extractDomainFrom(r));e=Object.assign(Object.assign({},e),{domainLock:t})}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(41);t.InputFileNameRule=e=>{let{inputFileName:t}=e;return t&&(t=t.replace(/^\/+/,"").split(o.StringSeparator.Dot).slice(0,-1).join(o.StringSeparator.Dot)||t,e=Object.assign(Object.assign({},e),{inputFileName:`${t}.js`})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeedRule=e=>{if(e.seed)return Object.assign(Object.assign({},e),{seed:e.seed});return Object.assign(Object.assign({},e),{seed:(t=0,r=999999999,Math.floor(Math.random()*(r-t+1)+t))});var t,r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingRule=e=>(e.selfDefending&&(e=Object.assign(Object.assign({},e),{compact:!0,selfDefending:!0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapBaseUrlRule=e=>{const{sourceMapBaseUrl:t}=e;return e.sourceMapFileName?(t&&!t.endsWith("/")&&(e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:`${t}/`})),e):e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:""})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(41);t.SourceMapFileNameRule=e=>{let{sourceMapFileName:t}=e;if(t){t=t.replace(/^\/+/,"").replace(/(?:\.js)?(?:\.map)?$/,"");let r=t.split(o.StringSeparator.Dot);const n=r.length,i=r[n-1];n>1&&i.length<=3&&(r=r.slice(0,-1)),t=r.join(o.StringSeparator.Dot),e=Object.assign(Object.assign({},e),{sourceMapFileName:`${t}.js.map`})}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SplitStringsChunkLengthRule=e=>e=0===e.splitStringsChunkLength?Object.assign(Object.assign({},e),{splitStrings:!1,splitStringsChunkLength:0}):Object.assign(Object.assign({},e),{splitStringsChunkLength:Math.floor(e.splitStringsChunkLength)})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRule=e=>(e.stringArray||(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,shuffleStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(24);t.StringArrayEncodingRule=e=>(!0===e.stringArrayEncoding&&(e=Object.assign(Object.assign({},e),{stringArrayEncoding:o.StringArrayEncoding.Base64})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayThresholdRule=e=>(0===e.stringArrayThreshold&&(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(21),s=r(66),c=r(196),d=r(197),l=r(67),u=r(198),f=r(202),p=r(204),m=r(205),g=r(207),y=r(208),N=r(209);t.preparingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.CommentsTransformer).whenTargetNamed(a.NodeTransformer.CommentsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.CustomNodesTransformer).whenTargetNamed(a.NodeTransformer.CustomNodesTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.EvalCallExpressionTransformer).whenTargetNamed(a.NodeTransformer.EvalCallExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.MetadataTransformer).whenTargetNamed(a.NodeTransformer.MetadataTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.ObfuscatingGuardsTransformer).whenTargetNamed(a.NodeTransformer.ObfuscatingGuardsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ParentificationTransformer).whenTargetNamed(a.NodeTransformer.ParentificationTransformer),e(i.ServiceIdentifiers.INodeGuard).to(c.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.BlackListObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(l.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ConditionalCommentObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(y.ReservedStringObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ReservedStringObfuscatingGuard),e(i.ServiceIdentifiers.Factory__INodeGuard).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeGuard)),e(i.ServiceIdentifiers.INodeTransformer).to(N.VariablePreserveTransformer).whenTargetNamed(a.NodeTransformer.VariablePreserveTransformer)})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=r(4);let c=o=class{constructor(){this.blackListGuardsLength=o.blackListGuards.length}check(e){for(let t=0;t=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(2),m=r(3),g=r(11),y=r(12),N=r(4),h=r(67);let b=o=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case g.TransformationStage.Initializing:return{leave:e=>{if(N.NodeGuards.isProgramNode(e))return this.transformNode(e)}};default:return null}}transformNode(e){if(!e.comments||!e.comments.length)return e;const t=this.transformComments(e.comments);return 0===t.length?e:e.body.length?(f.traverse(e,{enter:r=>{if(r===e)return;const o=t.findIndex(e=>e.range&&r.range&&e.range[0]0&&(e.trailingComments=t.reverse()),e):(e.leadingComments=t,e)}transformComments(e){return e.filter(e=>o.preservedWords.some(t=>e.value.includes(t))||h.ConditionalCommentObfuscatingGuard.isConditionalComment(e)).reverse()}};b.preservedWords=["@license","@preserve"],b=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],b),t.CommentsTransformer=b},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=r(199),g=r(200),y=r(2),N=r(3),h=r(201),b=r(62),I=r(22),v=r(11),S=r(12),O=r(4);let j=class extends S.AbstractNodeTransformer{constructor(e,t,r,o,n,i){super(n,i),this.callsGraphData=[],this.callsGraphAnalyzer=e,this.prevailingKindOfVariablesAnalyzer=t,this.obfuscationEventEmitter=r,this.customNodeGroupStorage=o}getVisitor(e){switch(e){case v.TransformationStage.Preparing:return{leave:(e,t)=>{if(O.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.appendCustomNodesBeforeObfuscation(e,t),this.transformNode(e,t)}};case v.TransformationStage.Finalizing:return{leave:(e,t)=>{O.NodeGuards.isProgramNode(e)&&this.appendCustomNodesAfterObfuscation(e,t)}};default:return null}}analyzeNode(e,t){this.callsGraphData=this.callsGraphAnalyzer.analyze(e),this.prevailingKindOfVariablesAnalyzer.analyze(e)}transformNode(e,t){return e}appendCustomNodesBeforeObfuscation(e,t){this.customNodeGroupStorage.getStorage().forEach(e=>{e.initialize(),this.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(I.ObfuscationEvent.BeforeObfuscation,e,this.callsGraphData)}appendCustomNodesAfterObfuscation(e,t){this.obfuscationEventEmitter.emit(I.ObfuscationEvent.AfterObfuscation,e,this.callsGraphData)}};j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.ICallsGraphAnalyzer)),u(1,f.inject(p.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),u(2,f.inject(p.ServiceIdentifiers.IObfuscationEventEmitter)),u(3,f.inject(p.ServiceIdentifiers.TCustomNodeGroupStorage)),u(4,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(5,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(o=void 0!==h.ICallsGraphAnalyzer&&h.ICallsGraphAnalyzer)?o:Object,"function"==typeof(n=void 0!==b.IPrevailingKindOfVariablesAnalyzer&&b.IPrevailingKindOfVariablesAnalyzer)?n:Object,"function"==typeof(i=void 0!==g.IObfuscationEventEmitter&&g.IObfuscationEventEmitter)?i:Object,"function"==typeof(a=void 0!==m.TCustomNodeGroupStorage&&m.TCustomNodeGroupStorage)?a:Object,"function"==typeof(s=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.CustomNodesTransformer=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(203)),p=r(2),m=r(3),g=r(11),y=r(12),N=r(8),h=r(4),b=r(6);let I=o=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t),this.evalRootAstHostNodeSet=new Set}static extractEvalStringFromCallExpressionArgument(e){return h.NodeGuards.isLiteralNode(e)?o.extractEvalStringFromLiteralNode(e):h.NodeGuards.isTemplateLiteralNode(e)?o.extractEvalStringFromTemplateLiteralNode(e):null}static extractEvalStringFromLiteralNode(e){return"string"==typeof e.value?e.value:null}static extractEvalStringFromTemplateLiteralNode(e){const t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(t&&h.NodeGuards.isCallExpressionNode(e)&&h.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return this.transformNode(e,t)}};case g.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:(e,t)=>{if(t&&this.isEvalRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}transformNode(e,t){const r=e.arguments[0];if(!r)return e;const n=o.extractEvalStringFromCallExpressionArgument(r);if(!n)return e;let i;try{i=b.NodeUtils.convertCodeToStructure(n)}catch(t){return e}const a=N.NodeFactory.functionExpressionNode([],N.NodeFactory.blockStatementNode(i));return this.evalRootAstHostNodeSet.add(a),a}restoreNode(e,t){const r=e.body.body,o=b.NodeUtils.convertStructureToCode(r);return N.NodeFactory.callExpressionNode(N.NodeFactory.identifierNode("eval"),[N.NodeFactory.literalNode(f.default(o))])}isEvalRootAstHostNode(e){return h.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}};I=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],I),t.EvalCallExpressionTransformer=I},function(e,t){e.exports=require("js-string-escape")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(4),g=r(15);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return g.NodeMetadata.set(e,{ignoredNode:!1}),m.NodeGuards.isLiteralNode(e)&&g.NodeMetadata.set(e,{replacedLiteral:!1}),e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MetadataTransformer=y},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(206),p=r(2),m=r(3),g=r(66),y=r(11),N=r(12),h=r(15);let b=o=class extends N.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.obfuscatingGuards=o.obfuscatingGuardsList.map(e)}getVisitor(e){switch(e){case y.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){const r=this.obfuscatingGuards.every(t=>t.check(e));return h.NodeMetadata.set(e,{ignoredNode:!r}),e}};b.obfuscatingGuardsList=[g.ObfuscatingGuard.BlackListObfuscatingGuard,g.ObfuscatingGuard.ConditionalCommentObfuscatingGuard,g.ObfuscatingGuard.ReservedStringObfuscatingGuard],b=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__INodeGuard)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TObfuscatingGuardFactory&&f.TObfuscatingGuardFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.ObfuscatingGuardsTransformer=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(6);let g=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return m.NodeUtils.parentizeNode(e,t)}};g=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],g),t.ParentificationTransformer=g},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(2),d=r(1),l=r(4);let u=class{constructor(e){this.options=e}check(e){return!this.options.reservedStrings.length||!l.NodeGuards.isLiteralNode(e)||"string"!=typeof e.value||!this.isReservedString(e.value)}isReservedString(e){return this.options.reservedStrings.some(t=>null!==new RegExp(t,"g").exec(e))}};u=n([s.injectable(),a(0,s.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==c.IOptions&&c.IOptions)?o:Object])],u),t.ReservedStringObfuscatingGuard=u},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(50),u=r(2),f=r(3),p=r(38),m=r(1),g=r(11),y=r(12),N=r(4);let h=class extends y.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(N.NodeGuards.isIdentifierNode(e)&&t&&(N.NodeGuards.parentNodeIsPropertyNode(e,t)||N.NodeGuards.parentNodeIsMemberExpressionNode(e,t)||N.NodeGuards.parentNodeIsMethodDefinitionNode(e,t)||N.NodeGuards.isLabelIdentifierNode(e,t)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return this.identifierObfuscatingReplacer.preserveName(e.name),e}};h=a([d.injectable(),c(0,d.inject(m.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,d.inject(m.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(m.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==l.TIdentifierObfuscatingReplacerFactory&&l.TIdentifierObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.VariablePreserveTransformer=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(211),a=r(212),s=r(214);t.storagesModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.TCustomNodeGroupStorage).to(a.CustomNodeGroupStorage).inSingletonScope(),e(n.ServiceIdentifiers.IStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(n.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(i.ControlFlowStorage),e(n.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(e=>()=>{const t=new(e.container.get(n.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(n.ServiceIdentifiers.IRandomGenerator),e.container.get(n.ServiceIdentifiers.IOptions));return t.initialize(),t})})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(51);let p=class extends f.MapStorage{constructor(e,t){super(e,t)}};p=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.ControlFlowStorage=p},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(213),p=r(2),m=r(3),g=r(61),y=r(51);let N=o=class extends y.MapStorage{constructor(e,t,r){super(t,r),this.customNodeGroupFactory=e}initialize(){super.initialize(),o.customNodeGroupsList.forEach(e=>{const t=this.customNodeGroupFactory(e);this.storage.set(e,t)})}};N.customNodeGroupsList=[g.CustomNodeGroup.ConsoleOutputCustomNodeGroup,g.CustomNodeGroup.DebugProtectionCustomNodeGroup,g.CustomNodeGroup.DomainLockCustomNodeGroup,g.CustomNodeGroup.SelfDefendingCustomNodeGroup,g.CustomNodeGroup.StringArrayCustomNodeGroup],s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],N.prototype,"initialize",null),N=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__ICustomNodeGroup)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TCustomNodeGroupFactory&&f.TCustomNodeGroupFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.CustomNodeGroupStorage=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=r(5),y=r(34),N=r(48),h=r(29),b=r(2),I=r(3),v=r(7),S=r(24),O=r(51);let j=o=class extends O.MapStorage{constructor(e,t,r,n,i,a){super(r,n),this.rc4EncodedValuesSourcesCache=new Map,this.rotationAmount=0,this.identifierNamesGenerator=e(n),this.arrayUtils=t,this.cryptUtils=i,this.escapeSequenceEncoder=a,this.rc4Keys=this.randomGenerator.getRandomGenerator().n(()=>this.randomGenerator.getRandomGenerator().string({length:o.rc4KeyLength}),o.rc4KeysCount)}initialize(){super.initialize();const e=this.identifierNamesGenerator.generate(o.stringArrayNameLength),t=this.identifierNamesGenerator.generate(o.stringArrayNameLength);this.stringArrayStorageName=`${this.options.identifiersPrefix}${e}`,this.stringArrayStorageCallsWrapperName=`${this.options.identifiersPrefix}${t}`,this.rotationAmount=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(o.minimumRotationAmount,o.maximumRotationAmount):0}get(e){return this.getOrSetIfDoesNotExist(e)}getRotationAmount(){return this.rotationAmount}getStorageId(){return this.stringArrayStorageName}getStorageName(){return this.getStorageId()}getStorageCallsWrapperName(){return this.stringArrayStorageCallsWrapperName}rotateStorage(){this.getLength()&&(this.storage=new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()),this.rotationAmount)))}shuffleStorage(){this.storage=new Map(this.arrayUtils.shuffle(Array.from(this.storage.entries())).map(([e,t],r)=>(t.index=r,[e,t])).sort(([,e],[,t])=>e.index-t.index))}toString(){return Array.from(this.storage.values()).map(e=>`'${this.escapeSequenceEncoder.encode(e.encodedValue,this.options.unicodeEscapeSequence)}'`).toString()}getOrSetIfDoesNotExist(e){const{encodedValue:t,decodeKey:r}=this.getEncodedValue(e),o=this.storage.get(t);if(o)return o;const n={encodedValue:t,decodeKey:r,value:e,index:this.getLength()};return this.storage.set(t,n),n}getEncodedValue(e){var t;switch(this.options.stringArrayEncoding){case S.StringArrayEncoding.Rc4:{const r=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),o=this.cryptUtils.btoa(this.cryptUtils.rc4(e,r)),n=null!==(t=this.rc4EncodedValuesSourcesCache.get(o))&&void 0!==t?t:[];let i=n.length;return(!i||!n.includes(e))&&(n.push(e),i++),this.rc4EncodedValuesSourcesCache.set(o,n),i>1?this.getEncodedValue(e):{encodedValue:o,decodeKey:r}}case S.StringArrayEncoding.Base64:{const t=null;return{encodedValue:this.cryptUtils.btoa(e),decodeKey:t}}default:return{encodedValue:e,decodeKey:null}}}};j.minimumRotationAmount=100,j.maximumRotationAmount=500,j.rc4KeyLength=4,j.rc4KeysCount=50,j.stringArrayNameLength=7,l([v.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageName",void 0),l([v.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageCallsWrapperName",void 0),l([p.postConstruct(),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],j.prototype,"initialize",null),j=o=l([p.injectable(),f(0,p.inject(m.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),f(1,p.inject(m.ServiceIdentifiers.IArrayUtils)),f(2,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f(3,p.inject(m.ServiceIdentifiers.IOptions)),f(4,p.inject(m.ServiceIdentifiers.ICryptUtils)),f(5,p.inject(m.ServiceIdentifiers.IEscapeSequenceEncoder)),u("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==I.IRandomGenerator&&I.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==b.IOptions&&b.IOptions)?s:Object,"function"==typeof(c=void 0!==N.ICryptUtils&&N.ICryptUtils)?c:Object,"function"==typeof(d=void 0!==h.IEscapeSequenceEncoder&&h.IEscapeSequenceEncoder)?d:Object])],j),t.StringArrayStorage=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(216),a=r(217),s=r(221),c=r(222),d=r(223),l=r(68);t.utilsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IArrayUtils).to(i.ArrayUtils).inSingletonScope(),e(n.ServiceIdentifiers.IRandomGenerator).to(l.RandomGenerator).inSingletonScope(),e(n.ServiceIdentifiers.ICryptUtils).to(a.CryptUtils).inSingletonScope(),e(n.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope(),e(n.ServiceIdentifiers.ILevelledTopologicalSorter).to(c.LevelledTopologicalSorter),e(n.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder).to(d.NodeTransformerNamesGroupsBuilder).inSingletonScope()})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(3);let l=class{constructor(e){this.randomGenerator=e}createWithRange(e){const t=[];for(let r=0;rn&&(o=i,n=e),r[i]=e}return o}rotate(e,t){if(!e.length)throw new ReferenceError("Cannot rotate empty array.");if(t<=0)return e;const r=e;let o;for(;t--;)o=r.pop(),o&&r.unshift(o);return r}shuffle(e){const t=[...e];for(let e=t.length;e;e--){const r=Math.floor(this.randomGenerator.getMathRandom()*e);[t[e-1],t[r]]=[t[r],t[e-1]]}return t}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IRandomGenerator&&d.IRandomGenerator)?o:Object])],l),t.ArrayUtils=l},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(3),l=r(68),u=r(30);let f=class{constructor(e){this.randomGenerator=e}btoa(e){let t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(`${u.Utils.hexadecimalPrefix}${t}`,16)));for(let r,o,n=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|n)||(i="=",n%1);t+=i.charAt(63&r>>8-n%1*8)){if(o=e.charCodeAt(n+=.75),o>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|o}return t}hideString(e,t){let r=this.randomGenerator.getRandomGenerator().string({length:t,pool:l.RandomGenerator.randomGeneratorPool}).replace(new RegExp(`[${o=e,o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}]`,"g"),"");var o;const n=r.split("");return this.randomGenerator.getRandomGenerator().shuffle(n),r=n.join(""),[((e,t)=>{let r=-1,o=-1,n="";for(;r=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.stringsCache=new Map}encode(e,t){const r=`${e}-${String(t)}`;if(this.stringsCache.has(r))return this.stringsCache.get(r);const o=new RegExp("[\\s\\S]","g"),n=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const c=e.replace(o,e=>t||n.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(r,c),this.stringsCache.set(`${c}-${String(t)}`,c),c}};n=o([r(0).injectable()],n),t.EscapeSequenceEncoder=n},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],r={};for(const o of e)void 0===r[o]&&this.visit(t,r,o);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const r of t){for(let t=r.length-1;t>=0;t-=1)r[t]===e&&r.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const r of e)this.hasPrecedents(r)||t.push(r);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const r=this.graph.get(t);return r&&!r.includes(e)&&r.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,r){const o=t[r];if("visiting"===o)throw new Error(`Detected cycle involving node: ${r}`);if(o)return;t[r]="visiting";const n=this.getPrecedents(r);for(const r of n)this.visit(e,t,r);t[r]="ok",e.push(r)}};n=o([r(0).injectable()],n),t.LevelledTopologicalSorter=n},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(224);let l=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),r=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of r)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const r=[];for(const o of e){const e=t[o].runAfter;if(e&&e.length)for(const n of e){void 0===t[n]?r.push([o,null]):r.push([n,o])}else r.push([o,null])}return r}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.ILevelledTopologicalSorter)),i("design:paramtypes",["function"==typeof(o=void 0!==d.ILevelledTopologicalSorter&&d.ILevelledTopologicalSorter)?o:Object])],l),t.NodeTransformerNamesGroupsBuilder=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=f(r(46)),y=r(226),N=r(227),h=r(2),b=r(3),I=r(57),v=r(228),S=r(21),O=r(11),j=r(43),_=r(55),C=r(4);let R=o=class{constructor(e,t,r,o,n){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=r,this.logger=o,this.options=n}obfuscate(e){const t=Date.now();this.logger.info(v.LoggingMessage.Version,"0.24.5"),this.logger.info(v.LoggingMessage.ObfuscationStarted),this.logger.info(v.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const r=this.parseCode(e),o=this.transformAstTree(r),n=this.generateCode(e,o),i=(Date.now()-t)/1e3;return this.logger.success(v.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(n)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return _.ASTParserFacade.parse(t,o.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,O.TransformationStage.Initializing),!C.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,O.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,O.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,O.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,O.TransformationStage.Converting),e=this.runTransformationStage(e,O.TransformationStage.Obfuscating),e=this.runTransformationStage(e,O.TransformationStage.Finalizing)):(this.logger.warn(v.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const r=Object.assign({},o.escodegenParams);this.options.sourceMap&&(r.sourceMap=this.options.inputFileName||"sourceMap",r.sourceContent=e);const n=g.generate(t,Object.assign(Object.assign({},r),{format:{compact:this.options.compact}}));return n.map=n.map?n.map.toString():"",n}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(v.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,o.transformersList,t)}};R.parseOptions={ecmaVersion:j.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},R.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},R.transformersList=[S.NodeTransformer.BlockStatementControlFlowTransformer,S.NodeTransformer.CommentsTransformer,S.NodeTransformer.CustomNodesTransformer,S.NodeTransformer.DeadCodeInjectionTransformer,S.NodeTransformer.EvalCallExpressionTransformer,S.NodeTransformer.FunctionControlFlowTransformer,S.NodeTransformer.LabeledStatementTransformer,S.NodeTransformer.LiteralTransformer,S.NodeTransformer.MemberExpressionTransformer,S.NodeTransformer.MetadataTransformer,S.NodeTransformer.MethodDefinitionTransformer,S.NodeTransformer.ObfuscatingGuardsTransformer,S.NodeTransformer.ObjectExpressionKeysTransformer,S.NodeTransformer.ObjectExpressionTransformer,S.NodeTransformer.ParentificationTransformer,S.NodeTransformer.ScopeIdentifiersTransformer,S.NodeTransformer.SplitStringTransformer,S.NodeTransformer.TemplateLiteralTransformer,S.NodeTransformer.VariablePreserveTransformer],R=o=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.ITransformersRunner)),u(1,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(2,p.inject(m.ServiceIdentifiers.Factory__IObfuscatedCode)),u(3,p.inject(m.ServiceIdentifiers.ILogger)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==I.ITransformersRunner&&I.ITransformersRunner)?n:Object,"function"==typeof(i=void 0!==b.IRandomGenerator&&b.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.TObfuscatedCodeFactory&&y.TObfuscatedCodeFactory)?a:Object,"function"==typeof(s=void 0!==N.ILogger&&N.ILogger)?s:Object,"function"==typeof(c=void 0!==h.IOptions&&h.IOptions)?c:Object])],R),t.JavaScriptObfuscator=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(230));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=o([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t){e.exports=require("eventemitter3")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(48),u=r(7),f=r(32),p=r(2);let m=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case f.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case f.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};i([u.initializable(),a("design:type",String)],m.prototype,"obfuscatedCode",void 0),i([u.initializable(),a("design:type",String)],m.prototype,"sourceMap",void 0),m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.ICryptUtils)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==l.ICryptUtils&&l.ICryptUtils)?o:Object,"function"==typeof(n=void 0!==p.IOptions&&p.IOptions)?n:Object])],m),t.ObfuscatedCode=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(234),p=r(235),m=r(236),g=r(4),y=r(15);let N=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,r){if(!t.length)return e;let o,n;this.cachedNodeTransformersData.has(t)?[o,n]=this.cachedNodeTransformersData.get(t):(o=this.buildNormalizedNodeTransformers(t),n=this.nodeTransformerNamesGroupsBuilder.build(o),this.cachedNodeTransformersData.set(t,[o,n]));for(const t of n){const n=[],i=[];for(const e of t){const t=o[e].getVisitor(r);t&&(t.enter&&n.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(n.length||i.length)&&u.replace(e,{enter:this.mergeVisitorsForDirection(n,m.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,m.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const r=e.length;return r?(o,n)=>{if(y.NodeMetadata.isIgnoredNode(o))return u.VisitorOption.Skip;for(let i=0;ie}};N=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__INodeTransformer)),s(1,d.inject(l.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),a("design:paramtypes",["function"==typeof(o=void 0!==f.TNodeTransformerFactory&&f.TNodeTransformerFactory)?o:Object,"function"==typeof(n=void 0!==p.INodeTransformerNamesGroupsBuilder&&p.INodeTransformerNamesGroupsBuilder)?n:Object])],N),t.TransformersRunner=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(25);e.exports=o.JavaScriptObfuscator}]); +require("source-map-support").install(),module.exports=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=240)}([function(e,t){e.exports=require("inversify")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscatedCode="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__IObjectExpressionKeysTransformerCustomNode="Factory",e.Factory__IObjectExpressionExtractor="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICallsGraphAnalyzer="ICallsGraphAnalyzer",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.ICustomNodeFormatter="ICustomNodeFormatter",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILevelledTopologicalSorter="ILevelledTopologicalSorter",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.INodeTransformerNamesGroupsBuilder="INodeTransformerNamesGroupsBuilder",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscatedCode="IObfuscatedCode",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IPrevailingKindOfVariablesAnalyzer="IPrevailingKindOfVariablesAnalyzer",e.IObjectExpressionExtractor="IObjectExpressionExtractor",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IScopeAnalyzer="IScopeAnalyzer",e.IStringArrayStorage="IStringArrayStorage",e.IStringArrayStorageAnalyzer="IStringArrayStorageAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(33);class n{static isArrayPatternNode(e){return e.type===o.NodeType.ArrayPattern}static isArrowFunctionExpressionNode(e){return e.type===o.NodeType.ArrowFunctionExpression}static isAssignmentExpressionNode(e){return e.type===o.NodeType.AssignmentExpression}static isAssignmentPatternNode(e){return e.type===o.NodeType.AssignmentPattern}static isAwaitExpressionNode(e){return e.type===o.NodeType.AwaitExpression}static isBlockStatementNode(e){return e.type===o.NodeType.BlockStatement}static isBreakStatementNode(e){return e.type===o.NodeType.BreakStatement}static isCallExpressionNode(e){return e.type===o.NodeType.CallExpression}static isClassDeclarationNode(e){return e.type===o.NodeType.ClassDeclaration&&null!==e.id}static isContinueStatementNode(e){return e.type===o.NodeType.ContinueStatement}static isDirectiveNode(e){return e.type===o.NodeType.ExpressionStatement&&"directive"in e}static isExportNamedDeclarationNode(e){return e.type===o.NodeType.ExportNamedDeclaration}static isExpressionStatementNode(e){return e.type===o.NodeType.ExpressionStatement&&!("directive"in e)}static isFunctionNode(e){return n.isFunctionDeclarationNode(e)||n.isFunctionExpressionNode(e)||n.isArrowFunctionExpressionNode(e)}static isFunctionDeclarationNode(e){return e.type===o.NodeType.FunctionDeclaration&&null!==e.id}static isFunctionExpressionNode(e){return e.type===o.NodeType.FunctionExpression}static isIdentifierNode(e){return e.type===o.NodeType.Identifier}static isImportDeclarationNode(e){return e.type===o.NodeType.ImportDeclaration}static isImportSpecifierNode(e){return e.type===o.NodeType.ImportSpecifier}static isLabelIdentifierNode(e,t){const r=n.isLabeledStatementNode(t)&&t.label===e,o=n.isContinueStatementNode(t)&&t.label===e,i=n.isBreakStatementNode(t)&&t.label===e;return r||o||i}static isLabeledStatementNode(e){return e.type===o.NodeType.LabeledStatement}static isLiteralNode(e){return e.type===o.NodeType.Literal}static isMemberExpressionNode(e){return e.type===o.NodeType.MemberExpression}static isMethodDefinitionNode(e){return e.type===o.NodeType.MethodDefinition}static isNode(e){return e&&void 0!==!e.type}static isNodeWithLexicalScope(e){return n.isProgramNode(e)||n.isFunctionNode(e)}static isNodeWithBlockLexicalScope(e){return n.isNodeWithLexicalScope(e)||n.isBlockStatementNode(e)}static isNodeWithLexicalScopeStatements(e,t){return n.isProgramNode(e)||n.isBlockStatementNode(e)&&n.nodesWithLexicalStatements.includes(t.type)}static isNodeWithStatements(e){return n.isProgramNode(e)||n.isBlockStatementNode(e)||n.isSwitchCaseNode(e)}static isNodeWithComments(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}static isObjectPatternNode(e){return e.type===o.NodeType.ObjectPattern}static isObjectExpressionNode(e){return e.type===o.NodeType.ObjectExpression}static isProgramNode(e){return e.type===o.NodeType.Program}static isPropertyNode(e){return e.type===o.NodeType.Property}static parentNodeIsPropertyNode(e,t){return n.isPropertyNode(t)&&!t.computed&&t.key===e}static parentNodeIsMemberExpressionNode(e,t){return n.isMemberExpressionNode(t)&&!t.computed&&t.property===e}static parentNodeIsMethodDefinitionNode(e,t){return n.isMethodDefinitionNode(t)&&!t.computed}static isRestElementNode(e){return e.type===o.NodeType.RestElement}static isReturnStatementNode(e){return e.type===o.NodeType.ReturnStatement}static isSuperNode(e){return e.type===o.NodeType.Super}static isSwitchCaseNode(e){return e.type===o.NodeType.SwitchCase}static isTaggedTemplateExpressionNode(e){return e.type===o.NodeType.TaggedTemplateExpression}static isTemplateLiteralNode(e){return e.type===o.NodeType.TemplateLiteral}static isUnaryExpressionNode(e){return e.type===o.NodeType.UnaryExpression}static isUseStrictOperator(e){return n.isDirectiveNode(e)&&"use strict"===e.directive}static isVariableDeclarationNode(e){return e.type===o.NodeType.VariableDeclaration}static isVariableDeclaratorNode(e){return e.type===o.NodeType.VariableDeclarator}static isWhileStatementNode(e){return e.type===o.NodeType.WhileStatement}}t.NodeGuards=n,n.nodesWithLexicalStatements=[o.NodeType.ArrowFunctionExpression,o.NodeType.FunctionDeclaration,o.NodeType.FunctionExpression,o.NodeType.MethodDefinition]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(46)),i=o(r(13)),a=r(43),s=r(55),c=r(4),d=r(15);class l{static addXVerbatimPropertyTo(e){return e["x-verbatim-property"]={content:e.raw,precedence:n.Precedence.Primary},e}static clone(e){return l.parentizeAst(l.cloneRecursive(e))}static convertCodeToStructure(e){const t=s.ASTParserFacade.parse({sourceCode:e},{ecmaVersion:a.ecmaVersion,sourceType:"script"});return i.replace(t,{enter:(e,t)=>(l.parentizeNode(e,t),c.NodeGuards.isLiteralNode(e)&&l.addXVerbatimPropertyTo(e),d.NodeMetadata.set(e,{ignoredNode:!1}),e)}),t.body}static convertStructureToCode(e){return e.reduce((e,t)=>e+n.generate(t,{sourceMapWithCode:!0}).code,"")}static getUnaryExpressionArgumentNode(e){return c.NodeGuards.isUnaryExpressionNode(e.argument)?l.getUnaryExpressionArgumentNode(e.argument):e.argument}static parentizeAst(e){return i.replace(e,{enter:l.parentizeNode}),e}static parentizeNode(e,t){return e.parentNode=null!=t?t:e,e}static cloneRecursive(e){if(null===e)return e;const t={};return Object.keys(e).forEach(r=>{if("parentNode"===r)return;const o=e[r];let n;n=null===o||o instanceof RegExp?o:Array.isArray(o)?o.map(l.cloneRecursive):"object"==typeof o?l.cloneRecursive(o):o,t[r]=n}),t}}t.NodeUtils=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o={configurable:!0,enumerable:!0};function n(e,t,r){Reflect.hasMetadata(e,r)||Reflect.defineMetadata(e,t,r)}t.initializable=function(e="initialize"){const t=Object.keys(this)[0];return(r,i)=>{const a=r[e];if(!a||"function"!=typeof a)throw new Error(`\`${e}\` method with initialization logic not `+`found. \`@${t}\` decorator requires \`${e}\` method`);return n("_initialized",!1,r),n("_initializablePropertiesSet",new Set,r),n("_wrappedMethodsSet",new Set,r),function(e,t){const r=Object.getOwnPropertyNames(e),n=[t,"constructor"];r.forEach(r=>{var i;const a=Reflect.getMetadata("_initializablePropertiesSet",e),s=Reflect.getMetadata("_wrappedMethodsSet",e);if(n.includes(r)||a.has(r)||s.has(r))return;if("function"!=typeof e[r])return;const c=null!==(i=Object.getOwnPropertyDescriptor(e,r))&&void 0!==i?i:o,d=c.value;Object.defineProperty(e,r,Object.assign(Object.assign({},c),{value(){if(!Reflect.getMetadata("_initialized",this))throw new Error(`Class should be initialized with \`${t}()\` method`);return d.apply(this,arguments)}})),s.add(r)})}(r,e),function(e,t,r){var n;const i=null!==(n=Object.getOwnPropertyDescriptor(e,t))&&void 0!==n?n:o,a=i.value;Object.defineProperty(e,t,Object.assign(Object.assign({},i),{value:function(){Reflect.defineMetadata("_initialized",!0,this);const e=a.apply(this,arguments);return this[r],e}}))}(r,e,i),function(e,t){var r;Reflect.getMetadata("_initializablePropertiesSet",e).add(t);const n=`_${t.toString()}`,i=null!==(r=Object.getOwnPropertyDescriptor(e,n))&&void 0!==r?r:o;return Object.defineProperty(e,t,Object.assign(Object.assign({},i),{get:function(){if(void 0===this[n])throw new Error(`Property \`${t.toString()}\` is not initialized! Initialize it first!`);return this[n]},set:function(e){this[n]=e}})),i}(r,i)}}},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(46)),i=r(33);class a{static programNode(e=[]){return{type:i.NodeType.Program,body:e,sourceType:"script",metadata:{ignoredNode:!1}}}static arrayExpressionNode(e=[]){return{type:i.NodeType.ArrayExpression,elements:e,metadata:{ignoredNode:!1}}}static assignmentExpressionNode(e,t,r){return{type:i.NodeType.AssignmentExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static binaryExpressionNode(e,t,r){return{type:i.NodeType.BinaryExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static blockStatementNode(e=[]){return{type:i.NodeType.BlockStatement,body:e,metadata:{ignoredNode:!1}}}static breakStatement(e){return{type:i.NodeType.BreakStatement,label:e,metadata:{ignoredNode:!1}}}static callExpressionNode(e,t=[]){return{type:i.NodeType.CallExpression,callee:e,arguments:t,metadata:{ignoredNode:!1}}}static continueStatement(e){return{type:i.NodeType.ContinueStatement,label:e,metadata:{ignoredNode:!1}}}static directiveNode(e,t){return{type:i.NodeType.ExpressionStatement,expression:e,directive:t,metadata:{ignoredNode:!1}}}static expressionStatementNode(e){return{type:i.NodeType.ExpressionStatement,expression:e,metadata:{ignoredNode:!1}}}static functionDeclarationNode(e,t,r){return{type:i.NodeType.FunctionDeclaration,id:a.identifierNode(e),params:t,body:r,generator:!1,metadata:{ignoredNode:!1}}}static functionExpressionNode(e,t){return{type:i.NodeType.FunctionExpression,params:e,body:t,generator:!1,metadata:{ignoredNode:!1}}}static ifStatementNode(e,t,r){return Object.assign(Object.assign({type:i.NodeType.IfStatement,test:e,consequent:t},r&&{alternate:r}),{metadata:{ignoredNode:!1}})}static identifierNode(e){return{type:i.NodeType.Identifier,name:e,metadata:{ignoredNode:!1}}}static importDeclarationNode(e,t){return{type:i.NodeType.ImportDeclaration,specifiers:e,source:t,metadata:{ignoredNode:!1}}}static literalNode(e,t){return t=void 0!==t?t:`'${e}'`,{type:i.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:n.Precedence.Primary},metadata:{ignoredNode:!1}}}static logicalExpressionNode(e,t,r){return{type:i.NodeType.LogicalExpression,operator:e,left:t,right:r,metadata:{ignoredNode:!1}}}static memberExpressionNode(e,t,r=!1){return{type:i.NodeType.MemberExpression,computed:r,object:e,property:t,metadata:{ignoredNode:!1}}}static methodDefinitionNode(e,t,r,o){return{type:i.NodeType.MethodDefinition,key:e,value:t,kind:r,computed:o,static:!1,metadata:{ignoredNode:!1}}}static objectExpressionNode(e){return{type:i.NodeType.ObjectExpression,properties:e,metadata:{ignoredNode:!1}}}static propertyNode(e,t,r=!1){return{type:i.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:r,metadata:{ignoredNode:!1}}}static returnStatementNode(e){return{type:i.NodeType.ReturnStatement,argument:e,metadata:{ignoredNode:!1}}}static switchStatementNode(e,t){return{type:i.NodeType.SwitchStatement,discriminant:e,cases:t,metadata:{ignoredNode:!1}}}static switchCaseNode(e,t){return{type:i.NodeType.SwitchCase,test:e,consequent:t,metadata:{ignoredNode:!1}}}static unaryExpressionNode(e,t,r=!0){return{type:i.NodeType.UnaryExpression,operator:e,argument:t,prefix:r,metadata:{ignoredNode:!1}}}static updateExpressionNode(e,t){return{type:i.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,metadata:{ignoredNode:!1}}}static variableDeclarationNode(e=[],t="var"){return{type:i.NodeType.VariableDeclaration,declarations:e,kind:t,metadata:{ignoredNode:!1}}}static variableDeclaratorNode(e,t){return{type:i.NodeType.VariableDeclarator,id:e,init:t,metadata:{ignoredNode:!1}}}static whileStatementNode(e,t){return{type:i.NodeType.WhileStatement,test:e,body:t,metadata:{ignoredNode:!1}}}}t.NodeFactory=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),N=r(113),h=r(114);let b=o=class{constructor(e,t,r,o){this.cachedNode=null,this.identifierNamesGenerator=e(o),this.customNodeFormatter=t,this.randomGenerator=r,this.options=o}getNode(){if(!this.cachedNode){const e=this.getNodeTemplate();this.cachedNode=this.customNodeFormatter.formatStructure(this.getNodeStructure(e))}return this.cachedNode}getGlobalVariableTemplate(){return this.randomGenerator.getRandomGenerator().pickone(o.globalVariableTemplateFunctions)}getNodeTemplate(){return""}};b.globalVariableTemplateFunctions=[N.GlobalVariableTemplate1(),h.GlobalVariableTemplate2()],b=o=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],b),t.AbstractCustomNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Initializing="Initializing",e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3);let f=class{constructor(e,t){this.randomGenerator=e,this.options=t}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractNodeTransformer=f},function(e,t){e.exports=require("estraverse")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static getParentNodeWithStatements(e){return n.getParentNodesWithStatementsRecursive(e,1)[0]}static getParentNodesWithStatements(e){return n.getParentNodesWithStatementsRecursive(e)}static getNextSiblingStatement(e){return n.getSiblingStatementByOffset(e,1)}static getPreviousSiblingStatement(e){return n.getSiblingStatementByOffset(e,-1)}static getRootStatementOfNode(e){if(o.NodeGuards.isProgramNode(e))throw new Error("Unable to find root statement for `Program` node");const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithStatements(t)?e:n.getRootStatementOfNode(t)}static getScopeOfNode(e){const t=e.parentNode;if(!t)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithStatements(t)?t:n.getScopeOfNode(t)}static getParentNodesWithStatementsRecursive(e,t=1/0,r=[],i=0){if(r.length>=t)return r;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return(o.NodeGuards.isProgramNode(e)||o.NodeGuards.isNodeWithLexicalScopeStatements(e,a)&&i>0)&&r.push(e),e!==a?n.getParentNodesWithStatementsRecursive(a,t,r,++i):r}static getSiblingStatementByOffset(e,t){const r=n.getScopeOfNode(e),i=o.NodeGuards.isSwitchCaseNode(r)?r.consequent:r.body,a=i.indexOf(e);return i[a+t]||null}}t.NodeStatementUtils=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static set(e,t){var r;e.metadata=Object.assign(null!==(r=e.metadata)&&void 0!==r?r:{},t)}static get(e,t){return void 0!==e.metadata?e.metadata[t]:void 0}static isIgnoredNode(e){return!0===o.get(e,"ignoredNode")}static isReplacedLiteral(e){return!0===o.get(e,"replacedLiteral")}}t.NodeMetadata=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(72),a=r(82),s=r(95),c=r(106),d=r(156),l=r(157),u=r(161),f=r(162),p=r(173),m=r(195),g=r(210),y=r(215),N=r(225),h=r(70),b=r(229),I=r(231),v=r(232),S=r(233);t.InversifyContainerFacade=class{constructor(){this.container=new o.Container}static getFactory(e){return t=>r=>t.container.getNamed(e,r)}static getCacheFactory(e){return t=>{const r=new Map;return o=>{if(r.has(o))return r.get(o);const n=t.container.getNamed(e,o);return r.set(o,n),n}}}static getConstructorFactory(e,...t){return r=>{const o=new Map,n=[];return i=>{if(t.forEach((e,t)=>{n[t]||(n[t]=r.container.get(e))}),o.has(i))return new(o.get(i))(...n);const a=r.container.getNamed(e,i);return o.set(i,a),new a(...n)}}}get(e){return this.container.get(e)}getNamed(e,t){return this.container.getNamed(e,t)}load(e,t,r){this.container.bind(n.ServiceIdentifiers.ISourceCode).toDynamicValue(()=>new v.SourceCode(e,t)).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.TInputOptions).toDynamicValue(()=>r).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ILogger).to(h.Logger).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IJavaScriptObfuscator).to(N.JavaScriptObfuscator).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.ITransformersRunner).to(S.TransformersRunner).inSingletonScope(),this.container.bind(n.ServiceIdentifiers.IObfuscatedCode).to(I.ObfuscatedCode),this.container.bind(n.ServiceIdentifiers.Factory__IObfuscatedCode).toFactory(e=>(t,r)=>{const o=e.container.get(n.ServiceIdentifiers.IObfuscatedCode);return o.initialize(t,r),o}),this.container.bind(n.ServiceIdentifiers.IObfuscationEventEmitter).to(b.ObfuscationEventEmitter).inSingletonScope(),this.container.load(i.analyzersModule),this.container.load(a.controlFlowTransformersModule),this.container.load(s.convertingTransformersModule),this.container.load(c.customNodesModule),this.container.load(d.finalizingTransformersModule),this.container.load(l.generatorsModule),this.container.load(u.nodeTransformersModule),this.container.load(f.obfuscatingTransformersModule),this.container.load(p.optionsModule),this.container.load(m.preparingTransformersModule),this.container.load(g.storagesModule),this.container.load(y.utilsModule)}unload(){this.container.unbindAll()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static append(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e),...t])}static appendToOptimalBlockScope(e,t,r,o=0){const i=e.length?n.getOptimalBlockScope(e,o):t;n.prepend(i,r)}static getOptimalBlockScope(e,t,r=1/0){const o=e[t];if(r<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return r>1&&o.callsGraph.length?n.getOptimalBlockScope(o.callsGraph,0,--r):o.callee}static insertBefore(e,t,r){const o=n.getScopeStatements(e).indexOf(r);n.insertAtIndex(e,t,o)}static insertAfter(e,t,r){const o=n.getScopeStatements(e).indexOf(r);n.insertAtIndex(e,t,o+1)}static insertAtIndex(e,t,r){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...n.getScopeStatements(e).slice(0,r),...t,...n.getScopeStatements(e).slice(r)])}static prepend(e,t){t=n.parentizeScopeStatementsBeforeAppend(e,t),n.setScopeStatements(e,[...t,...n.getScopeStatements(e)])}static getScopeStatements(e){return o.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}static parentizeScopeStatementsBeforeAppend(e,t){return t.forEach(t=>{t.parentNode=e}),t}static setScopeStatements(e,t){o.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}t.NodeAppender=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.ObfuscationTarget=o.MakeEnum({Browser:"browser",BrowserNoEval:"browser-no-eval",Node:"node"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MetadataTransformer="MetadataTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.ScopeIdentifiersTransformer="ScopeIdentifiersTransformer",e.SplitStringTransformer="SplitStringTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariablePreserveTransformer="VariablePreserveTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.StringArrayEncoding=o.MakeEnum({Base64:"base64",Rc4:"rc4"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(69);const o=r(1),n=r(16);class i{static obfuscate(e,t={}){const r=new n.InversifyContainerFacade;r.load(e,"",t);const i=r.get(o.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return r.unload(),i}}t.JavaScriptObfuscator=i,i.version=null!=="0.24.6"?"0.24.6":"unknown"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(5),f=r(2),p=r(3);let m=class{constructor(e,t,r){this.identifierNamesGenerator=e(r),this.randomGenerator=t,this.options=r}getAppendEvent(){return this.appendEvent}getCustomNodes(){return this.customNodes}appendCustomNodeIfExist(e,t){const r=this.customNodes.get(e);r&&t(r)}getRandomCallsGraphIndex(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}};m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==u.TIdentifierNamesGeneratorFactory&&u.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],m),t.AbstractCustomNodeGroup=m},function(e,t){e.exports=require("@gradecam/tsenum")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static extractDomainFrom(e){let t;return t=e.includes("://")||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0],t}}t.Utils=o,o.hexadecimalPrefix="0x"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.IdentifierNamesGenerator=o.MakeEnum({DictionaryIdentifierNamesGenerator:"dictionary",HexadecimalIdentifierNamesGenerator:"hexadecimal",MangledIdentifierNamesGenerator:"mangled"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(28);t.SourceMapMode=o.MakeEnum({Inline:"inline",Separate:"separate"})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExpressionStatement="ExpressionStatement",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(31),n=r(20),i=r(32);t.NO_ADDITIONAL_NODES_PRESET=Object.freeze({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!1,seed:0,selfDefending:!1,shuffleStringArray:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:0,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NumberUtils=class{static toHex(e){return e.toString(16)}static isCeil(e){return e%1==0}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(2);let l=class{constructor(e){this.options=e}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IOptions&&d.IOptions)?o:Object])],l),t.AbstractObfuscatingReplacer=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(31),n=r(20),i=r(32);t.DEFAULT_PRESET=Object.freeze({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",identifiersDictionary:[],inputFileName:"",inputFilePath:"",log:!1,renameGlobals:!1,reservedNames:[],reservedStrings:[],rotateStringArray:!0,seed:0,selfDefending:!1,shuffleStringArray:!0,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,splitStrings:!1,splitStringsChunkLength:10,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:n.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Dot=".",e.Comma=","}(t.StringSeparator||(t.StringSeparator={}))},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{};n=o([r(0).injectable()],n),t.AbstractCalleeDataExtractor=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecmaVersion=11},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);t.NodeLiteralUtils=class{static isProhibitedLiteralNode(e,t){return!(!o.NodeGuards.isPropertyNode(t)||t.computed||t.key!==e)||!!o.NodeGuards.isImportDeclarationNode(t)}}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3);let g=o=class{constructor(e,t,r){this.replacerDataByControlFlowStorageId=new Map,this.controlFlowCustomNodeFactory=e,this.randomGenerator=t,this.options=r}static getStorageKeysByIdForCurrentStorage(e,t){let r;return r=e.has(t)?e.get(t):new Map,r}insertCustomNodeToControlFlowStorage(e,t,r,n){const i=t.getStorageId(),a=o.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,i),s=a.get(r);if(this.randomGenerator.getMathRandom(){const r=this.randomGenerator.getRandomString(e);return t.getStorage().has(r)?c(e):r},d=c(5);return a.set(r,[d]),this.replacerDataByControlFlowStorageId.set(i,a),t.set(d,e),d}};g=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],g),t.AbstractControlFlowReplacer=g},function(e,t){e.exports=require("escodegen")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n const that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3);let f=class{constructor(e,t){this.preservedNamesSet=new Set,this.randomGenerator=e,this.options=t}preserveName(e){this.preservedNamesSet.add(e)}isValidIdentifierName(e){return this.notReservedName(e)&&!this.preservedNamesSet.has(e)}notReservedName(e){return!this.options.reservedNames.length||!this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};f=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],f),t.AbstractIdentifierNamesGenerator=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(7);let m=class{constructor(e,t){this.randomGenerator=e,this.options=t}initialize(){this.storage=new Map,this.storageId=this.randomGenerator.getRandomString(6)}get(e){return this.storage.get(e)}getOrThrow(e){const t=this.get(e);if(!t)throw new Error(`No value found in map storage with key \`${e}\``);return t}getKeyOf(e){for(const[t,r]of this.storage)if(e===r)return t;return null}getLength(){return this.storage.size}getStorage(){return this.storage}getStorageId(){return this.storageId}has(e){return this.storage.has(e)}mergeWith(e,t=!1){this.storage=new Map([...this.storage,...e.getStorage()]),t&&(this.storageId=e.getStorageId())}set(e,t){this.storage.set(e,t)}};a([p.initializable(),s("design:type",String)],m.prototype,"storageId",void 0),a([p.initializable(),s("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],m.prototype,"storage",void 0),a([d.postConstruct(),s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],m.prototype,"initialize",null),m=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MapStorage=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(17),f=r(2),p=r(3),m=r(18),g=r(45),y=r(4);let N=class extends g.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}getControlFlowStorageCallNode(e,t,r,o){const n=this.controlFlowCustomNodeFactory(m.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);n.initialize(e,t,r,o);const i=n.getNode()[0];if(!i||!y.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};N=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==u.TControlFlowCustomNodeFactory&&u.TControlFlowCustomNodeFactory)?o:Object,"function"==typeof(n=void 0!==p.IRandomGenerator&&p.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==f.IOptions&&f.IOptions)?i:Object])],N),t.ExpressionWithOperatorControlFlowReplacer=N},function(e,t,r){"use strict";var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(r(85)),a=n(r(86)),s=n(r(56));class c{static parse(e,t){const r=c.sourceTypes.length;for(let o=0;o"),u=`...${i.substring(s,d).replace(/^\s+/,"")}...`;throw new Error(`ERROR in ${a}line ${r.line}: ${t}\n${l} ${u}`)}}t.ASTParserFacade=c,c.colorError=s.default.red,c.nearestSymbolsCount=15,c.sourceTypes=["script","module"]},function(e,t){e.exports=require("chalk")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BasePropertiesExtractor="BasePropertiesExtractor",e.ObjectExpressionToVariableDeclarationExtractor="ObjectExpressionToVariableDeclarationExtractor"}(t.ObjectExpressionExtractor||(t.ObjectExpressionExtractor={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ObjectExpressionVariableDeclarationHostNode="ObjectExpressionVariableDeclarationHostNode"}(t.ObjectExpressionKeysTransformerCustomNode||(t.ObjectExpressionKeysTransformerCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t){e.exports=require("class-validator")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListObfuscatingGuard="BlackListObfuscatingGuard",e.ConditionalCommentObfuscatingGuard="ConditionalCommentObfuscatingGuard",e.ReservedStringObfuscatingGuard="ReservedStringObfuscatingGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(4);let s=o=class{constructor(){this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}static isConditionalComment(e){return o.obfuscationEnableCommentRegExp.test(e.value)||o.obfuscationDisableCommentRegExp.test(e.value)}check(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!a.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;const t=e.leadingComments,r=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),r&&(this.obfuscationAllowedForNextNode=this.checkComments(r)),this.obfuscationAllowedForCurrentNode}checkComments(e){const t=e.length;let r=this.obfuscationAllowedForCurrentNode;for(let n=0;n=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(218)),m=r(219),g=r(2),y=r(220),N=r(7);let h=o=class{constructor(e,t){this.sourceCode=e,this.options=t}initialize(){this.randomGenerator=new m.Chance(this.getRawSeed())}getMathRandom(){return this.getRandomInteger(0,99999)/1e5}getRandomGenerator(){return this.randomGenerator}getRandomInteger(e,t){return this.getRandomGenerator().integer({min:e,max:t})}getRandomString(e,t=o.randomGeneratorPool){return this.getRandomGenerator().string({length:e,pool:t})}getInputSeed(){return this.options.seed.toString()}getRawSeed(){const e=this.getInputSeed();return`${e}`.split("|").length>1?e:`${e}|${p.default(this.sourceCode.getSourceCode())}`}};h.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s([N.initializable(),c("design:type","function"==typeof(n=void 0!==m.Chance&&m.Chance.Chance)?n:Object)],h.prototype,"randomGenerator",void 0),s([u.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],h.prototype,"initialize",null),h=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.ISourceCode)),d(1,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(i=void 0!==y.ISourceCode&&y.ISourceCode)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],h),t.RandomGenerator=h},function(e,t){e.exports=require("reflect-metadata")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(56)),f=r(2),p=r(71);let m=o=class{constructor(e){this.options=e}static log(e,t,r,o){const n=e(`\n${t} ${r}`);console.log(n,null!=o?o:"")}info(e,t){this.options.log&&o.log(o.colorInfo,p.LoggingPrefix.Base,e,t)}success(e,t){this.options.log&&o.log(o.colorSuccess,p.LoggingPrefix.Base,e,t)}warn(e,t){this.options.log&&o.log(o.colorWarn,p.LoggingPrefix.Base,e,t)}};m.colorInfo=u.default.cyan,m.colorSuccess=u.default.green,m.colorWarn=u.default.yellow,m=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IOptions&&f.IOptions)?n:Object])],m),t.Logger=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(52),s=r(73),c=r(75),d=r(76),l=r(77),u=r(78),f=r(79),p=r(81);t.analyzersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICallsGraphAnalyzer).to(s.CallsGraphAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer).to(u.PrevailingKindOfVariablesAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IScopeAnalyzer).to(f.ScopeAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.IStringArrayStorageAnalyzer).to(p.StringArrayStorageAnalyzer).inSingletonScope(),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(d.FunctionExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.ICalleeDataExtractor).to(l.ObjectExpressionCalleeDataExtractor).whenTargetNamed(a.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(i.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(74),p=r(52),m=r(4),g=r(14);let y=o=class{constructor(e){this.calleeDataExtractorFactory=e}static getLimitIndex(e){const t=e-1,r=o.limitThresholdActivationLength-1;let n=t;return t>r&&(n=Math.round(r+t*o.limitThreshold),n>t&&(n=t)),n}analyze(e){return this.analyzeRecursive(e.body)}analyzeRecursive(e){const t=o.getLimitIndex(e.length),r=[],n=e.length;for(let o=0;ot);o++){const t=e[o];u.traverse(t,{enter:o=>{if(m.NodeGuards.isCallExpressionNode(o))return t.parentNode!==g.NodeStatementUtils.getParentNodeWithStatements(o)?u.VisitorOption.Skip:void this.analyzeCallExpressionNode(r,e,o)}})}return r}analyzeCallExpressionNode(e,t,r){o.calleeDataExtractorsList.forEach(o=>{const n=this.calleeDataExtractorFactory(o).extract(t,r.callee);n&&e.push(Object.assign(Object.assign({},n),{callsGraph:this.analyzeRecursive(n.callee.body)}))})}};y.calleeDataExtractorsList=[p.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,p.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,p.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],y.limitThresholdActivationLength=25,y.limitThreshold=.002,y=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__ICalleeDataExtractor)),a("design:paramtypes",["function"==typeof(n=void 0!==f.TCalleeDataExtractorFactory&&f.TCalleeDataExtractorFactory)?n:Object])],y),t.CallsGraphAnalyzer=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(13)),s=r(42),c=r(4),d=r(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){if(!c.NodeGuards.isIdentifierNode(t))return null;const r=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name);return r?{callee:r,name:t.name}:null}getCalleeBlockStatement(e,t){let r=null;return a.traverse(e,{enter:e=>{if(c.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return r=e.body,a.VisitorOption.Break}}),r}};l=o([i.injectable()],l),t.FunctionDeclarationCalleeDataExtractor=l},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(13)),s=r(42),c=r(4),d=r(14);let l=class extends s.AbstractCalleeDataExtractor{extract(e,t){var r;let o=null;return c.NodeGuards.isIdentifierNode(t)&&(o=this.getCalleeBlockStatement(d.NodeStatementUtils.getParentNodeWithStatements(e[0]),t.name)),c.NodeGuards.isFunctionExpressionNode(t)&&(o=t.body),o?{callee:o,name:null!==(r=t.name)&&void 0!==r?r:null}:null}getCalleeBlockStatement(e,t){let r=null;return a.traverse(e,{enter:(e,o)=>{if(c.NodeGuards.isFunctionExpressionNode(e)&&o&&c.NodeGuards.isVariableDeclaratorNode(o)&&c.NodeGuards.isIdentifierNode(o.id)&&o.id.name===t)return r=e.body,a.VisitorOption.Break}}),r}};l=o([i.injectable()],l),t.FunctionExpressionCalleeDataExtractor=l},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=i(r(13)),c=r(42),d=r(4),l=r(14);let u=o=class extends c.AbstractCalleeDataExtractor{static isValidTargetPropertyNode(e,t){if(!e.key)return!1;const r=d.NodeGuards.isIdentifierNode(e.key)&&e.key.name===t,o=d.NodeGuards.isLiteralNode(e.key)&&Boolean(e.key.value)&&e.key.value===t;return r||o}extract(e,t){if(!d.NodeGuards.isMemberExpressionNode(t))return null;const r=this.createObjectMembersCallsChain([],t);if(!r.length)return null;const o=r[r.length-1],n=this.getCalleeBlockStatement(l.NodeStatementUtils.getParentNodeWithStatements(e[0]),r);return n?{callee:n,name:o}:null}createObjectMembersCallsChain(e,t){if(d.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!d.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return d.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(d.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}getCalleeBlockStatement(e,t){const r=t.shift();if(!r)return null;let o=null;return s.traverse(e,{enter:e=>{if(d.NodeGuards.isVariableDeclaratorNode(e)&&d.NodeGuards.isIdentifierNode(e.id)&&e.init&&d.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===r)return o=this.findCalleeBlockStatement(e.init.properties,t),s.VisitorOption.Break}}),o}findCalleeBlockStatement(e,t){const r=t.shift();if(!r)return null;for(const n of e)if(o.isValidTargetPropertyNode(n,r)){if(d.NodeGuards.isObjectExpressionNode(n.value))return this.findCalleeBlockStatement(n.value.properties,t);if(d.NodeGuards.isFunctionExpressionNode(n.value))return n.value.body}return null}};u=o=n([a.injectable()],u),t.ObjectExpressionCalleeDataExtractor=u},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(34),p=r(4);let m=o=class{constructor(e){this.prevailingKindOfVariables=o.defaultKindOfVariables,this.arrayUtils=e}analyze(e){var t;const r=[];u.traverse(e,{enter:e=>{p.NodeGuards.isVariableDeclarationNode(e)&&r.push(e.kind)}}),this.prevailingKindOfVariables=null!==(t=this.arrayUtils.findMostOccurringElement(r))&&void 0!==t?t:o.defaultKindOfVariables}getPrevailingKind(){return this.prevailingKindOfVariables}};m.defaultKindOfVariables="var",m=o=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.IArrayUtils)),a("design:paramtypes",["function"==typeof(n=void 0!==f.IArrayUtils&&f.IArrayUtils)?n:Object])],m),t.PrevailingKindOfVariablesAnalyzer=m},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=i(r(80)),c=i(r(13)),d=r(43),l=r(4);let u=o=class{constructor(){this.scopeManager=null}static attachMissingRanges(e){c.replace(e,{enter:e=>(e.range||(e.range=[o.emptyRangeValue,o.emptyRangeValue]),e)})}static isRootNode(e){return l.NodeGuards.isProgramNode(e)||e.parentNode===e}analyze(e){const t=o.sourceTypes.length;o.attachMissingRanges(e);for(let r=0;r{if("class"===e.type&&e.upper){if(!e.variables.length)return;const t=e.variables[0],r=e.upper.variables.find(e=>t.defs.some(e=>"ClassName"===e.type)&&e.name===t.name);null==r||r.references.push(...e.variables[0].references)}});for(const t of e.childScopes)this.sanitizeScopes(t)}};u.eslintScopeOptions={ecmaVersion:d.ecmaVersion,optimistic:!0},u.sourceTypes=["script","module"],u.emptyRangeValue=0,u=o=n([a.injectable()],u),t.ScopeAnalyzer=u},function(e,t){e.exports=require("eslint-scope")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(13)),m=r(2),g=r(3),y=r(35),N=r(4),h=r(15),b=r(44);let I=o=class{constructor(e,t,r){this.stringArrayStorageData=new Map,this.stringArrayStorage=e,this.randomGenerator=t,this.options=r}analyze(e){this.options.stringArray&&p.traverse(e,{enter:(e,t)=>{if(t)return h.NodeMetadata.isIgnoredNode(e)?p.VisitorOption.Skip:void(N.NodeGuards.isLiteralNode(e)&&this.analyzeLiteralNode(e,t))}})}getItemDataForLiteralNode(e){return this.stringArrayStorageData.get(e)}analyzeLiteralNode(e,t){"string"==typeof e.value&&(b.NodeLiteralUtils.isProhibitedLiteralNode(e,t)||this.shouldAddValueToStringArray(e.value)&&this.stringArrayStorageData.set(e,this.stringArrayStorage.getOrThrow(e.value)))}shouldAddValueToStringArray(e){return e.length>=o.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}};I.minimumLengthForStringArray=3,I=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.IStringArrayStorage)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==y.IStringArrayStorage&&y.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==m.IOptions&&m.IOptions)?a:Object])],I),t.StringArrayStorageAnalyzer=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(53),s=r(21),c=r(83),d=r(84),l=r(87),u=r(88),f=r(90),p=r(93),m=r(94);t.controlFlowTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(l.CallExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(i.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(a.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(i.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(54);let N=o=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.BinaryExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}};N.usingExistingIdentifierChance=.5,N=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.BinaryExpressionControlFlowReplacer=N},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(17),y=r(34),N=r(2),h=r(3),b=r(18),I=r(11),v=r(12),S=r(4),O=r(6);let j=o=class extends v.AbstractNodeTransformer{constructor(e,t,r,o){super(r,o),this.controlFlowCustomNodeFactory=e,this.arrayUtils=t}static isProhibitedStatementNode(e){const t=S.NodeGuards.isBreakStatementNode(e)||S.NodeGuards.isContinueStatementNode(e),r=S.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),o=S.NodeGuards.isClassDeclarationNode(e);return S.NodeGuards.isFunctionDeclarationNode(e)||t||r||o}static canTransformBlockStatementNode(e){let t=!0;return m.traverse(e,{enter:e=>{if(S.NodeGuards.isWhileStatementNode(e))return m.VisitorOption.Skip;o.isProhibitedStatementNode(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}getVisitor(e){switch(e){case I.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&S.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!o.canTransformBlockStatementNode(e))return e;const r=e.body,n=this.arrayUtils.createWithRange(r.length),i=this.arrayUtils.shuffle(n),a=n.map(e=>i.indexOf(e)),s=this.controlFlowCustomNodeFactory(b.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);s.initialize(r,i,a);const c=s.getNode()[0];return O.NodeUtils.parentizeNode(c,t),c}};j=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IControlFlowCustomNode)),l(1,f.inject(p.ServiceIdentifiers.IArrayUtils)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TControlFlowCustomNodeFactory&&g.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==h.IRandomGenerator&&h.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==N.IOptions&&N.IOptions)?s:Object])],j),t.BlockStatementControlFlowTransformer=j},function(e,t){e.exports=require("acorn")},function(e,t){e.exports=require("acorn-import-meta")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(45),N=r(4);let h=o=class extends y.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){const n=e.callee;if(!N.NodeGuards.isIdentifierNode(n))return e;const i=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionFunctionNode),s=e.arguments;a.initialize(s);const c=this.insertCustomNodeToControlFlowStorage(a,r,i,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),c,n,s)}getControlFlowStorageCallNode(e,t,r,o){const n=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);n.initialize(e,t,r,o);const i=n.getNode()[0];if(!i||!N.NodeGuards.isExpressionStatementNode(i))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return i.expression}};h.usingExistingIdentifierChance=.5,h=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.CallExpressionControlFlowReplacer=h},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(89),y=r(2),N=r(3),h=r(57),b=r(58),I=r(21),v=r(33),S=r(11),O=r(12),j=r(8),_=r(4),C=r(14),R=r(6);let F=o=class extends O.AbstractNodeTransformer{constructor(e,t,r,o){super(r,o),this.deadCodeInjectionRootAstHostNodeSet=new Set,this.collectedBlockStatements=[],this.collectedBlockStatementsTotalLength=0,this.deadCodeInjectionCustomNodeFactory=e,this.transformersRunner=t}static isProhibitedNodeInsideCollectedBlockStatement(e){return _.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e)||_.NodeGuards.isAwaitExpressionNode(e)||_.NodeGuards.isSuperNode(e)}static isScopeHoistingFunctionDeclaration(e){if(!_.NodeGuards.isFunctionDeclarationNode(e))return!1;const t=C.NodeStatementUtils.getScopeOfNode(e),r=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,o=r.indexOf(e);if(0===o)return!1;const n=r.slice(0,o),i=j.NodeFactory.blockStatementNode(n),a=e.id.name;let s=!1;return m.traverse(i,{enter:e=>{if(_.NodeGuards.isIdentifierNode(e)&&e.name===a)return s=!0,m.VisitorOption.Break}}),s}static isValidCollectedBlockStatementNode(e){if(!e.body.length)return!1;let t=0,r=!0;return m.traverse(e,{enter:e=>{if(_.NodeGuards.isBlockStatementNode(e)&&t++,t>o.maxNestedBlockStatementsCount||o.isProhibitedNodeInsideCollectedBlockStatement(e)||o.isScopeHoistingFunctionDeclaration(e))return r=!1,m.VisitorOption.Break}}),r}static isValidWrappedBlockStatementNode(e){if(!e.body.length)return!1;let t=!0;if(m.traverse(e,{enter:e=>{if(o.isScopeHoistingFunctionDeclaration(e))return t=!1,m.VisitorOption.Break}}),!t)return!1;return C.NodeStatementUtils.getParentNodeWithStatements(e).type!==v.NodeType.Program}getVisitor(e){switch(e){case S.TransformationStage.DeadCodeInjection:return{enter:(e,t)=>{if(t&&_.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),e},leave:(e,t)=>{if(t&&_.NodeGuards.isBlockStatementNode(e))return this.transformNode(e,t)}};case S.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:(e,t)=>{if(t&&this.isDeadCodeInjectionRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}analyzeNode(e,t){m.traverse(e,{enter:e=>{if(!_.NodeGuards.isBlockStatementNode(e))return;const t=R.NodeUtils.clone(e);if(!o.isValidCollectedBlockStatementNode(t))return;const r=this.makeClonedBlockStatementNodeUnique(t);this.collectedBlockStatements.push(r)}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}transformNode(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!o.isValidWrappedBlockStatementNode(e))return e;const r=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,r),i=this.collectedBlockStatements.splice(n,1)[0];return i===e?e:this.replaceBlockStatementNode(e,i,t)}restoreNode(e,t){const r=e.body[0];if(!_.NodeGuards.isFunctionDeclarationNode(r))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return r.body}isDeadCodeInjectionRootAstHostNode(e){return _.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}makeClonedBlockStatementNodeUnique(e){const t=j.NodeFactory.functionExpressionNode([],e);return R.NodeUtils.parentizeNode(t,t),R.NodeUtils.parentizeNode(e,t),this.transformersRunner.transform(t,o.transformersToRenameBlockScopeIdentifiers,S.TransformationStage.Obfuscating).body}replaceBlockStatementNode(e,t,r){const n=j.NodeFactory.blockStatementNode([j.NodeFactory.functionDeclarationNode(o.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);const i=this.deadCodeInjectionCustomNodeFactory(b.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);i.initialize(e,n);const a=i.getNode()[0];return R.NodeUtils.parentizeNode(a,r),a}};F.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",F.maxNestedBlockStatementsCount=4,F.minCollectedBlockStatementsCount=5,F.transformersToRenameBlockScopeIdentifiers=[I.NodeTransformer.LabeledStatementTransformer,I.NodeTransformer.ScopeIdentifiersTransformer],F=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),l(1,f.inject(p.ServiceIdentifiers.ITransformersRunner)),l(2,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(3,f.inject(p.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TDeadNodeInjectionCustomNodeFactory&&g.TDeadNodeInjectionCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==h.ITransformersRunner&&h.ITransformersRunner)?i:Object,"function"==typeof(a=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==y.IOptions&&y.IOptions)?s:Object])],F),t.DeadCodeInjectionTransformer=F},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=f(r(13)),y=r(17),N=r(91),h=r(92),b=r(2),I=r(3),v=r(18),S=r(53),O=r(33),j=r(11),_=r(12),C=r(19),R=r(4),F=r(15),T=r(14),x=r(6);let G=o=class extends _.AbstractNodeTransformer{constructor(e,t,r,o,n){super(o,n),this.controlFlowData=new Map,this.visitedFunctionNodes=new Set,this.hostNodesWithControlFlowNode=new Set,this.controlFlowStorageFactory=e,this.controlFlowReplacerFactory=t,this.controlFlowCustomNodeFactory=r}getVisitor(e){switch(e){case j.TransformationStage.ControlFlowFlattening:return{leave:(e,t)=>{if(t&&(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(this.visitedFunctionNodes.add(e),!R.NodeGuards.isBlockStatementNode(e.body))return e;const r=this.getHostNode(e.body),o=this.getControlFlowStorage(r);if(this.controlFlowData.set(r,o),this.transformFunctionBody(e.body,o),!o.getLength())return e;const n=this.controlFlowCustomNodeFactory(v.ControlFlowCustomNode.ControlFlowStorageNode);return n.initialize(o),C.NodeAppender.prepend(r,n.getNode()),this.hostNodesWithControlFlowNode.add(r),x.NodeUtils.parentizeAst(e),e}getControlFlowStorage(e){const t=this.controlFlowStorageFactory();if(this.controlFlowData.has(e)){this.hostNodesWithControlFlowNode.has(e)&&(R.NodeGuards.isSwitchCaseNode(e)?e.consequent.shift():e.body.shift());const r=this.controlFlowData.get(e);t.mergeWith(r,!0)}return t}getHostNode(e){const t=T.NodeStatementUtils.getParentNodesWithStatements(e);return 1===t.length?e:(t.pop(),t.length>o.hostNodeSearchMinDepth&&t.splice(0,o.hostNodeSearchMinDepth),t.length>o.hostNodeSearchMaxDepth&&(t.length=o.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}isVisitedFunctionNode(e){return(R.NodeGuards.isFunctionDeclarationNode(e)||R.NodeGuards.isFunctionExpressionNode(e)||R.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}transformFunctionBody(e,t){g.replace(e,{enter:(e,r)=>{if(F.NodeMetadata.isIgnoredNode(e))return g.VisitorOption.Skip;if(this.isVisitedFunctionNode(e)||!r)return g.VisitorOption.Skip;if(!o.controlFlowReplacersMap.has(e.type))return e;if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold)return e;const n=o.controlFlowReplacersMap.get(e.type);return void 0===n?e:Object.assign(Object.assign({},this.controlFlowReplacerFactory(n).replace(e,r,t)),{parentNode:r})}})}};G.controlFlowReplacersMap=new Map([[O.NodeType.BinaryExpression,S.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[O.NodeType.CallExpression,S.ControlFlowReplacer.CallExpressionControlFlowReplacer],[O.NodeType.LogicalExpression,S.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[O.NodeType.Literal,S.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),G.hostNodeSearchMinDepth=0,G.hostNodeSearchMaxDepth=2,G=o=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),u(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),u(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==h.TControlFlowStorageFactory&&h.TControlFlowStorageFactory)?n:Object,"function"==typeof(i=void 0!==N.TControlFlowReplacerFactory&&N.TControlFlowReplacerFactory)?i:Object,"function"==typeof(a=void 0!==y.TControlFlowCustomNodeFactory&&y.TControlFlowCustomNodeFactory)?a:Object,"function"==typeof(s=void 0!==I.IRandomGenerator&&I.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==b.IOptions&&b.IOptions)?c:Object])],G),t.FunctionControlFlowTransformer=G},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(54),N=r(4),h=r(6);let b=o=class extends y.ExpressionWithOperatorControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){if(this.checkForProhibitedExpressions(e.left,e.right))return e;const n=e.operator,i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.LogicalExpressionFunctionNode);i.initialize(n);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}checkForProhibitedExpressions(e,t){return[e,t].some(e=>{let t;return t=N.NodeGuards.isUnaryExpressionNode(e)?h.NodeUtils.getUnaryExpressionArgumentNode(e):e,!(N.NodeGuards.isLiteralNode(t)||N.NodeGuards.isIdentifierNode(t)||N.NodeGuards.isObjectExpressionNode(t)||N.NodeGuards.isExpressionStatementNode(t))})}};b.usingExistingIdentifierChance=.5,b=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionControlFlowReplacer=b},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(17),p=r(2),m=r(3),g=r(18),y=r(45),N=r(4);let h=o=class extends y.AbstractControlFlowReplacer{constructor(e,t,r){super(e,t,r)}replace(e,t,r){if(N.NodeGuards.isPropertyNode(t)&&t.key===e)return e;if("string"!=typeof e.value||e.value.length<3)return e;const n=String(e.value),i=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralNode);i.initialize(e.value);const a=this.insertCustomNodeToControlFlowStorage(i,r,n,o.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a)}getControlFlowStorageCallNode(e,t){const r=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode);r.initialize(e,t);const o=r.getNode()[0];if(!o||!N.NodeGuards.isExpressionStatementNode(o))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return o.expression}};h.usingExistingIdentifierChance=1,h=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IControlFlowCustomNode)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TControlFlowCustomNodeFactory&&f.TControlFlowCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.StringLiteralControlFlowReplacer=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(16),i=r(1),a=r(21),s=r(59),c=r(96),d=r(98),l=r(99),u=r(100),f=r(102),p=r(103),m=r(104),g=r(105);t.convertingTransformersModule=new o.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.MemberExpressionTransformer).whenTargetNamed(a.NodeTransformer.MemberExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(l.MethodDefinitionTransformer).whenTargetNamed(a.NodeTransformer.MethodDefinitionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.ObjectExpressionKeysTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionKeysTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.ObjectExpressionTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.SplitStringTransformer).whenTargetNamed(a.NodeTransformer.SplitStringTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.TemplateLiteralTransformer).whenTargetNamed(a.NodeTransformer.TemplateLiteralTransformer),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(c.ObjectExpressionToVariableDeclarationExtractor).whenTargetNamed(s.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor),e(i.ServiceIdentifiers.IObjectExpressionExtractor).to(g.BasePropertiesExtractor).whenTargetNamed(s.ObjectExpressionExtractor.BasePropertiesExtractor),e(i.ServiceIdentifiers.Factory__IObjectExpressionExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObjectExpressionExtractor))})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(97),l=r(60),u=r(19),f=r(4),p=r(14),m=r(6);let g=class{constructor(e){this.objectExpressionKeysTransformerCustomNodeFactory=e}extract(e,t){return this.transformObjectExpressionToVariableDeclaration(e,t)}transformObjectExpressionToVariableDeclaration(e,t){const r=e.properties,o=this.getObjectExpressionHostNode(r),n=this.getObjectExpressionIdentifierNode(o),i=this.getObjectExpressionNode(o),a=[o],s=p.NodeStatementUtils.getScopeOfNode(t);return u.NodeAppender.insertBefore(s,a,t),m.NodeUtils.parentizeAst(o),m.NodeUtils.parentizeNode(o,s),{nodeToReplace:n,objectExpressionHostStatement:o,objectExpressionNode:i}}getObjectExpressionHostNode(e){const t=this.objectExpressionKeysTransformerCustomNodeFactory(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode);t.initialize(e);const r=t.getNode()[0];if(!r||!f.NodeGuards.isVariableDeclarationNode(r))throw new Error("`objectExpressionHostCustomNode.getNode()[0]` should returns array with `VariableDeclaration` node");return r}getObjectExpressionIdentifierNode(e){const t=e.declarations[0].id;if(!f.NodeGuards.isIdentifierNode(t))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `Identifier` id property");return t}getObjectExpressionNode(e){var t;const r=null!==(t=e.declarations[0].init)&&void 0!==t?t:null;if(!r||!f.NodeGuards.isObjectExpressionNode(r))throw new Error("`objectExpressionHostNode` should contain `VariableDeclarator` node with `ObjectExpression` init property");return r}};g=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode)),i("design:paramtypes",["function"==typeof(o=void 0!==d.TObjectExpressionKeysTransformerCustomNodeFactory&&d.TObjectExpressionKeysTransformerCustomNodeFactory)?o:Object])],g),t.ObjectExpressionToVariableDeclarationExtractor=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(8),g=r(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isMemberExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(g.NodeGuards.isIdentifierNode(e.property)){if(e.computed)return e;e.computed=!0,e.property=m.NodeFactory.literalNode(e.property.name)}return e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MemberExpressionTransformer=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(11),m=r(12),g=r(8),y=r(4);let N=o=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&y.NodeGuards.isMethodDefinitionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return y.NodeGuards.isIdentifierNode(e.key)?this.replaceIdentifierKey(e,e.key):y.NodeGuards.isLiteralNode(e.key)?this.replaceLiteralKey(e,e.key):e}replaceIdentifierKey(e,t){return o.ignoredNames.includes(t.name)||e.computed||(e.computed=!0,e.key=g.NodeFactory.literalNode(t.name)),e}replaceLiteralKey(e,t){return"string"!=typeof t.value||o.ignoredNames.includes(t.value)||e.computed||(e.computed=!0),e}};N.ignoredNames=["constructor"],N=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],N),t.MethodDefinitionTransformer=N},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=l(r(13)),m=r(101),g=r(2),y=r(3),N=r(11),h=r(12),b=r(4),I=r(14),v=r(59);let S=o=class extends h.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.objectExpressionExtractorFactory=e}static isProhibitedHostStatement(e,t){return o.isReferencedIdentifierName(e,t)}static isReferencedIdentifierName(e,t){const r=[];let o=!1,n=!1;return p.traverse(t,{enter:t=>{t===e&&(n=!0),b.NodeGuards.isIdentifierNode(t)&&(n?r.includes(t.name)&&(o=!0):r.push(t.name))},leave:t=>{if(t===e)return n=!1,p.VisitorOption.Break}}),o}getVisitor(e){if(!this.options.transformObjectKeys)return null;switch(e){case N.TransformationStage.Converting:return{leave:(e,t)=>{if(t&&b.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){if(!e.properties.length)return e;const r=I.NodeStatementUtils.getRootStatementOfNode(e);return o.isProhibitedHostStatement(e,r)?e:this.applyObjectExpressionKeysExtractorsRecursive(o.objectExpressionExtractorNames,e,r)}applyObjectExpressionKeysExtractorsRecursive(e,t,r){const o=[...e],n=o.shift();if(!n)return t;const{nodeToReplace:i,objectExpressionHostStatement:a,objectExpressionNode:s}=this.objectExpressionExtractorFactory(n).extract(t,r);return this.applyObjectExpressionKeysExtractorsRecursive(o,s,a),i}};S.objectExpressionExtractorNames=[v.ObjectExpressionExtractor.ObjectExpressionToVariableDeclarationExtractor,v.ObjectExpressionExtractor.BasePropertiesExtractor],S=o=s([u.injectable(),d(0,u.inject(f.ServiceIdentifiers.Factory__IObjectExpressionExtractor)),d(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),d(2,u.inject(f.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==m.TObjectExpressionExtractorFactory&&m.TObjectExpressionExtractorFactory)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object])],S),t.ObjectExpressionKeysTransformer=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(8),g=r(4);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&g.NodeGuards.isObjectExpressionNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return e.properties.forEach(e=>{e.key&&(e.computed?this.transformComputedProperty(e):this.transformBaseProperty(e))}),e}transformComputedProperty(e){g.NodeGuards.isLiteralNode(e.key)&&"string"==typeof e.key.value&&(e.key=m.NodeFactory.literalNode(e.key.value))}transformBaseProperty(e){e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=m.NodeFactory.literalNode(e.key.name))}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.ObjectExpressionTransformer=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(2),m=r(3),g=r(21),y=r(11),N=r(12),h=r(8),b=r(4),I=r(44),v=r(6);let S=o=class extends N.AbstractNodeTransformer{constructor(e,t){super(e,t),this.runAfter=[g.NodeTransformer.ObjectExpressionKeysTransformer,g.NodeTransformer.TemplateLiteralTransformer]}static chunkString(e,t){const r=Math.ceil(e.length/t),o=[];let n=0;for(let i=0;i{if(this.options.splitStrings)return t&&b.NodeGuards.isLiteralNode(e)?this.transformNode(e,t):void 0}};default:return null}}transformNode(e,t){if(I.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;const r=this.transformLiteralNodeByChunkLength(e,t,o.firstPassChunkLength);return f.replace(r,{enter:(e,t)=>{if(t&&b.NodeGuards.isLiteralNode(e))return this.transformLiteralNodeByChunkLength(e,t,this.options.splitStringsChunkLength)}})}transformLiteralNodeByChunkLength(e,t,r){if("string"!=typeof e.value)return e;if(r>=e.value.length)return e;const n=o.chunkString(e.value,r),i=this.transformStringChunksToBinaryExpressionNode(n);return v.NodeUtils.parentizeAst(i),v.NodeUtils.parentizeNode(i,t),i}transformStringChunksToBinaryExpressionNode(e){const t=e.shift(),r=e.shift();if(!t||!r)throw new Error("First and second chunks values should not be empty");const o=h.NodeFactory.binaryExpressionNode("+",h.NodeFactory.literalNode(t),h.NodeFactory.literalNode(r));return e.reduce((e,t)=>{const r=h.NodeFactory.literalNode(t);return h.NodeFactory.binaryExpressionNode("+",e,r)},o)}};S.firstPassChunkLength=1e3,S=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],S),t.SplitStringTransformer=S},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(11),m=r(12),g=r(8),y=r(4),N=r(6);let h=o=class extends m.AbstractNodeTransformer{constructor(e,t){super(e,t)}static isLiteralNodeWithStringValue(e){return!!e&&y.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}static isValidTemplateLiteralNode(e,t){return y.NodeGuards.isTemplateLiteralNode(e)&&!y.NodeGuards.isTaggedTemplateExpressionNode(t)}getVisitor(e){switch(e){case p.TransformationStage.Converting:return{enter:(e,t)=>{if(t&&o.isValidTemplateLiteralNode(e,t))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const r=e.expressions;let n,i=[];if(e.quasis.forEach(e=>{i.push(g.NodeFactory.literalNode(e.value.cooked));const t=r.shift();t&&i.push(t)}),i=i.filter(e=>!(y.NodeGuards.isLiteralNode(e)&&""===e.value)),o.isLiteralNodeWithStringValue(i[0])||o.isLiteralNodeWithStringValue(i[1])||i.unshift(g.NodeFactory.literalNode("")),i.length>1){let e=g.NodeFactory.binaryExpressionNode("+",i.shift(),i.shift());i.forEach(t=>{e=g.NodeFactory.binaryExpressionNode("+",e,t)}),n=e}else n=i[0];return N.NodeUtils.parentizeAst(n),N.NodeUtils.parentizeNode(n,t),n}};h=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.TemplateLiteralTransformer=h},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(19),s=r(8),c=r(4),d=r(14);let l=o=class{static getPropertyNodeKeyName(e){const t=e.key;return!c.NodeGuards.isLiteralNode(t)||"string"!=typeof t.value&&"number"!=typeof t.value?c.NodeGuards.isIdentifierNode(t)?t.name:null:t.value.toString()}static isProhibitedPattern(e){return!e||c.NodeGuards.isObjectPatternNode(e)||c.NodeGuards.isArrayPatternNode(e)||c.NodeGuards.isAssignmentPatternNode(e)||c.NodeGuards.isRestElementNode(e)}extract(e,t){const r=e.parentNode;return r&&c.NodeGuards.isVariableDeclaratorNode(r)&&c.NodeGuards.isIdentifierNode(r.id)?this.transformObjectExpressionNode(e,t,r.id):{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}transformObjectExpressionNode(e,t,r){const o=e.properties,[n,i]=this.extractPropertiesToExpressionStatements(o,t,r),s=d.NodeStatementUtils.getScopeOfNode(t);return this.filterExtractedObjectExpressionProperties(e,i),a.NodeAppender.insertAfter(s,n,t),{nodeToReplace:e,objectExpressionHostStatement:t,objectExpressionNode:e}}extractPropertiesToExpressionStatements(e,t,r){const n=e.length,i=[],a=[];for(let d=0;d!t.includes(r))}};l=o=n([i.injectable()],l),t.BasePropertiesExtractor=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(18),s=r(23),c=r(61),d=r(58),l=r(60),u=r(107),f=r(108),p=r(109),m=r(110),g=r(111),y=r(112),N=r(115),h=r(116),b=r(117),I=r(118),v=r(119),S=r(120),O=r(122),j=r(124),_=r(126),C=r(128),R=r(130),F=r(134),T=r(136),x=r(137),G=r(138),E=r(140),w=r(142),P=r(149),A=r(151),M=r(154),D=r(155);t.customNodesModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.ICustomNode).to(O.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(i.ServiceIdentifiers.ICustomNode).to(_.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(i.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(i.ServiceIdentifiers.ICustomNode).to(R.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(F.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(i.ServiceIdentifiers.ICustomNode).to(G.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(i.ServiceIdentifiers.ICustomNode).to(E.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(i.ServiceIdentifiers.ICustomNode).to(w.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(i.ServiceIdentifiers.ICustomNode).to(P.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(i.ServiceIdentifiers.ICustomNode).to(A.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BinaryExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.BlockStatementControlFlowFlatteningNode).whenTargetNamed(a.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(I.CallExpressionControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.CallExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(S.ControlFlowStorageNode).whenTargetNamed(a.ControlFlowCustomNode.ControlFlowStorageNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(T.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(x.LogicalExpressionFunctionNode).whenTargetNamed(a.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(D.StringLiteralNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(M.StringLiteralControlFlowStorageCallNode).whenTargetNamed(a.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(b.BlockStatementDeadCodeInjectionNode).whenTargetNamed(d.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(i.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.ObjectExpressionVariableDeclarationHostNode).whenTargetNamed(l.ObjectExpressionKeysTransformerCustomNode.ObjectExpressionVariableDeclarationHostNode),e(i.ServiceIdentifiers.ICustomNodeGroup).to(u.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(f.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(p.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(m.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(i.ServiceIdentifiers.ICustomNodeGroup).to(g.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(i.ServiceIdentifiers.Factory__ICustomNode).toFactory(o.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNode)),e(i.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions)),e(i.ServiceIdentifiers.Factory__IObjectExpressionKeysTransformerCustomNode).toFactory(o.InversifyContainerFacade.getConstructorFactory(i.ServiceIdentifiers.Newable__ICustomNode,i.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,i.ServiceIdentifiers.ICustomNodeFormatter,i.ServiceIdentifiers.IRandomGenerator,i.ServiceIdentifiers.IOptions,i.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),e(i.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(o.InversifyContainerFacade.getFactory(i.ServiceIdentifiers.ICustomNodeGroup)),e(i.ServiceIdentifiers.ICustomNodeFormatter).to(j.CustomNodeFormatter).inSingletonScope()})},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19);let S=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.ConsoleOutputDisableExpressionNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.disableConsoleOutput)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(h.CustomNode.ConsoleOutputDisableExpressionNode),r=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(h.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,r)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.ConsoleOutputCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19),S=r(4);let O=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.DebugProtectionFunctionCallNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.DebugProtectionFunctionNode,t=>{v.NodeAppender.append(e,t.getNode())}),this.appendCustomNodeIfExist(h.CustomNode.DebugProtectionFunctionIntervalNode,t=>{const r=S.NodeGuards.isSwitchCaseNode(e)?e.consequent.length:e.body.length,o=this.randomGenerator.getRandomInteger(0,r);v.NodeAppender.insertAtIndex(e,t.getNode(),o)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.debugProtection)return;const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r=this.customNodeFactory(h.CustomNode.DebugProtectionFunctionNode),o=this.customNodeFactory(h.CustomNode.DebugProtectionFunctionCallNode),n=this.customNodeFactory(h.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);r.initialize(e),o.initialize(e,t),n.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(h.CustomNode.DebugProtectionFunctionNode,r),this.customNodes.set(h.CustomNode.DebugProtectionFunctionCallNode,o),this.options.debugProtectionInterval&&this.customNodes.set(h.CustomNode.DebugProtectionFunctionIntervalNode,n),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,i)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],O.prototype,"customNodes",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.DebugProtectionCustomNodeGroup=O},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19);let S=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.BeforeObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.DomainLockNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.domainLock.length)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(h.CustomNode.DomainLockNode),r=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(h.CustomNode.DomainLockNode,t),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,r)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.DomainLockCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(26),m=r(5),g=r(2),y=r(3),N=r(7),h=r(23),b=r(22),I=r(27),v=r(19);let S=class extends I.AbstractCustomNodeGroup{constructor(e,t,r,o){super(t,r,o),this.appendEvent=b.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e}appendCustomNodes(e,t){const r=this.getRandomCallsGraphIndex(t.length);this.appendCustomNodeIfExist(h.CustomNode.SelfDefendingUnicodeNode,o=>{v.NodeAppender.appendToOptimalBlockScope(t,e,o.getNode(),r)}),this.appendCustomNodeIfExist(h.CustomNode.NodeCallsControllerFunctionNode,o=>{const n=t.length?v.NodeAppender.getOptimalBlockScope(t,r,1):e;v.NodeAppender.prepend(n,o.getNode())})}initialize(){if(this.customNodes=new Map,!this.options.selfDefending)return;const e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(h.CustomNode.SelfDefendingUnicodeNode),r=this.customNodeFactory(h.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(h.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(h.CustomNode.NodeCallsControllerFunctionNode,r)}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],S.prototype,"customNodes",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__ICustomNode)),l(1,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TCustomNodeFactory&&p.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],S),t.SelfDefendingCustomNodeGroup=S},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=r(26),g=r(5),y=r(2),N=r(3),h=r(35),b=r(7),I=r(23),v=r(22),S=r(27),O=r(19);let j=class extends S.AbstractCustomNodeGroup{constructor(e,t,r,o,n){super(r,o,n),this.appendEvent=v.ObfuscationEvent.AfterObfuscation,this.customNodeFactory=e,this.stringArrayStorage=t}appendCustomNodes(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(I.CustomNode.StringArrayNode,t=>{O.NodeAppender.prepend(e,t.getNode())}),this.appendCustomNodeIfExist(I.CustomNode.StringArrayCallsWrapper,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(I.CustomNode.StringArrayRotateFunctionNode,t=>{O.NodeAppender.insertAtIndex(e,t.getNode(),1)}))}initialize(){if(this.customNodes=new Map,!this.options.stringArray)return;const e=this.customNodeFactory(I.CustomNode.StringArrayNode),t=this.customNodeFactory(I.CustomNode.StringArrayCallsWrapper),r=this.customNodeFactory(I.CustomNode.StringArrayRotateFunctionNode),o=this.stringArrayStorage.getStorageName(),n=this.stringArrayStorage.getStorageCallsWrapperName(),i=this.stringArrayStorage.getRotationAmount();e.initialize(this.stringArrayStorage,o),t.initialize(o,n),r.initialize(o,i),this.customNodes.set(I.CustomNode.StringArrayNode,e),this.customNodes.set(I.CustomNode.StringArrayCallsWrapper,t),this.options.rotateStringArray&&this.customNodes.set(I.CustomNode.StringArrayRotateFunctionNode,r)}};d([b.initializable(),l("design:type","function"==typeof(o="undefined"!=typeof Map&&Map)?o:Object)],j.prototype,"customNodes",void 0),j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.Factory__ICustomNode)),u(1,f.inject(p.ServiceIdentifiers.IStringArrayStorage)),u(2,f.inject(p.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u(3,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(4,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==m.TCustomNodeFactory&&m.TCustomNodeFactory)?n:Object,"function"==typeof(i=void 0!==h.IStringArrayStorage&&h.IStringArrayStorage)?i:Object,"function"==typeof(a=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?a:Object,"function"==typeof(s=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.StringArrayCustomNodeGroup=j},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8);let h=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.properties=e}getNodeStructure(e){return[N.NodeFactory.variableDeclarationNode([N.NodeFactory.variableDeclaratorNode(N.NodeFactory.identifierNode(this.identifierNamesGenerator.generate()),N.NodeFactory.objectExpressionNode(this.properties))],"const")]}};h=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],h),t.ObjectExpressionVariableDeclarationHostNode=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n let that;\n \n try {\n const getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n const getGlobal = function () {\n let globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n const that = getGlobal();\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8),h=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.operator=e}getNodeStructure(e){const t=N.NodeFactory.expressionStatementNode(N.NodeFactory.functionExpressionNode([N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")],N.NodeFactory.blockStatementNode([N.NodeFactory.returnStatementNode(N.NodeFactory.binaryExpressionNode(this.operator,N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")))])));return h.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BinaryExpressionFunctionNode=b},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(4),I=r(6);let v=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=r}getNodeStructure(e){const t=this.randomGenerator.getRandomString(6),r=this.randomGenerator.getRandomString(6),o=h.NodeFactory.blockStatementNode([h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(t),h.NodeFactory.callExpressionNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.literalNode(this.originalKeysIndexesInShuffledArray.join("|")),h.NodeFactory.identifierNode("split")),[h.NodeFactory.literalNode("|")]))],"const"),h.NodeFactory.variableDeclarationNode([h.NodeFactory.variableDeclaratorNode(h.NodeFactory.identifierNode(r),h.NodeFactory.literalNode(0))],"let"),h.NodeFactory.whileStatementNode(h.NodeFactory.literalNode(!0),h.NodeFactory.blockStatementNode([h.NodeFactory.switchStatementNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.identifierNode(t),h.NodeFactory.updateExpressionNode("++",h.NodeFactory.identifierNode(r)),!0),this.shuffledKeys.map((e,t)=>{const r=this.blockStatementBody[e],o=[r];return b.NodeGuards.isReturnStatementNode(r)||o.push(h.NodeFactory.continueStatement()),h.NodeFactory.switchCaseNode(h.NodeFactory.literalNode(String(t)),o)})),h.NodeFactory.breakStatement()]))]);return I.NodeUtils.parentizeAst(o),[o]}};s([y.initializable(),c("design:type",Array)],v.prototype,"blockStatementBody",void 0),s([y.initializable(),c("design:type",Array)],v.prototype,"originalKeysIndexesInShuffledArray",void 0),s([y.initializable(),c("design:type",Array)],v.prototype,"shuffledKeys",void 0),v=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],v),t.BlockStatementControlFlowFlatteningNode=v},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8),h=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.blockStatementNode=e,this.deadCodeInjectionRootAstHostNode=t}getNodeStructure(e){const t=this.randomGenerator.getMathRandom()>.5,r=this.randomGenerator.getMathRandom()>.5,o=t?"===":"!==",n=this.randomGenerator.getRandomString(5),i=r?n:this.randomGenerator.getRandomString(5),[a,s]=t===r?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],c=N.NodeFactory.blockStatementNode([N.NodeFactory.ifStatementNode(N.NodeFactory.binaryExpressionNode(o,N.NodeFactory.literalNode(n),N.NodeFactory.literalNode(i)),a,s)]);return h.NodeUtils.parentizeAst(c),[c]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.BlockStatementDeadCodeInjectionNode=b},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),N=r(7),h=r(10),b=r(8),I=r(6);let v=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r,o){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.callee=r,this.expressionArguments=o}getNodeStructure(){const e=b.NodeFactory.expressionStatementNode(b.NodeFactory.callExpressionNode(b.NodeFactory.memberExpressionNode(b.NodeFactory.identifierNode(this.controlFlowStorageName),b.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.callee,...this.expressionArguments]));return I.NodeUtils.parentizeAst(e),[e]}};c([N.initializable(),d("design:type","function"==typeof(o="undefined"!=typeof ESTree&&ESTree.Expression)?o:Object)],v.prototype,"callee",void 0),c([N.initializable(),d("design:type",String)],v.prototype,"controlFlowStorageKey",void 0),c([N.initializable(),d("design:type",String)],v.prototype,"controlFlowStorageName",void 0),c([N.initializable(),d("design:type",Array)],v.prototype,"expressionArguments",void 0),v=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],v),t.CallExpressionControlFlowStorageCallNode=v},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.expressionArguments=e}getNodeStructure(e){const t=h.NodeFactory.identifierNode("callee"),r=[],o=this.expressionArguments.length;for(let e=0;e=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(121),m=r(5),g=r(2),y=r(3),N=r(9),h=r(7),b=r(10),I=r(8),v=r(4),S=r(6);let O=class extends b.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.controlFlowStorage=e}getNodeStructure(e){const t=Array.from(this.controlFlowStorage.getStorage()).map(([e,t])=>{const r=t.getNode()[0];if(!v.NodeGuards.isExpressionStatementNode(r))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return I.NodeFactory.propertyNode(I.NodeFactory.identifierNode(e),r.expression)});let r=I.NodeFactory.variableDeclarationNode([I.NodeFactory.variableDeclaratorNode(I.NodeFactory.identifierNode(this.controlFlowStorage.getStorageId()),I.NodeFactory.objectExpressionNode(t))],"const");return r=S.NodeUtils.parentizeAst(r),[r]}};c([h.initializable(),d("design:type","function"==typeof(o=void 0!==p.TControlFlowStorage&&p.TControlFlowStorage)?o:Object)],O.prototype,"controlFlowStorage",void 0),O=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==m.TIdentifierNamesGeneratorFactory&&m.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==g.IOptions&&g.IOptions)?s:Object])],O),t.ControlFlowStorageNode=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(20),N=r(123),h=r(47),b=r(7),I=r(10),v=r(6);let S=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return v.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():h.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(N.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([b.initializable(),c("design:type",String)],S.prototype,"callsControllerFunctionName",void 0),S=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],S),t.ConsoleOutputDisableExpressionNode=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n const {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n const c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.table = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.table = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=s(r(13)),f=c(r(125)),p=r(62),m=r(4);let g=class{constructor(e){this.prevailingKindOfVariables=e.getPrevailingKind()}formatTemplate(e,t){return f.default(e,t)}formatStructure(e){for(const t of e)u.replace(t,{enter:e=>{if(m.NodeGuards.isVariableDeclarationNode(e))return"var"===this.prevailingKindOfVariables&&(e.kind="var"),e}});return e}};g=n([d.injectable(),a(0,d.inject(l.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),i("design:paramtypes",["function"==typeof(o=void 0!==p.IPrevailingKindOfVariablesAnalyzer&&p.IPrevailingKindOfVariablesAnalyzer)?o:Object])],g),t.CustomNodeFormatter=g},function(e,t){e.exports=require("string-template")},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(127),h=r(10),b=r(6);let I=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(N.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};s([y.initializable(),c("design:type",String)],I.prototype,"callsControllerFunctionName",void 0),s([y.initializable(),c("design:type",String)],I.prototype,"debugProtectionFunctionName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.DebugProtectionFunctionCallNode=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(\n this,\n function () {\n const regExp1 = new RegExp('function *\\\\( *\\\\)');\n const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');\n \n const result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n }\n )();\n })();\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(129),h=r(10),b=r(6);let I=class extends h.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return b.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(N.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([y.initializable(),c("design:type",String)],I.prototype,"debugProtectionFunctionName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.DebugProtectionFunctionIntervalNode=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(20),N=r(7),h=r(131),b=r(132),I=r(133),v=r(10),S=r(6);let O=class extends v.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.debugProtectionFunctionName=e}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.target!==y.ObfuscationTarget.BrowserNoEval?h.DebuggerTemplate():b.DebuggerTemplateNoEval();return this.customNodeFormatter.formatTemplate(I.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}};s([N.initializable(),c("design:type",String)],O.prototype,"debugProtectionFunctionName",void 0),O=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],O),t.DebugProtectionFunctionNode=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n const func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(48),g=r(2),y=r(3),N=r(9),h=r(20),b=r(7),I=r(135),v=r(47),S=r(10),O=r(6);let j=class extends S.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.cryptUtils=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.options.domainLock.join(";"),[t,r]=this.cryptUtils.hideString(e,3*e.length),o=this.options.target!==h.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():v.GlobalVariableNoEvalTemplate();return this.customNodeFormatter.formatTemplate(I.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:r,domains:t,globalVariableTemplate:o,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([b.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.ICryptUtils)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.ICryptUtils&&m.ICryptUtils)?s:Object])],j),t.DomainLockNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n const {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n const func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (let i = 0; i < 1000; i--) {\n const isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n const regExp = new RegExp("[{diff}]", "g");\n const domains = "{domains}".replace(regExp, "").split(";");\n let document;\n let domain;\n let location;\n let hostname;\n\n for (let d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (let d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n\n if (!("~" > domain)) {\n for (let d2 in that[document]) {\n if (d2.length == 8 && d2.charCodeAt(7) == 110 && d2.charCodeAt(0) == 108) {\n location = d2;\n \n break;\n }\n }\n\n for (let d3 in that[document][location]) {\n if (d3.length == 8 && d3.charCodeAt(7) == 101 && d3.charCodeAt(0) == 104) {\n hostname = d3;\n \n break;\n }\n }\n }\n \n if (!document || !that[document]) {\n return;\n }\n \n const documentDomain = that[document][domain];\n const documentLocationHostName = !!that[document][location] && that[document][location][hostname];\n const currentDomain = documentDomain || documentLocationHostName;\n \n if (!currentDomain) {\n return;\n }\n \n let ok = false;\n \n for (let i = 0; i < domains.length; i++) {\n const domain = domains[i];\n const position = currentDomain.length - domain.length;\n const lastIndex = currentDomain.indexOf(domain, position);\n const endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t,r,o){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=r,this.rightValue=o}getNodeStructure(){const e=h.NodeFactory.expressionStatementNode(h.NodeFactory.callExpressionNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.identifierNode(this.controlFlowStorageName),h.NodeFactory.identifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.ExpressionWithOperatorControlFlowStorageCallNode=I},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(10),N=r(8),h=r(6);let b=class extends y.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.operator=e}getNodeStructure(e){const t=N.NodeFactory.expressionStatementNode(N.NodeFactory.functionExpressionNode([N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")],N.NodeFactory.blockStatementNode([N.NodeFactory.returnStatementNode(N.NodeFactory.logicalExpressionNode(this.operator,N.NodeFactory.identifierNode("x"),N.NodeFactory.identifierNode("y")))])));return h.NodeUtils.parentizeAst(t),[t]}};b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.LogicalExpressionFunctionNode=b},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(22),N=r(7),h=r(139),b=r(36),I=r(10),v=r(25),S=r(6),O=r(9);let j=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}getNodeStructure(e){return S.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.appendEvent===y.ObfuscationEvent.AfterObfuscation?v.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(h.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed})).getObfuscatedCode():this.customNodeFormatter.formatTemplate(h.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}};c([N.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),c([N.initializable(),d("design:type","function"==typeof(o=void 0!==y.ObfuscationEvent&&y.ObfuscationEvent)?o:Object)],j.prototype,"appendEvent",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==O.ICustomNodeFormatter&&O.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],j),t.NodeCallsControllerFunctionNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n const {singleNodeCallControllerFunctionName} = (function(){\n let firstCall = true;\n \n return function (context, fn){\n const rfn = firstCall ? function(){\n if(fn){\n const res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),N=r(9),h=r(7),b=r(36),I=r(141),v=r(10),S=r(25),O=r(6);let j=class extends v.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e){this.callsControllerFunctionName=e}getNodeStructure(e){return O.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return S.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(I.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}};c([h.initializable(),d("design:type",String)],j.prototype,"callsControllerFunctionName",void 0),j=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],j),t.SelfDefendingUnicodeNode=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n const func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return !regExp.test(func1.toString());\n };\n \n const test2 = function () {\n const regExp = new RegExp('${e.encode("(\\\\[x|u](\\w){2,4})+",!0)}');\n \n return regExp.test(func2.toString());\n };\n \n const recursiveFunc1 = function (string) {\n const i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n const recursiveFunc2 = function (string) {\n const i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+"")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n `}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),N=r(9),h=r(20),b=r(24),I=r(7),v=r(36),S=r(143),O=r(47),j=r(144),_=r(145),C=r(146),R=r(147),F=r(148),T=r(10),x=r(25),G=r(6);let E=class extends T.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}getNodeStructure(e){return G.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.getDecodeStringArrayTemplate();return x.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(R.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),Object.assign(Object.assign({},v.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}getDecodeStringArrayTemplate(){const e=this.options.target!==h.ObfuscationTarget.BrowserNoEval?this.getGlobalVariableTemplate():O.GlobalVariableNoEvalTemplate(),t=this.customNodeFormatter.formatTemplate(S.AtobTemplate(),{globalVariableTemplate:e});let r="",o="";switch(this.options.selfDefending&&(o=this.customNodeFormatter.formatTemplate(_.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case b.StringArrayEncoding.Rc4:r=this.customNodeFormatter.formatTemplate(F.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:j.Rc4Template(),selfDefendingCode:o,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case b.StringArrayEncoding.Base64:r=this.customNodeFormatter.formatTemplate(C.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:o,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return r}};c([I.initializable(),d("design:type",String)],E.prototype,"stringArrayName",void 0),c([I.initializable(),d("design:type",String)],E.prototype,"stringArrayCallsWrapperName",void 0),E=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],E),t.StringArrayCallsWrapper=E},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n const str = String(input).replace(/=+$/, '');\n let output = '';\n for (\n let bc = 0, bs, buffer, idx = 0;\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n }\n );\n })();\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n const rc4 = function (str, key) {\n let s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (let k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n let i;\n \t \n\t for (i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (let y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){const r=e.getRandomString(6),o=e.getRandomString(6),n=e.getRandomString(6),i=e.getRandomString(6),a=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),d=e.getRandomString(6),l=e.getRandomString(6);return`\n const StatesClass = function (${r}) {\n this.${r} = ${r};\n this.${o} = [1, 0, 0];\n this.${n} = function(){return 'newState';};\n this.${i} = '${t.encode("\\w+ *\\(\\) *{\\w+ *",!0)}';\n this.${a} = '${t.encode("['|\"].+['|\"];? *}",!0)}';\n };\n \n StatesClass.prototype.${s} = function () {\n const regExp = new RegExp(this.${i} + this.${a});\n const expression = regExp.test(this.${n}.toString())\n ? --this.${o}[1]\n : --this.${o}[0];\n \n return this.${c}(expression);\n };\n \n StatesClass.prototype.${c} = function (${l}) {\n if (!Boolean(~${l})) {\n return ${l};\n }\n \n return this.${d}(this.${r});\n };\n\n StatesClass.prototype.${d} = function (${r}) {\n for (let i = 0, len = this.${o}.length; i < len; i++) {\n this.${o}.push(Math.round(Math.random()));\n len = this.${o}.length;\n }\n \n return ${r}(this.${o}[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).${s}();\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){const t=e.getRandomString(6),r=e.getRandomString(6),o=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.${r} = function (str) {\n const string = atob(str);\n let newStringChars = [];\n \n for (let i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.${o} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${o}[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.${r}(value);\n {stringArrayCallsWrapperName}.${o}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n const {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n let value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){const t=e.getRandomString(6),r=e.getRandomString(6),o=e.getRandomString(6),n=e.getRandomString(6);return`\n if ({stringArrayCallsWrapperName}.${t} === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.${r} = rc4;\n \n {stringArrayCallsWrapperName}.${o} = {};\n \n {stringArrayCallsWrapperName}.${t} = true;\n }\n \n const cachedValue = {stringArrayCallsWrapperName}.${o}[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.${n} === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.${n} = true;\n }\n \n value = {stringArrayCallsWrapperName}.${r}(value, key);\n {stringArrayCallsWrapperName}.${o}[index] = value;\n } else {\n value = cachedValue;\n }\n `}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(2),g=r(3),y=r(9),N=r(35),h=r(7),b=r(150),I=r(10),v=r(6);let S=class extends I.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.stringArrayStorage=e,this.stringArrayName=t}getNodeStructure(e){return v.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){return this.customNodeFormatter.formatTemplate(b.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}};c([h.initializable(),d("design:type","function"==typeof(o=void 0!==N.IStringArrayStorage&&N.IStringArrayStorage)?o:Object)],S.prototype,"stringArrayStorage",void 0),c([h.initializable(),d("design:type",String)],S.prototype,"stringArrayName",void 0),S=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),d("design:paramtypes",["function"==typeof(n=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.ICustomNodeFormatter&&y.ICustomNodeFormatter)?i:Object,"function"==typeof(a=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==m.IOptions&&m.IOptions)?s:Object])],S),t.StringArrayNode=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n const {stringArrayName} = [{stringArray}];\n "}},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(5),m=r(29),g=r(2),y=r(3),N=r(9),h=r(7),b=r(36),I=r(152),v=r(153),S=r(10),O=r(25),j=r(6),_=r(37);let C=class extends S.AbstractCustomNode{constructor(e,t,r,o,n){super(e,t,r,o),this.escapeSequenceEncoder=n}initialize(e,t){this.stringArrayName=e,this.stringArrayRotationAmount=t}getNodeStructure(e){return j.NodeUtils.convertCodeToStructure(e)}getNodeTemplate(){const e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate();let r="";return r=this.options.selfDefending?this.customNodeFormatter.formatTemplate(I.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):`${t}(++${e})`,O.JavaScriptObfuscator.obfuscate(this.customNodeFormatter.formatTemplate(v.StringArrayRotateFunctionTemplate(),{code:r,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotationAmount:_.NumberUtils.toHex(this.stringArrayRotationAmount),whileFunctionName:t}),Object.assign(Object.assign({},b.NO_ADDITIONAL_NODES_PRESET),{identifierNamesGenerator:this.options.identifierNamesGenerator,identifiersDictionary:this.options.identifiersDictionary,seed:this.randomGenerator.getRawSeed()})).getObfuscatedCode()}};c([h.initializable(),d("design:type",String)],C.prototype,"stringArrayName",void 0),c([h.initializable(),d("design:type",Number)],C.prototype,"stringArrayRotationAmount",void 0),C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),l(1,u.inject(f.ServiceIdentifiers.ICustomNodeFormatter)),l(2,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(3,u.inject(f.ServiceIdentifiers.IOptions)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierNamesGeneratorFactory&&p.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==N.ICustomNodeFormatter&&N.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==g.IOptions&&g.IOptions)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.StringArrayRotateFunctionNode=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return`\n const selfDefendingFunc = function () {\n const object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n let updatedCookie = name + "=" + value;\n let i = 0;\n \n for (let i = 0, len = options.length; i < len; i++) {\n const propName = options[i];\n \n updatedCookie += "; " + propName;\n \n const propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += "=" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n const matches = document(new RegExp(\n "(?:^|; )" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + "=([^;]*)"\n ));\n \n const func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n const test1 = function () {\n const regExp = new RegExp('${e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0)}');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n let cookie = '';\n const result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n `}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n const {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotationAmount});\n "}},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8),b=r(6);let I=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}getNodeStructure(){const e=h.NodeFactory.expressionStatementNode(h.NodeFactory.memberExpressionNode(h.NodeFactory.identifierNode(this.controlFlowStorageName),h.NodeFactory.identifierNode(this.controlFlowStorageKey)));return b.NodeUtils.parentizeAst(e),[e]}};s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageKey",void 0),s([y.initializable(),c("design:type",String)],I.prototype,"controlFlowStorageName",void 0),I=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],I),t.StringLiteralControlFlowStorageCallNode=I},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(5),p=r(2),m=r(3),g=r(9),y=r(7),N=r(10),h=r(8);let b=class extends N.AbstractCustomNode{constructor(e,t,r,o){super(e,t,r,o)}initialize(e){this.literalValue=e}getNodeStructure(e){return[h.NodeFactory.expressionStatementNode(h.NodeFactory.literalNode(this.literalValue))]}};s([y.initializable(),c("design:type",String)],b.prototype,"literalValue",void 0),b=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d(1,l.inject(u.ServiceIdentifiers.ICustomNodeFormatter)),d(2,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(3,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(o=void 0!==f.TIdentifierNamesGeneratorFactory&&f.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==g.ICustomNodeFormatter&&g.ICustomNodeFormatter)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.StringLiteralNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0);t.finalizingTransformersModule=new o.ContainerModule(e=>{})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(31),a=r(158),s=r(159),c=r(160);t.generatorsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(a.DictionaryIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(n.ServiceIdentifiers.IIdentifierNamesGenerator).to(c.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(n.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(){let e=null;return t=>r=>{if(e)return e;let o;switch(r.identifierNamesGenerator){case i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:o=t.container.getNamed(n.ServiceIdentifiers.IIdentifierNamesGenerator,i.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return e=o,o}}())})},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(34),p=r(2),m=r(3),g=r(49);let y=o=class extends g.AbstractIdentifierNamesGenerator{constructor(e,t,r){super(e,t),this.arrayUtils=r,this.identifierNamesSet=new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary)),this.identifiersIterator=this.identifierNamesSet.values()}static incrementIdentifierName(e){let t="",r=!1;for(const o of e)r||o!==o.toUpperCase()?r||o!==o.toLowerCase()?t+=o:(t+=o.toUpperCase(),r=!0):t+=o.toLowerCase();return r?t:null}generate(){if(!this.identifierNamesSet.size)throw new Error("Too many identifiers in the code, add more words to identifiers dictionary");const e=this.identifiersIterator.next();return e.done?(this.identifierNamesSet=new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet])),this.identifiersIterator=this.identifierNamesSet.values(),this.generate()):e.value}generateWithPrefix(){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate()}`.replace("__","_")}getInitialIdentifierNames(e){const t=e.filter(Boolean).map(e=>e.toLowerCase());return this.arrayUtils.shuffle(t)}getIncrementedIdentifierNames(e){const t=[];for(const r of e){const e=o.incrementIdentifierName(r);e&&t.push(e)}return this.arrayUtils.shuffle(t)}};y=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(1,l.inject(u.ServiceIdentifiers.IOptions)),d(2,l.inject(u.ServiceIdentifiers.IArrayUtils)),c("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object,"function"==typeof(a=void 0!==f.IArrayUtils&&f.IArrayUtils)?a:Object])],y),t.DictionaryIdentifierNamesGenerator=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(49),m=r(37),g=r(30);let y=o=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.randomVariableNameSet=new Set}generate(e){const t=this.randomGenerator.getRandomInteger(1e4,99999999),r=m.NumberUtils.toHex(t),n=g.Utils.hexadecimalPrefix.length+1,i=e?e-n:o.baseIdentifierNameLength,a=r.substr(0,i),s=`_${g.Utils.hexadecimalPrefix}${a}`;return this.randomVariableNameSet.has(s)?this.generate(e):(this.randomVariableNameSet.add(s),s)}generateWithPrefix(e){const t=this.generate(e);return`${this.options.identifiersPrefix}${t}`.replace("__","_")}};y.baseIdentifierNameLength=6,y=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],y),t.HexadecimalIdentifierNamesGenerator=y},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=r(2),f=r(3),p=r(49);let m=o=class extends p.AbstractIdentifierNamesGenerator{constructor(e,t){super(e,t),this.previousMangledName=o.initMangledNameCharacter}generate(e){const t=this.generateNewMangledName(this.previousMangledName);return this.previousMangledName=t,t}generateWithPrefix(e){return`${this.options.identifiersPrefix?`${this.options.identifiersPrefix}_`:""}${this.generate(e)}`}isValidIdentifierName(e){return super.isValidIdentifierName(e)&&!o.reservedNamesSet.has(e)}generateNewMangledName(e){let t=(e=>{const t=o.nameSequence,r=t.length,n=e.length,i=e=>"0".repeat(e);let a=n-1;do{const o=e[a],s=t.indexOf(o);if(s!==r-1){return e.substring(0,a)+t[s+1]+i(n-(a+1))}--a}while(a>=0);return`a${i(n)}`})(e);return this.isValidIdentifierName(t)||(t=this.generateNewMangledName(t)),t}};m.initMangledNameCharacter="9",m.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),m.reservedNamesSet=new Set(["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"]),m=o=a([d.injectable(),c(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),c(1,d.inject(l.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],m),t.MangledIdentifierNamesGenerator=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1);t.nodeTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.Factory__INodeTransformer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeTransformer))})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(38),s=r(63),c=r(21),d=r(163),l=r(164),u=r(165),f=r(167),p=r(169),m=r(170),g=r(171);t.obfuscatingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(u.LabeledStatementTransformer).whenTargetNamed(c.NodeTransformer.LabeledStatementTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.LiteralTransformer).whenTargetNamed(c.NodeTransformer.LiteralTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ScopeIdentifiersTransformer).whenTargetNamed(c.NodeTransformer.ScopeIdentifiersTransformer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(l.BooleanLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(p.NumberLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IObfuscatingReplacer).to(m.StringLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer),e(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(d.BaseIdentifierObfuscatingReplacer).whenTargetNamed(a.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),e(i.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IObfuscatingReplacer)),e(i.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.IIdentifierObfuscatingReplacer))})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(5),u=r(2),f=r(39),p=r(8);let m=class extends f.AbstractObfuscatingReplacer{constructor(e,t){super(t),this.blockScopesMap=new Map,this.identifierNamesGenerator=e(t)}replace(e,t){let r=e.name;if(this.blockScopesMap.has(t)){const e=this.blockScopesMap.get(t);e.has(r)&&(r=e.get(r))}return p.NodeFactory.identifierNode(r)}storeGlobalName(e,t){const r=e.name;if(this.isReservedName(r))return;const o=this.identifierNamesGenerator.generateWithPrefix();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(r,o)}storeLocalName(e,t){const r=e.name;if(this.isReservedName(r))return;const o=this.identifierNamesGenerator.generate();this.blockScopesMap.has(t)||this.blockScopesMap.set(t,new Map),this.blockScopesMap.get(t).set(r,o)}preserveName(e){this.identifierNamesGenerator.preserveName(e)}isReservedName(e){return!!this.options.reservedNames.length&&this.options.reservedNames.some(t=>null!==new RegExp(t,"g").exec(e))}};m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==l.TIdentifierNamesGeneratorFactory&&l.TIdentifierNamesGeneratorFactory)?o:Object,"function"==typeof(n=void 0!==u.IOptions&&u.IOptions)?n:Object])],m),t.BaseIdentifierObfuscatingReplacer=m},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(39),f=r(8);let p=o=class extends u.AbstractObfuscatingReplacer{constructor(e){super(e)}static getTrueUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",o.getFalseUnaryExpressionNode())}static getFalseUnaryExpressionNode(){return f.NodeFactory.unaryExpressionNode("!",f.NodeFactory.arrayExpressionNode())}replace(e){const t=e.value;if("boolean"!=typeof t)throw new Error("`BooleanLiteralObfuscatingReplacer` should accept only literals with `boolean` value");return t?o.getTrueUnaryExpressionNode():o.getFalseUnaryExpressionNode()}};p=o=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.BooleanLiteralObfuscatingReplacer=p},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(50),m=r(2),g=r(3),y=r(38),N=r(11),h=r(12),b=r(4),I=r(166);let v=class extends h.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.identifierObfuscatingReplacer=e(y.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case N.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&b.NodeGuards.isLabeledStatementNode(e))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){const r=I.NodeLexicalScopeUtils.getLexicalScope(e);return r?(this.storeLabeledStatementName(e,r),this.replaceLabeledStatementName(e,r),e):e}storeLabeledStatementName(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label,t)}replaceLabeledStatementName(e,t){f.replace(e,{enter:(e,r)=>{if(r&&b.NodeGuards.isLabelIdentifierNode(e,r)){const r=this.identifierObfuscatingReplacer.replace(e,t);e.name=r.name}}})}};v=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(2,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==p.TIdentifierObfuscatingReplacerFactory&&p.TIdentifierObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==g.IRandomGenerator&&g.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==m.IOptions&&m.IOptions)?i:Object])],v),t.LabeledStatementTransformer=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(4);class n{static getLexicalScope(e){return n.getLexicalScopesRecursive(e,1)[0]}static getLexicalScopes(e){return n.getLexicalScopesRecursive(e)}static getLexicalScopesRecursive(e,t=1/0,r=[],i=0){if(r.length>=t)return r;const a=e.parentNode;if(!a)throw new ReferenceError("`parentNode` property of given node is `undefined`");return o.NodeGuards.isNodeWithLexicalScope(e)&&r.push(e),e!==a?n.getLexicalScopesRecursive(a,t,r,++i):r}}t.NodeLexicalScopeUtils=n},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(0),f=r(1),p=r(168),m=r(29),g=r(2),y=r(3),N=r(64),h=r(63),b=r(11),I=r(12),v=r(8),S=r(4),O=r(44),j=r(15),_=r(6);let C=class extends I.AbstractNodeTransformer{constructor(e,t,r,o,n){super(t,r),this.literalObfuscatingReplacerFactory=e,this.stringArrayStorageAnalyzer=o,this.escapeSequenceEncoder=n}getVisitor(e){switch(e){case b.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(S.NodeGuards.isProgramNode(e)&&this.analyzeNode(e),t&&S.NodeGuards.isLiteralNode(e)&&!j.NodeMetadata.isReplacedLiteral(e))return this.transformNode(e,t)}};case b.TransformationStage.Finalizing:return{enter:(e,t)=>{if(t&&S.NodeGuards.isLiteralNode(e))return this.encodeLiteralNodeToEscapeSequence(e,t)}};default:return null}}analyzeNode(e){this.stringArrayStorageAnalyzer.analyze(e)}transformNode(e,t){if(O.NodeLiteralUtils.isProhibitedLiteralNode(e,t))return e;let r;switch(typeof e.value){case"boolean":r=this.literalObfuscatingReplacerFactory(h.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e);break;case"number":r=this.literalObfuscatingReplacerFactory(h.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e);break;case"string":r=this.literalObfuscatingReplacerFactory(h.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e);break;default:r=e}return _.NodeUtils.parentizeNode(r,t),r}encodeLiteralNodeToEscapeSequence(e,t){return"string"!=typeof e.value?e:v.NodeFactory.literalNode(this.escapeSequenceEncoder.encode(e.value,this.options.unicodeEscapeSequence))}};C=c([u.injectable(),l(0,u.inject(f.ServiceIdentifiers.Factory__IObfuscatingReplacer)),l(1,u.inject(f.ServiceIdentifiers.IRandomGenerator)),l(2,u.inject(f.ServiceIdentifiers.IOptions)),l(3,u.inject(f.ServiceIdentifiers.IStringArrayStorageAnalyzer)),l(4,u.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d("design:paramtypes",["function"==typeof(o=void 0!==p.TLiteralObfuscatingReplacerFactory&&p.TLiteralObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==y.IRandomGenerator&&y.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==g.IOptions&&g.IOptions)?i:Object,"function"==typeof(a=void 0!==N.IStringArrayStorageAnalyzer&&N.IStringArrayStorageAnalyzer)?a:Object,"function"==typeof(s=void 0!==m.IEscapeSequenceEncoder&&m.IEscapeSequenceEncoder)?s:Object])],C),t.LiteralTransformer=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(2),l=r(39),u=r(8),f=r(37),p=r(30);let m=class extends l.AbstractObfuscatingReplacer{constructor(e){super(e),this.numberLiteralCache=new Map}replace(e){const t=e.value;if("number"!=typeof t)throw new Error("`NumberLiteralObfuscatingReplacer` should accept only literals with `number` value");let r;return this.numberLiteralCache.has(t)?r=this.numberLiteralCache.get(t):(r=f.NumberUtils.isCeil(t)?`${p.Utils.hexadecimalPrefix}${f.NumberUtils.toHex(t)}`:String(t),this.numberLiteralCache.set(t,r)),u.NodeFactory.literalNode(t,r)}};m=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IOptions&&d.IOptions)?o:Object])],m),t.NumberLiteralObfuscatingReplacer=m},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(2),p=r(35),m=r(64),g=r(7),y=r(24),N=r(39),h=r(15),b=r(8),I=r(37),v=r(30);let S=o=class extends N.AbstractObfuscatingReplacer{constructor(e,t,r){super(r),this.nodesCache=new Map,this.stringArrayStorage=e,this.stringArrayStorageAnalyzer=t}static getHexadecimalLiteralNode(e){const t=b.NodeFactory.literalNode(e);return h.NodeMetadata.set(t,{replacedLiteral:!0}),t}static getRc4KeyLiteralNode(e){const t=b.NodeFactory.literalNode(e);return h.NodeMetadata.set(t,{replacedLiteral:!0}),t}initialize(){this.stringArrayStorageCallsWrapperName=this.stringArrayStorage.getStorageCallsWrapperName(),this.options.shuffleStringArray&&this.stringArrayStorage.shuffleStorage(),this.options.rotateStringArray&&this.stringArrayStorage.rotateStorage()}replace(e){const t=e.value;if("string"!=typeof t)throw new Error("`StringLiteralObfuscatingReplacer` should accept only literals with `string` value");const r=this.stringArrayStorageAnalyzer.getItemDataForLiteralNode(e),o=`${t}-${Boolean(r)}`;if(this.nodesCache.has(o)&&this.options.stringArrayEncoding!==y.StringArrayEncoding.Rc4)return this.nodesCache.get(o);const n=r?this.replaceWithStringArrayCallNode(r):this.replaceWithLiteralNode(t);return this.nodesCache.set(o,n),n}replaceWithLiteralNode(e){return b.NodeFactory.literalNode(e)}replaceWithStringArrayCallNode(e){const{index:t,decodeKey:r}=e,n=`${v.Utils.hexadecimalPrefix}${I.NumberUtils.toHex(t)}`,i=[o.getHexadecimalLiteralNode(n)];r&&i.push(o.getRc4KeyLiteralNode(r));const a=b.NodeFactory.identifierNode(this.stringArrayStorageCallsWrapperName);return b.NodeFactory.callExpressionNode(a,i)}};s([g.initializable(),c("design:type",String)],S.prototype,"stringArrayStorageCallsWrapperName",void 0),s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],S.prototype,"initialize",null),S=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.IStringArrayStorage)),d(1,l.inject(u.ServiceIdentifiers.IStringArrayStorageAnalyzer)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==p.IStringArrayStorage&&p.IStringArrayStorage)?n:Object,"function"==typeof(i=void 0!==m.IStringArrayStorageAnalyzer&&m.IStringArrayStorageAnalyzer)?i:Object,"function"==typeof(a=void 0!==f.IOptions&&f.IOptions)?a:Object])],S),t.StringLiteralObfuscatingReplacer=S},function(e,t,r){"use strict";var o,n,i,a,s,c=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},d=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=u(r(13)),g=r(50),y=r(2),N=r(3),h=r(172),b=r(38),I=r(11),v=r(12),S=r(4),O=r(15);let j=o=class extends v.AbstractNodeTransformer{constructor(e,t,r,o){super(t,r),this.lexicalScopesWithObjectPatternWithoutDeclarationMap=new Map,this.identifierObfuscatingReplacer=e(b.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),this.scopeAnalyzer=o}getVisitor(e){switch(e){case I.TransformationStage.Obfuscating:return{enter:(e,t)=>{if(t&&S.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.transformNode(e,t)}};default:return null}}analyzeNode(e,t){this.scopeAnalyzer.analyze(e)}transformNode(e,t){const r=this.scopeAnalyzer.acquireScope(e);return this.traverseScopeVariables(r),e}traverseScopeVariables(e){const t=e.variableScope,r=S.NodeGuards.isNodeWithBlockLexicalScope(t.block)?t.block:null,n=o.globalScopeNames.includes(t.type);if(r){for(const t of e.variables)if(t.name!==o.argumentsVariableName){if(!this.options.renameGlobals&&n){if(!t.defs.every(e=>"ImportBinding"===e.type||"CatchClause"===e.type))continue}this.transformScopeVariableIdentifiers(t,r,n)}for(const t of e.childScopes)this.traverseScopeVariables(t)}}transformScopeVariableIdentifiers(e,t,r){for(const o of e.identifiers)this.isReplaceableIdentifierNode(o,t,e)&&(this.storeIdentifierName(o,t,r),this.replaceIdentifierName(o,t,e))}storeIdentifierName(e,t,r){r?this.identifierObfuscatingReplacer.storeGlobalName(e,t):this.identifierObfuscatingReplacer.storeLocalName(e,t)}replaceIdentifierName(e,t,r){const o=this.identifierObfuscatingReplacer.replace(e,t);e.name=o.name,r.references.forEach(t=>{t.identifier.name=e.name})}isReplaceableIdentifierNode(e,t,r){const o=e.parentNode;return!(!o||O.NodeMetadata.isIgnoredNode(e)||this.isProhibitedPropertyNode(e,o)||this.isProhibitedClassDeclarationNameIdentifierNode(r,e,o)||this.isProhibitedExportNamedClassDeclarationIdentifierNode(e,o)||this.isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,o)||this.isProhibitedExportNamedVariableDeclarationIdentifierNode(e,o)||this.isProhibitedImportSpecifierNode(e,o)||this.isProhibitedVariableNameUsedInObjectPatternNode(r,e,t)||S.NodeGuards.isLabelIdentifierNode(e,o))}isProhibitedClassDeclarationNameIdentifierNode(e,t,r){return S.NodeGuards.isClassDeclarationNode(e.scope.block)&&S.NodeGuards.isClassDeclarationNode(r)&&r.id===t}isProhibitedExportNamedClassDeclarationIdentifierNode(e,t){return S.NodeGuards.isClassDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedFunctionDeclarationIdentifierNode(e,t){return S.NodeGuards.isFunctionDeclarationNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode)}isProhibitedExportNamedVariableDeclarationIdentifierNode(e,t){return S.NodeGuards.isVariableDeclaratorNode(t)&&t.id===e&&!!t.parentNode&&S.NodeGuards.isVariableDeclarationNode(t.parentNode)&&!!t.parentNode.parentNode&&S.NodeGuards.isExportNamedDeclarationNode(t.parentNode.parentNode)}isProhibitedImportSpecifierNode(e,t){return S.NodeGuards.isImportSpecifierNode(t)&&t.imported.name===t.local.name}isProhibitedPropertyNode(e,t){const r=S.NodeGuards.isPropertyNode(t)&&!t.computed&&t.key===e,o=S.NodeGuards.isAssignmentPatternNode(t)&&t.left===e&&!!t.parentNode&&S.NodeGuards.isPropertyNode(t.parentNode)&&t.left===t.parentNode.key;return r||o}isProhibitedVariableNameUsedInObjectPatternNode(e,t,r){let o=this.lexicalScopesWithObjectPatternWithoutDeclarationMap.get(r);if(!1===o)return!1;if(!e.defs.some(e=>"var"===e.kind))return!1;let n=!1;return m.traverse(r,{enter:(e,r)=>{if(S.NodeGuards.isObjectPatternNode(e)&&r&&S.NodeGuards.isAssignmentExpressionNode(r)){o=!0;const r=e.properties;for(const e of r)if(!e.computed&&e.shorthand&&S.NodeGuards.isIdentifierNode(e.key)&&t.name===e.key.name)return n=!0,m.VisitorOption.Break}}}),this.lexicalScopesWithObjectPatternWithoutDeclarationMap.set(r,null!=o&&o),n}};j.argumentsVariableName="arguments",j.globalScopeNames=["global","module"],j=o=c([f.injectable(),l(0,f.inject(p.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),l(1,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l(2,f.inject(p.ServiceIdentifiers.IOptions)),l(3,f.inject(p.ServiceIdentifiers.IScopeAnalyzer)),d("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierObfuscatingReplacerFactory&&g.TIdentifierObfuscatingReplacerFactory)?n:Object,"function"==typeof(i=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.IOptions&&y.IOptions)?a:Object,"function"==typeof(s=void 0!==h.IScopeAnalyzer&&h.IScopeAnalyzer)?s:Object])],j),t.ScopeIdentifiersTransformer=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(174),a=r(181);t.optionsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IOptions).to(i.Options).inSingletonScope(),e(n.ServiceIdentifiers.IOptionsNormalizer).to(a.OptionsNormalizer).inSingletonScope()})},function(e,t,r){"use strict";var o,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=r(28),m=r(0),g=r(1),y=r(65),N=r(175),h=r(176),b=r(177),I=r(31),v=r(20),S=r(32),O=r(24),j=r(40),_=r(178),C=r(179);let R=o=class{constructor(e,t){Object.assign(this,j.DEFAULT_PRESET,e);const r=y.validateSync(this,o.validatorOptions);if(r.length)throw new ReferenceError(`Validation failed. errors:\n${_.ValidationErrorsFormatter.format(r)}`);Object.assign(this,t.normalize(this))}};R.validatorOptions={validationError:{target:!1}},l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"compact",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"controlFlowFlattening",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"controlFlowFlatteningThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"deadCodeInjection",void 0),l([y.IsNumber(),u("design:type",Number)],R.prototype,"deadCodeInjectionThreshold",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtection",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"debugProtectionInterval",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"disableConsoleOutput",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),C.IsAllowedForObfuscationTargets([v.ObfuscationTarget.Browser,v.ObfuscationTarget.BrowserNoEval]),u("design:type",Array)],R.prototype,"domainLock",void 0),l([y.IsIn([I.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,I.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,I.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]),u("design:type","function"==typeof(n=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?n:Object)],R.prototype,"identifierNamesGenerator",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"identifiersPrefix",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),y.ValidateIf(e=>e.identifierNamesGenerator===I.IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator),y.ArrayNotEmpty(),u("design:type",Array)],R.prototype,"identifiersDictionary",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFileName",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"inputFilePath",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"log",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"renameGlobals",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedNames",void 0),l([y.IsArray(),y.ArrayUnique(),y.IsString({each:!0}),u("design:type",Array)],R.prototype,"reservedStrings",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"rotateStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"selfDefending",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"shuffleStringArray",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"sourceMap",void 0),l([y.IsString(),y.ValidateIf(e=>Boolean(e.sourceMapBaseUrl)),y.IsUrl({require_protocol:!0,require_tld:!1,require_valid_protocol:!0}),u("design:type",String)],R.prototype,"sourceMapBaseUrl",void 0),l([y.IsString(),u("design:type",String)],R.prototype,"sourceMapFileName",void 0),l([y.IsIn([S.SourceMapMode.Inline,S.SourceMapMode.Separate]),u("design:type","function"==typeof(i=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?i:Object)],R.prototype,"sourceMapMode",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"splitStrings",void 0),l([y.IsNumber(),y.ValidateIf(e=>Boolean(e.splitStrings)),y.Min(1),u("design:type",Number)],R.prototype,"splitStringsChunkLength",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"stringArray",void 0),l([y.IsIn([!0,!1,O.StringArrayEncoding.Base64,O.StringArrayEncoding.Rc4]),u("design:type","function"==typeof(a=void 0!==h.TStringArrayEncoding&&h.TStringArrayEncoding)?a:Object)],R.prototype,"stringArrayEncoding",void 0),l([y.IsNumber(),y.Min(0),y.Max(1),u("design:type",Number)],R.prototype,"stringArrayThreshold",void 0),l([y.IsIn([v.ObfuscationTarget.Browser,v.ObfuscationTarget.BrowserNoEval,v.ObfuscationTarget.Node]),u("design:type","function"==typeof(s=void 0!==p.TypeFromEnum&&p.TypeFromEnum)?s:Object)],R.prototype,"target",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"transformObjectKeys",void 0),l([y.IsBoolean(),u("design:type",Boolean)],R.prototype,"unicodeEscapeSequence",void 0),R=o=l([m.injectable(),f(0,m.inject(g.ServiceIdentifiers.TInputOptions)),f(1,m.inject(g.ServiceIdentifiers.IOptionsNormalizer)),u("design:paramtypes",["function"==typeof(c=void 0!==N.TInputOptions&&N.TInputOptions)?c:Object,"function"==typeof(d=void 0!==b.IOptionsNormalizer&&b.IOptionsNormalizer)?d:Object])],R),t.Options=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o{static format(e){return e.reduce((e,t)=>[...e,o.formatWithNestedConstraints(t)],[]).join("\n")}static formatWithNestedConstraints(e){const t=e.constraints;return`${`\`${e.property}\` errors:\n`}${Object.keys(t).map(e=>` - ${t[e]}\n`).join()}`}}t.ValidationErrorsFormatter=o},function(e,t,r){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(65),i=o(r(180)),a=r(41),s=r(40);t.IsAllowedForObfuscationTargets=function(e,t){return(r,o)=>{n.registerDecorator({propertyName:o,constraints:[e],name:"IsAllowedForObfuscationTargets",options:t,target:r.constructor,validator:{validate(t,r){const n=r.object,a=s.DEFAULT_PRESET[o];return i.default(t,a)||e.includes(n.target)},defaultMessage:t=>`This option allowed only for obfuscation targets: ${e.join(`${a.StringSeparator.Comma} `)}`}})}}},function(e,t){e.exports=require("fast-deep-equal")},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=r(182),s=r(183),c=r(184),d=r(185),l=r(186),u=r(187),f=r(188),p=r(189),m=r(190),g=r(191),y=r(192),N=r(193),h=r(194);let b=o=class{normalize(e){let t=Object.assign({},e);for(const e of o.normalizerRules)t=e(t);return t}};b.normalizerRules=[a.ControlFlowFlatteningThresholdRule,s.DeadCodeInjectionRule,c.DeadCodeInjectionThresholdRule,d.DomainLockRule,l.InputFileNameRule,u.SeedRule,f.SelfDefendingRule,p.SourceMapBaseUrlRule,m.SourceMapFileNameRule,g.SplitStringsChunkLengthRule,y.StringArrayRule,N.StringArrayEncodingRule,h.StringArrayThresholdRule],b=o=n([i.injectable()],b),t.OptionsNormalizer=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControlFlowFlatteningThresholdRule=e=>(0===e.controlFlowFlatteningThreshold&&(e=Object.assign(Object.assign({},e),{controlFlowFlattening:!1,controlFlowFlatteningThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(40);t.DeadCodeInjectionRule=e=>(e.deadCodeInjection&&((e=Object.assign(Object.assign({},e),{deadCodeInjection:!0,stringArray:!0})).stringArrayThreshold||(e=Object.assign(Object.assign({},e),{stringArray:!0,stringArrayThreshold:o.DEFAULT_PRESET.stringArrayThreshold}))),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeadCodeInjectionThresholdRule=e=>(0===e.deadCodeInjectionThreshold&&(e=Object.assign(Object.assign({},e),{deadCodeInjection:!1,deadCodeInjectionThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(30);t.DomainLockRule=e=>{if(e.domainLock.length){const t=[];for(const r of e.domainLock)t.push(o.Utils.extractDomainFrom(r));e=Object.assign(Object.assign({},e),{domainLock:t})}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(41);t.InputFileNameRule=e=>{let{inputFileName:t}=e;return t&&(t=t.replace(/^\/+/,"").split(o.StringSeparator.Dot).slice(0,-1).join(o.StringSeparator.Dot)||t,e=Object.assign(Object.assign({},e),{inputFileName:`${t}.js`})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeedRule=e=>{if(e.seed)return Object.assign(Object.assign({},e),{seed:e.seed});return Object.assign(Object.assign({},e),{seed:(t=0,r=999999999,Math.floor(Math.random()*(r-t+1)+t))});var t,r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingRule=e=>(e.selfDefending&&(e=Object.assign(Object.assign({},e),{compact:!0,selfDefending:!0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapBaseUrlRule=e=>{const{sourceMapBaseUrl:t}=e;return e.sourceMapFileName?(t&&!t.endsWith("/")&&(e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:`${t}/`})),e):e=Object.assign(Object.assign({},e),{sourceMapBaseUrl:""})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(41);t.SourceMapFileNameRule=e=>{let{sourceMapFileName:t}=e;if(t){t=t.replace(/^\/+/,"").replace(/(?:\.js)?(?:\.map)?$/,"");let r=t.split(o.StringSeparator.Dot);const n=r.length,i=r[n-1];n>1&&i.length<=3&&(r=r.slice(0,-1)),t=r.join(o.StringSeparator.Dot),e=Object.assign(Object.assign({},e),{sourceMapFileName:`${t}.js.map`})}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SplitStringsChunkLengthRule=e=>e=0===e.splitStringsChunkLength?Object.assign(Object.assign({},e),{splitStrings:!1,splitStringsChunkLength:0}):Object.assign(Object.assign({},e),{splitStringsChunkLength:Math.floor(e.splitStringsChunkLength)})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRule=e=>(e.stringArray||(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,shuffleStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(24);t.StringArrayEncodingRule=e=>(!0===e.stringArrayEncoding&&(e=Object.assign(Object.assign({},e),{stringArrayEncoding:o.StringArrayEncoding.Base64})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayThresholdRule=e=>(0===e.stringArrayThreshold&&(e=Object.assign(Object.assign({},e),{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(16),n=r(0),i=r(1),a=r(21),s=r(66),c=r(196),d=r(197),l=r(67),u=r(198),f=r(202),p=r(204),m=r(205),g=r(207),y=r(208),N=r(209);t.preparingTransformersModule=new n.ContainerModule(e=>{e(i.ServiceIdentifiers.INodeTransformer).to(d.CommentsTransformer).whenTargetNamed(a.NodeTransformer.CommentsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(u.CustomNodesTransformer).whenTargetNamed(a.NodeTransformer.CustomNodesTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(f.EvalCallExpressionTransformer).whenTargetNamed(a.NodeTransformer.EvalCallExpressionTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(p.MetadataTransformer).whenTargetNamed(a.NodeTransformer.MetadataTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(m.ObfuscatingGuardsTransformer).whenTargetNamed(a.NodeTransformer.ObfuscatingGuardsTransformer),e(i.ServiceIdentifiers.INodeTransformer).to(g.ParentificationTransformer).whenTargetNamed(a.NodeTransformer.ParentificationTransformer),e(i.ServiceIdentifiers.INodeGuard).to(c.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.BlackListObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(l.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ConditionalCommentObfuscatingGuard),e(i.ServiceIdentifiers.INodeGuard).to(y.ReservedStringObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ReservedStringObfuscatingGuard),e(i.ServiceIdentifiers.Factory__INodeGuard).toFactory(o.InversifyContainerFacade.getCacheFactory(i.ServiceIdentifiers.INodeGuard)),e(i.ServiceIdentifiers.INodeTransformer).to(N.VariablePreserveTransformer).whenTargetNamed(a.NodeTransformer.VariablePreserveTransformer)})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),s=r(4);let c=o=class{constructor(){this.blackListGuardsLength=o.blackListGuards.length}check(e){for(let t=0;t=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(13)),p=r(2),m=r(3),g=r(11),y=r(12),N=r(4),h=r(67);let b=o=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case g.TransformationStage.Initializing:return{leave:e=>{if(N.NodeGuards.isProgramNode(e))return this.transformNode(e)}};default:return null}}transformNode(e){if(!e.comments||!e.comments.length)return e;const t=this.transformComments(e.comments);return 0===t.length?e:e.body.length?(f.traverse(e,{enter:r=>{if(r===e)return;const o=t.findIndex(e=>e.range&&r.range&&e.range[0]0&&(e.trailingComments=t.reverse()),e):(e.leadingComments=t,e)}transformComments(e){return e.filter(e=>o.preservedWords.some(t=>e.value.includes(t))||h.ConditionalCommentObfuscatingGuard.isConditionalComment(e)).reverse()}};b.preservedWords=["@license","@preserve"],b=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],b),t.CommentsTransformer=b},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const f=r(0),p=r(1),m=r(199),g=r(200),y=r(2),N=r(3),h=r(201),b=r(62),I=r(22),v=r(11),S=r(12),O=r(4);let j=class extends S.AbstractNodeTransformer{constructor(e,t,r,o,n,i){super(n,i),this.callsGraphData=[],this.callsGraphAnalyzer=e,this.prevailingKindOfVariablesAnalyzer=t,this.obfuscationEventEmitter=r,this.customNodeGroupStorage=o}getVisitor(e){switch(e){case v.TransformationStage.Preparing:return{leave:(e,t)=>{if(O.NodeGuards.isProgramNode(e))return this.analyzeNode(e,t),this.appendCustomNodesBeforeObfuscation(e,t),this.transformNode(e,t)}};case v.TransformationStage.Finalizing:return{leave:(e,t)=>{O.NodeGuards.isProgramNode(e)&&this.appendCustomNodesAfterObfuscation(e,t)}};default:return null}}analyzeNode(e,t){this.callsGraphData=this.callsGraphAnalyzer.analyze(e),this.prevailingKindOfVariablesAnalyzer.analyze(e)}transformNode(e,t){return e}appendCustomNodesBeforeObfuscation(e,t){this.customNodeGroupStorage.getStorage().forEach(e=>{e.initialize(),this.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(I.ObfuscationEvent.BeforeObfuscation,e,this.callsGraphData)}appendCustomNodesAfterObfuscation(e,t){this.obfuscationEventEmitter.emit(I.ObfuscationEvent.AfterObfuscation,e,this.callsGraphData)}};j=d([f.injectable(),u(0,f.inject(p.ServiceIdentifiers.ICallsGraphAnalyzer)),u(1,f.inject(p.ServiceIdentifiers.IPrevailingKindOfVariablesAnalyzer)),u(2,f.inject(p.ServiceIdentifiers.IObfuscationEventEmitter)),u(3,f.inject(p.ServiceIdentifiers.TCustomNodeGroupStorage)),u(4,f.inject(p.ServiceIdentifiers.IRandomGenerator)),u(5,f.inject(p.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(o=void 0!==h.ICallsGraphAnalyzer&&h.ICallsGraphAnalyzer)?o:Object,"function"==typeof(n=void 0!==b.IPrevailingKindOfVariablesAnalyzer&&b.IPrevailingKindOfVariablesAnalyzer)?n:Object,"function"==typeof(i=void 0!==g.IObfuscationEventEmitter&&g.IObfuscationEventEmitter)?i:Object,"function"==typeof(a=void 0!==m.TCustomNodeGroupStorage&&m.TCustomNodeGroupStorage)?a:Object,"function"==typeof(s=void 0!==N.IRandomGenerator&&N.IRandomGenerator)?s:Object,"function"==typeof(c=void 0!==y.IOptions&&y.IOptions)?c:Object])],j),t.CustomNodesTransformer=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=d(r(203)),p=r(2),m=r(3),g=r(11),y=r(12),N=r(8),h=r(4),b=r(6);let I=o=class extends y.AbstractNodeTransformer{constructor(e,t){super(e,t),this.evalRootAstHostNodeSet=new Set}static extractEvalStringFromCallExpressionArgument(e){return h.NodeGuards.isLiteralNode(e)?o.extractEvalStringFromLiteralNode(e):h.NodeGuards.isTemplateLiteralNode(e)?o.extractEvalStringFromTemplateLiteralNode(e):null}static extractEvalStringFromLiteralNode(e){return"string"==typeof e.value?e.value:null}static extractEvalStringFromTemplateLiteralNode(e){const t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(t&&h.NodeGuards.isCallExpressionNode(e)&&h.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return this.transformNode(e,t)}};case g.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:(e,t)=>{if(t&&this.isEvalRootAstHostNode(e))return this.restoreNode(e,t)}}:null;default:return null}}transformNode(e,t){const r=e.arguments[0];if(!r)return e;const n=o.extractEvalStringFromCallExpressionArgument(r);if(!n)return e;let i;try{i=b.NodeUtils.convertCodeToStructure(n)}catch(t){return e}const a=N.NodeFactory.functionExpressionNode([],N.NodeFactory.blockStatementNode(i));return this.evalRootAstHostNodeSet.add(a),a}restoreNode(e,t){const r=e.body.body,o=b.NodeUtils.convertStructureToCode(r);return N.NodeFactory.callExpressionNode(N.NodeFactory.identifierNode("eval"),[N.NodeFactory.literalNode(f.default(o))])}isEvalRootAstHostNode(e){return h.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}};I=o=a([l.injectable(),c(0,l.inject(u.ServiceIdentifiers.IRandomGenerator)),c(1,l.inject(u.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(n=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==p.IOptions&&p.IOptions)?i:Object])],I),t.EvalCallExpressionTransformer=I},function(e,t){e.exports=require("js-string-escape")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(4),g=r(15);let y=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return g.NodeMetadata.set(e,{ignoredNode:!1}),m.NodeGuards.isLiteralNode(e)&&g.NodeMetadata.set(e,{replacedLiteral:!1}),e}};y=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],y),t.MetadataTransformer=y},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(206),p=r(2),m=r(3),g=r(66),y=r(11),N=r(12),h=r(15);let b=o=class extends N.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.obfuscatingGuards=o.obfuscatingGuardsList.map(e)}getVisitor(e){switch(e){case y.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){const r=this.obfuscatingGuards.every(t=>t.check(e));return h.NodeMetadata.set(e,{ignoredNode:!r}),e}};b.obfuscatingGuardsList=[g.ObfuscatingGuard.BlackListObfuscatingGuard,g.ObfuscatingGuard.ConditionalCommentObfuscatingGuard,g.ObfuscatingGuard.ReservedStringObfuscatingGuard],b=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__INodeGuard)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TObfuscatingGuardFactory&&f.TObfuscatingGuardFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],b),t.ObfuscatingGuardsTransformer=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(11),p=r(12),m=r(6);let g=class extends p.AbstractNodeTransformer{constructor(e,t){super(e,t)}getVisitor(e){switch(e){case f.TransformationStage.Preparing:return{enter:(e,t)=>this.transformNode(e,t)};default:return null}}transformNode(e,t){return m.NodeUtils.parentizeNode(e,t)}};g=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],g),t.ParentificationTransformer=g},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(2),d=r(1),l=r(4);let u=class{constructor(e){this.options=e}check(e){return!this.options.reservedStrings.length||!l.NodeGuards.isLiteralNode(e)||"string"!=typeof e.value||!this.isReservedString(e.value)}isReservedString(e){return this.options.reservedStrings.some(t=>null!==new RegExp(t,"g").exec(e))}};u=n([s.injectable(),a(0,s.inject(d.ServiceIdentifiers.IOptions)),i("design:paramtypes",["function"==typeof(o=void 0!==c.IOptions&&c.IOptions)?o:Object])],u),t.ReservedStringObfuscatingGuard=u},function(e,t,r){"use strict";var o,n,i,a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(50),u=r(2),f=r(3),p=r(38),m=r(1),g=r(11),y=r(12),N=r(4);let h=class extends y.AbstractNodeTransformer{constructor(e,t,r){super(t,r),this.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer)}getVisitor(e){switch(e){case g.TransformationStage.Preparing:return{enter:(e,t)=>{if(N.NodeGuards.isIdentifierNode(e)&&t&&(N.NodeGuards.parentNodeIsPropertyNode(e,t)||N.NodeGuards.parentNodeIsMemberExpressionNode(e,t)||N.NodeGuards.parentNodeIsMethodDefinitionNode(e,t)||N.NodeGuards.isLabelIdentifierNode(e,t)))return this.transformNode(e,t)}};default:return null}}transformNode(e,t){return this.identifierObfuscatingReplacer.preserveName(e.name),e}};h=a([d.injectable(),c(0,d.inject(m.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c(1,d.inject(m.ServiceIdentifiers.IRandomGenerator)),c(2,d.inject(m.ServiceIdentifiers.IOptions)),s("design:paramtypes",["function"==typeof(o=void 0!==l.TIdentifierObfuscatingReplacerFactory&&l.TIdentifierObfuscatingReplacerFactory)?o:Object,"function"==typeof(n=void 0!==f.IRandomGenerator&&f.IRandomGenerator)?n:Object,"function"==typeof(i=void 0!==u.IOptions&&u.IOptions)?i:Object])],h),t.VariablePreserveTransformer=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(211),a=r(212),s=r(214);t.storagesModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.TCustomNodeGroupStorage).to(a.CustomNodeGroupStorage).inSingletonScope(),e(n.ServiceIdentifiers.IStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(n.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(i.ControlFlowStorage),e(n.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(e=>()=>{const t=new(e.container.get(n.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(n.ServiceIdentifiers.IRandomGenerator),e.container.get(n.ServiceIdentifiers.IOptions));return t.initialize(),t})})},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(2),u=r(3),f=r(51);let p=class extends f.MapStorage{constructor(e,t){super(e,t)}};p=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.IRandomGenerator)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==u.IRandomGenerator&&u.IRandomGenerator)?o:Object,"function"==typeof(n=void 0!==l.IOptions&&l.IOptions)?n:Object])],p),t.ControlFlowStorage=p},function(e,t,r){"use strict";var o,n,i,a,s=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},c=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const l=r(0),u=r(1),f=r(213),p=r(2),m=r(3),g=r(61),y=r(51);let N=o=class extends y.MapStorage{constructor(e,t,r){super(t,r),this.customNodeGroupFactory=e}initialize(){super.initialize(),o.customNodeGroupsList.forEach(e=>{const t=this.customNodeGroupFactory(e);this.storage.set(e,t)})}};N.customNodeGroupsList=[g.CustomNodeGroup.ConsoleOutputCustomNodeGroup,g.CustomNodeGroup.DebugProtectionCustomNodeGroup,g.CustomNodeGroup.DomainLockCustomNodeGroup,g.CustomNodeGroup.SelfDefendingCustomNodeGroup,g.CustomNodeGroup.StringArrayCustomNodeGroup],s([l.postConstruct(),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],N.prototype,"initialize",null),N=o=s([l.injectable(),d(0,l.inject(u.ServiceIdentifiers.Factory__ICustomNodeGroup)),d(1,l.inject(u.ServiceIdentifiers.IRandomGenerator)),d(2,l.inject(u.ServiceIdentifiers.IOptions)),c("design:paramtypes",["function"==typeof(n=void 0!==f.TCustomNodeGroupFactory&&f.TCustomNodeGroupFactory)?n:Object,"function"==typeof(i=void 0!==m.IRandomGenerator&&m.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==p.IOptions&&p.IOptions)?a:Object])],N),t.CustomNodeGroupStorage=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d,l=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},u=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=r(5),y=r(34),N=r(48),h=r(29),b=r(2),I=r(3),v=r(7),S=r(24),O=r(51);let j=o=class extends O.MapStorage{constructor(e,t,r,n,i,a){super(r,n),this.rc4EncodedValuesSourcesCache=new Map,this.rotationAmount=0,this.identifierNamesGenerator=e(n),this.arrayUtils=t,this.cryptUtils=i,this.escapeSequenceEncoder=a,this.rc4Keys=this.randomGenerator.getRandomGenerator().n(()=>this.randomGenerator.getRandomGenerator().string({length:o.rc4KeyLength}),o.rc4KeysCount)}initialize(){super.initialize();const e=this.identifierNamesGenerator.generate(o.stringArrayNameLength),t=this.identifierNamesGenerator.generate(o.stringArrayNameLength);this.stringArrayStorageName=`${this.options.identifiersPrefix}${e}`,this.stringArrayStorageCallsWrapperName=`${this.options.identifiersPrefix}${t}`,this.rotationAmount=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(o.minimumRotationAmount,o.maximumRotationAmount):0}get(e){return this.getOrSetIfDoesNotExist(e)}getRotationAmount(){return this.rotationAmount}getStorageId(){return this.stringArrayStorageName}getStorageName(){return this.getStorageId()}getStorageCallsWrapperName(){return this.stringArrayStorageCallsWrapperName}rotateStorage(){this.getLength()&&(this.storage=new Map(this.arrayUtils.rotate(Array.from(this.storage.entries()),this.rotationAmount)))}shuffleStorage(){this.storage=new Map(this.arrayUtils.shuffle(Array.from(this.storage.entries())).map(([e,t],r)=>(t.index=r,[e,t])).sort(([,e],[,t])=>e.index-t.index))}toString(){return Array.from(this.storage.values()).map(e=>`'${this.escapeSequenceEncoder.encode(e.encodedValue,this.options.unicodeEscapeSequence)}'`).toString()}getOrSetIfDoesNotExist(e){const{encodedValue:t,decodeKey:r}=this.getEncodedValue(e),o=this.storage.get(t);if(o)return o;const n={encodedValue:t,decodeKey:r,value:e,index:this.getLength()};return this.storage.set(t,n),n}getEncodedValue(e){var t;switch(this.options.stringArrayEncoding){case S.StringArrayEncoding.Rc4:{const r=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),o=this.cryptUtils.btoa(this.cryptUtils.rc4(e,r)),n=null!==(t=this.rc4EncodedValuesSourcesCache.get(o))&&void 0!==t?t:[];let i=n.length;return(!i||!n.includes(e))&&(n.push(e),i++),this.rc4EncodedValuesSourcesCache.set(o,n),i>1?this.getEncodedValue(e):{encodedValue:o,decodeKey:r}}case S.StringArrayEncoding.Base64:{const t=null;return{encodedValue:this.cryptUtils.btoa(e),decodeKey:t}}default:return{encodedValue:e,decodeKey:null}}}};j.minimumRotationAmount=100,j.maximumRotationAmount=500,j.rc4KeyLength=4,j.rc4KeysCount=50,j.stringArrayNameLength=7,l([v.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageName",void 0),l([v.initializable(),u("design:type",String)],j.prototype,"stringArrayStorageCallsWrapperName",void 0),l([p.postConstruct(),u("design:type",Function),u("design:paramtypes",[]),u("design:returntype",void 0)],j.prototype,"initialize",null),j=o=l([p.injectable(),f(0,p.inject(m.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),f(1,p.inject(m.ServiceIdentifiers.IArrayUtils)),f(2,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f(3,p.inject(m.ServiceIdentifiers.IOptions)),f(4,p.inject(m.ServiceIdentifiers.ICryptUtils)),f(5,p.inject(m.ServiceIdentifiers.IEscapeSequenceEncoder)),u("design:paramtypes",["function"==typeof(n=void 0!==g.TIdentifierNamesGeneratorFactory&&g.TIdentifierNamesGeneratorFactory)?n:Object,"function"==typeof(i=void 0!==y.IArrayUtils&&y.IArrayUtils)?i:Object,"function"==typeof(a=void 0!==I.IRandomGenerator&&I.IRandomGenerator)?a:Object,"function"==typeof(s=void 0!==b.IOptions&&b.IOptions)?s:Object,"function"==typeof(c=void 0!==N.ICryptUtils&&N.ICryptUtils)?c:Object,"function"==typeof(d=void 0!==h.IEscapeSequenceEncoder&&h.IEscapeSequenceEncoder)?d:Object])],j),t.StringArrayStorage=j},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(0),n=r(1),i=r(216),a=r(217),s=r(221),c=r(222),d=r(223),l=r(68);t.utilsModule=new o.ContainerModule(e=>{e(n.ServiceIdentifiers.IArrayUtils).to(i.ArrayUtils).inSingletonScope(),e(n.ServiceIdentifiers.IRandomGenerator).to(l.RandomGenerator).inSingletonScope(),e(n.ServiceIdentifiers.ICryptUtils).to(a.CryptUtils).inSingletonScope(),e(n.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope(),e(n.ServiceIdentifiers.ILevelledTopologicalSorter).to(c.LevelledTopologicalSorter),e(n.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder).to(d.NodeTransformerNamesGroupsBuilder).inSingletonScope()})},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(3);let l=class{constructor(e){this.randomGenerator=e}createWithRange(e){const t=[];for(let r=0;rn&&(o=i,n=e),r[i]=e}return o}rotate(e,t){if(!e.length)throw new ReferenceError("Cannot rotate empty array.");if(t<=0)return e;const r=e;let o;for(;t--;)o=r.pop(),o&&r.unshift(o);return r}shuffle(e){const t=[...e];for(let e=t.length;e;e--){const r=Math.floor(this.randomGenerator.getMathRandom()*e);[t[e-1],t[r]]=[t[r],t[e-1]]}return t}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i("design:paramtypes",["function"==typeof(o=void 0!==d.IRandomGenerator&&d.IRandomGenerator)?o:Object])],l),t.ArrayUtils=l},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(3),l=r(68),u=r(30);let f=class{constructor(e){this.randomGenerator=e}btoa(e){let t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(`${u.Utils.hexadecimalPrefix}${t}`,16)));for(let r,o,n=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|n)||(i="=",n%1);t+=i.charAt(63&r>>8-n%1*8)){if(o=e.charCodeAt(n+=.75),o>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|o}return t}hideString(e,t){let r=this.randomGenerator.getRandomGenerator().string({length:t,pool:l.RandomGenerator.randomGeneratorPool}).replace(new RegExp(`[${o=e,o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}]`,"g"),"");var o;const n=r.split("");return this.randomGenerator.getRandomGenerator().shuffle(n),r=n.join(""),[((e,t)=>{let r=-1,o=-1,n="";for(;r=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.stringsCache=new Map}encode(e,t){const r=`${e}-${String(t)}`;if(this.stringsCache.has(r))return this.stringsCache.get(r);const o=new RegExp("[\\s\\S]","g"),n=new RegExp("['\"\\\\\\s]"),i=new RegExp("[\\x00-\\x7F]");let a,s;const c=e.replace(o,e=>t||n.exec(e)?(i.exec(e)?(a="\\x",s="00"):(a="\\u",s="0000"),`${a}${(s+e.charCodeAt(0).toString(16)).slice(-s.length)}`):e);return this.stringsCache.set(r,c),this.stringsCache.set(`${c}-${String(t)}`,c),c}};n=o([r(0).injectable()],n),t.EscapeSequenceEncoder=n},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0});let n=class{constructor(){this.graph=new Map}add(e,t=null){return null!==t?this.link(e,t):this.register(e)}sort(){const e=Array.from(this.graph.keys()),t=[],r={};for(const o of e)void 0===r[o]&&this.visit(t,r,o);return t}sortByGroups(){this.sort();const e=[];for(;this.hasNodes();){const t=this.findRootNodes();e.push(t);for(const e of t)this.delete(e)}return e}delete(e){if(this.getPrecedents(e).length)throw new Error(`Unable to remove non-root node: ${e}`);this.graph.delete(e);const t=Array.from(this.graph.values());for(const r of t){for(let t=r.length-1;t>=0;t-=1)r[t]===e&&r.splice(t,1)}}findRootNodes(){const e=Array.from(this.graph.keys()),t=[];for(const r of e)this.hasPrecedents(r)||t.push(r);return t}getPrecedents(e){const t=this.graph.get(e);if(!t)throw new Error(`Unknown node: ${e}`);return t}hasNodes(){return this.graph.size>0}hasPrecedents(e){return this.getPrecedents(e).length>0}link(e,t){this.register(e),this.register(t);const r=this.graph.get(t);return r&&!r.includes(e)&&r.push(e),this}register(e){return this.graph.has(e)||this.graph.set(e,[]),this}visit(e,t,r){const o=t[r];if("visiting"===o)throw new Error(`Detected cycle involving node: ${r}`);if(o)return;t[r]="visiting";const n=this.getPrecedents(r);for(const r of n)this.visit(e,t,r);t[r]="ok",e.push(r)}};n=o([r(0).injectable()],n),t.LevelledTopologicalSorter=n},function(e,t,r){"use strict";var o,n=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(0),c=r(1),d=r(224);let l=class{constructor(e){this.levelledTopologicalSorter=e}build(e){const t=Object.keys(e),r=this.buildNodeTransformersRelationEdges(t,e);for(const[e,t]of r)this.levelledTopologicalSorter.add(e,t);return this.levelledTopologicalSorter.sortByGroups()}buildNodeTransformersRelationEdges(e,t){const r=[];for(const o of e){const e=t[o].runAfter;if(e&&e.length)for(const n of e){void 0===t[n]?r.push([o,null]):r.push([n,o])}else r.push([o,null])}return r}};l=n([s.injectable(),a(0,s.inject(c.ServiceIdentifiers.ILevelledTopologicalSorter)),i("design:paramtypes",["function"==typeof(o=void 0!==d.ILevelledTopologicalSorter&&d.ILevelledTopologicalSorter)?o:Object])],l),t.NodeTransformerNamesGroupsBuilder=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";var o,n,i,a,s,c,d=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const p=r(0),m=r(1),g=f(r(46)),y=r(226),N=r(227),h=r(2),b=r(3),I=r(57),v=r(228),S=r(21),O=r(11),j=r(43),_=r(55),C=r(4);let R=o=class{constructor(e,t,r,o,n){this.transformersRunner=e,this.randomGenerator=t,this.obfuscatedCodeFactory=r,this.logger=o,this.options=n}obfuscate(e){const t=Date.now();this.logger.info(v.LoggingMessage.Version,"0.24.6"),this.logger.info(v.LoggingMessage.ObfuscationStarted),this.logger.info(v.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getInputSeed());const r=this.parseCode(e),o=this.transformAstTree(r),n=this.generateCode(e,o),i=(Date.now()-t)/1e3;return this.logger.success(v.LoggingMessage.ObfuscationCompleted,i),this.getObfuscatedCode(n)}parseCode(e){const t={sourceCode:e,inputFilePath:this.options.inputFilePath};return _.ASTParserFacade.parse(t,o.parseOptions)}transformAstTree(e){return e=this.runTransformationStage(e,O.TransformationStage.Initializing),!C.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments||e.trailingComments?(e=this.runTransformationStage(e,O.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,O.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,O.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,O.TransformationStage.Converting),e=this.runTransformationStage(e,O.TransformationStage.Obfuscating),e=this.runTransformationStage(e,O.TransformationStage.Finalizing)):(this.logger.warn(v.LoggingMessage.EmptySourceCode),e)}generateCode(e,t){const r=Object.assign({},o.escodegenParams);this.options.sourceMap&&(r.sourceMap=this.options.inputFileName||"sourceMap",r.sourceContent=e);const n=g.generate(t,Object.assign(Object.assign({},r),{format:{compact:this.options.compact}}));return n.map=n.map?n.map.toString():"",n}getObfuscatedCode(e){return this.obfuscatedCodeFactory(e.code,e.map)}runTransformationStage(e,t){return this.logger.info(v.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,o.transformersList,t)}};R.parseOptions={ecmaVersion:j.ecmaVersion,allowHashBang:!0,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,locations:!0,ranges:!0},R.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},R.transformersList=[S.NodeTransformer.BlockStatementControlFlowTransformer,S.NodeTransformer.CommentsTransformer,S.NodeTransformer.CustomNodesTransformer,S.NodeTransformer.DeadCodeInjectionTransformer,S.NodeTransformer.EvalCallExpressionTransformer,S.NodeTransformer.FunctionControlFlowTransformer,S.NodeTransformer.LabeledStatementTransformer,S.NodeTransformer.LiteralTransformer,S.NodeTransformer.MemberExpressionTransformer,S.NodeTransformer.MetadataTransformer,S.NodeTransformer.MethodDefinitionTransformer,S.NodeTransformer.ObfuscatingGuardsTransformer,S.NodeTransformer.ObjectExpressionKeysTransformer,S.NodeTransformer.ObjectExpressionTransformer,S.NodeTransformer.ParentificationTransformer,S.NodeTransformer.ScopeIdentifiersTransformer,S.NodeTransformer.SplitStringTransformer,S.NodeTransformer.TemplateLiteralTransformer,S.NodeTransformer.VariablePreserveTransformer],R=o=d([p.injectable(),u(0,p.inject(m.ServiceIdentifiers.ITransformersRunner)),u(1,p.inject(m.ServiceIdentifiers.IRandomGenerator)),u(2,p.inject(m.ServiceIdentifiers.Factory__IObfuscatedCode)),u(3,p.inject(m.ServiceIdentifiers.ILogger)),u(4,p.inject(m.ServiceIdentifiers.IOptions)),l("design:paramtypes",["function"==typeof(n=void 0!==I.ITransformersRunner&&I.ITransformersRunner)?n:Object,"function"==typeof(i=void 0!==b.IRandomGenerator&&b.IRandomGenerator)?i:Object,"function"==typeof(a=void 0!==y.TObfuscatedCodeFactory&&y.TObfuscatedCodeFactory)?a:Object,"function"==typeof(s=void 0!==N.ILogger&&N.ILogger)?s:Object,"function"==typeof(c=void 0!==h.IOptions&&h.IOptions)?c:Object])],R),t.JavaScriptObfuscator=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,r){"use strict";var o=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),a=n(r(230));i.decorate(i.injectable(),a.default);let s=class extends a.default{};s=o([i.injectable()],s),t.ObfuscationEventEmitter=s},function(e,t){e.exports=require("eventemitter3")},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}};Object.defineProperty(t,"__esModule",{value:!0});const c=r(0),d=r(1),l=r(48),u=r(7),f=r(32),p=r(2);let m=class{constructor(e,t){this.cryptUtils=e,this.options=t}initialize(e,t){this.obfuscatedCode=e,this.sourceMap=t}getObfuscatedCode(){return this.correctObfuscatedCode()}getSourceMap(){return this.sourceMap}toString(){return this.obfuscatedCode}correctObfuscatedCode(){if(!this.sourceMap)return this.obfuscatedCode;const e=this.options.sourceMapBaseUrl+this.options.sourceMapFileName;let t="//# sourceMappingURL=";switch(this.options.sourceMapMode){case f.SourceMapMode.Inline:t+=`data:application/json;base64,${this.cryptUtils.btoa(this.sourceMap)}`;break;case f.SourceMapMode.Separate:default:if(!e)return this.obfuscatedCode;t+=e}return`${this.obfuscatedCode}\n${t}`}};i([u.initializable(),a("design:type",String)],m.prototype,"obfuscatedCode",void 0),i([u.initializable(),a("design:type",String)],m.prototype,"sourceMap",void 0),m=i([c.injectable(),s(0,c.inject(d.ServiceIdentifiers.ICryptUtils)),s(1,c.inject(d.ServiceIdentifiers.IOptions)),a("design:paramtypes",["function"==typeof(o=void 0!==l.ICryptUtils&&l.ICryptUtils)?o:Object,"function"==typeof(n=void 0!==p.IOptions&&p.IOptions)?n:Object])],m),t.ObfuscatedCode=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SourceCode=class{constructor(e,t){this.sourceCode=e,this.sourceMap=t}getSourceCode(){return this.sourceCode}getSourceMap(){return this.sourceMap}toString(){return this.sourceCode}}},function(e,t,r){"use strict";var o,n,i=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__param||function(e,t){return function(r,o){t(r,o,e)}},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(0),l=r(1),u=c(r(13)),f=r(234),p=r(235),m=r(236),g=r(4),y=r(15);let N=class{constructor(e,t){this.cachedNodeTransformersData=new Map,this.nodeTransformerFactory=e,this.nodeTransformerNamesGroupsBuilder=t}transform(e,t,r){if(!t.length)return e;let o,n;this.cachedNodeTransformersData.has(t)?[o,n]=this.cachedNodeTransformersData.get(t):(o=this.buildNormalizedNodeTransformers(t),n=this.nodeTransformerNamesGroupsBuilder.build(o),this.cachedNodeTransformersData.set(t,[o,n]));for(const t of n){const n=[],i=[];for(const e of t){const t=o[e].getVisitor(r);t&&(t.enter&&n.push({enter:t.enter}),t.leave&&i.push({leave:t.leave}))}(n.length||i.length)&&u.replace(e,{enter:this.mergeVisitorsForDirection(n,m.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(i,m.VisitorDirection.Leave)})}return e}buildNormalizedNodeTransformers(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:this.nodeTransformerFactory(t)}),{})}mergeVisitorsForDirection(e,t){const r=e.length;return r?(o,n)=>{if(y.NodeMetadata.isIgnoredNode(o))return u.VisitorOption.Skip;for(let i=0;ie}};N=i([d.injectable(),s(0,d.inject(l.ServiceIdentifiers.Factory__INodeTransformer)),s(1,d.inject(l.ServiceIdentifiers.INodeTransformerNamesGroupsBuilder)),a("design:paramtypes",["function"==typeof(o=void 0!==f.TNodeTransformerFactory&&f.TNodeTransformerFactory)?o:Object,"function"==typeof(n=void 0!==p.INodeTransformerNamesGroupsBuilder&&p.INodeTransformerNamesGroupsBuilder)?n:Object])],N),t.TransformersRunner=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(25);e.exports=o.JavaScriptObfuscator}]); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/package.json b/package.json index 1fad267f..1c916d1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "javascript-obfuscator", - "version": "0.24.5", + "version": "0.24.6", "description": "JavaScript obfuscator", "keywords": [ "obfuscator",