"use strict";function find_builtins(e){function n(n){push_uniq(e,n)}["null","true","false","Infinity","-Infinity","undefined"].forEach(n),[Array,Boolean,Date,Error,Function,Math,Number,Object,RegExp,String].forEach(function(e){Object.getOwnPropertyNames(e).map(n),e.prototype&&Object.getOwnPropertyNames(e.prototype).map(n)})}function reserve_quoted_keys(e,n){function t(e){push_uniq(n,e)}e.walk(new TreeWalker(function(e){e instanceof AST_ObjectKeyVal&&e.quote?t(e.key):e instanceof AST_Sub&&addStrings(e.property,t)}))}function addStrings(e,n){e.walk(new TreeWalker(function(e){return e instanceof AST_Sequence?addStrings(e.tail_node(),n):e instanceof AST_String?n(e.value):e instanceof AST_Conditional&&(addStrings(e.consequent,n),addStrings(e.alternative,n)),!0}))}function mangle_properties(e,n){var t=(n=defaults(n,{builtins:!1,cache:null,debug:!1,keep_quoted:!1,only_cache:!1,regex:null,reserved:null},!0)).reserved;Array.isArray(t)||(t=[]),n.builtins||find_builtins(t);var r,i=-1;n.cache?(r=n.cache.props).each(function(e){push_uniq(t,e)}):r=new Dictionary;var a,o=n.regex,s=!1!==n.debug;s&&(a=!0===n.debug?"":n.debug);var u=[],c=[];return e.walk(new TreeWalker(function(e){e instanceof AST_ObjectKeyVal?l(e.key):e instanceof AST_ObjectProperty?l(e.key.name):e instanceof AST_Dot?l(e.property):e instanceof AST_Sub?addStrings(e.property,l):e instanceof AST_Call&&"Object.defineProperty"==e.expression.print_to_string()&&addStrings(e.args[1],l)})),e.transform(new TreeTransformer(function(e){e instanceof AST_ObjectKeyVal?e.key=_(e.key):e instanceof AST_ObjectProperty?e.key.name=_(e.key.name):e instanceof AST_Dot?e.property=_(e.property):!n.keep_quoted&&e instanceof AST_Sub?e.property=d(e.property):e instanceof AST_Call&&"Object.defineProperty"==e.expression.print_to_string()&&(e.args[1]=d(e.args[1]))}));function f(e){return!(c.indexOf(e)>=0)&&(!(t.indexOf(e)>=0)&&(n.only_cache?r.has(e):!/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(e)))}function p(e){return!(o&&!o.test(e))&&(!(t.indexOf(e)>=0)&&(r.has(e)||u.indexOf(e)>=0))}function l(e){f(e)&&push_uniq(u,e),p(e)||push_uniq(c,e)}function _(e){if(!p(e))return e;var n=r.get(e);if(!n){if(s){var t="_$"+e+"$"+a+"_";f(t)&&(n=t)}if(!n)do{n=base54(++i)}while(!f(n));r.set(e,n)}return n}function d(e){return e.transform(new TreeTransformer(function(e){if(e instanceof AST_Sequence){var n=e.expressions.length-1;e.expressions[n]=d(e.expressions[n])}else e instanceof AST_String?e.value=_(e.value):e instanceof AST_Conditional&&(e.consequent=d(e.consequent),e.alternative=d(e.alternative));return e}))}}