Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlLoud/e0a5f6bc3c957635f7fe031686cc89b1 to your computer and use it in GitHub Desktop.
Save AlLoud/e0a5f6bc3c957635f7fe031686cc89b1 to your computer and use it in GitHub Desktop.
Identifiers.has(n)?this.replaceScopeCachedIdentifiers(e,n,r):this.replaceScopeIdentifiers(n,r),e)}},{key:"storeFunctionName",value:function(e,t,r){t?this.identifierObfuscatingReplacer.storeGlobalName(e.id.name,r):this.identifierObfuscatingReplacer.storeLocalName(e.id.name,r)}},{key:"replaceScopeCachedIdentifiers",value:function(e,t,r){var n=this.replaceableIdentifiers.get(t);if(n){var o=n.get(e.id.name);if(o)for(var a=o.length,i=0;i<a;i++){var s=o[i],c=this.identifierObfuscatingReplacer.replace(s.name,r);s.name=c.name}}}},{key:"replaceScopeIdentifiers",value:function(e,t){var r=this,n=new Map;l.replace(e,{enter:function(e,o){if(o&&y.NodeGuards.isReplaceableIdentifierNode(e,o)){var a=r.identifierObfuscatingReplacer.replace(e.name,t),i=a.name;if(e.name!==i)e.name=i;else{var s=n.get(e.name)||[];s.push(e),n.set(e.name,s)}}}}),this.replaceableIdentifiers.set(e,n)}}]),t}(m.AbstractNodeTransformer);g=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),s.__param(1,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(2,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Function,Object,Object])],g),t.FunctionDeclarationTransformer=g},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=s.__importStar(r(10)),f=r(18),d=r(6),p=r(7),m=r(3),y=function(e){function t(e,r,a){n(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,a));return i.identifierObfuscatingReplacer=e(f.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),i}return a(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case d.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&(m.NodeGuards.isFunctionDeclarationNode(e)||m.NodeGuards.isFunctionExpressionNode(e)||m.NodeGuards.isArrowFunctionExpressionNode(e)))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++;return this.storeFunctionParams(e,r),this.replaceFunctionParams(e,r),e}},{key:"storeFunctionParams",value:function(e,t){var r=this;e.params.forEach(function(e){if(m.NodeGuards.isObjectPatternNode(e))return l.VisitorOption.Skip;l.traverse(e,{enter:function(e){if(m.NodeGuards.isAssignmentPatternNode(e)&&m.NodeGuards.isIdentifierNode(e.left))return r.identifierObfuscatingReplacer.storeLocalName(e.left.name,t),l.VisitorOption.Skip;m.NodeGuards.isIdentifierNode(e)&&r.identifierObfuscatingReplacer.storeLocalName(e.name,t)}})})}},{key:"addIdentifiersToIgnoredIdentifierNamesSet",value:function(e,t){e.forEach(function(e){m.NodeGuards.isIdentifierNode(e.key)&&t.add(e.key.name)})}},{key:"replaceFunctionParams",value:function(e,t){var r=this,n=new Set,o={enter:function(e,o){if(m.NodeGuards.isObjectPatternNode(e)&&r.addIdentifiersToIgnoredIdentifierNamesSet(e.properties,n),o&&m.NodeGuards.isReplaceableIdentifierNode(e,o)&&!n.has(e.name)){var a=r.identifierObfuscatingReplacer.replace(e.name,t),i=a.name;e.name!==i&&(e.name=i,e.obfuscatedNode=!0)}}};e.params.forEach(function(e){return l.replace(e,o)}),l.replace(e.body,o)}}]),t}(p.AbstractNodeTransformer);y=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),s.__param(1,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(2,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Function,Object,Object])],y),t.FunctionTransformer=y},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=s.__importStar(r(10)),f=r(18),d=r(6),p=r(7),m=r(3),y=function(e){function t(e,r,a){n(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,a));return i.identifierObfuscatingReplacer=e(f.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),i}return a(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case d.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&m.NodeGuards.isLabeledStatementNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++;return this.storeLabeledStatementName(e,r),this.replaceLabeledStatementName(e,r),e}},{key:"storeLabeledStatementName",value:function(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label.name,t)}},{key:"replaceLabeledStatementName",value:function(e,t){var r=this;l.replace(e,{enter:function(e,n){if(n&&m.NodeGuards.isLabelIdentifierNode(e,n)){var o=r.identifierObfuscatingReplacer.replace(e.name,t);e.name=o.name}}})}}]),t}(p.AbstractNodeTransformer);y=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),s.__param(1,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(2,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Function,Object,Object])],y),t.LabeledStatementTransformer=y},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i="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},s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var c=r(2),u=r(0),l=r(1),f=r(43),d=r(6),p=r(7),m=r(3),y=function(e){function t(e,r,a){n(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,a));return i.literalObfuscatingReplacerFactory=e,i}return a(t,e),s(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case d.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&m.NodeGuards.isLiteralNode(e)&&!e.obfuscatedNode)return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(t&&m.NodeGuards.isPropertyNode(t)&&t.key===e)return e;switch(i(e.value)){case"boolean":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e.value);case"number":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e.value);case"string":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e.value);default:return e}}}]),t}(p.AbstractNodeTransformer);y=c.__decorate([u.injectable(),c.__param(0,u.inject(l.ServiceIdentifiers.Factory__IObfuscatingReplacer)),c.__param(1,u.inject(l.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(l.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],y),t.LiteralTransformer=y},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=r(28),f=r(9),d=r(22),p=function(e){function t(e){n(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.numberLiteralCache=new Map,r}return a(t,e),i(t,[{key:"replace",value:function(e){var t=void 0;return this.numberLiteralCache.has(e)?t=this.numberLiteralCache.get(e):(t=d.Utils.isCeilNumber(e)?""+d.Utils.hexadecimalPrefix+d.Utils.decToHex(e):String(e),this.numberLiteralCache.set(e,t)),f.Nodes.getLiteralNode(e,t)}}]),t}(l.AbstractObfuscatingReplacer);p=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object])],p),t.NumberLiteralObfuscatingReplacer=p},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=r(11),f=r(6),d=r(7),p=r(3),m=y=function(e){function t(e,r){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return a(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case f.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&p.NodeGuards.isObjectExpressionNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return e.properties.forEach(function(e){e.computed||(e.shorthand&&(e.shorthand=!1),p.NodeGuards.isIdentifierNode(e.key)&&(e.key=y.transformIdentifierPropertyKey(e.key)))}),e}}],[{key:"transformIdentifierPropertyKey",value:function(e){return{type:l.NodeType.Literal,value:e.name,raw:"'"+e.name+"'"}}}]),t}(d.AbstractNodeTransformer);m=y=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(1,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object])],m),t.ObjectExpressionTransformer=m;var y},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=r(26),f=r(28),d=r(9),p=r(22),m=y=function(e){function t(e,r,a,i,s){n(this,t);var c=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,s));return c.nodesCache=new Map,c.stringLiteralHexadecimalIndexCache=new Map,c.stringArrayStorage=e,c.escapeSequenceEncoder=r,c.randomGenerator=a,c.cryptUtils=i,c.rc4Keys=c.randomGenerator.getRandomGenerator().n(function(){return c.randomGenerator.getRandomGenerator().string({length:y.rc4KeyLength})},y.rc4KeysCount),c}return a(t,e),i(t,[{key:"replace",value:function(e){var t=this.canUseStringArray(e),r=e+"-"+String(t);if(this.nodesCache.has(r)&&this.options.stringArrayEncoding!==l.StringArrayEncoding.Rc4)return this.nodesCache.get(r);var n=t?this.replaceWithStringArrayCallNode(e):this.replaceWithLiteralNode(e);return this.nodesCache.set(r,n),n}},{key:"canUseStringArray",value:function(e){return this.options.stringArray&&e.length>=y.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}},{key:"getStringArrayHexadecimalIndex",value:function(e,t){if(this.stringLiteralHexadecimalIndexCache.has(e))return{fromCache:!0,index:this.stringLiteralHexadecimalIndexCache.get(e)};var r=p.Utils.decToHex(t),n=""+p.Utils.hexadecimalPrefix+r;return this.stringLiteralHexadecimalIndexCache.set(e,n),{fromCache:!1,index:n}}},{key:"getEncodedValue",value:function(e){var t=void 0,r=null;switch(this.options.stringArrayEncoding){case l.StringArrayEncoding.Rc4:r=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),t=this.cryptUtils.btoa(this.cryptUtils.rc4(e,r));break;case l.StringArrayEncoding.Base64:t=this.cryptUtils.btoa(e);break;default:t=e}return{encodedValue:t,key:r}}},{key:"replaceWithLiteralNode",value:function(e){return d.Nodes.getLiteralNode(this.escapeSequenceEncoder.encode(e,this.options.unicodeEscapeSequence))}},{key:"replaceWithStringArrayCallNode",value:function(e){var t=this.getEncodedValue(e),r=t.encodedValue,n=t.key,o=this.escapeSequenceEncoder.encode(r,this.options.unicodeEscapeSequence),a=this.stringArrayStorage.getLength(),i=this.stringArrayStorage.getStorageId().split("|")[1],s=this.getStringArrayHexadecimalIndex(o,a),c=s.fromCache,u=s.index;c||this.stringArrayStorage.set(a,o);var l=[y.getHexadecimalLiteralNode(u)];n&&l.push(y.getRc4KeyLiteralNode(this.escapeSequenceEncoder.encode(n,this.options.unicodeEscapeSequence)));var f=d.Nodes.getIdentifierNode(i);return f.obfuscatedNode=!0,d.Nodes.getCallExpressionNode(f,l)}}],[{key:"getHexadecimalLiteralNode",value:function(e){var t=d.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}},{key:"getRc4KeyLiteralNode",value:function(e){var t=d.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}}]),t}(f.AbstractObfuscatingReplacer);m.minimumLengthForStringArray=3,m.rc4KeyLength=4,m.rc4KeysCount=50,m=y=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.TStringArrayStorage)),s.__param(1,c.inject(u.ServiceIdentifiers.IEscapeSequenceEncoder)),s.__param(2,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(3,c.inject(u.ServiceIdentifiers.ICryptUtils)),s.__param(4,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],m),t.StringLiteralObfuscatingReplacer=m;var y},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=s.__importStar(r(10)),f=r(18),d=r(11),p=r(6),m=r(7),y=r(3),b=r(4),g=function(e){function t(e,r,a){n(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,a));return i.replaceableIdentifiers=new Map,i.identifierObfuscatingReplacer=e(f.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),i}return a(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&y.NodeGuards.isVariableDeclarationNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=b.NodeUtils.getBlockScopesOfNode(e)[0],n=r.type===d.NodeType.Program;if(!this.options.renameGlobals&&n)return e;var o=this.nodeIdentifier++,a="var"===e.kind?r:t;return this.storeVariableNames(e,n,o),this.replaceableIdentifiers.has(a)?this.replaceScopeCachedIdentifiers(e,a,o):this.replaceScopeIdentifiers(a,o),e}},{key:"storeVariableNames",value:function(e,t,r){var n=this;this.traverseDeclarationIdentifiers(e,function(e){t?n.identifierObfuscatingReplacer.storeGlobalName(e.name,r):n.identifierObfuscatingReplacer.storeLocalName(e.name,r)})}},{key:"replaceScopeCachedIdentifiers",value:function(e,t,r){var n=this,o=this.replaceableIdentifiers.get(t);if(o){var a=[];this.traverseDeclarationIdentifiers(e,function(e){a.push(e.name)}),a.forEach(function(e){var t=o.get(e);if(t)for(var a=t.length,i=0;i<a;i++){var s=t[i];if(e===s.name){var c=n.identifierObfuscatingReplacer.replace(s.name,r);s.name=c.name}}})}}},{key:"replaceScopeIdentifiers",value:function(e,t){var r=this,n=new Map;l.replace(e,{enter:function(e,o){if(o&&!e.obfuscatedNode&&y.NodeGuards.isReplaceableIdentifierNode(e,o)){var a=r.identifierObfuscatingReplacer.replace(e.name,t),i=a.name;if(e.name!==i)e.name=i;else{var s=n.get(e.name)||[];s.push(e),n.set(e.name,s)}}}}),this.replaceableIdentifiers.set(e,n)}},{key:"traverseDeclarationIdentifiers",value:function(e,t){e.declarations.forEach(function(e){if(y.NodeGuards.isObjectPatternNode(e.id))return l.VisitorOption.Skip;l.traverse(e.id,{enter:function(e){y.NodeGuards.isIdentifierNode(e)&&t(e)}})})}}]),t}(m.AbstractNodeTransformer);g=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),s.__param(1,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(2,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Function,Object,Object])],g),t.VariableDeclarationTransformer=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(1),a=r(136),i=r(139);t.optionsModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.IOptions).to(a.Options).inSingletonScope(),e(o.ServiceIdentifiers.IOptionsNormalizer).to(i.OptionsNormalizer).inSingletonScope()})},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),a=r(0),i=r(1),s=r(137),c=r(24),u=r(14),l=r(25),f=r(26),d=r(33),p=r(138),m=y=function e(t,r){n(this,e),Object.assign(this,d.DEFAULT_PRESET,t);var o=s.validateSync(this,y.validatorOptions);if(o.length)throw new ReferenceError("Validation failed. errors:\n"+p.ValidationErrorsFormatter.format(o));Object.assign(this,r.normalize(this))};m.validatorOptions={validationError:{target:!1}},o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"compact",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"controlFlowFlattening",void 0),o.__decorate([s.IsNumber(),s.Min(0),s.Max(1),o.__metadata("design:type",Number)],m.prototype,"controlFlowFlatteningThreshold",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"deadCodeInjection",void 0),o.__decorate([s.IsNumber(),o.__metadata("design:type",Number)],m.prototype,"deadCodeInjectionThreshold",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"debugProtection",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"debugProtectionInterval",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"disableConsoleOutput",void 0),o.__decorate([s.IsArray(),s.ArrayUnique(),s.IsString({each:!0}),o.__metadata("design:type",Array)],m.prototype,"domainLock",void 0),o.__decorate([s.IsIn([c.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,c.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]),o.__metadata("design:type",String)],m.prototype,"identifierNamesGenerator",void 0),o.__decorate([s.IsString(),o.__metadata("design:type",String)],m.prototype,"identifiersPrefix",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"log",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"renameGlobals",void 0),o.__decorate([s.IsArray(),s.ArrayUnique(),s.IsString({each:!0}),o.__metadata("design:type",Array)],m.prototype,"reservedNames",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"rotateStringArray",void 0),o.__decorate([s.IsNumber(),o.__metadata("design:type",Number)],m.prototype,"seed",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"selfDefending",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"sourceMap",void 0),o.__decorate([s.IsString(),s.ValidateIf(function(e){return Boolean(e.sourceMapBaseUrl)}),s.IsUrl({require_protocol:!0,require_tld:!1,require_valid_protocol:!0}),o.__metadata("design:type",String)],m.prototype,"sourceMapBaseUrl",void 0),o.__decorate([s.IsString(),o.__metadata("design:type",String)],m.prototype,"sourceMapFileName",void 0),o.__decorate([s.IsIn([l.SourceMapMode.Inline,l.SourceMapMode.Separate]),o.__metadata("design:type",String)],m.prototype,"sourceMapMode",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"stringArray",void 0),o.__decorate([s.IsIn([!0,!1,f.StringArrayEncoding.Base64,f.StringArrayEncoding.Rc4]),o.__metadata("design:type",Object)],m.prototype,"stringArrayEncoding",void 0),o.__decorate([s.IsNumber(),s.Min(0),s.Max(1),o.__metadata("design:type",Number)],m.prototype,"stringArrayThreshold",void 0),o.__decorate([s.IsIn([u.ObfuscationTarget.Browser,u.ObfuscationTarget.Extension,u.ObfuscationTarget.Node]),o.__metadata("design:type",String)],m.prototype,"target",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"transformObjectKeys",void 0),o.__decorate([s.IsBoolean(),o.__metadata("design:type",Boolean)],m.prototype,"unicodeEscapeSequence",void 0),m=y=o.__decorate([a.injectable(),o.__param(0,a.inject(i.ServiceIdentifiers.TInputOptions)),o.__param(1,a.inject(i.ServiceIdentifiers.IOptionsNormalizer)),o.__metadata("design:paramtypes",[Object,Object])],m),t.Options=m;var y},function(e,t){e.exports=require("class-validator")},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){n(this,e)}return o(e,null,[{key:"format",value:function(t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=t[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var c=i.value;r.push(e.formatError(c))}}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return r.join("\n")}},{key:"formatError",value:function(e){var t=e.constraints,r="`"+e.property+"` errors:\n";for(var n in t)t.hasOwnProperty(n)&&(r+=" - "+t[n]+"\n");return r}}]),e}();t.ValidationErrorsFormatter=a},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=r(140),c=r(141),u=r(142),l=r(143),f=r(144),d=r(145),p=r(146),m=r(147),y=r(148),b=r(149),g=v=function(){function e(){n(this,e)}return o(e,[{key:"normalize",value:function(e){var t=Object.assign({},e),r=!0,n=!1,o=void 0;try{for(var a,i=v.normalizerRules[Symbol.iterator]();!(r=(a=i.next()).done);r=!0){t=(0,a.value)(t)}}catch(e){n=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(n)throw o}}return t}}]),e}();g.normalizerRules=[s.ControlFlowFlatteningThresholdRule,c.DeadCodeInjectionRule,u.DeadCodeInjectionThresholdRule,l.DomainLockRule,f.SelfDefendingRule,d.SourceMapBaseUrlRule,p.SourceMapFileNameRule,m.StringArrayRule,y.StringArrayEncodingRule,b.StringArrayThresholdRule],g=v=a.__decorate([i.injectable()],g),t.OptionsNormalizer=g;var v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControlFlowFlatteningThresholdRule=function(e){return 0===e.controlFlowFlatteningThreshold&&(e=Object.assign({},e,{controlFlowFlattening:!1,controlFlowFlatteningThreshold:0})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(33);t.DeadCodeInjectionRule=function(e){return e.deadCodeInjection&&(e=Object.assign({},e,{deadCodeInjection:!0,stringArray:!0}),e.stringArrayThreshold||(e=Object.assign({},e,{stringArray:!0,stringArrayThreshold:n.DEFAULT_PRESET.stringArrayThreshold}))),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeadCodeInjectionThresholdRule=function(e){return 0===e.deadCodeInjectionThreshold&&(e=Object.assign({},e,{deadCodeInjection:!1,deadCodeInjectionThreshold:0})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22);t.DomainLockRule=function(e){if(e.domainLock.length){var t=[],r=!0,o=!1,a=void 0;try{for(var i,s=e.domainLock[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var c=i.value;t.push(n.Utils.extractDomainFromUrl(c))}}catch(e){o=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw a}}e=Object.assign({},e,{domainLock:t})}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingRule=function(e){return e.selfDefending&&(e=Object.assign({},e,{compact:!0,selfDefending:!0})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapBaseUrlRule=function(e){var t=e,r=t.sourceMapBaseUrl;return e.sourceMapFileName?(r&&!r.endsWith("/")&&(e=Object.assign({},e,{sourceMapBaseUrl:r+"/"})),e):e=Object.assign({},e,{sourceMapBaseUrl:""})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapFileNameRule=function(e){var t=e,r=t.sourceMapFileName;return r&&(r=r.replace(/^\/+/,"").split(".")[0],e=Object.assign({},e,{sourceMapFileName:r+".js.map"})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRule=function(e){return e.stringArray||(e=Object.assign({},e,{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26);t.StringArrayEncodingRule=function(e){return!0===e.stringArrayEncoding&&(e=Object.assign({},e,{stringArrayEncoding:n.StringArrayEncoding.Base64})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayThresholdRule=function(e){return 0===e.stringArrayThreshold&&(e=Object.assign({},e,{rotateStringArray:!1,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0})),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(15),o=r(0),a=r(1),i=r(20),s=r(44),c=r(151),u=r(152),l=r(153),f=r(154),d=r(155),p=r(157),m=r(158);t.preparingTransformersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.INodeTransformer).to(u.CommentsTransformer).whenTargetNamed(i.NodeTransformer.CommentsTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(f.CustomNodesTransformer).whenTargetNamed(i.NodeTransformer.CustomNodesTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(d.EvalCallExpressionTransformer).whenTargetNamed(i.NodeTransformer.EvalCallExpressionTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(p.ObfuscatingGuardsTransformer).whenTargetNamed(i.NodeTransformer.ObfuscatingGuardsTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(m.ParentificationTransformer).whenTargetNamed(i.NodeTransformer.ParentificationTransformer),e(a.ServiceIdentifiers.INodeGuard).to(c.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.BlackListNodeGuard),e(a.ServiceIdentifiers.INodeGuard).to(l.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(s.ObfuscatingGuard.ConditionalCommentNodeGuard),e(a.ServiceIdentifiers.Factory__INodeGuard).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.INodeGuard))})},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=r(3),c=u=function(){function e(){n(this,e),this.blackListGuardsLength=u.blackListGuards.length}return o(e,[{key:"check",value:function(e){for(var t=0;t<this.blackListGuardsLength;t++)if(u.blackListGuards[t](e))return!1;return!0}}]),e}();c.blackListGuards=[s.NodeGuards.isUseStrictOperator],c=u=a.__decorate([i.injectable(),a.__metadata("design:paramtypes",[])],c),t.BlackListObfuscatingGuard=c;var u},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=r(6),f=r(7),d=r(3),p=m=function(e){function t(e,r){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return a(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case l.TransformationStage.Preparing:return{leave:function(e,r){if(r&&d.NodeGuards.isNodeWithComments(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return e.leadingComments&&(e.leadingComments=this.transformComments(e.leadingComments)),e.trailingComments&&(e.trailingComments=this.transformComments(e.trailingComments)),e}},{key:"transformComments",value:function(e){return e.filter(function(e){return m.preservedWords.some(function(t){return-1!==e.value.indexOf(t)})})}}]),t}(f.AbstractNodeTransformer);p.preservedWords=["@license","@preserve"],p=m=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(1,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object])],p),t.CommentsTransformer=p;var m},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=r(3),c=u=function(){function e(){n(this,e),this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}return o(e,[{key:"check",value:function(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!s.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;var t=e.leadingComments,r=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),r&&(this.obfuscationAllowedForNextNode=this.checkComments(r)),this.obfuscationAllowedForCurrentNode}},{key:"checkComments",value:function(e){for(var t=e.length,r=this.obfuscationAllowedForCurrentNode,n=0;n<t;n++){var o=e[n];u.obfuscationEnableCommentRegExp.test(o.value)?r=!0:u.obfuscationDisableCommentRegExp.test(o.value)&&(r=!1)}return r}}]),e}();c.obfuscationEnableCommentRegExp=new RegExp("javascript-obfuscator *: *enable"),c.obfuscationDisableCommentRegExp=new RegExp("javascript-obfuscator *: *disable"),c=u=a.__decorate([i.injectable()],c),t.ConditionalCommentObfuscatingGuard=c;var u},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=r(17),f=r(6),d=r(7),p=r(3),m=function(e){function t(e,r,a,i,s){n(this,t);var c=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i,s));return c.stackTraceData=[],c.stackTraceAnalyzer=e,c.obfuscationEventEmitter=r,c.customNodeGroupStorage=a,c}return a(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case f.TransformationStage.Preparing:return{leave:function(e,r){if(p.NodeGuards.isProgramNode(e))return t.analyzeNode(e,r),t.appendCustomNodesBeforeObfuscation(e,r),t.transformNode(e,r)}};case f.TransformationStage.Finalizing:return{leave:function(e,r){p.NodeGuards.isProgramNode(e)&&t.appendCustomNodesAfterObfuscation(e,r)}};default:return null}}},{key:"analyzeNode",value:function(e,t){this.stackTraceData=this.stackTraceAnalyzer.analyze(e)}},{key:"transformNode",value:function(e,t){return e}},{key:"appendCustomNodesBeforeObfuscation",value:function(e,t){var r=this;this.customNodeGroupStorage.getStorage().forEach(function(e){e.initialize(),r.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(l.ObfuscationEvent.BeforeObfuscation,e,this.stackTraceData)}},{key:"appendCustomNodesAfterObfuscation",value:function(e,t){this.obfuscationEventEmitter.emit(l.ObfuscationEvent.AfterObfuscation,e,this.stackTraceData)}}]),t}(d.AbstractNodeTransformer);m=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.IStackTraceAnalyzer)),s.__param(1,c.inject(u.ServiceIdentifiers.IObfuscationEventEmitter)),s.__param(2,c.inject(u.ServiceIdentifiers.TCustomNodeGroupStorage)),s.__param(3,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(4,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],m),t.CustomNodesTransformer=m},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=s.__importDefault(r(156)),f=r(6),d=r(7),p=r(3),m=r(9),y=r(4),b=g=function(e){function t(e,r){n(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return a.evalRootAstHostNodeSet=new Set,a}return a(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case f.TransformationStage.Preparing:return{enter:function(e,r){if(r&&p.NodeGuards.isCallExpressionNode(e)&&p.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return t.transformNode(e,r)}};case f.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:function(e,r){if(r&&t.isEvalRootAstHostNode(e))return t.restoreNode(e,r)}}:null;default:return null}}},{key:"transformNode",value:function(e,t){var r=e.arguments[0];if(!r)return e;var n=g.extractEvalStringFromCallExpressionArgument(r);if(!n)return e;var o=void 0;try{o=y.NodeUtils.convertCodeToStructure(n)}catch(t){return e}var a=m.Nodes.getFunctionExpressionNode([],m.Nodes.getBlockStatementNode(o));return this.evalRootAstHostNodeSet.add(a),a}},{key:"restoreNode",value:function(e,t){var r=e.body.body,n=y.NodeUtils.convertStructureToCode(r);return m.Nodes.getCallExpressionNode(m.Nodes.getIdentifierNode("eval"),[m.Nodes.getLiteralNode(l.default(n))])}},{key:"isEvalRootAstHostNode",value:function(e){return p.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}}],[{key:"extractEvalStringFromCallExpressionArgument",value:function(e){return p.NodeGuards.isLiteralNode(e)?g.extractEvalStringFromLiteralNode(e):p.NodeGuards.isTemplateLiteralNode(e)?g.extractEvalStringFromTemplateLiteralNode(e):null}},{key:"extractEvalStringFromLiteralNode",value:function(e){return"string"==typeof e.value?e.value:null}},{key:"extractEvalStringFromTemplateLiteralNode",value:function(e){var t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}}]),t}(d.AbstractNodeTransformer);b=g=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(1,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object])],b),t.EvalCallExpressionTransformer=b;var g},function(e,t){e.exports=require("js-string-escape")},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=r(44),f=r(6),d=r(7),p=m=function(e){function t(e,r,a){n(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,a));return i.obfuscatingGuards=m.obfuscatingGuardsList.map(e),i}return a(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case f.TransformationStage.Preparing:return{enter:function(e,r){return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.obfuscatingGuards.every(function(t){return t.check(e)});return e.ignoredNode=!r,e}}]),t}(d.AbstractNodeTransformer);p.obfuscatingGuardsList=[l.ObfuscatingGuard.BlackListNodeGuard,l.ObfuscatingGuard.ConditionalCommentNodeGuard],p=m=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.Factory__INodeGuard)),s.__param(1,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(2,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Function,Object,Object])],p),t.ObfuscatingGuardsTransformer=p;var m},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),c=r(0),u=r(1),l=r(6),f=r(7),d=r(4),p=function(e){function t(e,r){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return a(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case l.TransformationStage.Preparing:return{enter:function(e,r){return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return d.NodeUtils.parentizeNode(e,t)}}]),t}(f.AbstractNodeTransformer);p=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(1,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object])],p),t.ParentificationTransformer=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(1),a=r(160),i=r(161),s=r(162);t.storagesModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.TCustomNodeGroupStorage).to(i.CustomNodeGroupStorage).inSingletonScope(),e(o.ServiceIdentifiers.TStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(o.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(a.ControlFlowStorage),e(o.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(function(e){return function(){var t=e.container.get(o.ServiceIdentifiers.Newable__TControlFlowStorage),r=e.container.get(o.ServiceIdentifiers.IRandomGenerator),n=e.container.get(o.ServiceIdentifiers.IOptions),a=new t(r,n);return a.initialize(),a}})})},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),s=r(0),c=r(1),u=r(45),l=function(e){function t(e,r){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return a(t,e),t}(u.MapStorage);l=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__param(1,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Object,Object])],l),t.ControlFlowStorage=l},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)};Object.defineProperty(t,"__esModule",{value:!0});var c=r(2),u=r(0),l=r(1),f=r(41),d=r(45),p=m=function(e){function t(e,r,a){n(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,a));return i.customNodeGroupFactory=e,i}return a(t,e),i(t,[{key:"initialize",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"initialize",this).call(this),m.customNodeGroupsList.forEach(function(t){var r=e.customNodeGroupFactory(t);r&&e.storage.set(t,r)})}}]),t}(d.MapStorage);p.customNodeGroupsList=[f.CustomNodeGroup.ConsoleOutputCustomNodeGroup,f.CustomNodeGroup.DebugProtectionCustomNodeGroup,f.CustomNodeGroup.DomainLockCustomNodeGroup,f.CustomNodeGroup.SelfDefendingCustomNodeGroup,f.CustomNodeGroup.StringArrayCustomNodeGroup],c.__decorate([u.postConstruct(),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],p.prototype,"initialize",null),p=m=c.__decorate([u.injectable(),c.__param(0,u.inject(l.ServiceIdentifiers.Factory__ICustomNodeGroup)),c.__param(1,u.inject(l.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(l.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],p),t.CustomNodeGroupStorage=p;var m},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)};Object.defineProperty(t,"__esModule",{value:!0});var c=r(2),u=r(0),l=r(1),f=r(163),d=p=function(e){function t(e,r,a,i){n(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a,i));return s.identifierNamesGenerator=e(i),s.arrayUtils=r,s}return a(t,e),i(t,[{key:"initialize",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"initialize",this).call(this);var e=this.identifierNamesGenerator.generate().slice(0,p.stringArrayNameLength),r=this.identifierNamesGenerator.generate().slice(0,p.stringArrayNameLength),n=""+this.options.identifiersPrefix+e,o=""+this.options.identifiersPrefix+r;this.storageId=n+"|"+o}},{key:"rotateArray",value:function(e){this.storage=this.arrayUtils.arrayRotate(this.storage,e)}},{key:"toString",value:function(){return this.storage.map(function(e){return"'"+e+"'"}).toString()}}]),t}(f.ArrayStorage);d.stringArrayNameLength=7,c.__decorate([u.postConstruct(),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],d.prototype,"initialize",null),d=p=c.__decorate([u.injectable(),c.__param(0,u.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(l.ServiceIdentifiers.IArrayUtils)),c.__param(2,u.inject(l.ServiceIdentifiers.IRandomGenerator)),c.__param(3,u.inject(l.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object,Object])],d),t.StringArrayStorage=d;var p},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),s=r(0),c=r(1),u=r(5),l=function(){function e(t,r){o(this,e),this.storageLength=0,this.randomGenerator=t,this.options=r}return a(e,[{key:"initialize",value:function(){this.storage=[],this.storageId=this.randomGenerator.getRandomString(6)}},{key:"get",value:function(e){var t=this.storage[e];if(!t)throw new Error("No value found in array storage with key `"+e+"`");return t}},{key:"getKeyOf",value:function(e){var t=this.storage.indexOf(e);return t>=0?t:null}},{key:"getLength",value:function(){return this.storageLength}},{key:"getStorage",value:function(){return this.storage}},{key:"getStorageId",value:function(){return this.storageId}},{key:"mergeWith",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.storage=[].concat(n(this.storage),n(e.getStorage())),t&&(this.storageId=e.getStorageId())}},{key:"set",value:function(e,t){e===this.storageLength?this.storage.push(t):this.storage.splice(e,0,t),this.storageLength++}}]),e}();i.__decorate([u.initializable(),i.__metadata("design:type",Array)],l.prototype,"storage",void 0),i.__decorate([u.initializable(),i.__metadata("design:type",String)],l.prototype,"storageId",void 0),i.__decorate([s.postConstruct(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],l.prototype,"initialize",null),l=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__param(1,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Object,Object])],l),t.ArrayStorage=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(1),a=r(165),i=r(166),s=r(169),c=r(46);t.utilsModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.IArrayUtils).to(a.ArrayUtils).inSingletonScope(),e(o.ServiceIdentifiers.IRandomGenerator).to(c.RandomGenerator).inSingletonScope(),e(o.ServiceIdentifiers.ICryptUtils).to(i.CryptUtils).inSingletonScope(),e(o.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope()})},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),s=r(0),c=r(1),u=function(){function e(t){o(this,e),this.randomGenerator=t}return a(e,[{key:"arrayRange",value:function(e){for(var t=[],r=0;r<e;r++)t.push(r);return t}},{key:"arrayRotate",value:function(e,t){if(!e.length)throw new ReferenceError("Cannot rotate empty array.");if(t<=0)return e;for(var r=e,n=void 0;t--;)n=r.pop(),r.unshift(n);return r}},{key:"arrayShuffle",value:function(e){for(var t=[].concat(n(e)),r=t.length;r;r--){var o=Math.floor(this.randomGenerator.getMathRandom()*r),a=[t[o],t[r-1]];t[r-1]=a[0],t[o]=a[1]}return t}}]),e}();u=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__metadata("design:paramtypes",[Object])],u),t.ArrayUtils=u},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=r(1),c=r(46),u=r(22),l=function(){function e(t){n(this,e),this.randomGenerator=t}return o(e,[{key:"btoa",value:function(e){var t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(""+u.Utils.hexadecimalPrefix+t))});for(var r,n,o=0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|o)||(a="=",o%1);t+=a.charAt(63&r>>8-o%1*8)){if((n=e.charCodeAt(o+=.75))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|n}return t}},{key:"hideString",value:function(e,t){var r=this,n=this.randomGenerator.getRandomGenerator().string({length:t,pool:c.RandomGenerator.randomGeneratorPool}),o=n.replace(new RegExp("["+function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e)+"]","g"),""),a=o.split("");return this.randomGenerator.getRandomGenerator().shuffle(a),o=a.join(""),[function(e,t){for(var n=-1,o=-1,a="";n<e.length||o<t.length;)r.randomGenerator.getMathRandom()<.5&&o<t.length?a+=t.charAt(++o):a+=e.charAt(++n);return a}(e,o),o]}},{key:"rc4",value:function(e,t){for(var r=[],n=0,o=void 0,a="",i=0;i<256;i++)r[i]=i;for(i=0;i<256;i++)n=(n+r[i]+t.charCodeAt(i%t.length))%256,o=r[i],r[i]=r[n],r[n]=o;i=0,n=0;for(var s=0;s<e.length;s++)i=(i+1)%256,n=(n+r[i])%256,o=r[i],r[i]=r[n],r[n]=o,a+=String.fromCharCode(e.charCodeAt(s)^r[(r[i]+r[n])%256]);return a}}]),e}();l=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__metadata("design:paramtypes",[Object])],l),t.CryptUtils=l},function(e,t){e.exports=require("md5")},function(e,t){e.exports=require("chance")},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=function(){function e(){n(this,e),this.stringsCache=new Map}return o(e,[{key:"encode",value:function(e,t){var r=e+"-"+String(t);if(this.stringsCache.has(r))return this.stringsCache.get(r);var n=new RegExp("[\\s\\S]","g"),o=new RegExp("['\"\\\\\\s]"),a=new RegExp("[\\x00-\\x7F]"),i=void 0,s=void 0,c=e.replace(n,function(e){return t||o.exec(e)?(a.exec(e)?(i="\\x",s="00"):(i="\\u",s="0000"),""+i+(s+e.charCodeAt(0).toString(16)).slice(-s.length)):e});return this.stringsCache.set(r,c),c}}]),e}();s=a.__decorate([i.injectable()],s),t.EscapeSequenceEncoder=s},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=r(1),c=a.__importStar(r(30)),u=a.__importStar(r(47)),l=r(171),f=r(20),d=r(6),p=r(172),m=r(3),y=b=function(){function e(t,r,o,a,i){n(this,e),this.transformersRunner=t,this.sourceMapCorrector=r,this.randomGenerator=o,this.logger=a,this.options=i}return o(e,[{key:"obfuscate",value:function(e){var t=Date.now();this.logger.info(l.LoggingMessage.Version,u.version),this.logger.info(l.LoggingMessage.ObfuscationStarted),this.logger.info(l.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getSeed());var r=this.parseCode(e),n=this.transformAstTree(r),o=this.generateCode(e,n),a=(Date.now()-t)/1e3;return this.logger.success(l.LoggingMessage.ObfuscationCompleted,a),this.getObfuscationResult(o)}},{key:"parseCode",value:function(e){return p.EsprimaFacade.parseScript(e,{attachComment:!0,loc:this.options.sourceMap})}},{key:"transformAstTree",value:function(e){return!m.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments?(e=this.runTransformationStage(e,d.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,d.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,d.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,d.TransformationStage.Converting),e=this.runTransformationStage(e,d.TransformationStage.Obfuscating),e=this.runTransformationStage(e,d.TransformationStage.Finalizing)):(this.logger.warn(l.LoggingMessage.EmptySourceCode),e)}},{key:"generateCode",value:function(e,t){var r=Object.assign({},b.escodegenParams);this.options.sourceMap&&(r.sourceMap="sourceMap",r.sourceContent=e);var n=c.generate(t,Object.assign({},r,{format:{compact:this.options.compact}}));return n.map=n.map?n.map.toString():"",n}},{key:"getObfuscationResult",value:function(e){return this.sourceMapCorrector.correct(e.code,e.map)}},{key:"runTransformationStage",value:function(e,t){return this.logger.info(l.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,b.transformersList,t)}}]),e}();y.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},y.transformersList=[f.NodeTransformer.BlockStatementControlFlowTransformer,f.NodeTransformer.ClassDeclarationTransformer,f.NodeTransformer.CommentsTransformer,f.NodeTransformer.CustomNodesTransformer,f.NodeTransformer.DeadCodeInjectionTransformer,f.NodeTransformer.EvalCallExpressionTransformer,f.NodeTransformer.FunctionControlFlowTransformer,f.NodeTransformer.CatchClauseTransformer,f.NodeTransformer.FunctionDeclarationTransformer,f.NodeTransformer.FunctionTransformer,f.NodeTransformer.LabeledStatementTransformer,f.NodeTransformer.LiteralTransformer,f.NodeTransformer.MemberExpressionTransformer,f.NodeTransformer.MethodDefinitionTransformer,f.NodeTransformer.ObfuscatingGuardsTransformer,f.NodeTransformer.ObjectExpressionKeysTransformer,f.NodeTransformer.ObjectExpressionTransformer,f.NodeTransformer.ParentificationTransformer,f.NodeTransformer.TemplateLiteralTransformer,f.NodeTransformer.VariableDeclarationTransformer],y=b=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.ITransformersRunner)),a.__param(1,i.inject(s.ServiceIdentifiers.ISourceMapCorrector)),a.__param(2,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__param(3,i.inject(s.ServiceIdentifiers.ILogger)),a.__param(4,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],y),t.JavaScriptObfuscator=y;var b},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";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=a.__importStar(r(37)),s=a.__importDefault(r(48)),c=function(){function e(){n(this,e)}return o(e,null,[{key:"parseScript",value:function(t,r){var n=null;try{return i.parseScript(t,r,function(e,t){return n=t})}catch(r){return e.processParsingError(t,r.message,n)}}},{key:"processParsingError",value:function(t,r,n){if(!(n&&n.start&&n.end&&n.start.column&&n.end.column))throw new Error(r);var o=r.match(/Line *(\d*)/);if(!o)throw new Error(r);var a=parseInt(o[1],10),i=t.split(/\r?\n/),s=i[a-1];if(!s)throw new Error(r);var c=Math.max(0,n.start.column-e.nearestSymbolsCount),u=Math.min(s.length,n.end.column+e.nearestSymbolsCount),l=e.colorError(">"),f="..."+s.substring(c,u).replace(/^\s+/,"")+"...";throw new Error(r+"\n"+l+" "+f)}}]),e}();c.colorError=s.default.red,c.nearestSymbolsCount=10,t.EsprimaFacade=c},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=r(1),c=a.__importDefault(r(48)),u=r(5),l=f=function(){function e(t){n(this,e),this.options=t}return o(e,[{key:"initialize",value:function(){this.colorInfo=c.default.cyan,this.colorSuccess=c.default.green,this.colorWarn=c.default.yellow}},{key:"info",value:function(e,t){this.log(this.colorInfo,e,t)}},{key:"success",value:function(e,t){this.log(this.colorSuccess,e,t)}},{key:"warn",value:function(e,t){this.log(this.colorWarn,e,t)}},{key:"log",value:function(e,t,r){if(this.options.log){var n=e("\n"+f.loggingPrefix+" "+t);r?console.log(n,r):console.log(n)}}}]),e}();l.loggingPrefix="[javascript-obfuscator]",a.__decorate([u.initializable(),a.__metadata("design:type",Function)],l.prototype,"colorInfo",void 0),a.__decorate([u.initializable(),a.__metadata("design:type",Function)],l.prototype,"colorSuccess",void 0),a.__decorate([u.initializable(),a.__metadata("design:type",Function)],l.prototype,"colorWarn",void 0),a.__decorate([i.postConstruct(),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[]),a.__metadata("design:returntype",void 0)],l.prototype,"initialize",null),l=f=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Object])],l),t.Logger=l;var f},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),s=r(0),c=r(175);s.decorate(s.injectable(),c.EventEmitter);var u=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(c.EventEmitter);u=i.__decorate([s.injectable()],u),t.ObfuscationEventEmitter=u},function(e,t){e.exports=require("events")},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=r(5),c=function(){function e(){n(this,e)}return o(e,[{key:"initialize",value:function(e,t){this.obfuscatedCode=e,this.sourceMap=t}},{key:"getObfuscatedCode",value:function(){return this.obfuscatedCode}},{key:"getSourceMap",value:function(){return this.sourceMap}},{key:"toString",value:function(){return this.obfuscatedCode}}]),e}();a.__decorate([s.initializable(),a.__metadata("design:type",String)],c.prototype,"obfuscatedCode",void 0),a.__decorate([s.initializable(),a.__metadata("design:type",String)],c.prototype,"sourceMap",void 0),c=a.__decorate([i.injectable()],c),t.ObfuscationResult=c},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(t){n(this,e),this.sourceCode=t}return o(e,[{key:"getSourceCode",value:function(){return this.sourceCode}}]),e}();t.SourceCode=a},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=r(1),c=r(25),u=function(){function e(t,r,o){n(this,e),this.obfuscationResultFactory=t,this.cryptUtils=r,this.options=o}return o(e,[{key:"correct",value:function(e,t){return this.obfuscationResultFactory(this.correctObfuscatedCode(e,t),t)}},{key:"correctObfuscatedCode",value:function(e,t){if(!t)return e;var r=this.options.sourceMapBaseUrl+this.options.sourceMapFileName,n="//# sourceMappingURL=";switch(this.options.sourceMapMode){case c.SourceMapMode.Inline:n+="data:application/json;base64,"+this.cryptUtils.btoa(t);break;case c.SourceMapMode.Separate:default:if(!r)return e;n+=r}return e+"\n"+n}}]),e}();u=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.Factory__IObfuscationResult)),a.__param(1,i.inject(s.ServiceIdentifiers.ICryptUtils)),a.__param(2,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Function,Object,Object])],u),t.SourceMapCorrector=u},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r(0),s=r(1),c=a.__importStar(r(10)),u=r(180),l=r(3),f=function(){function e(t){n(this,e),this.nodeTransformerFactory=t}return o(e,[{key:"transform",value:function(e,t,r){if(!t.length)return e;for(var n=[],o=[],a=t.length,i=void 0,s=0;s<a;s++)(i=this.nodeTransformerFactory(t[s]).getVisitor(r))&&(i.enter&&n.push({enter:i.enter}),i.leave&&o.push({leave:i.leave}));return n.length||o.length?(c.replace(e,{enter:this.mergeVisitorsForDirection(n,u.VisitorDirection.Enter),leave:this.mergeVisitorsForDirection(o,u.VisitorDirection.Leave)}),e):e}},{key:"mergeVisitorsForDirection",value:function(e,t){var r=e.length;return r?function(n,o){if(n.ignoredNode)return c.VisitorOption.Skip;for(var a=0;a<r;a++){var i=e[a][t];if(i){var s=i(n,o);s&&l.NodeGuards.isNode(s)&&(n=s)}}return n}:function(e,t){return e}}}]),e}();f=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.Factory__INodeTransformer)),a.__metadata("design:paramtypes",[Function])],f),t.TransformersRunner=f},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){e.exports=require("commander")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArraySanitizer=function(e){if(/,$/.test(e))throw new SyntaxError("Multiple <list> values should be wrapped inside quotes: --option-name 'value1, value2'");return e.split(",").map(function(e){return e.trim()})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=function(e){return"true"===e||"1"===e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(24);t.IdentifierNamesGeneratorSanitizer=function(e){if(!Object.keys(n.IdentifierNamesGenerator).some(function(t){return n.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});var n=r(14);t.ObfuscationTargetSanitizer=function(e){if(!Object.keys(n.ObfuscationTarget).some(function(t){return n.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});var n=r(25);t.SourceMapModeSanitizer=function(e){if(!Object.keys(n.SourceMapMode).some(function(t){return n.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});var n=r(26);t.StringArrayEncodingSanitizer=function(e){switch(e){case"true":case"1":case n.StringArrayEncoding.Base64:return!0;case n.StringArrayEncoding.Rc4:return n.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=__importStar(r(49)),i=__importStar(r(189)),s=__importStar(r(35)),c=r(34),u=function(){function e(){n(this,e)}return o(e,null,[{key:"getOutputCodePath",value:function(e){return s.normalize(e).split(".").map(function(e,t){return 0===t?""+e+c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix:e}).join(".")}},{key:"getOutputSourceMapPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t&&(e=e.substring(0,e.lastIndexOf("/"))+"/"+t),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e=e.split(".")[0]+".js.map",e}},{key:"getUserConfig",value:function(e){var t=void 0;try{t=!function(){var e=new Error('Cannot find module "."');throw e.code="MODULE_NOT_FOUND",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}},{key:"writeFile",value:function(e,t){i.sync(s.dirname(e)),a.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}]),e}();t.CLIUtils=u},function(e,t){e.exports=require("mkdirp")},function(e,t){function r(e){throw new Error("Cannot find module '"+e+"'.")}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id=190},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(49)),s=__importStar(r(35)),c=r(34),u=function(){function e(){o(this,e)}return a(e,null,[{key:"readSourceCode",value:function(t){if(e.isFilePath(t))return e.readFile(t);if(e.isDirectoryPath(t))return e.readDirectoryRecursive(t);throw new ReferenceError("Given input path must be a valid source code file or directory path")}},{key:"isDirectoryPath",value:function(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}},{key:"isFilePath",value:function(e){try{return i.statSync(e).isFile()}catch(e){return!1}}},{key:"readDirectoryRecursive",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i.readdirSync(t,c.JavaScriptObfuscatorCLI.encoding).forEach(function(o){var a=t+"/"+o;if(e.isDirectoryPath(a))r.push.apply(r,n(e.readDirectoryRecursive(a)));else if(e.isFilePath(a)&&e.isValidFile(o)){var s=i.readFileSync(a,c.JavaScriptObfuscatorCLI.encoding);r.push({filePath:a,content:s})}}),r}},{key:"readFile",value:function(t){if(!e.isValidFile(t))throw new ReferenceError("Input file must have .js extension");return i.readFileSync(t,c.JavaScriptObfuscatorCLI.encoding)}},{key:"isValidFile",value:function(e){return-1!==c.JavaScriptObfuscatorCLI.availableInputExtensions.indexOf(s.extname(e))&&!(-1!==e.indexOf(c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix))}}]),e}();t.SourceCodeReader=u}]);
^
ReferenceError: Given config path must be a valid `.js` or `.json` file path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment