diff --git a/js/lib/beautifier.js b/js/lib/beautifier.js index 23ba6f70c..ecb71b974 100644 --- a/js/lib/beautifier.js +++ b/js/lib/beautifier.js @@ -223,12 +223,13 @@ module.exports = js_beautify; var Output = __webpack_require__(3).Output; -var acorn = __webpack_require__(4); -var Options = __webpack_require__(5).Options; -var Tokenizer = __webpack_require__(7).Tokenizer; -var line_starters = __webpack_require__(7).line_starters; -var positionable_operators = __webpack_require__(7).positionable_operators; -var TOKEN = __webpack_require__(7).TOKEN; +var Token = __webpack_require__(4).Token; +var acorn = __webpack_require__(5); +var Options = __webpack_require__(6).Options; +var Tokenizer = __webpack_require__(8).Tokenizer; +var line_starters = __webpack_require__(8).line_starters; +var positionable_operators = __webpack_require__(8).positionable_operators; +var TOKEN = __webpack_require__(8).TOKEN; function remove_redundant_indentation(output, frame) { // This implementation is effective but has some issues: @@ -263,6 +264,16 @@ function generateMapFromStrings(list) { return result; } +function reserved_word(token, word) { + return token && token.type === TOKEN.RESERVED && token.text === word; +} + +function reserved_array(token, words) { + return token && token.type === TOKEN.RESERVED && in_array(token.text, words); +} +// Unsure of what they mean, but they work. Worth cleaning up in future. +var special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async']; + var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline']; // Generate map from array @@ -331,9 +342,6 @@ function each_line_matches_indent(lines, indent) { return true; } -function is_special_word(word) { - return in_array(word, ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async']); -} function Beautifier(source_text, options) { options = options || {}; @@ -341,7 +349,6 @@ function Beautifier(source_text, options) { this._output = null; this._tokens = null; - this._last_type = null; this._last_last_text = null; this._flags = null; this._previous_flags = null; @@ -363,7 +370,7 @@ Beautifier.prototype.create_flags = function(flags_base, mode) { var next_flags = { mode: mode, parent: flags_base, - last_text: flags_base ? flags_base.last_text : '', // last token text + last_token: flags_base ? flags_base.last_token : new Token(TOKEN.START_BLOCK, ''), // last token text last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed declaration_statement: false, declaration_assignment: false, @@ -386,19 +393,10 @@ Beautifier.prototype.create_flags = function(flags_base, mode) { }; Beautifier.prototype._reset = function(source_text) { - var baseIndentString = ''; + var baseIndentString = source_text.match(/^[\t ]*/)[0]; - if (this._options.base_indent_string) { - baseIndentString = this._options.base_indent_string; - } else { - var match = source_text.match(/^[\t ]*/); - baseIndentString = match[0]; - } - - - this._last_type = TOKEN.START_BLOCK; // last token type this._last_last_text = ''; // pre-last token text - this._output = new Output(this._options.indent_string, baseIndentString); + this._output = new Output(this._options, baseIndentString); // If testing the ignore directive, start with output disable set to true this._output.raw = this._options.test_output_raw; @@ -442,14 +440,13 @@ Beautifier.prototype.beautify = function() { while (current_token) { this.handle_token(current_token); - this._last_last_text = this._flags.last_text; - this._last_type = current_token.type; - this._flags.last_text = current_token.text; + this._last_last_text = this._flags.last_token.text; + this._flags.last_token = current_token; current_token = this._tokens.next(); } - sweet_code = this._output.get_code(this._options.end_with_newline, eol); + sweet_code = this._output.get_code(eol); return sweet_code; }; @@ -540,12 +537,12 @@ Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, f } var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap; - var operatorLogicApplies = in_array(this._flags.last_text, positionable_operators) || + var operatorLogicApplies = in_array(this._flags.last_token.text, positionable_operators) || in_array(current_token.text, positionable_operators); if (operatorLogicApplies) { var shouldPrintOperatorNewline = ( - in_array(this._flags.last_text, positionable_operators) && + in_array(this._flags.last_token.text, positionable_operators) && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE) ) || in_array(current_token.text, positionable_operators); @@ -555,7 +552,7 @@ Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, f if (shouldPreserveOrForce) { this.print_newline(false, true); } else if (this._options.wrap_line_length) { - if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, newline_restricted_tokens)) { + if (reserved_array(this._flags.last_token, newline_restricted_tokens)) { // These tokens should never have a newline inserted // between them and the following expression. return; @@ -570,10 +567,10 @@ Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, f Beautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) { if (!preserve_statement_flags) { - if (this._flags.last_text !== ';' && this._flags.last_text !== ',' && this._flags.last_text !== '=' && (this._last_type !== TOKEN.OPERATOR || this._flags.last_text === '--' || this._flags.last_text === '++')) { + if (this._flags.last_token.text !== ';' && this._flags.last_token.text !== ',' && this._flags.last_token.text !== '=' && (this._flags.last_token.type !== TOKEN.OPERATOR || this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) { var next_token = this._tokens.peek(); while (this._flags.mode === MODE.Statement && - !(this._flags.if_block && next_token && next_token.type === TOKEN.RESERVED && next_token.text === 'else') && + !(this._flags.if_block && reserved_word(next_token, 'else')) && !this._flags.do_block) { this.restore_mode(); } @@ -602,7 +599,7 @@ Beautifier.prototype.print_token = function(current_token, printable_token) { return; } - if (this._options.comma_first && this._last_type === TOKEN.COMMA && + if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN.COMMA && this._output.just_added_newline()) { if (this._output.previous_line.last() === ',') { var popped = this._output.previous_line.pop(); @@ -663,24 +660,24 @@ Beautifier.prototype.restore_mode = function() { Beautifier.prototype.start_of_object_property = function() { return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && ( - (this._flags.last_text === ':' && this._flags.ternary_depth === 0) || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['get', 'set']))); + (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set']))); }; Beautifier.prototype.start_of_statement = function(current_token) { var start = false; - start = start || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD); - start = start || (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'do'); - start = start || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, newline_restricted_tokens) && !current_token.newlines); - start = start || (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'else' && - !(current_token.type === TOKEN.RESERVED && current_token.text === 'if' && !current_token.comments_before)); - start = start || (this._last_type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional)); - start = start || (this._last_type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement && + start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD; + start = start || reserved_word(this._flags.last_token, 'do'); + start = start || (reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines); + start = start || reserved_word(this._flags.last_token, 'else') && + !(reserved_word(current_token, 'if') && !current_token.comments_before); + start = start || (this._flags.last_token.type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional)); + start = start || (this._flags.last_token.type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement && !this._flags.in_case && !(current_token.text === '--' || current_token.text === '++') && this._last_last_text !== 'function' && current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED); start = start || (this._flags.mode === MODE.ObjectLiteral && ( - (this._flags.last_text === ':' && this._flags.ternary_depth === 0) || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['get', 'set'])))); + (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set']))); if (start) { this.set_mode(MODE.Statement); @@ -693,9 +690,8 @@ Beautifier.prototype.start_of_statement = function(current_token) { // if (a) if (b) if(c) d(); else e(); else f(); if (!this.start_of_object_property()) { this.allow_wrap_or_preserved_newline(current_token, - current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['do', 'for', 'if', 'while'])); + reserved_array(current_token, ['do', 'for', 'if', 'while'])); } - return true; } return false; @@ -710,10 +706,10 @@ Beautifier.prototype.handle_start_expr = function(current_token) { var next_mode = MODE.Expression; if (current_token.text === '[') { - if (this._last_type === TOKEN.WORD || this._flags.last_text === ')') { + if (this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === ')') { // this is array index specifier, break immediately // a[x], fn()[x] - if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, line_starters)) { + if (reserved_array(this._flags.last_token, line_starters)) { this._output.space_before_token = true; } this.set_mode(next_mode); @@ -727,8 +723,8 @@ Beautifier.prototype.handle_start_expr = function(current_token) { next_mode = MODE.ArrayLiteral; if (is_array(this._flags.mode)) { - if (this._flags.last_text === '[' || - (this._flags.last_text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) { + if (this._flags.last_token.text === '[' || + (this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) { // ], [ goes to new line // }, [ goes to new line if (!this._options.keep_array_indentation) { @@ -737,33 +733,33 @@ Beautifier.prototype.handle_start_expr = function(current_token) { } } - if (!in_array(this._last_type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) { + if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) { this._output.space_before_token = true; } } else { - if (this._last_type === TOKEN.RESERVED) { - if (this._flags.last_text === 'for') { + if (this._flags.last_token.type === TOKEN.RESERVED) { + if (this._flags.last_token.text === 'for') { this._output.space_before_token = this._options.space_before_conditional; next_mode = MODE.ForInitializer; - } else if (in_array(this._flags.last_text, ['if', 'while'])) { + } else if (in_array(this._flags.last_token.text, ['if', 'while'])) { this._output.space_before_token = this._options.space_before_conditional; next_mode = MODE.Conditional; } else if (in_array(this._flags.last_word, ['await', 'async'])) { // Should be a space between await and an IIFE, or async and an arrow function this._output.space_before_token = true; - } else if (this._flags.last_text === 'import' && current_token.whitespace_before === '') { + } else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') { this._output.space_before_token = false; - } else if (in_array(this._flags.last_text, line_starters) || this._flags.last_text === 'catch') { + } else if (in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') { this._output.space_before_token = true; } - } else if (this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) { + } else if (this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) { // Support of this kind of newline preservation. // a = (b && // (c || d)); if (!this.start_of_object_property()) { this.allow_wrap_or_preserved_newline(current_token); } - } else if (this._last_type === TOKEN.WORD) { + } else if (this._flags.last_token.type === TOKEN.WORD) { this._output.space_before_token = false; } else { // Support preserving wrapped arrow function expressions @@ -776,8 +772,8 @@ Beautifier.prototype.handle_start_expr = function(current_token) { // function() vs function () // yield*() vs yield* () // function*() vs function* () - if ((this._last_type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) || - (this._flags.last_text === '*' && + if ((this._flags.last_token.type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) || + (this._flags.last_token.text === '*' && (in_array(this._last_last_text, ['function', 'yield']) || (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) { @@ -786,9 +782,9 @@ Beautifier.prototype.handle_start_expr = function(current_token) { } - if (this._flags.last_text === ';' || this._last_type === TOKEN.START_BLOCK) { + if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN.START_BLOCK) { this.print_newline(); - } else if (this._last_type === TOKEN.END_EXPR || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.END_BLOCK || this._flags.last_text === '.' || this._last_type === TOKEN.COMMA) { + } else if (this._flags.last_token.type === TOKEN.END_EXPR || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.END_BLOCK || this._flags.last_token.text === '.' || this._flags.last_token.type === TOKEN.COMMA) { // do nothing on (( and )( and ][ and ]( and .( // TODO: Consider whether forcing this is required. Review failing tests when removed. this.allow_wrap_or_preserved_newline(current_token, current_token.newlines); @@ -819,7 +815,7 @@ Beautifier.prototype.handle_end_expr = function(current_token) { } if (this._options.space_in_paren) { - if (this._last_type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) { + if (this._flags.last_token.type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) { // () [] no inner space in empty parens like these, ever, ref #320 this._output.trim(); this._output.space_before_token = false; @@ -851,7 +847,10 @@ Beautifier.prototype.handle_start_block = function(current_token) { // Check if this is should be treated as a ObjectLiteral var next_token = this._tokens.peek(); var second_token = this._tokens.peek(1); - if (second_token && ( + if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN.END_EXPR) { + this.set_mode(MODE.BlockStatement); + this._flags.in_case_statement = true; + } else if (second_token && ( (in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) || (in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED])) )) { @@ -862,11 +861,11 @@ Beautifier.prototype.handle_start_block = function(current_token) { } else { this.set_mode(MODE.BlockStatement); } - } else if (this._last_type === TOKEN.OPERATOR && this._flags.last_text === '=>') { + } else if (this._flags.last_token.type === TOKEN.OPERATOR && this._flags.last_token.text === '=>') { // arrow function: (param1, paramN) => { statements } this.set_mode(MODE.BlockStatement); - } else if (in_array(this._last_type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) || - (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['return', 'throw', 'import', 'default'])) + } else if (in_array(this._flags.last_token.type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) || + reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default']) ) { // Detecting shorthand function syntax is difficult by scanning forward, // so check the surrounding context. @@ -879,7 +878,7 @@ Beautifier.prototype.handle_start_block = function(current_token) { var empty_braces = !next_token.comments_before && next_token.text === '}'; var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' && - this._last_type === TOKEN.END_EXPR; + this._flags.last_token.type === TOKEN.END_EXPR; if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so { @@ -901,28 +900,28 @@ Beautifier.prototype.handle_start_block = function(current_token) { if ((this._options.brace_style === "expand" || (this._options.brace_style === "none" && current_token.newlines)) && !this._flags.inline_frame) { - if (this._last_type !== TOKEN.OPERATOR && + if (this._flags.last_token.type !== TOKEN.OPERATOR && (empty_anonymous_function || - this._last_type === TOKEN.EQUALS || - (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text) && this._flags.last_text !== 'else'))) { + this._flags.last_token.type === TOKEN.EQUALS || + (reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) { this._output.space_before_token = true; } else { this.print_newline(false, true); } } else { // collapse || inline_frame - if (is_array(this._previous_flags.mode) && (this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.COMMA)) { - if (this._last_type === TOKEN.COMMA || this._options.space_in_paren) { + if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.COMMA)) { + if (this._flags.last_token.type === TOKEN.COMMA || this._options.space_in_paren) { this._output.space_before_token = true; } - if (this._last_type === TOKEN.COMMA || (this._last_type === TOKEN.START_EXPR && this._flags.inline_frame)) { + if (this._flags.last_token.type === TOKEN.COMMA || (this._flags.last_token.type === TOKEN.START_EXPR && this._flags.inline_frame)) { this.allow_wrap_or_preserved_newline(current_token); this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame; this._flags.multiline_frame = false; } } - if (this._last_type !== TOKEN.OPERATOR && this._last_type !== TOKEN.START_EXPR) { - if (this._last_type === TOKEN.START_BLOCK && !this._flags.inline_frame) { + if (this._flags.last_token.type !== TOKEN.OPERATOR && this._flags.last_token.type !== TOKEN.START_EXPR) { + if (this._flags.last_token.type === TOKEN.START_BLOCK && !this._flags.inline_frame) { this.print_newline(); } else { this._output.space_before_token = true; @@ -941,7 +940,7 @@ Beautifier.prototype.handle_end_block = function(current_token) { this.restore_mode(); } - var empty_braces = this._last_type === TOKEN.START_BLOCK; + var empty_braces = this._flags.last_token.type === TOKEN.START_BLOCK; if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first this._output.space_before_token = true; @@ -983,13 +982,13 @@ Beautifier.prototype.handle_word = function(current_token) { if (this.start_of_statement(current_token)) { // The conditional starts the statement if appropriate. - if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) { + if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) { this._flags.declaration_statement = true; } } else if (current_token.newlines && !is_expression(this._flags.mode) && - (this._last_type !== TOKEN.OPERATOR || (this._flags.last_text === '--' || this._flags.last_text === '++')) && - this._last_type !== TOKEN.EQUALS && - (this._options.preserve_newlines || !(this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const', 'set', 'get'])))) { + (this._flags.last_token.type !== TOKEN.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) && + this._flags.last_token.type !== TOKEN.EQUALS && + (this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) { this.handle_whitespace_and_comments(current_token); this.print_newline(); } else { @@ -997,7 +996,7 @@ Beautifier.prototype.handle_word = function(current_token) { } if (this._flags.do_block && !this._flags.do_while) { - if (current_token.type === TOKEN.RESERVED && current_token.text === 'while') { + if (reserved_word(current_token, 'while')) { // do {} ## while () this._output.space_before_token = true; this.print_token(current_token); @@ -1016,7 +1015,7 @@ Beautifier.prototype.handle_word = function(current_token) { // Bare/inline ifs are tricky // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e(); if (this._flags.if_block) { - if (!this._flags.else_block && (current_token.type === TOKEN.RESERVED && current_token.text === 'else')) { + if (!this._flags.else_block && reserved_word(current_token, 'else')) { this._flags.else_block = true; } else { while (this._flags.mode === MODE.Statement) { @@ -1027,7 +1026,7 @@ Beautifier.prototype.handle_word = function(current_token) { } } - if (current_token.type === TOKEN.RESERVED && (current_token.text === 'case' || (current_token.text === 'default' && this._flags.in_case_statement))) { + if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) { this.print_newline(); if (this._flags.case_body || this._options.jslint_happy) { // switch cases following one another @@ -1036,19 +1035,18 @@ Beautifier.prototype.handle_word = function(current_token) { } this.print_token(current_token); this._flags.in_case = true; - this._flags.in_case_statement = true; return; } - if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) { + if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) { if (!this.start_of_object_property()) { this.allow_wrap_or_preserved_newline(current_token); } } - if (current_token.type === TOKEN.RESERVED && current_token.text === 'function') { - if (in_array(this._flags.last_text, ['}', ';']) || - (this._output.just_added_newline() && !(in_array(this._flags.last_text, ['(', '[', '{', ':', '=', ',']) || this._last_type === TOKEN.OPERATOR))) { + if (reserved_word(current_token, 'function')) { + if (in_array(this._flags.last_token.text, ['}', ';']) || + (this._output.just_added_newline() && !(in_array(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN.OPERATOR))) { // make sure there is a nice clean space of at least one blank line // before a new function definition if (!this._output.just_added_blankline() && !current_token.comments_before) { @@ -1056,17 +1054,16 @@ Beautifier.prototype.handle_word = function(current_token) { this.print_newline(true); } } - if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD) { - if (this._last_type === TOKEN.RESERVED && ( - in_array(this._flags.last_text, ['get', 'set', 'new', 'export']) || - in_array(this._flags.last_text, newline_restricted_tokens))) { + if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD) { + if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) || + reserved_array(this._flags.last_token, newline_restricted_tokens)) { this._output.space_before_token = true; - } else if (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'default' && this._last_last_text === 'export') { + } else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') { this._output.space_before_token = true; } else { this.print_newline(); } - } else if (this._last_type === TOKEN.OPERATOR || this._flags.last_text === '=') { + } else if (this._flags.last_token.type === TOKEN.OPERATOR || this._flags.last_token.text === '=') { // foo = function this._output.space_before_token = true; } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) { @@ -1082,11 +1079,11 @@ Beautifier.prototype.handle_word = function(current_token) { var prefix = 'NONE'; - if (this._last_type === TOKEN.END_BLOCK) { + if (this._flags.last_token.type === TOKEN.END_BLOCK) { if (this._previous_flags.inline_frame) { prefix = 'SPACE'; - } else if (!(current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['else', 'catch', 'finally', 'from']))) { + } else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) { prefix = 'NEWLINE'; } else { if (this._options.brace_style === "expand" || @@ -1098,31 +1095,31 @@ Beautifier.prototype.handle_word = function(current_token) { this._output.space_before_token = true; } } - } else if (this._last_type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) { + } else if (this._flags.last_token.type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) { // TODO: Should this be for STATEMENT as well? prefix = 'NEWLINE'; - } else if (this._last_type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) { + } else if (this._flags.last_token.type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) { prefix = 'SPACE'; - } else if (this._last_type === TOKEN.STRING) { + } else if (this._flags.last_token.type === TOKEN.STRING) { prefix = 'NEWLINE'; - } else if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD || - (this._flags.last_text === '*' && + } else if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || + (this._flags.last_token.text === '*' && (in_array(this._last_last_text, ['function', 'yield']) || (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) { prefix = 'SPACE'; - } else if (this._last_type === TOKEN.START_BLOCK) { + } else if (this._flags.last_token.type === TOKEN.START_BLOCK) { if (this._flags.inline_frame) { prefix = 'SPACE'; } else { prefix = 'NEWLINE'; } - } else if (this._last_type === TOKEN.END_EXPR) { + } else if (this._flags.last_token.type === TOKEN.END_EXPR) { this._output.space_before_token = true; prefix = 'NEWLINE'; } - if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, line_starters) && this._flags.last_text !== ')') { - if (this._flags.inline_frame || this._flags.last_text === 'else' || this._flags.last_text === 'export') { + if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') { + if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') { prefix = 'SPACE'; } else { prefix = 'NEWLINE'; @@ -1130,8 +1127,8 @@ Beautifier.prototype.handle_word = function(current_token) { } - if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['else', 'catch', 'finally'])) { - if ((!(this._last_type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) || + if (reserved_array(current_token, ['else', 'catch', 'finally'])) { + if ((!(this._flags.last_token.type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) || this._options.brace_style === "expand" || this._options.brace_style === "end-expand" || (this._options.brace_style === "none" && current_token.newlines)) && @@ -1148,28 +1145,28 @@ Beautifier.prototype.handle_word = function(current_token) { this._output.space_before_token = true; } } else if (prefix === 'NEWLINE') { - if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) { + if (reserved_array(this._flags.last_token, special_words)) { // no newline between 'return nnn' this._output.space_before_token = true; - } else if (this._last_type !== TOKEN.END_EXPR) { - if ((this._last_type !== TOKEN.START_EXPR || !(current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['var', 'let', 'const']))) && this._flags.last_text !== ':') { + } else if (this._flags.last_token.type !== TOKEN.END_EXPR) { + if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') { // no need to force newline on 'var': for (var x = 0...) - if (current_token.type === TOKEN.RESERVED && current_token.text === 'if' && this._flags.last_text === 'else') { + if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) { // no newline for } else if { this._output.space_before_token = true; } else { this.print_newline(); } } - } else if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, line_starters) && this._flags.last_text !== ')') { + } else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') { this.print_newline(); } - } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_text === ',' && this._last_last_text === '}') { + } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') { this.print_newline(); // }, in lists get a newline treatment } else if (prefix === 'SPACE') { this._output.space_before_token = true; } - if (this._last_type === TOKEN.WORD || this._last_type === TOKEN.RESERVED) { + if (current_token.previous && (current_token.previous.type === TOKEN.WORD || current_token.previous.type === TOKEN.RESERVED)) { this._output.space_before_token = true; } this.print_token(current_token); @@ -1182,7 +1179,7 @@ Beautifier.prototype.handle_word = function(current_token) { this._flags.if_block = true; } else if (current_token.text === 'import') { this._flags.import_block = true; - } else if (this._flags.import_block && current_token.type === TOKEN.RESERVED && current_token.text === 'from') { + } else if (this._flags.import_block && reserved_word(current_token, 'from')) { this._flags.import_block = false; } } @@ -1199,7 +1196,7 @@ Beautifier.prototype.handle_semicolon = function(current_token) { var next_token = this._tokens.peek(); while (this._flags.mode === MODE.Statement && - !(this._flags.if_block && next_token && next_token.type === TOKEN.RESERVED && next_token.text === 'else') && + !(this._flags.if_block && reserved_word(next_token, 'else')) && !this._flags.do_block) { this.restore_mode(); } @@ -1218,9 +1215,9 @@ Beautifier.prototype.handle_string = function(current_token) { this._output.space_before_token = true; } else { this.handle_whitespace_and_comments(current_token); - if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD || this._flags.inline_frame) { + if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.inline_frame) { this._output.space_before_token = true; - } else if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) { + } else if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) { if (!this.start_of_object_property()) { this.allow_wrap_or_preserved_newline(current_token); } @@ -1285,13 +1282,13 @@ Beautifier.prototype.handle_comma = function(current_token) { Beautifier.prototype.handle_operator = function(current_token) { var isGeneratorAsterisk = current_token.text === '*' && - ((this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['function', 'yield'])) || - (in_array(this._last_type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON])) + (reserved_array(this._flags.last_token, ['function', 'yield']) || + (in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON])) ); var isUnary = in_array(current_token.text, ['-', '+']) && ( - in_array(this._last_type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) || - in_array(this._flags.last_text, line_starters) || - this._flags.last_text === ',' + in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) || + in_array(this._flags.last_token.text, line_starters) || + this._flags.last_token.text === ',' ); if (this.start_of_statement(current_token)) { @@ -1301,7 +1298,7 @@ Beautifier.prototype.handle_operator = function(current_token) { this.handle_whitespace_and_comments(current_token, preserve_statement_flags); } - if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) { + if (reserved_array(this._flags.last_token, special_words)) { // "return" had a special handling in TK_WORD. Now we need to return the favor this._output.space_before_token = true; this.print_token(current_token); @@ -1309,7 +1306,7 @@ Beautifier.prototype.handle_operator = function(current_token) { } // hack for actionscript's import .*; - if (current_token.text === '*' && this._last_type === TOKEN.DOT) { + if (current_token.text === '*' && this._flags.last_token.type === TOKEN.DOT) { this.print_token(current_token); return; } @@ -1322,7 +1319,7 @@ Beautifier.prototype.handle_operator = function(current_token) { // Allow line wrapping between operators when operator_position is // set to before or preserve - if (this._last_type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) { + if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) { this.allow_wrap_or_preserved_newline(current_token); } @@ -1414,11 +1411,11 @@ Beautifier.prototype.handle_operator = function(current_token) { space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]); } else if (current_token.text === '...') { this.allow_wrap_or_preserved_newline(current_token); - space_before = this._last_type === TOKEN.START_BLOCK; + space_before = this._flags.last_token.type === TOKEN.START_BLOCK; space_after = false; } else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) { // unary operators (and binary +/- pretending to be unary) special cases - if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR) { + if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR) { this.allow_wrap_or_preserved_newline(current_token); } @@ -1431,32 +1428,32 @@ Beautifier.prototype.handle_operator = function(current_token) { this.print_newline(false, true); } - if (this._flags.last_text === ';' && is_expression(this._flags.mode)) { + if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) { // for (;; ++i) // ^^^ space_before = true; } - if (this._last_type === TOKEN.RESERVED) { + if (this._flags.last_token.type === TOKEN.RESERVED) { space_before = true; - } else if (this._last_type === TOKEN.END_EXPR) { - space_before = !(this._flags.last_text === ']' && (current_token.text === '--' || current_token.text === '++')); - } else if (this._last_type === TOKEN.OPERATOR) { + } else if (this._flags.last_token.type === TOKEN.END_EXPR) { + space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++')); + } else if (this._flags.last_token.type === TOKEN.OPERATOR) { // a++ + ++b; // a - -b - space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_text, ['--', '-', '++', '+']); + space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_token.text, ['--', '-', '++', '+']); // + and - are not unary when preceeded by -- or ++ operator // a-- + b // a * +b // a - -b - if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_text, ['--', '++'])) { + if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_token.text, ['--', '++'])) { space_after = true; } } if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) && - (this._flags.last_text === '{' || this._flags.last_text === ';')) { + (this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) { // { foo; --i } // foo(); --bar; this.print_newline(); @@ -1553,13 +1550,13 @@ Beautifier.prototype.handle_dot = function(current_token) { this.deindent(); } - if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) { + if (reserved_array(this._flags.last_token, special_words)) { this._output.space_before_token = false; } else { // allow preserved newlines before dots in general // force newlines on dots after close paren when break_chained - for bar().baz() this.allow_wrap_or_preserved_newline(current_token, - this._flags.last_text === ')' && this._options.break_chained_methods); + this._flags.last_token.text === ')' && this._options.break_chained_methods); } this.print_token(current_token); @@ -1734,13 +1731,24 @@ IndentCache.prototype.get_level_string = function(level) { }; -function Output(indent_string, baseIndentString) { +function Output(options, baseIndentString) { + var indent_string = options.indent_char; + if (options.indent_size > 1) { + indent_string = new Array(options.indent_size + 1).join(options.indent_char); + } + + // Set to null to continue support for auto detection of base indent level. baseIndentString = baseIndentString || ''; + if (options.indent_level > 0) { + baseIndentString = new Array(options.indent_level + 1).join(indent_string); + } + this.__indent_cache = new IndentCache(baseIndentString, indent_string); this.__alignment_cache = new IndentCache('', ' '); this.baseIndentLength = baseIndentString.length; this.indent_length = indent_string.length; this.raw = false; + this._end_with_newline = options.end_with_newline; this.__lines = []; this.previous_line = null; @@ -1788,10 +1796,10 @@ Output.prototype.add_new_line = function(force_newline) { return true; }; -Output.prototype.get_code = function(end_with_newline, eol) { +Output.prototype.get_code = function(eol) { var sweet_code = this.__lines.join('\n').replace(/[\r\n\t ]+$/, ''); - if (end_with_newline) { + if (this._end_with_newline) { sweet_code += '\n'; } @@ -1891,6 +1899,66 @@ module.exports.Output = Output; /* 4 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; +/*jshint node:true */ +/* + + The MIT License (MIT) + + Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + + + +function Token(type, text, newlines, whitespace_before) { + this.type = type; + this.text = text; + + // comments_before are + // comments that have a new line before them + // and may or may not have a newline after + // this is a set of comments before + this.comments_before = null; /* inline comment*/ + + + // this.comments_after = new TokenStream(); // no new line before and newline after + this.newlines = newlines || 0; + this.whitespace_before = whitespace_before || ''; + this.parent = null; + this.next = null; + this.previous = null; + this.opened = null; + this.closed = null; + this.directives = null; +} + + +module.exports.Token = Token; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* jshint node: true, curly: false */ // Parts of this section of code is taken from acorn. @@ -1950,7 +2018,7 @@ exports.lineBreak = new RegExp('\r\n|' + exports.newline.source); exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); /***/ }), -/* 5 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1984,7 +2052,7 @@ exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); -var BaseOptions = __webpack_require__(6).Options; +var BaseOptions = __webpack_require__(7).Options; var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline']; @@ -2006,7 +2074,7 @@ function Options(options) { //preserve-inline in delimited string will trigger brace_preserve_inline, everything //else is considered a brace_style and the last one only will have an effect - var brace_style_split = this._get_selection('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']); + var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']); this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option this.brace_style = "collapse"; @@ -2030,7 +2098,7 @@ function Options(options) { this.unescape_strings = this._get_boolean('unescape_strings'); this.e4x = this._get_boolean('e4x'); this.comma_first = this._get_boolean('comma_first'); - this.operator_position = this._get_selection('operator_position', validPositionValues)[0]; + this.operator_position = this._get_selection('operator_position', validPositionValues); // For testing of beautify preserve:start directive this.test_output_raw = this._get_boolean('test_output_raw'); @@ -2047,7 +2115,7 @@ Options.prototype = new BaseOptions(); module.exports.Options = Options; /***/ }), -/* 6 */ +/* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2095,7 +2163,7 @@ function Options(options, merge_child_field) { this.indent_level = this._get_number('indent_level'); this.preserve_newlines = this._get_boolean('preserve_newlines', true); - this.max_preserve_newlines = this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); + this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); if (!this.preserve_newlines) { this.max_preserve_newlines = 0; } @@ -2106,16 +2174,6 @@ function Options(options, merge_child_field) { this.indent_size = 1; } - this.indent_string = this.indent_char; - if (this.indent_size > 1) { - this.indent_string = new Array(this.indent_size + 1).join(this.indent_char); - } - // Set to null to continue support for auto detection of base indent level. - this.base_indent_string = null; - if (this.indent_level > 0) { - this.base_indent_string = new Array(this.indent_level + 1).join(this.indent_string); - } - // Backwards compat with 1.3.x this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char')); @@ -2163,6 +2221,22 @@ Options.prototype._get_number = function(name, default_value) { }; Options.prototype._get_selection = function(name, selection_list, default_value) { + var result = this._get_selection_list(name, selection_list, default_value); + if (result.length !== 1) { + throw new Error( + "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); + } + + return result[0]; +}; + + +Options.prototype._get_selection_list = function(name, selection_list, default_value) { + if (!selection_list || selection_list.length === 0) { + throw new Error("Selection list cannot be empty."); + } + default_value = default_value || [selection_list[0]]; if (!this._is_valid_selection(default_value, selection_list)) { throw new Error("Invalid Default Value!"); @@ -2171,7 +2245,8 @@ Options.prototype._get_selection = function(name, selection_list, default_value) var result = this._get_array(name, default_value); if (!this._is_valid_selection(result, selection_list)) { throw new Error( - "Invalid Option Value: The option '" + name + "' must be one of the following values\n" + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); + "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); } return result; @@ -2224,7 +2299,7 @@ module.exports.normalizeOpts = _normalizeOpts; module.exports.mergeOpts = _mergeOpts; /***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2258,11 +2333,11 @@ module.exports.mergeOpts = _mergeOpts; -var InputScanner = __webpack_require__(8).InputScanner; -var BaseTokenizer = __webpack_require__(9).Tokenizer; -var BASETOKEN = __webpack_require__(9).TOKEN; +var InputScanner = __webpack_require__(9).InputScanner; +var BaseTokenizer = __webpack_require__(10).Tokenizer; +var BASETOKEN = __webpack_require__(10).TOKEN; var Directives = __webpack_require__(12).Directives; -var acorn = __webpack_require__(4); +var acorn = __webpack_require__(5); function in_array(what, arr) { return arr.indexOf(what) !== -1; @@ -2764,7 +2839,7 @@ module.exports.positionable_operators = positionable_operators.slice(); module.exports.line_starters = line_starters.slice(); /***/ }), -/* 8 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2918,7 +2993,7 @@ InputScanner.prototype.lookBack = function(testVal) { module.exports.InputScanner = InputScanner; /***/ }), -/* 9 */ +/* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2952,8 +3027,8 @@ module.exports.InputScanner = InputScanner; -var InputScanner = __webpack_require__(8).InputScanner; -var Token = __webpack_require__(10).Token; +var InputScanner = __webpack_require__(9).InputScanner; +var Token = __webpack_require__(4).Token; var TokenStream = __webpack_require__(11).TokenStream; var TOKEN = { @@ -3075,66 +3150,6 @@ Tokenizer.prototype._readWhitespace = function() { module.exports.Tokenizer = Tokenizer; module.exports.TOKEN = TOKEN; -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function Token(type, text, newlines, whitespace_before) { - this.type = type; - this.text = text; - - // comments_before are - // comments that have a new line before them - // and may or may not have a newline after - // this is a set of comments before - this.comments_before = null; /* inline comment*/ - - - // this.comments_after = new TokenStream(); // no new line before and newline after - this.newlines = newlines || 0; - this.whitespace_before = whitespace_before || ''; - this.parent = null; - this.next = null; - this.previous = null; - this.opened = null; - this.closed = null; - this.directives = null; -} - - -module.exports.Token = Token; - /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { @@ -3368,7 +3383,7 @@ module.exports = css_beautify; var Options = __webpack_require__(15).Options; var Output = __webpack_require__(3).Output; -var InputScanner = __webpack_require__(8).InputScanner; +var InputScanner = __webpack_require__(9).InputScanner; var lineBreak = /\r\n|[\r\n]/; var allLineBreaks = /\r\n|[\r\n]/g; @@ -3511,15 +3526,9 @@ Beautifier.prototype.beautify = function() { source_text = source_text.replace(allLineBreaks, '\n'); // reset - var baseIndentString = ''; - if (this._options.base_indent_string) { - baseIndentString = this._options.base_indent_string; - } else { - var match = source_text.match(/^[\t ]*/); - baseIndentString = match[0]; - } + var baseIndentString = source_text.match(/^[\t ]*/)[0]; - this._output = new Output(this._options.indent_string, baseIndentString); + this._output = new Output(this._options, baseIndentString); this._input = new InputScanner(source_text); this._indentLevel = 0; this._nestedLevel = 0; @@ -3774,7 +3783,7 @@ Beautifier.prototype.beautify = function() { } } - var sweetCode = this._output.get_code(this._options.end_with_newline, eol); + var sweetCode = this._output.get_code(eol); return sweetCode; }; @@ -3816,7 +3825,7 @@ module.exports.Beautifier = Beautifier; -var BaseOptions = __webpack_require__(6).Options; +var BaseOptions = __webpack_require__(7).Options; function Options(options) { BaseOptions.call(this, options, 'css'); @@ -3920,15 +3929,15 @@ var TOKEN = __webpack_require__(19).TOKEN; var lineBreak = /\r\n|[\r\n]/; var allLineBreaks = /\r\n|[\r\n]/g; -var Printer = function(indent_string, base_indent_string, wrap_line_length, max_preserve_newlines, preserve_newlines) { //handles input/output and some other printing functions +var Printer = function(options, base_indent_string) { //handles input/output and some other printing functions this.indent_level = 0; this.alignment_size = 0; - this.wrap_line_length = wrap_line_length; - this.max_preserve_newlines = max_preserve_newlines; - this.preserve_newlines = preserve_newlines; + this.wrap_line_length = options.wrap_line_length; + this.max_preserve_newlines = options.max_preserve_newlines; + this.preserve_newlines = options.preserve_newlines; - this._output = new Output(indent_string, base_indent_string); + this._output = new Output(options, base_indent_string); }; @@ -4147,13 +4156,8 @@ Beautifier.prototype.beautify = function() { source_text = source_text.replace(allLineBreaks, '\n'); var baseIndentString = ''; - if (this._options.base_indent_string) { - baseIndentString = this._options.base_indent_string; - } else { - // Including commented out text would change existing beautifier behavior for v1.8.1 to autodetect base indent. - // var match = source_text.match(/^[\t ]*/); - // baseIndentString = match[0]; - } + // Including commented out text would change existing html beautifier behavior to autodetect base indent. + // baseIndentString = source_text.match(/^[\t ]*/)[0]; var last_token = { text: '', @@ -4162,8 +4166,7 @@ Beautifier.prototype.beautify = function() { var last_tag_token = new TagOpenParserToken(); - var printer = new Printer(this._options.indent_string, baseIndentString, - this._options.wrap_line_length, this._options.max_preserve_newlines, this._options.preserve_newlines); + var printer = new Printer(this._options, baseIndentString); var tokens = new Tokenizer(source_text, this._options).tokenize(); this._tag_stack = new TagStack(printer); @@ -4191,7 +4194,7 @@ Beautifier.prototype.beautify = function() { raw_token = tokens.next(); } - var sweet_code = printer._output.get_code(this._options.end_with_newline, eol); + var sweet_code = printer._output.get_code(eol); return sweet_code; }; @@ -4660,7 +4663,7 @@ module.exports.Beautifier = Beautifier; -var BaseOptions = __webpack_require__(6).Options; +var BaseOptions = __webpack_require__(7).Options; function Options(options) { BaseOptions.call(this, options, 'html'); @@ -4671,7 +4674,7 @@ function Options(options) { this.indent_handlebars = this._get_boolean('indent_handlebars', true); this.wrap_attributes = this._get_selection('wrap_attributes', - ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple'])[0]; + ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple']); this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size); this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']); @@ -4748,8 +4751,8 @@ module.exports.Options = Options; -var BaseTokenizer = __webpack_require__(9).Tokenizer; -var BASETOKEN = __webpack_require__(9).TOKEN; +var BaseTokenizer = __webpack_require__(10).Tokenizer; +var BASETOKEN = __webpack_require__(10).TOKEN; var Directives = __webpack_require__(12).Directives; var TOKEN = { diff --git a/js/lib/beautifier.js.map b/js/lib/beautifier.js.map index 9c7b10fe3..9e9ccdfe2 100644 --- a/js/lib/beautifier.js.map +++ b/js/lib/beautifier.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://beautifier/webpack/universalModuleDefinition","webpack://beautifier/webpack/bootstrap","webpack://beautifier/./js/src/index.js","webpack://beautifier/./js/src/javascript/index.js","webpack://beautifier/./js/src/javascript/beautifier.js","webpack://beautifier/./js/src/core/output.js","webpack://beautifier/./js/src/javascript/acorn.js","webpack://beautifier/./js/src/javascript/options.js","webpack://beautifier/./js/src/core/options.js","webpack://beautifier/./js/src/javascript/tokenizer.js","webpack://beautifier/./js/src/core/inputscanner.js","webpack://beautifier/./js/src/core/tokenizer.js","webpack://beautifier/./js/src/core/token.js","webpack://beautifier/./js/src/core/tokenstream.js","webpack://beautifier/./js/src/core/directives.js","webpack://beautifier/./js/src/css/index.js","webpack://beautifier/./js/src/css/beautifier.js","webpack://beautifier/./js/src/css/options.js","webpack://beautifier/./js/src/html/index.js","webpack://beautifier/./js/src/html/beautifier.js","webpack://beautifier/./js/src/html/options.js","webpack://beautifier/./js/src/html/tokenizer.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;AClFA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,kBAAkB,mBAAO,CAAC,CAAoB;AAC9C,mBAAmB,mBAAO,CAAC,EAAa;AACxC,oBAAoB,mBAAO,CAAC,EAAc;;AAE1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iC;;;;;;;AC1CA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,iBAAiB,mBAAO,CAAC,CAAc;;AAEvC;AACA;AACA;AACA;;AAEA,6B;;;;;;;ACrCA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,aAAa,mBAAO,CAAC,CAAgB;AACrC,YAAY,mBAAO,CAAC,CAAS;AAC7B,cAAc,mBAAO,CAAC,CAAW;AACjC,gBAAgB,mBAAO,CAAC,CAAa;AACrC,oBAAoB,mBAAO,CAAC,CAAa;AACzC,6BAA6B,mBAAO,CAAC,CAAa;AAClD,YAAY,mBAAO,CAAC,CAAa;;AAEjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ,SAAS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;;AAGA,sCAAsC;AACtC,4BAA4B;AAC5B;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA,iFAAiF;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,+BAA+B,UAAU;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sGAAsG;AACtG;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF;;AAExF;AACA;;AAEA;;AAEA,kCAAkC;AAClC;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH,4CAA4C;AAC5C;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,0EAA0E;AAC1E;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,OAAO;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,kDAAkD;AAClD;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,2CAA2C,KAAK;AAChD,2FAA2F;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,sFAAsF;AACtF;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,2CAA2C;AAC3C,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,mIAAmI;AACtI,yBAAyB,KAAK;AAC9B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oCAAoC;AACpC,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,mCAAmC,iCAAiC;AACpE,UAAU,KAAK;AACf,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uC;;;;;;;AC72CA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA,uDAAuD,wBAAwB;AAC/E;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+B;;;;;;;ACzSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;AAGA,+EAA+E;;AAE/E;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kE;;;;;;;ACvDA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,kBAAkB,mBAAO,CAAC,CAAiB;;AAE3C;;AAEA;AACA;;AAEA;AACA;AACA,4CAA4C;AAC5C;AACA,GAAG,2DAA2D;AAC9D;AACA,GAAG,8DAA8D;AACjE;AACA,QAAQ,6BAA6B;AACrC;AACA;;AAEA;AACA;;AAEA;;AAEA,qCAAqC;AACrC;;AAEA,kBAAkB,+BAA+B;AACjD;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;AAIA,iC;;;;;;;AC1FA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,iCAAiC,4CAA4C,EAAE;AAC/E;;;AAGA;AACA,mBAAmB,UAAU;AAC7B;AACA;AACA,sBAAsB,UAAU;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sC;;;;;;;AC1KA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,mBAAmB,mBAAO,CAAC,CAAsB;AACjD,oBAAoB,mBAAO,CAAC,CAAmB;AAC/C,gBAAgB,mBAAO,CAAC,CAAmB;AAC3C,iBAAiB,mBAAO,CAAC,EAAoB;AAC7C,YAAY,mBAAO,CAAC,CAAS;;AAE7B;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8BAA8B;AAC9B;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2BAA2B;AAC3D;;AAEA;AACA;AACA;;AAEA,4EAA4E;AAC5E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG,kBAAkB;AACrB;AACA,GAAG,kBAAkB;AACrB;AACA,GAAG,kBAAkB;AACrB;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO,mCAAmC,+BAA+B;AACzE,oBAAoB;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oEAAoE;AACpE,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,4CAA4C,SAAS,6BAA6B,SAAS,iEAAiE,SAAS;AACrK,kDAAkD,SAAS,6BAA6B,SAAS,iEAAiE,SAAS;;AAE3K;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ,gBAAgB,MAAM;AACtE,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,QAAQ,gBAAgB,MAAM;AACnG;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,oCAAoC,EAAE;AACtC;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kDAAkD,EAAE;AACpD,OAAO;AACP,kDAAkD,EAAE;AACpD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA,0DAA0D;AAC1D,OAAO;AACP,0FAA0F;AAC1F;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qD;;;;;;;ACrhBA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA,2C;;;;;;;ACnJA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,mBAAmB,mBAAO,CAAC,CAAsB;AACjD,YAAY,mBAAO,CAAC,EAAe;AACnC,kBAAkB,mBAAO,CAAC,EAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA,2DAA2D;AAC3D;AACA;;AAEA,2DAA2D;AAC3D;AACA;;AAEA,uEAAuE;AACvE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA,6B;;;;;;;ACvJA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,8BAA8B;;;AAG9B,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,6B;;;;;;;ACrDA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yC;;;;;;;AC7EA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA,uC;;;;;;;AC7DA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,iBAAiB,mBAAO,CAAC,EAAc;;AAEvC;AACA;AACA;AACA;;AAEA,8B;;;;;;;ACrCA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,cAAc,mBAAO,CAAC,EAAW;AACjC,aAAa,mBAAO,CAAC,CAAgB;AACrC,mBAAmB,mBAAO,CAAC,CAAsB;;AAEjD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK,mBAAmB,cAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA,yCAAyC;AACzC,mCAAmC;AACnC,sDAAsD;AACtD,OAAO;AACP;;AAEA;AACA,gEAAgE;;AAEhE;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK,uDAAuD;AAC5D;AACA,oDAAoD;AACpD,KAAK,yBAAyB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,oFAAoF;AACpF;AACA;AACA;AACA;AACA;AACA,KAAK,yBAAyB;AAC9B;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK,yBAAyB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,6BAA6B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK,6BAA6B;AAClC;AACA;AACA;AACA;AACA;AACA,KAAK,6BAA6B;AAClC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,uC;;;;;;;AC3bA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,kBAAkB,mBAAO,CAAC,CAAiB;;AAE3C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;AAIA,iC;;;;;;;AC7CA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,iBAAiB,mBAAO,CAAC,EAAc;;AAEvC;AACA;AACA;AACA;;AAEA,4B;;;;;;;ACrCA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,cAAc,mBAAO,CAAC,EAAiB;AACvC,aAAa,mBAAO,CAAC,CAAgB;AACrC,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C,YAAY,mBAAO,CAAC,EAAmB;;AAEvC;AACA;;AAEA,uHAAuH;;AAEvH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,qBAAqB,cAAc;AACnC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qGAAqG;AACrG;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wDAAwD;AACxD;AACA;AACA;;AAEA,qDAAqD;AACrD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+DAA+D;AAC/D;;AAEA,iBAAiB;AACjB,6CAA6C;AAC7C;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,uDAAuD;AACvD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO,4CAA4C;AACnD;AACA,OAAO,uFAAuF;AAC9F;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB;AACtB,yCAAyC;AACzC;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,iDAAiD,SAAS;AAC1D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;AACA;;AAEA,gEAAgE;AAChE;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8HAA8H;;AAE9H;AACA;;AAEA;;AAEA;AACA,kCAAkC;AAClC,oFAAoF;AACpF,KAAK,OAAO;AACZ;AACA;AACA;;AAEA,+CAA+C;;AAE/C;AACA;AACA;AACA;AACA;AACA;;AAEA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC;AACA;AACA,0CAA0C;AAC1C;AACA;AACA,0CAA0C,KAAK;AAC/C,mEAAmE;AACnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG,oCAAoC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,OAAO;AACV;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;;AAEA,OAAO;AACP;;AAEA,GAAG;AACH;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;;AAEA,GAAG;AACH;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;;AAEA,OAAO;AACP;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO;AACP;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uC;;;;;;;ACruBA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,kBAAkB,mBAAO,CAAC,CAAiB;;AAE3C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA,iC;;;;;;;ACjFA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,oBAAoB,mBAAO,CAAC,CAAmB;AAC/C,gBAAgB,mBAAO,CAAC,CAAmB;AAC3C,iBAAiB,mBAAO,CAAC,EAAoB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uEAAuE;AACvE;AACA;;AAEA,2DAA2D;AAC3D,eAAe;AACf;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC,8BAA8B,8BAA8B;AAC7F;;AAEA;AACA;AACA;;AAEA,4EAA4E;AAC5E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iDAAiD;AACjD;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,WAAW,+CAA+C;AAC1D;AACA;AACA,WAAW,yCAAyC;AACpD;AACA;AACA,WAAW,0CAA0C;AACrD;AACA;AACA,WAAW,6BAA6B,cAAc,MAAM;AAC5D,6BAA6B;AAC7B;AACA,WAAW,6BAA6B,YAAY,MAAM;AAC1D,2DAA2D;AAC3D,6BAA6B;AAC7B;AACA;AACA,WAAW,wCAAwC,MAAM;AACzD;AACA;AACA,WAAW,wCAAwC,MAAM;AACzD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0DAA0D,YAAY;AACtE;AACA,KAAK,qDAAqD,+BAA+B;AACzF,yDAAyD;AACzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,KAAK,mCAAmC,aAAa,+BAA+B;AACpF;AACA;AACA,qDAAqD;AACrD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mDAAmD;AACnD;AACA;;AAEA;AACA,KAAK;AACL,kBAAkB,+BAA+B;AACjD,yDAAyD;AACzD,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,8EAA8E;AAC9E;AACA,6CAA6C;AAC7C,gDAAgD;AAChD,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6B","file":"beautifier.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"beautifier\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"beautifier\"] = factory();\n\telse\n\t\troot[\"beautifier\"] = factory();\n})(typeof self !== 'undefined' ? self : typeof windows !== 'undefined' ? window : typeof global !== 'undefined' ? global : this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar js_beautify = require('./javascript/index');\nvar css_beautify = require('./css/index');\nvar html_beautify = require('./html/index');\n\nfunction style_html(html_source, options, js, css) {\n js = js || js_beautify;\n css = css || css_beautify;\n return html_beautify(html_source, options, js, css);\n}\n\nmodule.exports.js = js_beautify;\nmodule.exports.css = css_beautify;\nmodule.exports.html = style_html;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction js_beautify(js_source_text, options) {\n var beautifier = new Beautifier(js_source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = js_beautify;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Output = require('../core/output').Output;\nvar acorn = require('./acorn');\nvar Options = require('./options').Options;\nvar Tokenizer = require('./tokenizer').Tokenizer;\nvar line_starters = require('./tokenizer').line_starters;\nvar positionable_operators = require('./tokenizer').positionable_operators;\nvar TOKEN = require('./tokenizer').TOKEN;\n\nfunction remove_redundant_indentation(output, frame) {\n // This implementation is effective but has some issues:\n // - can cause line wrap to happen too soon due to indent removal\n // after wrap points are calculated\n // These issues are minor compared to ugly indentation.\n\n if (frame.multiline_frame ||\n frame.mode === MODE.ForInitializer ||\n frame.mode === MODE.Conditional) {\n return;\n }\n\n // remove one indent from each line inside this section\n output.remove_indent(frame.start_line_index);\n}\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction ltrim(s) {\n return s.replace(/^\\s+/g, '');\n}\n\nfunction generateMapFromStrings(list) {\n var result = {};\n for (var x = 0; x < list.length; x++) {\n // make the mapped names underscored instead of dash\n result[list[x].replace(/-/g, '_')] = list[x];\n }\n return result;\n}\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\n// Generate map from array\nvar OPERATOR_POSITION = generateMapFromStrings(validPositionValues);\n\nvar OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];\n\nvar MODE = {\n BlockStatement: 'BlockStatement', // 'BLOCK'\n Statement: 'Statement', // 'STATEMENT'\n ObjectLiteral: 'ObjectLiteral', // 'OBJECT',\n ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]',\n ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)',\n Conditional: 'Conditional', //'(COND-EXPRESSION)',\n Expression: 'Expression' //'(EXPRESSION)'\n};\n\n// we could use just string.split, but\n// IE doesn't like returning empty strings\nfunction split_linebreaks(s) {\n //return s.split(/\\x0d\\x0a|\\x0a/);\n\n s = s.replace(acorn.allLineBreaks, '\\n');\n var out = [],\n idx = s.indexOf(\"\\n\");\n while (idx !== -1) {\n out.push(s.substring(0, idx));\n s = s.substring(idx + 1);\n idx = s.indexOf(\"\\n\");\n }\n if (s.length) {\n out.push(s);\n }\n return out;\n}\n\nfunction is_array(mode) {\n return mode === MODE.ArrayLiteral;\n}\n\nfunction is_expression(mode) {\n return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);\n}\n\nfunction all_lines_start_with(lines, c) {\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i].trim();\n if (line.charAt(0) !== c) {\n return false;\n }\n }\n return true;\n}\n\nfunction each_line_matches_indent(lines, indent) {\n var i = 0,\n len = lines.length,\n line;\n for (; i < len; i++) {\n line = lines[i];\n // allow empty lines to pass through\n if (line && line.indexOf(indent) !== 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction is_special_word(word) {\n return in_array(word, ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async']);\n}\n\nfunction Beautifier(source_text, options) {\n options = options || {};\n this._source_text = source_text || '';\n\n this._output = null;\n this._tokens = null;\n this._last_type = null;\n this._last_last_text = null;\n this._flags = null;\n this._previous_flags = null;\n\n this._flag_store = null;\n this._options = new Options(options);\n}\n\nBeautifier.prototype.create_flags = function(flags_base, mode) {\n var next_indent_level = 0;\n if (flags_base) {\n next_indent_level = flags_base.indentation_level;\n if (!this._output.just_added_newline() &&\n flags_base.line_indent_level > next_indent_level) {\n next_indent_level = flags_base.line_indent_level;\n }\n }\n\n var next_flags = {\n mode: mode,\n parent: flags_base,\n last_text: flags_base ? flags_base.last_text : '', // last token text\n last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed\n declaration_statement: false,\n declaration_assignment: false,\n multiline_frame: false,\n inline_frame: false,\n if_block: false,\n else_block: false,\n do_block: false,\n do_while: false,\n import_block: false,\n in_case_statement: false, // switch(..){ INSIDE HERE }\n in_case: false, // we're on the exact line with \"case 0:\"\n case_body: false, // the indented case-action block\n indentation_level: next_indent_level,\n line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,\n start_line_index: this._output.get_line_number(),\n ternary_depth: 0\n };\n return next_flags;\n};\n\nBeautifier.prototype._reset = function(source_text) {\n var baseIndentString = '';\n\n if (this._options.base_indent_string) {\n baseIndentString = this._options.base_indent_string;\n } else {\n var match = source_text.match(/^[\\t ]*/);\n baseIndentString = match[0];\n }\n\n\n this._last_type = TOKEN.START_BLOCK; // last token type\n this._last_last_text = ''; // pre-last token text\n this._output = new Output(this._options.indent_string, baseIndentString);\n\n // If testing the ignore directive, start with output disable set to true\n this._output.raw = this._options.test_output_raw;\n\n\n // Stack of parsing/formatting states, including MODE.\n // We tokenize, parse, and output in an almost purely a forward-only stream of token input\n // and formatted output. This makes the beautifier less accurate than full parsers\n // but also far more tolerant of syntax errors.\n //\n // For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type\n // MODE.BlockStatement on the the stack, even though it could be object literal. If we later\n // encounter a \":\", we'll switch to to MODE.ObjectLiteral. If we then see a \";\",\n // most full parsers would die, but the beautifier gracefully falls back to\n // MODE.BlockStatement and continues on.\n this._flag_store = [];\n this.set_mode(MODE.BlockStatement);\n var tokenizer = new Tokenizer(source_text, this._options);\n this._tokens = tokenizer.tokenize();\n return source_text;\n};\n\nBeautifier.prototype.beautify = function() {\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var sweet_code;\n var source_text = this._reset(this._source_text);\n\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && acorn.lineBreak.test(source_text || '')) {\n eol = source_text.match(acorn.lineBreak)[0];\n }\n }\n\n var current_token = this._tokens.next();\n while (current_token) {\n this.handle_token(current_token);\n\n this._last_last_text = this._flags.last_text;\n this._last_type = current_token.type;\n this._flags.last_text = current_token.text;\n\n current_token = this._tokens.next();\n }\n\n sweet_code = this._output.get_code(this._options.end_with_newline, eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype.handle_token = function(current_token, preserve_statement_flags) {\n if (current_token.type === TOKEN.START_EXPR) {\n this.handle_start_expr(current_token);\n } else if (current_token.type === TOKEN.END_EXPR) {\n this.handle_end_expr(current_token);\n } else if (current_token.type === TOKEN.START_BLOCK) {\n this.handle_start_block(current_token);\n } else if (current_token.type === TOKEN.END_BLOCK) {\n this.handle_end_block(current_token);\n } else if (current_token.type === TOKEN.WORD) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.RESERVED) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.SEMICOLON) {\n this.handle_semicolon(current_token);\n } else if (current_token.type === TOKEN.STRING) {\n this.handle_string(current_token);\n } else if (current_token.type === TOKEN.EQUALS) {\n this.handle_equals(current_token);\n } else if (current_token.type === TOKEN.OPERATOR) {\n this.handle_operator(current_token);\n } else if (current_token.type === TOKEN.COMMA) {\n this.handle_comma(current_token);\n } else if (current_token.type === TOKEN.BLOCK_COMMENT) {\n this.handle_block_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.COMMENT) {\n this.handle_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.DOT) {\n this.handle_dot(current_token);\n } else if (current_token.type === TOKEN.EOF) {\n this.handle_eof(current_token);\n } else if (current_token.type === TOKEN.UNKNOWN) {\n this.handle_unknown(current_token, preserve_statement_flags);\n } else {\n this.handle_unknown(current_token, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) {\n var newlines = current_token.newlines;\n var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode);\n\n if (current_token.comments_before) {\n var comment_token = current_token.comments_before.next();\n while (comment_token) {\n // The cleanest handling of inline comments is to treat them as though they aren't there.\n // Just continue formatting and the behavior should be logical.\n // Also ignore unknown tokens. Again, this should result in better behavior.\n this.handle_whitespace_and_comments(comment_token, preserve_statement_flags);\n this.handle_token(comment_token, preserve_statement_flags);\n comment_token = current_token.comments_before.next();\n }\n }\n\n if (keep_whitespace) {\n for (var i = 0; i < newlines; i += 1) {\n this.print_newline(i > 0, preserve_statement_flags);\n }\n } else {\n if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) {\n newlines = this._options.max_preserve_newlines;\n }\n\n if (this._options.preserve_newlines) {\n if (newlines > 1) {\n this.print_newline(false, preserve_statement_flags);\n for (var j = 1; j < newlines; j += 1) {\n this.print_newline(true, preserve_statement_flags);\n }\n }\n }\n }\n\n};\n\nvar newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield'];\n\nBeautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) {\n force_linewrap = (force_linewrap === undefined) ? false : force_linewrap;\n\n // Never wrap the first token on a line\n if (this._output.just_added_newline()) {\n return;\n }\n\n var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap;\n var operatorLogicApplies = in_array(this._flags.last_text, positionable_operators) ||\n in_array(current_token.text, positionable_operators);\n\n if (operatorLogicApplies) {\n var shouldPrintOperatorNewline = (\n in_array(this._flags.last_text, positionable_operators) &&\n in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)\n ) ||\n in_array(current_token.text, positionable_operators);\n shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;\n }\n\n if (shouldPreserveOrForce) {\n this.print_newline(false, true);\n } else if (this._options.wrap_line_length) {\n if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, newline_restricted_tokens)) {\n // These tokens should never have a newline inserted\n // between them and the following expression.\n return;\n }\n var proposed_line_length = this._output.current_line.get_character_count() + current_token.text.length +\n (this._output.space_before_token ? 1 : 0);\n if (proposed_line_length >= this._options.wrap_line_length) {\n this.print_newline(false, true);\n }\n }\n};\n\nBeautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) {\n if (!preserve_statement_flags) {\n if (this._flags.last_text !== ';' && this._flags.last_text !== ',' && this._flags.last_text !== '=' && (this._last_type !== TOKEN.OPERATOR || this._flags.last_text === '--' || this._flags.last_text === '++')) {\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && next_token && next_token.type === TOKEN.RESERVED && next_token.text === 'else') &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n }\n }\n\n if (this._output.add_new_line(force_newline)) {\n this._flags.multiline_frame = true;\n }\n};\n\nBeautifier.prototype.print_token_line_indentation = function(current_token) {\n if (this._output.just_added_newline()) {\n if (this._options.keep_array_indentation && is_array(this._flags.mode) && current_token.newlines) {\n this._output.current_line.push(current_token.whitespace_before);\n this._output.space_before_token = false;\n } else if (this._output.set_indent(this._flags.indentation_level)) {\n this._flags.line_indent_level = this._flags.indentation_level;\n }\n }\n};\n\nBeautifier.prototype.print_token = function(current_token, printable_token) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n return;\n }\n\n if (this._options.comma_first && this._last_type === TOKEN.COMMA &&\n this._output.just_added_newline()) {\n if (this._output.previous_line.last() === ',') {\n var popped = this._output.previous_line.pop();\n // if the comma was already at the start of the line,\n // pull back onto that line and reprint the indentation\n if (this._output.previous_line.is_empty()) {\n this._output.previous_line.push(popped);\n this._output.trim(true);\n this._output.current_line.pop();\n this._output.trim();\n }\n\n // add the comma in front of the next token\n this.print_token_line_indentation(current_token);\n this._output.add_token(',');\n this._output.space_before_token = true;\n }\n }\n\n printable_token = printable_token || current_token.text;\n this.print_token_line_indentation(current_token);\n this._output.add_token(printable_token);\n};\n\nBeautifier.prototype.indent = function() {\n this._flags.indentation_level += 1;\n};\n\nBeautifier.prototype.deindent = function() {\n if (this._flags.indentation_level > 0 &&\n ((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) {\n this._flags.indentation_level -= 1;\n\n }\n};\n\nBeautifier.prototype.set_mode = function(mode) {\n if (this._flags) {\n this._flag_store.push(this._flags);\n this._previous_flags = this._flags;\n } else {\n this._previous_flags = this.create_flags(null, mode);\n }\n\n this._flags = this.create_flags(this._previous_flags, mode);\n};\n\n\nBeautifier.prototype.restore_mode = function() {\n if (this._flag_store.length > 0) {\n this._previous_flags = this._flags;\n this._flags = this._flag_store.pop();\n if (this._previous_flags.mode === MODE.Statement) {\n remove_redundant_indentation(this._output, this._previous_flags);\n }\n }\n};\n\nBeautifier.prototype.start_of_object_property = function() {\n return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && (\n (this._flags.last_text === ':' && this._flags.ternary_depth === 0) || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['get', 'set'])));\n};\n\nBeautifier.prototype.start_of_statement = function(current_token) {\n var start = false;\n start = start || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD);\n start = start || (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'do');\n start = start || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, newline_restricted_tokens) && !current_token.newlines);\n start = start || (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'else' &&\n !(current_token.type === TOKEN.RESERVED && current_token.text === 'if' && !current_token.comments_before));\n start = start || (this._last_type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional));\n start = start || (this._last_type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement &&\n !this._flags.in_case &&\n !(current_token.text === '--' || current_token.text === '++') &&\n this._last_last_text !== 'function' &&\n current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED);\n start = start || (this._flags.mode === MODE.ObjectLiteral && (\n (this._flags.last_text === ':' && this._flags.ternary_depth === 0) || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['get', 'set']))));\n\n if (start) {\n this.set_mode(MODE.Statement);\n this.indent();\n\n this.handle_whitespace_and_comments(current_token, true);\n\n // Issue #276:\n // If starting a new statement with [if, for, while, do], push to a new line.\n // if (a) if (b) if(c) d(); else e(); else f();\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token,\n current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['do', 'for', 'if', 'while']));\n }\n\n return true;\n }\n return false;\n};\n\nBeautifier.prototype.handle_start_expr = function(current_token) {\n // The conditional starts the statement if appropriate.\n if (!this.start_of_statement(current_token)) {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_mode = MODE.Expression;\n if (current_token.text === '[') {\n\n if (this._last_type === TOKEN.WORD || this._flags.last_text === ')') {\n // this is array index specifier, break immediately\n // a[x], fn()[x]\n if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, line_starters)) {\n this._output.space_before_token = true;\n }\n this.set_mode(next_mode);\n this.print_token(current_token);\n this.indent();\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n return;\n }\n\n next_mode = MODE.ArrayLiteral;\n if (is_array(this._flags.mode)) {\n if (this._flags.last_text === '[' ||\n (this._flags.last_text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) {\n // ], [ goes to new line\n // }, [ goes to new line\n if (!this._options.keep_array_indentation) {\n this.print_newline();\n }\n }\n }\n\n if (!in_array(this._last_type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) {\n this._output.space_before_token = true;\n }\n } else {\n if (this._last_type === TOKEN.RESERVED) {\n if (this._flags.last_text === 'for') {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.ForInitializer;\n } else if (in_array(this._flags.last_text, ['if', 'while'])) {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.Conditional;\n } else if (in_array(this._flags.last_word, ['await', 'async'])) {\n // Should be a space between await and an IIFE, or async and an arrow function\n this._output.space_before_token = true;\n } else if (this._flags.last_text === 'import' && current_token.whitespace_before === '') {\n this._output.space_before_token = false;\n } else if (in_array(this._flags.last_text, line_starters) || this._flags.last_text === 'catch') {\n this._output.space_before_token = true;\n }\n } else if (this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) {\n // Support of this kind of newline preservation.\n // a = (b &&\n // (c || d));\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._last_type === TOKEN.WORD) {\n this._output.space_before_token = false;\n } else {\n // Support preserving wrapped arrow function expressions\n // a.b('c',\n // () => d.e\n // )\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // function() vs function ()\n // yield*() vs yield* ()\n // function*() vs function* ()\n if ((this._last_type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) ||\n (this._flags.last_text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n\n this._output.space_before_token = this._options.space_after_anon_function;\n }\n\n }\n\n if (this._flags.last_text === ';' || this._last_type === TOKEN.START_BLOCK) {\n this.print_newline();\n } else if (this._last_type === TOKEN.END_EXPR || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.END_BLOCK || this._flags.last_text === '.' || this._last_type === TOKEN.COMMA) {\n // do nothing on (( and )( and ][ and ]( and .(\n // TODO: Consider whether forcing this is required. Review failing tests when removed.\n this.allow_wrap_or_preserved_newline(current_token, current_token.newlines);\n }\n\n this.set_mode(next_mode);\n this.print_token(current_token);\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n // In all cases, if we newline while inside an expression it should be indented.\n this.indent();\n};\n\nBeautifier.prototype.handle_end_expr = function(current_token) {\n // statements inside expressions are not valid syntax, but...\n // statements must all be closed when their container closes\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n this.handle_whitespace_and_comments(current_token);\n\n if (this._flags.multiline_frame) {\n this.allow_wrap_or_preserved_newline(current_token,\n current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation);\n }\n\n if (this._options.space_in_paren) {\n if (this._last_type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) {\n // () [] no inner space in empty parens like these, ever, ref #320\n this._output.trim();\n this._output.space_before_token = false;\n } else {\n this._output.space_before_token = true;\n }\n }\n if (current_token.text === ']' && this._options.keep_array_indentation) {\n this.print_token(current_token);\n this.restore_mode();\n } else {\n this.restore_mode();\n this.print_token(current_token);\n }\n remove_redundant_indentation(this._output, this._previous_flags);\n\n // do {} while () // no statement required after\n if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) {\n this._previous_flags.mode = MODE.Expression;\n this._flags.do_block = false;\n this._flags.do_while = false;\n\n }\n};\n\nBeautifier.prototype.handle_start_block = function(current_token) {\n this.handle_whitespace_and_comments(current_token);\n\n // Check if this is should be treated as a ObjectLiteral\n var next_token = this._tokens.peek();\n var second_token = this._tokens.peek(1);\n if (second_token && (\n (in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) ||\n (in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED]))\n )) {\n // We don't support TypeScript,but we didn't break it for a very long time.\n // We'll try to keep not breaking it.\n if (!in_array(this._last_last_text, ['class', 'interface'])) {\n this.set_mode(MODE.ObjectLiteral);\n } else {\n this.set_mode(MODE.BlockStatement);\n }\n } else if (this._last_type === TOKEN.OPERATOR && this._flags.last_text === '=>') {\n // arrow function: (param1, paramN) => { statements }\n this.set_mode(MODE.BlockStatement);\n } else if (in_array(this._last_type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) ||\n (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['return', 'throw', 'import', 'default']))\n ) {\n // Detecting shorthand function syntax is difficult by scanning forward,\n // so check the surrounding context.\n // If the block is being returned, imported, export default, passed as arg,\n // assigned with = or assigned in a nested object, treat as an ObjectLiteral.\n this.set_mode(MODE.ObjectLiteral);\n } else {\n this.set_mode(MODE.BlockStatement);\n }\n\n var empty_braces = !next_token.comments_before && next_token.text === '}';\n var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' &&\n this._last_type === TOKEN.END_EXPR;\n\n if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so\n {\n // search forward for a newline wanted inside this block\n var index = 0;\n var check_token = null;\n this._flags.inline_frame = true;\n do {\n index += 1;\n check_token = this._tokens.peek(index - 1);\n if (check_token.newlines) {\n this._flags.inline_frame = false;\n break;\n }\n } while (check_token.type !== TOKEN.EOF &&\n !(check_token.type === TOKEN.END_BLOCK && check_token.opened === current_token));\n }\n\n if ((this._options.brace_style === \"expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n if (this._last_type !== TOKEN.OPERATOR &&\n (empty_anonymous_function ||\n this._last_type === TOKEN.EQUALS ||\n (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text) && this._flags.last_text !== 'else'))) {\n this._output.space_before_token = true;\n } else {\n this.print_newline(false, true);\n }\n } else { // collapse || inline_frame\n if (is_array(this._previous_flags.mode) && (this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.COMMA)) {\n if (this._last_type === TOKEN.COMMA || this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n if (this._last_type === TOKEN.COMMA || (this._last_type === TOKEN.START_EXPR && this._flags.inline_frame)) {\n this.allow_wrap_or_preserved_newline(current_token);\n this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame;\n this._flags.multiline_frame = false;\n }\n }\n if (this._last_type !== TOKEN.OPERATOR && this._last_type !== TOKEN.START_EXPR) {\n if (this._last_type === TOKEN.START_BLOCK && !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.space_before_token = true;\n }\n }\n }\n this.print_token(current_token);\n this.indent();\n};\n\nBeautifier.prototype.handle_end_block = function(current_token) {\n // statements must all be closed when their container closes\n this.handle_whitespace_and_comments(current_token);\n\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n var empty_braces = this._last_type === TOKEN.START_BLOCK;\n\n if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first\n this._output.space_before_token = true;\n } else if (this._options.brace_style === \"expand\") {\n if (!empty_braces) {\n this.print_newline();\n }\n } else {\n // skip {}\n if (!empty_braces) {\n if (is_array(this._flags.mode) && this._options.keep_array_indentation) {\n // we REALLY need a newline here, but newliner would skip that\n this._options.keep_array_indentation = false;\n this.print_newline();\n this._options.keep_array_indentation = true;\n\n } else {\n this.print_newline();\n }\n }\n }\n this.restore_mode();\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_word = function(current_token) {\n if (current_token.type === TOKEN.RESERVED) {\n if (in_array(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) {\n current_token.type = TOKEN.WORD;\n } else if (in_array(current_token.text, ['as', 'from']) && !this._flags.import_block) {\n current_token.type = TOKEN.WORD;\n } else if (this._flags.mode === MODE.ObjectLiteral) {\n var next_token = this._tokens.peek();\n if (next_token.text === ':') {\n current_token.type = TOKEN.WORD;\n }\n }\n }\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) {\n this._flags.declaration_statement = true;\n }\n } else if (current_token.newlines && !is_expression(this._flags.mode) &&\n (this._last_type !== TOKEN.OPERATOR || (this._flags.last_text === '--' || this._flags.last_text === '++')) &&\n this._last_type !== TOKEN.EQUALS &&\n (this._options.preserve_newlines || !(this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const', 'set', 'get'])))) {\n this.handle_whitespace_and_comments(current_token);\n this.print_newline();\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.do_block && !this._flags.do_while) {\n if (current_token.type === TOKEN.RESERVED && current_token.text === 'while') {\n // do {} ## while ()\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n this._flags.do_while = true;\n return;\n } else {\n // do {} should always have while as the next word.\n // if we don't see the expected while, recover\n this.print_newline();\n this._flags.do_block = false;\n }\n }\n\n // if may be followed by else, or not\n // Bare/inline ifs are tricky\n // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();\n if (this._flags.if_block) {\n if (!this._flags.else_block && (current_token.type === TOKEN.RESERVED && current_token.text === 'else')) {\n this._flags.else_block = true;\n } else {\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this._flags.if_block = false;\n this._flags.else_block = false;\n }\n }\n\n if (current_token.type === TOKEN.RESERVED && (current_token.text === 'case' || (current_token.text === 'default' && this._flags.in_case_statement))) {\n this.print_newline();\n if (this._flags.case_body || this._options.jslint_happy) {\n // switch cases following one another\n this.deindent();\n this._flags.case_body = false;\n }\n this.print_token(current_token);\n this._flags.in_case = true;\n this._flags.in_case_statement = true;\n return;\n }\n\n if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n }\n\n if (current_token.type === TOKEN.RESERVED && current_token.text === 'function') {\n if (in_array(this._flags.last_text, ['}', ';']) ||\n (this._output.just_added_newline() && !(in_array(this._flags.last_text, ['(', '[', '{', ':', '=', ',']) || this._last_type === TOKEN.OPERATOR))) {\n // make sure there is a nice clean space of at least one blank line\n // before a new function definition\n if (!this._output.just_added_blankline() && !current_token.comments_before) {\n this.print_newline();\n this.print_newline(true);\n }\n }\n if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD) {\n if (this._last_type === TOKEN.RESERVED && (\n in_array(this._flags.last_text, ['get', 'set', 'new', 'export']) ||\n in_array(this._flags.last_text, newline_restricted_tokens))) {\n this._output.space_before_token = true;\n } else if (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'default' && this._last_last_text === 'export') {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n } else if (this._last_type === TOKEN.OPERATOR || this._flags.last_text === '=') {\n // foo = function\n this._output.space_before_token = true;\n } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) {\n // (function\n } else {\n this.print_newline();\n }\n\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n return;\n }\n\n var prefix = 'NONE';\n\n if (this._last_type === TOKEN.END_BLOCK) {\n\n if (this._previous_flags.inline_frame) {\n prefix = 'SPACE';\n } else if (!(current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['else', 'catch', 'finally', 'from']))) {\n prefix = 'NEWLINE';\n } else {\n if (this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) {\n prefix = 'NEWLINE';\n } else {\n prefix = 'SPACE';\n this._output.space_before_token = true;\n }\n }\n } else if (this._last_type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) {\n // TODO: Should this be for STATEMENT as well?\n prefix = 'NEWLINE';\n } else if (this._last_type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) {\n prefix = 'SPACE';\n } else if (this._last_type === TOKEN.STRING) {\n prefix = 'NEWLINE';\n } else if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD ||\n (this._flags.last_text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n prefix = 'SPACE';\n } else if (this._last_type === TOKEN.START_BLOCK) {\n if (this._flags.inline_frame) {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n } else if (this._last_type === TOKEN.END_EXPR) {\n this._output.space_before_token = true;\n prefix = 'NEWLINE';\n }\n\n if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, line_starters) && this._flags.last_text !== ')') {\n if (this._flags.inline_frame || this._flags.last_text === 'else' || this._flags.last_text === 'export') {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n\n }\n\n if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['else', 'catch', 'finally'])) {\n if ((!(this._last_type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) ||\n this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.trim(true);\n var line = this._output.current_line;\n // If we trimmed and there's something other than a close block before us\n // put a newline back in. Handles '} // comment' scenario.\n if (line.last() !== '}') {\n this.print_newline();\n }\n this._output.space_before_token = true;\n }\n } else if (prefix === 'NEWLINE') {\n if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) {\n // no newline between 'return nnn'\n this._output.space_before_token = true;\n } else if (this._last_type !== TOKEN.END_EXPR) {\n if ((this._last_type !== TOKEN.START_EXPR || !(current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['var', 'let', 'const']))) && this._flags.last_text !== ':') {\n // no need to force newline on 'var': for (var x = 0...)\n if (current_token.type === TOKEN.RESERVED && current_token.text === 'if' && this._flags.last_text === 'else') {\n // no newline for } else if {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n }\n } else if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, line_starters) && this._flags.last_text !== ')') {\n this.print_newline();\n }\n } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_text === ',' && this._last_last_text === '}') {\n this.print_newline(); // }, in lists get a newline treatment\n } else if (prefix === 'SPACE') {\n this._output.space_before_token = true;\n }\n if (this._last_type === TOKEN.WORD || this._last_type === TOKEN.RESERVED) {\n this._output.space_before_token = true;\n }\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n\n if (current_token.type === TOKEN.RESERVED) {\n if (current_token.text === 'do') {\n this._flags.do_block = true;\n } else if (current_token.text === 'if') {\n this._flags.if_block = true;\n } else if (current_token.text === 'import') {\n this._flags.import_block = true;\n } else if (this._flags.import_block && current_token.type === TOKEN.RESERVED && current_token.text === 'from') {\n this._flags.import_block = false;\n }\n }\n};\n\nBeautifier.prototype.handle_semicolon = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // Semicolon can be the start (and end) of a statement\n this._output.space_before_token = false;\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && next_token && next_token.type === TOKEN.RESERVED && next_token.text === 'else') &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n\n // hacky but effective for the moment\n if (this._flags.import_block) {\n this._flags.import_block = false;\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_string = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // One difference - strings want at least a space before\n this._output.space_before_token = true;\n } else {\n this.handle_whitespace_and_comments(current_token);\n if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD || this._flags.inline_frame) {\n this._output.space_before_token = true;\n } else if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else {\n this.print_newline();\n }\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_equals = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.declaration_statement) {\n // just got an '=' in a var-line, different formatting/line-breaking, etc will now be done\n this._flags.declaration_assignment = true;\n }\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n};\n\nBeautifier.prototype.handle_comma = function(current_token) {\n this.handle_whitespace_and_comments(current_token, true);\n\n this.print_token(current_token);\n this._output.space_before_token = true;\n if (this._flags.declaration_statement) {\n if (is_expression(this._flags.parent.mode)) {\n // do not break on comma, for(var a = 1, b = 2)\n this._flags.declaration_assignment = false;\n }\n\n if (this._flags.declaration_assignment) {\n this._flags.declaration_assignment = false;\n this.print_newline(false, true);\n } else if (this._options.comma_first) {\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._flags.mode === MODE.ObjectLiteral ||\n (this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) {\n if (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n if (!this._flags.inline_frame) {\n this.print_newline();\n }\n } else if (this._options.comma_first) {\n // EXPR or DO_BLOCK\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n};\n\nBeautifier.prototype.handle_operator = function(current_token) {\n var isGeneratorAsterisk = current_token.text === '*' &&\n ((this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['function', 'yield'])) ||\n (in_array(this._last_type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON]))\n );\n var isUnary = in_array(current_token.text, ['-', '+']) && (\n in_array(this._last_type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) ||\n in_array(this._flags.last_text, line_starters) ||\n this._flags.last_text === ','\n );\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n var preserve_statement_flags = !isGeneratorAsterisk;\n this.handle_whitespace_and_comments(current_token, preserve_statement_flags);\n }\n\n if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) {\n // \"return\" had a special handling in TK_WORD. Now we need to return the favor\n this._output.space_before_token = true;\n this.print_token(current_token);\n return;\n }\n\n // hack for actionscript's import .*;\n if (current_token.text === '*' && this._last_type === TOKEN.DOT) {\n this.print_token(current_token);\n return;\n }\n\n if (current_token.text === '::') {\n // no spaces around exotic namespacing syntax operator\n this.print_token(current_token);\n return;\n }\n\n // Allow line wrapping between operators when operator_position is\n // set to before or preserve\n if (this._last_type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n if (current_token.text === ':' && this._flags.in_case) {\n this._flags.case_body = true;\n this.indent();\n this.print_token(current_token);\n this.print_newline();\n this._flags.in_case = false;\n return;\n }\n\n var space_before = true;\n var space_after = true;\n var in_ternary = false;\n if (current_token.text === ':') {\n if (this._flags.ternary_depth === 0) {\n // Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant.\n space_before = false;\n } else {\n this._flags.ternary_depth -= 1;\n in_ternary = true;\n }\n } else if (current_token.text === '?') {\n this._flags.ternary_depth += 1;\n }\n\n // let's handle the operator_position option prior to any conflicting logic\n if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array(current_token.text, positionable_operators)) {\n var isColon = current_token.text === ':';\n var isTernaryColon = (isColon && in_ternary);\n var isOtherColon = (isColon && !in_ternary);\n\n switch (this._options.operator_position) {\n case OPERATOR_POSITION.before_newline:\n // if the current token is : and it's not a ternary statement then we set space_before to false\n this._output.space_before_token = !isOtherColon;\n\n this.print_token(current_token);\n\n if (!isColon || isTernaryColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.after_newline:\n // if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement,\n // then print a newline.\n\n this._output.space_before_token = true;\n\n if (!isColon || isTernaryColon) {\n if (this._tokens.peek().newlines) {\n this.print_newline(false, true);\n } else {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else {\n this._output.space_before_token = false;\n }\n\n this.print_token(current_token);\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.preserve_newline:\n if (!isOtherColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // if we just added a newline, or the current token is : and it's not a ternary statement,\n // then we set space_before to false\n space_before = !(this._output.just_added_newline() || isOtherColon);\n\n this._output.space_before_token = space_before;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n }\n }\n\n if (isGeneratorAsterisk) {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = false;\n var next_token = this._tokens.peek();\n space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]);\n } else if (current_token.text === '...') {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = this._last_type === TOKEN.START_BLOCK;\n space_after = false;\n } else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) {\n // unary operators (and binary +/- pretending to be unary) special cases\n if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n space_before = false;\n space_after = false;\n\n // http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1\n // if there is a newline between -- or ++ and anything else we should preserve it.\n if (current_token.newlines && (current_token.text === '--' || current_token.text === '++')) {\n this.print_newline(false, true);\n }\n\n if (this._flags.last_text === ';' && is_expression(this._flags.mode)) {\n // for (;; ++i)\n // ^^^\n space_before = true;\n }\n\n if (this._last_type === TOKEN.RESERVED) {\n space_before = true;\n } else if (this._last_type === TOKEN.END_EXPR) {\n space_before = !(this._flags.last_text === ']' && (current_token.text === '--' || current_token.text === '++'));\n } else if (this._last_type === TOKEN.OPERATOR) {\n // a++ + ++b;\n // a - -b\n space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_text, ['--', '-', '++', '+']);\n // + and - are not unary when preceeded by -- or ++ operator\n // a-- + b\n // a * +b\n // a - -b\n if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_text, ['--', '++'])) {\n space_after = true;\n }\n }\n\n\n if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) &&\n (this._flags.last_text === '{' || this._flags.last_text === ';')) {\n // { foo; --i }\n // foo(); --bar;\n this.print_newline();\n }\n }\n\n this._output.space_before_token = this._output.space_before_token || space_before;\n this.print_token(current_token);\n this._output.space_before_token = space_after;\n};\n\nBeautifier.prototype.handle_block_comment = function(current_token, preserve_statement_flags) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n if (current_token.directives && current_token.directives.preserve === 'end') {\n // If we're testing the raw output behavior, do not allow a directive to turn it off.\n this._output.raw = this._options.test_output_raw;\n }\n return;\n }\n\n if (current_token.directives) {\n this.print_newline(false, preserve_statement_flags);\n this.print_token(current_token);\n if (current_token.directives.preserve === 'start') {\n this._output.raw = true;\n }\n this.print_newline(false, true);\n return;\n }\n\n // inline block\n if (!acorn.newline.test(current_token.text) && !current_token.newlines) {\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n }\n\n var lines = split_linebreaks(current_token.text);\n var j; // iterator for this case\n var javadoc = false;\n var starless = false;\n var lastIndent = current_token.whitespace_before;\n var lastIndentLength = lastIndent.length;\n\n // block comment starts with a new line\n this.print_newline(false, preserve_statement_flags);\n if (lines.length > 1) {\n javadoc = all_lines_start_with(lines.slice(1), '*');\n starless = each_line_matches_indent(lines.slice(1), lastIndent);\n }\n\n // first line always indented\n this.print_token(current_token, lines[0]);\n for (j = 1; j < lines.length; j++) {\n this.print_newline(false, true);\n if (javadoc) {\n // javadoc: reformat and re-indent\n this.print_token(current_token, ' ' + ltrim(lines[j]));\n } else if (starless && lines[j].length > lastIndentLength) {\n // starless: re-indent non-empty content, avoiding trim\n this.print_token(current_token, lines[j].substring(lastIndentLength));\n } else {\n // normal comments output raw\n this._output.add_token(lines[j]);\n }\n }\n\n // for comments of more than one line, make sure there's a new line after\n this.print_newline(false, preserve_statement_flags);\n};\n\nBeautifier.prototype.handle_comment = function(current_token, preserve_statement_flags) {\n if (current_token.newlines) {\n this.print_newline(false, preserve_statement_flags);\n } else {\n this._output.trim(true);\n }\n\n this._output.space_before_token = true;\n this.print_token(current_token);\n this.print_newline(false, preserve_statement_flags);\n};\n\nBeautifier.prototype.handle_dot = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token, true);\n }\n\n if (this._options.unindent_chained_methods) {\n this.deindent();\n }\n\n if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) {\n this._output.space_before_token = false;\n } else {\n // allow preserved newlines before dots in general\n // force newlines on dots after close paren when break_chained - for bar().baz()\n this.allow_wrap_or_preserved_newline(current_token,\n this._flags.last_text === ')' && this._options.break_chained_methods);\n }\n\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_unknown = function(current_token, preserve_statement_flags) {\n this.print_token(current_token);\n\n if (current_token.text[current_token.text.length - 1] === '\\n') {\n this.print_newline(false, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_eof = function(current_token) {\n // Unwind any open statements\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this.handle_whitespace_and_comments(current_token);\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n\n this.__items = [];\n}\n\nOutputLine.prototype.item = function(index) {\n if (index < 0) {\n return this.__items[this.__items.length + index];\n } else {\n return this.__items[index];\n }\n};\n\nOutputLine.prototype.has_match = function(pattern) {\n for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {\n if (this.__items[lastCheckedOutput].match(pattern)) {\n return true;\n }\n }\n return false;\n};\n\nOutputLine.prototype.set_indent = function(indent, alignment) {\n this.__indent_count = indent || 0;\n this.__alignment_count = alignment || 0;\n this.__character_count = this.__parent.baseIndentLength + this.__alignment_count + this.__indent_count * this.__parent.indent_length;\n};\n\nOutputLine.prototype.get_character_count = function() {\n return this.__character_count;\n};\n\nOutputLine.prototype.is_empty = function() {\n return this.__items.length === 0;\n};\n\nOutputLine.prototype.last = function() {\n if (!this.is_empty()) {\n return this.__items[this.__items.length - 1];\n } else {\n return null;\n }\n};\n\nOutputLine.prototype.push = function(item) {\n this.__items.push(item);\n this.__character_count += item.length;\n};\n\nOutputLine.prototype.push_raw = function(item) {\n this.push(item);\n var last_newline_index = item.lastIndexOf('\\n');\n if (last_newline_index !== -1) {\n this.__character_count = item.length - last_newline_index;\n }\n};\n\nOutputLine.prototype.pop = function() {\n var item = null;\n if (!this.is_empty()) {\n item = this.__items.pop();\n this.__character_count -= item.length;\n }\n return item;\n};\n\nOutputLine.prototype.remove_indent = function() {\n if (this.__indent_count > 0) {\n this.__indent_count -= 1;\n this.__character_count -= this.__parent.indent_length;\n }\n};\n\nOutputLine.prototype.trim = function() {\n while (this.last() === ' ') {\n this.__items.pop();\n this.__character_count -= 1;\n }\n};\n\nOutputLine.prototype.toString = function() {\n var result = '';\n if (!this.is_empty()) {\n if (this.__indent_count >= 0) {\n result = this.__parent.get_indent_string(this.__indent_count);\n }\n if (this.__alignment_count >= 0) {\n result += this.__parent.get_alignment_string(this.__alignment_count);\n }\n result += this.__items.join('');\n }\n return result;\n};\n\nfunction IndentCache(base_string, level_string) {\n this.__cache = [base_string];\n this.__level_string = level_string;\n}\n\nIndentCache.prototype.__ensure_cache = function(level) {\n while (level >= this.__cache.length) {\n this.__cache.push(this.__cache[this.__cache.length - 1] + this.__level_string);\n }\n};\n\nIndentCache.prototype.get_level_string = function(level) {\n this.__ensure_cache(level);\n return this.__cache[level];\n};\n\n\nfunction Output(indent_string, baseIndentString) {\n baseIndentString = baseIndentString || '';\n this.__indent_cache = new IndentCache(baseIndentString, indent_string);\n this.__alignment_cache = new IndentCache('', ' ');\n this.baseIndentLength = baseIndentString.length;\n this.indent_length = indent_string.length;\n this.raw = false;\n\n this.__lines = [];\n this.previous_line = null;\n this.current_line = null;\n this.space_before_token = false;\n // initialize\n this.__add_outputline();\n}\n\nOutput.prototype.__add_outputline = function() {\n this.previous_line = this.current_line;\n this.current_line = new OutputLine(this);\n this.__lines.push(this.current_line);\n};\n\nOutput.prototype.get_line_number = function() {\n return this.__lines.length;\n};\n\nOutput.prototype.get_indent_string = function(level) {\n return this.__indent_cache.get_level_string(level);\n};\n\nOutput.prototype.get_alignment_string = function(level) {\n return this.__alignment_cache.get_level_string(level);\n};\n\nOutput.prototype.is_empty = function() {\n return !this.previous_line && this.current_line.is_empty();\n};\n\nOutput.prototype.add_new_line = function(force_newline) {\n // never newline at the start of file\n // otherwise, newline only if we didn't just add one or we're forced\n if (this.is_empty() ||\n (!force_newline && this.just_added_newline())) {\n return false;\n }\n\n // if raw output is enabled, don't print additional newlines,\n // but still return True as though you had\n if (!this.raw) {\n this.__add_outputline();\n }\n return true;\n};\n\nOutput.prototype.get_code = function(end_with_newline, eol) {\n var sweet_code = this.__lines.join('\\n').replace(/[\\r\\n\\t ]+$/, '');\n\n if (end_with_newline) {\n sweet_code += '\\n';\n }\n\n if (eol !== '\\n') {\n sweet_code = sweet_code.replace(/[\\n]/g, eol);\n }\n\n return sweet_code;\n};\n\nOutput.prototype.set_indent = function(indent, alignment) {\n indent = indent || 0;\n alignment = alignment || 0;\n\n // Never indent your first output indent at the start of the file\n if (this.__lines.length > 1) {\n this.current_line.set_indent(indent, alignment);\n return true;\n }\n this.current_line.set_indent();\n return false;\n};\n\nOutput.prototype.add_raw_token = function(token) {\n for (var x = 0; x < token.newlines; x++) {\n this.__add_outputline();\n }\n this.current_line.push(token.whitespace_before);\n this.current_line.push_raw(token.text);\n this.space_before_token = false;\n};\n\nOutput.prototype.add_token = function(printable_token) {\n this.add_space_before_token();\n this.current_line.push(printable_token);\n};\n\nOutput.prototype.add_space_before_token = function() {\n if (this.space_before_token && !this.just_added_newline()) {\n this.current_line.push(' ');\n }\n this.space_before_token = false;\n};\n\nOutput.prototype.remove_indent = function(index) {\n var output_length = this.__lines.length;\n while (index < output_length) {\n this.__lines[index].remove_indent();\n index++;\n }\n};\n\nOutput.prototype.trim = function(eat_newlines) {\n eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;\n\n this.current_line.trim(this.indent_string, this.baseIndentString);\n\n while (eat_newlines && this.__lines.length > 1 &&\n this.current_line.is_empty()) {\n this.__lines.pop();\n this.current_line = this.__lines[this.__lines.length - 1];\n this.current_line.trim();\n }\n\n this.previous_line = this.__lines.length > 1 ?\n this.__lines[this.__lines.length - 2] : null;\n};\n\nOutput.prototype.just_added_newline = function() {\n return this.current_line.is_empty();\n};\n\nOutput.prototype.just_added_blankline = function() {\n return this.is_empty() ||\n (this.current_line.is_empty() && this.previous_line.is_empty());\n};\n\nOutput.prototype.ensure_empty_line_above = function(starts_with, ends_with) {\n var index = this.__lines.length - 2;\n while (index >= 0) {\n var potentialEmptyLine = this.__lines[index];\n if (potentialEmptyLine.is_empty()) {\n break;\n } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&\n potentialEmptyLine.item(-1) !== ends_with) {\n this.__lines.splice(index + 1, 0, new OutputLine(this));\n this.previous_line = this.__lines[this.__lines.length - 2];\n break;\n }\n index--;\n }\n};\n\nmodule.exports.Output = Output;","/* jshint node: true, curly: false */\n// Parts of this section of code is taken from acorn.\n//\n// Acorn was written by Marijn Haverbeke and released under an MIT\n// license. The Unicode regexps (for identifiers and whitespace) were\n// taken from [Esprima](http://esprima.org) by Ariya Hidayat.\n//\n// Git repositories for Acorn are available at\n//\n// http://marijnhaverbeke.nl/git/acorn\n// https://github.com/marijnh/acorn.git\n\n// ## Character categories\n\n\n'use strict';\n\n// acorn used char codes to squeeze the last bit of performance out\n// Beautifier is okay without that, so we're using regex\n// permit $ (36) and @ (64). @ is used in ES7 decorators.\n// 65 through 91 are uppercase letters.\n// permit _ (95).\n// 97 through 123 are lowercase letters.\nvar baseASCIIidentifierStartChars = \"\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a\";\n\n// inside an identifier @ is not allowed but 0-9 are.\nvar baseASCIIidentifierChars = \"\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\";\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 128.\nvar nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nvar nonASCIIidentifierChars = \"\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n//var nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\n//var nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n\nvar identifierStart = \"[\" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + \"]\";\nvar identifierChars = \"[\" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]*\";\n\nexports.identifier = new RegExp(identifierStart + identifierChars, 'g');\n\n\nvar nonASCIIwhitespace = /[\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/; // jshint ignore:line\n\n// Whether a single character denotes a newline.\n\nexports.newline = /[\\n\\r\\u2028\\u2029]/;\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\n// in javascript, these two differ\n// in python they are the same, different methods are called on them\nexports.lineBreak = new RegExp('\\r\\n|' + exports.newline.source);\nexports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'js');\n\n // compatibility, re\n var raw_brace_style = this.raw_options.brace_style || null;\n if (raw_brace_style === \"expand-strict\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"expand\";\n } else if (raw_brace_style === \"collapse-preserve-inline\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"collapse,preserve-inline\";\n } else if (this.raw_options.braces_on_own_line !== undefined) { //graceful handling of deprecated option\n this.raw_options.brace_style = this.raw_options.braces_on_own_line ? \"expand\" : \"collapse\";\n // } else if (!raw_brace_style) { //Nothing exists to set it\n // raw_brace_style = \"collapse\";\n }\n\n //preserve-inline in delimited string will trigger brace_preserve_inline, everything\n //else is considered a brace_style and the last one only will have an effect\n\n var brace_style_split = this._get_selection('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);\n\n this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option\n this.brace_style = \"collapse\";\n\n for (var bs = 0; bs < brace_style_split.length; bs++) {\n if (brace_style_split[bs] === \"preserve-inline\") {\n this.brace_preserve_inline = true;\n } else {\n this.brace_style = brace_style_split[bs];\n }\n }\n\n this.unindent_chained_methods = this._get_boolean('unindent_chained_methods');\n this.break_chained_methods = this._get_boolean('break_chained_methods');\n this.space_in_paren = this._get_boolean('space_in_paren');\n this.space_in_empty_paren = this._get_boolean('space_in_empty_paren');\n this.jslint_happy = this._get_boolean('jslint_happy');\n this.space_after_anon_function = this._get_boolean('space_after_anon_function');\n this.keep_array_indentation = this._get_boolean('keep_array_indentation');\n this.space_before_conditional = this._get_boolean('space_before_conditional', true);\n this.unescape_strings = this._get_boolean('unescape_strings');\n this.e4x = this._get_boolean('e4x');\n this.comma_first = this._get_boolean('comma_first');\n this.operator_position = this._get_selection('operator_position', validPositionValues)[0];\n\n // For testing of beautify preserve:start directive\n this.test_output_raw = this._get_boolean('test_output_raw');\n\n // force this._options.space_after_anon_function to true if this._options.jslint_happy\n if (this.jslint_happy) {\n this.space_after_anon_function = true;\n }\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Options(options, merge_child_field) {\n options = _mergeOpts(options, merge_child_field);\n this.raw_options = _normalizeOpts(options);\n\n // Support passing the source text back with no change\n this.disabled = this._get_boolean('disabled');\n\n this.eol = this._get_characters('eol', 'auto');\n this.end_with_newline = this._get_boolean('end_with_newline');\n this.indent_size = this._get_number('indent_size', 4);\n this.indent_char = this._get_characters('indent_char', ' ');\n this.indent_level = this._get_number('indent_level');\n\n this.preserve_newlines = this._get_boolean('preserve_newlines', true);\n this.max_preserve_newlines = this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);\n if (!this.preserve_newlines) {\n this.max_preserve_newlines = 0;\n }\n\n this.indent_with_tabs = this._get_boolean('indent_with_tabs');\n if (this.indent_with_tabs) {\n this.indent_char = '\\t';\n this.indent_size = 1;\n }\n\n this.indent_string = this.indent_char;\n if (this.indent_size > 1) {\n this.indent_string = new Array(this.indent_size + 1).join(this.indent_char);\n }\n // Set to null to continue support for auto detection of base indent level.\n this.base_indent_string = null;\n if (this.indent_level > 0) {\n this.base_indent_string = new Array(this.indent_level + 1).join(this.indent_string);\n }\n\n // Backwards compat with 1.3.x\n this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));\n\n}\n\nOptions.prototype._get_array = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || [];\n if (typeof option_value === 'object') {\n if (option_value !== null && typeof option_value.concat === 'function') {\n result = option_value.concat();\n }\n } else if (typeof option_value === 'string') {\n result = option_value.split(/[^a-zA-Z0-9_\\/\\-]+/);\n }\n return result;\n};\n\nOptions.prototype._get_boolean = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = option_value === undefined ? !!default_value : !!option_value;\n return result;\n};\n\nOptions.prototype._get_characters = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || '';\n if (typeof option_value === 'string') {\n result = option_value.replace(/\\\\r/, '\\r').replace(/\\\\n/, '\\n').replace(/\\\\t/, '\\t');\n }\n return result;\n};\n\nOptions.prototype._get_number = function(name, default_value) {\n var option_value = this.raw_options[name];\n default_value = parseInt(default_value, 10);\n if (isNaN(default_value)) {\n default_value = 0;\n }\n var result = parseInt(option_value, 10);\n if (isNaN(result)) {\n result = default_value;\n }\n return result;\n};\n\nOptions.prototype._get_selection = function(name, selection_list, default_value) {\n default_value = default_value || [selection_list[0]];\n if (!this._is_valid_selection(default_value, selection_list)) {\n throw new Error(\"Invalid Default Value!\");\n }\n\n var result = this._get_array(name, default_value);\n if (!this._is_valid_selection(result, selection_list)) {\n throw new Error(\n \"Invalid Option Value: The option '\" + name + \"' must be one of the following values\\n\" + selection_list + \"\\nYou passed in: '\" + this.raw_options[name] + \"'\");\n }\n\n return result;\n};\n\nOptions.prototype._is_valid_selection = function(result, selection_list) {\n return result.length && selection_list.length &&\n !result.some(function(item) { return selection_list.indexOf(item) === -1; });\n};\n\n\n// merges child options up with the parent options object\n// Example: obj = {a: 1, b: {a: 2}}\n// mergeOpts(obj, 'b')\n//\n// Returns: {a: 2, b: {a: 2}}\nfunction _mergeOpts(allOptions, childFieldName) {\n var finalOpts = {};\n allOptions = allOptions || {};\n var name;\n\n for (name in allOptions) {\n if (name !== childFieldName) {\n finalOpts[name] = allOptions[name];\n }\n }\n\n //merge in the per type settings for the childFieldName\n if (childFieldName && allOptions[childFieldName]) {\n for (name in allOptions[childFieldName]) {\n finalOpts[name] = allOptions[childFieldName][name];\n }\n }\n return finalOpts;\n}\n\nfunction _normalizeOpts(options) {\n var convertedOpts = {};\n var key;\n\n for (key in options) {\n var newKey = key.replace(/-/g, \"_\");\n convertedOpts[newKey] = options[key];\n }\n return convertedOpts;\n}\n\nmodule.exports.Options = Options;\nmodule.exports.normalizeOpts = _normalizeOpts;\nmodule.exports.mergeOpts = _mergeOpts;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\nvar acorn = require('./acorn');\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\n\nvar TOKEN = {\n START_EXPR: 'TK_START_EXPR',\n END_EXPR: 'TK_END_EXPR',\n START_BLOCK: 'TK_START_BLOCK',\n END_BLOCK: 'TK_END_BLOCK',\n WORD: 'TK_WORD',\n RESERVED: 'TK_RESERVED',\n SEMICOLON: 'TK_SEMICOLON',\n STRING: 'TK_STRING',\n EQUALS: 'TK_EQUALS',\n OPERATOR: 'TK_OPERATOR',\n COMMA: 'TK_COMMA',\n BLOCK_COMMENT: 'TK_BLOCK_COMMENT',\n COMMENT: 'TK_COMMENT',\n DOT: 'TK_DOT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\n\nvar directives_core = new Directives(/\\/\\*/, /\\*\\//);\n\nvar number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\\d+n|(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?/g;\n\nvar digit = /[0-9]/;\n\n// Dot \".\" must be distinguished from \"...\" and decimal\nvar dot_pattern = /[^\\d\\.]/;\n\nvar positionable_operators = (\n \">>> === !== \" +\n \"<< && >= ** != == <= >> || \" +\n \"< / - + > : & % ? ^ | *\").split(' ');\n\n// IMPORTANT: this must be sorted longest to shortest or tokenizing many not work.\n// Also, you must update possitionable operators separately from punct\nvar punct =\n \">>>= \" +\n \"... >>= <<= === >>> !== **= \" +\n \"=> ^= :: /= << <= == && -= >= >> != -- += ** || ++ %= &= *= |= \" +\n \"= ! ? > < : / ^ - + * & % ~ |\";\n\npunct = punct.replace(/[-[\\]{}()*+?.,\\\\^$|#]/g, \"\\\\$&\");\npunct = punct.replace(/ /g, '|');\n\nvar punct_pattern = new RegExp(punct, 'g');\n\n// words which should always start on new line.\nvar line_starters = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(',');\nvar reserved_words = line_starters.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as']);\nvar reserved_word_pattern = new RegExp('^(?:' + reserved_words.join('|') + ')$');\n\n// /* ... */ comment ends with nearest */ or end of file\nvar block_comment_pattern = /\\/\\*(?:[\\s\\S]*?)((?:\\*\\/)|$)/g;\n\n// comment ends just before nearest linefeed or end of file\nvar comment_pattern = /\\/\\/(?:[^\\n\\r\\u2028\\u2029]*)/g;\n\nvar template_pattern = /(?:(?:<\\?php|<\\?=)[\\s\\S]*?\\?>)|(?:<%[\\s\\S]*?%>)/g;\n\nvar in_html_comment;\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n\n this._whitespace_pattern = /[\\n\\r\\u2028\\u2029\\t\\u000B\\u00A0\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff ]+/g;\n this._newline_pattern = /([^\\n\\r\\u2028\\u2029]*)(\\r\\n|[\\n\\r\\u2028\\u2029])?/g;\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) {\n return current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.BLOCK_COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.START_BLOCK || current_token.type === TOKEN.START_EXPR;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return (current_token.type === TOKEN.END_BLOCK || current_token.type === TOKEN.END_EXPR) &&\n (open_token && (\n (current_token.text === ']' && open_token.text === '[') ||\n (current_token.text === ')' && open_token.text === '(') ||\n (current_token.text === '}' && open_token.text === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n in_html_comment = false;\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var token = null;\n var c = this._input.peek();\n\n token = token || this._read_singles(c);\n token = token || this._read_word(previous_token);\n token = token || this._read_comment(c);\n token = token || this._read_string(c);\n token = token || this._read_regexp(c, previous_token);\n token = token || this._read_xml(c, previous_token);\n token = token || this._read_non_javascript(c);\n token = token || this._read_punctuation();\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_word = function(previous_token) {\n var resulting_string;\n resulting_string = this._input.read(acorn.identifier);\n if (resulting_string !== '') {\n if (!(previous_token.type === TOKEN.DOT ||\n (previous_token.type === TOKEN.RESERVED && (previous_token.text === 'set' || previous_token.text === 'get'))) &&\n reserved_word_pattern.test(resulting_string)) {\n if (resulting_string === 'in' || resulting_string === 'of') { // hack for 'in' and 'of' operators\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n return this._create_token(TOKEN.RESERVED, resulting_string);\n }\n\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n\n resulting_string = this._input.read(number_pattern);\n if (resulting_string !== '') {\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n};\n\nTokenizer.prototype._read_singles = function(c) {\n var token = null;\n if (c === null) {\n token = this._create_token(TOKEN.EOF, '');\n } else if (c === '(' || c === '[') {\n token = this._create_token(TOKEN.START_EXPR, c);\n } else if (c === ')' || c === ']') {\n token = this._create_token(TOKEN.END_EXPR, c);\n } else if (c === '{') {\n token = this._create_token(TOKEN.START_BLOCK, c);\n } else if (c === '}') {\n token = this._create_token(TOKEN.END_BLOCK, c);\n } else if (c === ';') {\n token = this._create_token(TOKEN.SEMICOLON, c);\n } else if (c === '.' && dot_pattern.test(this._input.peek(1))) {\n token = this._create_token(TOKEN.DOT, c);\n } else if (c === ',') {\n token = this._create_token(TOKEN.COMMA, c);\n }\n\n if (token) {\n this._input.next();\n }\n return token;\n};\n\nTokenizer.prototype._read_punctuation = function() {\n var resulting_string = this._input.read(punct_pattern);\n\n if (resulting_string !== '') {\n if (resulting_string === '=') {\n return this._create_token(TOKEN.EQUALS, resulting_string);\n } else {\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n }\n};\n\nTokenizer.prototype._read_non_javascript = function(c) {\n var resulting_string = '';\n\n if (c === '#') {\n c = this._input.next();\n\n if (this._is_first_token() && this._input.peek() === '!') {\n // shebang\n resulting_string = c;\n while (this._input.hasNext() && c !== '\\n') {\n c = this._input.next();\n resulting_string += c;\n }\n return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\\n');\n }\n\n // Spidermonkey-specific sharp variables for circular references. Considered obsolete.\n var sharp = '#';\n if (this._input.hasNext() && this._input.testChar(digit)) {\n do {\n c = this._input.next();\n sharp += c;\n } while (this._input.hasNext() && c !== '#' && c !== '=');\n if (c === '#') {\n //\n } else if (this._input.peek() === '[' && this._input.peek(1) === ']') {\n sharp += '[]';\n this._input.next();\n this._input.next();\n } else if (this._input.peek() === '{' && this._input.peek(1) === '}') {\n sharp += '{}';\n this._input.next();\n this._input.next();\n }\n return this._create_token(TOKEN.WORD, sharp);\n }\n\n this._input.back();\n\n } else if (c === '<') {\n if (this._input.peek(1) === '?' || this._input.peek(1) === '%') {\n resulting_string = this._input.read(template_pattern);\n if (resulting_string) {\n resulting_string = resulting_string.replace(acorn.allLineBreaks, '\\n');\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n } else if (this._input.match(/<\\!--/g)) {\n c = '/g)) {\n in_html_comment = false;\n return this._create_token(TOKEN.COMMENT, '-->');\n }\n\n return null;\n};\n\nTokenizer.prototype._read_comment = function(c) {\n var token = null;\n if (c === '/') {\n var comment = '';\n if (this._input.peek(1) === '*') {\n // peek for comment /* ... */\n comment = this._input.read(block_comment_pattern);\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n comment = comment.replace(acorn.allLineBreaks, '\\n');\n token = this._create_token(TOKEN.BLOCK_COMMENT, comment);\n token.directives = directives;\n } else if (this._input.peek(1) === '/') {\n // peek for comment // ...\n comment = this._input.read(comment_pattern);\n token = this._create_token(TOKEN.COMMENT, comment);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_string = function(c) {\n if (c === '`' || c === \"'\" || c === '\"') {\n var resulting_string = this._input.next();\n this.has_char_escapes = false;\n\n if (c === '`') {\n resulting_string += this._read_string_recursive('`', true, '${');\n } else {\n resulting_string += this._read_string_recursive(c);\n }\n\n if (this.has_char_escapes && this._options.unescape_strings) {\n resulting_string = unescape_string(resulting_string);\n }\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n }\n\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._allow_regexp_or_xml = function(previous_token) {\n // regex and xml can only appear in specific locations during parsing\n return (previous_token.type === TOKEN.RESERVED && in_array(previous_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) ||\n (previous_token.type === TOKEN.END_EXPR && previous_token.text === ')' &&\n previous_token.opened.previous.type === TOKEN.RESERVED && in_array(previous_token.opened.previous.text, ['if', 'while', 'for'])) ||\n (in_array(previous_token.type, [TOKEN.COMMENT, TOKEN.START_EXPR, TOKEN.START_BLOCK, TOKEN.START,\n TOKEN.END_BLOCK, TOKEN.OPERATOR, TOKEN.EQUALS, TOKEN.EOF, TOKEN.SEMICOLON, TOKEN.COMMA\n ]));\n};\n\nTokenizer.prototype._read_regexp = function(c, previous_token) {\n\n if (c === '/' && this._allow_regexp_or_xml(previous_token)) {\n // handle regexp\n //\n var resulting_string = this._input.next();\n var esc = false;\n\n var in_char_class = false;\n while (this._input.hasNext() &&\n ((esc || in_char_class || this._input.peek() !== c) &&\n !this._input.testChar(acorn.newline))) {\n resulting_string += this._input.peek();\n if (!esc) {\n esc = this._input.peek() === '\\\\';\n if (this._input.peek() === '[') {\n in_char_class = true;\n } else if (this._input.peek() === ']') {\n in_char_class = false;\n }\n } else {\n esc = false;\n }\n this._input.next();\n }\n\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n\n // regexps may have modifiers /regexp/MOD , so fetch those, too\n // Only [gim] are valid, but if the user puts in garbage, do what we can to take it.\n resulting_string += this._input.read(acorn.identifier);\n }\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n return null;\n};\n\n\nvar startXmlRegExp = /<()([-a-zA-Z:0-9_.]+|{[\\s\\S]+?}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+{[\\s\\S]+?}|\\s+[-a-zA-Z:0-9_.]+|\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{[\\s\\S]+?}))*\\s*(\\/?)\\s*>/g;\nvar xmlRegExp = /[\\s\\S]*?<(\\/?)([-a-zA-Z:0-9_.]+|{[\\s\\S]+?}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+{[\\s\\S]+?}|\\s+[-a-zA-Z:0-9_.]+|\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{[\\s\\S]+?}))*\\s*(\\/?)\\s*>/g;\n\nTokenizer.prototype._read_xml = function(c, previous_token) {\n\n if (this._options.e4x && c === \"<\" && this._input.test(startXmlRegExp) && this._allow_regexp_or_xml(previous_token)) {\n // handle e4x xml literals\n //\n var xmlStr = '';\n var match = this._input.match(startXmlRegExp);\n if (match) {\n // Trim root tag to attempt to\n var rootTag = match[2].replace(/^{\\s+/, '{').replace(/\\s+}$/, '}');\n var isCurlyRoot = rootTag.indexOf('{') === 0;\n var depth = 0;\n while (match) {\n var isEndTag = !!match[1];\n var tagName = match[2];\n var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === \"![CDATA[\");\n if (!isSingletonTag &&\n (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\\s+/, '{').replace(/\\s+}$/, '}')))) {\n if (isEndTag) {\n --depth;\n } else {\n ++depth;\n }\n }\n xmlStr += match[0];\n if (depth <= 0) {\n break;\n }\n match = this._input.match(xmlRegExp);\n }\n // if we didn't close correctly, keep unformatted.\n if (!match) {\n xmlStr += this._input.match(/[\\s\\S]*/g)[0];\n }\n xmlStr = xmlStr.replace(acorn.allLineBreaks, '\\n');\n return this._create_token(TOKEN.STRING, xmlStr);\n }\n }\n\n return null;\n};\n\nfunction unescape_string(s) {\n // You think that a regex would work for this\n // return s.replace(/\\\\x([0-9a-f]{2})/gi, function(match, val) {\n // return String.fromCharCode(parseInt(val, 16));\n // })\n // However, dealing with '\\xff', '\\\\xff', '\\\\\\xff' makes this more fun.\n var out = '',\n escaped = 0;\n\n var input_scan = new InputScanner(s);\n var matched = null;\n\n while (input_scan.hasNext()) {\n // Keep any whitespace, non-slash characters\n // also keep slash pairs.\n matched = input_scan.match(/([\\s]|[^\\\\]|\\\\\\\\)+/g);\n\n if (matched) {\n out += matched[0];\n }\n\n if (input_scan.peek() === '\\\\') {\n input_scan.next();\n if (input_scan.peek() === 'x') {\n matched = input_scan.match(/x([0-9A-Fa-f]{2})/g);\n } else if (input_scan.peek() === 'u') {\n matched = input_scan.match(/u([0-9A-Fa-f]{4})/g);\n } else {\n out += '\\\\';\n if (input_scan.hasNext()) {\n out += input_scan.next();\n }\n continue;\n }\n\n // If there's some error decoding, return the original string\n if (!matched) {\n return s;\n }\n\n escaped = parseInt(matched[1], 16);\n\n if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) {\n // we bail out on \\x7f..\\xff,\n // leaving whole string escaped,\n // as it's probably completely binary\n return s;\n } else if (escaped >= 0x00 && escaped < 0x20) {\n // leave 0x00...0x1f escaped\n out += '\\\\' + matched[0];\n continue;\n } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) {\n // single-quote, apostrophe, backslash - escape these\n out += '\\\\' + String.fromCharCode(escaped);\n } else {\n out += String.fromCharCode(escaped);\n }\n }\n }\n\n return out;\n}\n\n// handle string\n//\nTokenizer.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) {\n // Template strings can travers lines without escape characters.\n // Other strings cannot\n var current_char;\n var resulting_string = '';\n var esc = false;\n while (this._input.hasNext()) {\n current_char = this._input.peek();\n if (!(esc || (current_char !== delimiter &&\n (allow_unescaped_newlines || !acorn.newline.test(current_char))))) {\n break;\n }\n\n // Handle \\r\\n linebreaks after escapes or in template strings\n if ((esc || allow_unescaped_newlines) && acorn.newline.test(current_char)) {\n if (current_char === '\\r' && this._input.peek(1) === '\\n') {\n this._input.next();\n current_char = this._input.peek();\n }\n resulting_string += '\\n';\n } else {\n resulting_string += current_char;\n }\n\n if (esc) {\n if (current_char === 'x' || current_char === 'u') {\n this.has_char_escapes = true;\n }\n esc = false;\n } else {\n esc = current_char === '\\\\';\n }\n\n this._input.next();\n\n if (start_sub && resulting_string.indexOf(start_sub, resulting_string.length - start_sub.length) !== -1) {\n if (delimiter === '`') {\n resulting_string += this._read_string_recursive('}', allow_unescaped_newlines, '`');\n } else {\n resulting_string += this._read_string_recursive('`', allow_unescaped_newlines, '${');\n }\n\n if (this._input.hasNext()) {\n resulting_string += this._input.next();\n }\n }\n }\n\n return resulting_string;\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;\nmodule.exports.positionable_operators = positionable_operators.slice();\nmodule.exports.line_starters = line_starters.slice();","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction InputScanner(input_string) {\n this.__input = input_string || '';\n this.__input_length = this.__input.length;\n this.__position = 0;\n}\n\nInputScanner.prototype.restart = function() {\n this.__position = 0;\n};\n\nInputScanner.prototype.back = function() {\n if (this.__position > 0) {\n this.__position -= 1;\n }\n};\n\nInputScanner.prototype.hasNext = function() {\n return this.__position < this.__input_length;\n};\n\nInputScanner.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__input.charAt(this.__position);\n this.__position += 1;\n }\n return val;\n};\n\nInputScanner.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__input_length) {\n val = this.__input.charAt(index);\n }\n return val;\n};\n\nInputScanner.prototype.test = function(pattern, index) {\n index = index || 0;\n index += this.__position;\n pattern.lastIndex = index;\n\n if (index >= 0 && index < this.__input_length) {\n var pattern_match = pattern.exec(this.__input);\n return pattern_match && pattern_match.index === index;\n } else {\n return false;\n }\n};\n\nInputScanner.prototype.testChar = function(pattern, index) {\n // test one character regex match\n var val = this.peek(index);\n return val !== null && pattern.test(val);\n};\n\nInputScanner.prototype.match = function(pattern) {\n pattern.lastIndex = this.__position;\n var pattern_match = pattern.exec(this.__input);\n if (pattern_match && pattern_match.index === this.__position) {\n this.__position += pattern_match[0].length;\n } else {\n pattern_match = null;\n }\n return pattern_match;\n};\n\nInputScanner.prototype.read = function(pattern) {\n var val = '';\n var match = this.match(pattern);\n if (match) {\n val = match[0];\n }\n return val;\n};\n\nInputScanner.prototype.readUntil = function(pattern, include_match) {\n var val = '';\n var match_index = this.__position;\n pattern.lastIndex = this.__position;\n var pattern_match = pattern.exec(this.__input);\n if (pattern_match) {\n if (include_match) {\n match_index = pattern_match.index + pattern_match[0].length;\n } else {\n match_index = pattern_match.index;\n }\n } else {\n match_index = this.__input_length;\n }\n\n val = this.__input.substring(this.__position, match_index);\n this.__position = match_index;\n return val;\n};\n\nInputScanner.prototype.readUntilAfter = function(pattern) {\n return this.readUntil(pattern, true);\n};\n\n/* css beautifier legacy helpers */\nInputScanner.prototype.peekUntilAfter = function(pattern) {\n var start = this.__position;\n var val = this.readUntilAfter(pattern);\n this.__position = start;\n return val;\n};\n\nInputScanner.prototype.lookBack = function(testVal) {\n var start = this.__position - 1;\n return start >= testVal.length && this.__input.substring(start - testVal.length, start)\n .toLowerCase() === testVal;\n};\n\n\nmodule.exports.InputScanner = InputScanner;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar Token = require('../core/token').Token;\nvar TokenStream = require('../core/tokenstream').TokenStream;\n\nvar TOKEN = {\n START: 'TK_START',\n RAW: 'TK_RAW',\n EOF: 'TK_EOF'\n};\n\nvar Tokenizer = function(input_string, options) {\n this._input = new InputScanner(input_string);\n this._options = options || {};\n this.__tokens = null;\n this.__newline_count = 0;\n this.__whitespace_before_token = '';\n\n this._whitespace_pattern = /[\\n\\r\\t ]+/g;\n this._newline_pattern = /([^\\n\\r]*)(\\r\\n|[\\n\\r])?/g;\n};\n\nTokenizer.prototype.tokenize = function() {\n this._input.restart();\n this.__tokens = new TokenStream();\n\n this._reset();\n\n var current;\n var previous = new Token(TOKEN.START, '');\n var open_token = null;\n var open_stack = [];\n var comments = new TokenStream();\n\n while (previous.type !== TOKEN.EOF) {\n current = this._get_next_token(previous, open_token);\n while (this._is_comment(current)) {\n comments.add(current);\n current = this._get_next_token(previous, open_token);\n }\n\n if (!comments.isEmpty()) {\n current.comments_before = comments;\n comments = new TokenStream();\n }\n\n current.parent = open_token;\n\n if (this._is_opening(current)) {\n open_stack.push(open_token);\n open_token = current;\n } else if (open_token && this._is_closing(current, open_token)) {\n current.opened = open_token;\n open_token.closed = current;\n open_token = open_stack.pop();\n current.parent = open_token;\n }\n\n current.previous = previous;\n previous.next = current;\n\n this.__tokens.add(current);\n previous = current;\n }\n\n return this.__tokens;\n};\n\n\nTokenizer.prototype._is_first_token = function() {\n return this.__tokens.isEmpty();\n};\n\nTokenizer.prototype._reset = function() {};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var resulting_string = this._input.read(/.+/g);\n if (resulting_string) {\n return this._create_token(TOKEN.RAW, resulting_string);\n } else {\n return this._create_token(TOKEN.EOF, '');\n }\n};\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_opening = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._create_token = function(type, text) {\n var token = new Token(type, text, this.__newline_count, this.__whitespace_before_token);\n this.__newline_count = 0;\n this.__whitespace_before_token = '';\n return token;\n};\n\nTokenizer.prototype._readWhitespace = function() {\n var resulting_string = this._input.read(this._whitespace_pattern);\n if (resulting_string === ' ') {\n this.__whitespace_before_token = resulting_string;\n } else if (resulting_string !== '') {\n this._newline_pattern.lastIndex = 0;\n var nextMatch = this._newline_pattern.exec(resulting_string);\n while (nextMatch[2]) {\n this.__newline_count += 1;\n nextMatch = this._newline_pattern.exec(resulting_string);\n }\n this.__whitespace_before_token = nextMatch[1];\n }\n};\n\n\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}\n\n\nmodule.exports.Token = Token;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction TokenStream(parent_token) {\n // private\n this.__tokens = [];\n this.__tokens_length = this.__tokens.length;\n this.__position = 0;\n this.__parent_token = parent_token;\n}\n\nTokenStream.prototype.restart = function() {\n this.__position = 0;\n};\n\nTokenStream.prototype.isEmpty = function() {\n return this.__tokens_length === 0;\n};\n\nTokenStream.prototype.hasNext = function() {\n return this.__position < this.__tokens_length;\n};\n\nTokenStream.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__tokens[this.__position];\n this.__position += 1;\n }\n return val;\n};\n\nTokenStream.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__tokens_length) {\n val = this.__tokens[index];\n }\n return val;\n};\n\nTokenStream.prototype.add = function(token) {\n if (this.__parent_token) {\n token.parent = this.__parent_token;\n }\n this.__tokens.push(token);\n this.__tokens_length += 1;\n};\n\nmodule.exports.TokenStream = TokenStream;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Directives(start_block_pattern, end_block_pattern) {\n start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;\n end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;\n this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \\w+[:]\\w+)+ /.source + end_block_pattern, 'g');\n this.__directive_pattern = / (\\w+)[:](\\w+)/g;\n\n this.__directives_end_ignore_pattern = new RegExp('(?:[\\\\s\\\\S]*?)((?:' + start_block_pattern + /\\sbeautify\\signore:end\\s/.source + end_block_pattern + ')|$)', 'g');\n}\n\nDirectives.prototype.get_directives = function(text) {\n if (!text.match(this.__directives_block_pattern)) {\n return null;\n }\n\n var directives = {};\n this.__directive_pattern.lastIndex = 0;\n var directive_match = this.__directive_pattern.exec(text);\n\n while (directive_match) {\n directives[directive_match[1]] = directive_match[2];\n directive_match = this.__directive_pattern.exec(text);\n }\n\n return directives;\n};\n\nDirectives.prototype.readIgnored = function(input) {\n return input.read(this.__directives_end_ignore_pattern);\n};\n\n\nmodule.exports.Directives = Directives;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction css_beautify(source_text, options) {\n var beautifier = new Beautifier(source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = css_beautify;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('./options').Options;\nvar Output = require('../core/output').Output;\nvar InputScanner = require('../core/inputscanner').InputScanner;\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\n// tokenizer\nvar whitespaceChar = /\\s/;\nvar whitespacePattern = /(?:\\s|\\n)+/g;\nvar block_comment_pattern = /\\/\\*(?:[\\s\\S]*?)((?:\\*\\/)|$)/g;\nvar comment_pattern = /\\/\\/(?:[^\\n\\r\\u2028\\u2029]*)/g;\n\nfunction Beautifier(source_text, options) {\n this._source_text = source_text || '';\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n this._options = new Options(options);\n this._ch = null;\n this._input = null;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule\n this.NESTED_AT_RULE = {\n \"@page\": true,\n \"@font-face\": true,\n \"@keyframes\": true,\n // also in CONDITIONAL_GROUP_RULE below\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n this.CONDITIONAL_GROUP_RULE = {\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n\n}\n\nBeautifier.prototype.eatString = function(endChars) {\n var result = '';\n this._ch = this._input.next();\n while (this._ch) {\n result += this._ch;\n if (this._ch === \"\\\\\") {\n result += this._input.next();\n } else if (endChars.indexOf(this._ch) !== -1 || this._ch === \"\\n\") {\n break;\n }\n this._ch = this._input.next();\n }\n return result;\n};\n\n// Skips any white space in the source text from the current position.\n// When allowAtLeastOneNewLine is true, will output new lines for each\n// newline character found; if the user has preserve_newlines off, only\n// the first newline will be output\nBeautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {\n var result = whitespaceChar.test(this._input.peek());\n var isFirstNewLine = true;\n\n while (whitespaceChar.test(this._input.peek())) {\n this._ch = this._input.next();\n if (allowAtLeastOneNewLine && this._ch === '\\n') {\n if (this._options.preserve_newlines || isFirstNewLine) {\n isFirstNewLine = false;\n this._output.add_new_line(true);\n }\n }\n }\n return result;\n};\n\n// Nested pseudo-class if we are insideRule\n// and the next special character found opens\n// a new block\nBeautifier.prototype.foundNestedPseudoClass = function() {\n var openParen = 0;\n var i = 1;\n var ch = this._input.peek(i);\n while (ch) {\n if (ch === \"{\") {\n return true;\n } else if (ch === '(') {\n // pseudoclasses can contain ()\n openParen += 1;\n } else if (ch === ')') {\n if (openParen === 0) {\n return false;\n }\n openParen -= 1;\n } else if (ch === \";\" || ch === \"}\") {\n return false;\n }\n i++;\n ch = this._input.peek(i);\n }\n return false;\n};\n\nBeautifier.prototype.print_string = function(output_string) {\n if (this._output.just_added_newline()) {\n this._output.set_indent(this._indentLevel);\n }\n this._output.add_token(output_string);\n};\n\nBeautifier.prototype.preserveSingleSpace = function(isAfterSpace) {\n if (isAfterSpace) {\n this._output.space_before_token = true;\n }\n};\n\nBeautifier.prototype.indent = function() {\n this._indentLevel++;\n};\n\nBeautifier.prototype.outdent = function() {\n if (this._indentLevel > 0) {\n this._indentLevel--;\n }\n};\n\n/*_____________________--------------------_____________________*/\n\nBeautifier.prototype.beautify = function() {\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text || '')) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n\n // HACK: newline parsing inconsistent. This brute force normalizes the this._input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n\n // reset\n var baseIndentString = '';\n if (this._options.base_indent_string) {\n baseIndentString = this._options.base_indent_string;\n } else {\n var match = source_text.match(/^[\\t ]*/);\n baseIndentString = match[0];\n }\n\n this._output = new Output(this._options.indent_string, baseIndentString);\n this._input = new InputScanner(source_text);\n this._indentLevel = 0;\n this._nestedLevel = 0;\n\n this._ch = null;\n var parenLevel = 0;\n\n var insideRule = false;\n // This is the value side of a property value pair (blue in the following ex)\n // label { content: blue }\n var insidePropertyValue = false;\n var enteringConditionalGroup = false;\n var insideAtExtend = false;\n var insideAtImport = false;\n var topCharacter = this._ch;\n\n while (true) {\n var whitespace = this._input.read(whitespacePattern);\n var isAfterSpace = whitespace !== '';\n var previous_ch = topCharacter;\n this._ch = this._input.next();\n topCharacter = this._ch;\n\n if (!this._ch) {\n break;\n } else if (this._ch === '/' && this._input.peek() === '*') {\n // /* css comment */\n // Always start block comments on a new line.\n // This handles scenarios where a block comment immediately\n // follows a property definition on the same line or where\n // minified code is being beautified.\n this._output.add_new_line();\n this._input.back();\n this.print_string(this._input.read(block_comment_pattern));\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n\n // Block comments are followed by a new line so they don't\n // share a line with other properties\n this._output.add_new_line();\n } else if (this._ch === '/' && this._input.peek() === '/') {\n // // single line comment\n // Preserves the space before a comment\n // on the same line as a rule\n this._output.space_before_token = true;\n this._input.back();\n this.print_string(this._input.read(comment_pattern));\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n } else if (this._ch === '@') {\n this.preserveSingleSpace(isAfterSpace);\n\n // deal with less propery mixins @{...}\n if (this._input.peek() === '{') {\n this.print_string(this._ch + this.eatString('}'));\n } else {\n this.print_string(this._ch);\n\n // strip trailing space, if present, for hash property checks\n var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\\]\\/='\"]/g);\n\n if (variableOrRule.match(/[ :]$/)) {\n // we have a variable or pseudo-class, add it and insert one space before continuing\n variableOrRule = this.eatString(\": \").replace(/\\s$/, '');\n this.print_string(variableOrRule);\n this._output.space_before_token = true;\n }\n\n variableOrRule = variableOrRule.replace(/\\s$/, '');\n\n if (variableOrRule === 'extend') {\n insideAtExtend = true;\n } else if (variableOrRule === 'import') {\n insideAtImport = true;\n }\n\n // might be a nesting at-rule\n if (variableOrRule in this.NESTED_AT_RULE) {\n this._nestedLevel += 1;\n if (variableOrRule in this.CONDITIONAL_GROUP_RULE) {\n enteringConditionalGroup = true;\n }\n // might be less variable\n } else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) {\n insidePropertyValue = true;\n this.indent();\n }\n }\n } else if (this._ch === '#' && this._input.peek() === '{') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch + this.eatString('}'));\n } else if (this._ch === '{') {\n if (insidePropertyValue) {\n insidePropertyValue = false;\n this.outdent();\n }\n this.indent();\n this._output.space_before_token = true;\n this.print_string(this._ch);\n\n // when entering conditional groups, only rulesets are allowed\n if (enteringConditionalGroup) {\n enteringConditionalGroup = false;\n insideRule = (this._indentLevel > this._nestedLevel);\n } else {\n // otherwise, declarations are also allowed\n insideRule = (this._indentLevel >= this._nestedLevel);\n }\n if (this._options.newline_between_rules && insideRule) {\n if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') {\n this._output.ensure_empty_line_above('/', ',');\n }\n }\n this.eatWhitespace(true);\n this._output.add_new_line();\n } else if (this._ch === '}') {\n this.outdent();\n this._output.add_new_line();\n if (previous_ch === '{') {\n this._output.trim(true);\n }\n insideAtImport = false;\n insideAtExtend = false;\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n this.print_string(this._ch);\n insideRule = false;\n if (this._nestedLevel) {\n this._nestedLevel--;\n }\n\n this.eatWhitespace(true);\n this._output.add_new_line();\n\n if (this._options.newline_between_rules && !this._output.just_added_blankline()) {\n if (this._input.peek() !== '}') {\n this._output.add_new_line(true);\n }\n }\n } else if (this._ch === \":\") {\n if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack(\"&\") || this.foundNestedPseudoClass()) && !this._input.lookBack(\"(\") && !insideAtExtend) {\n // 'property: value' delimiter\n // which could be in a conditional group query\n this.print_string(':');\n if (!insidePropertyValue) {\n insidePropertyValue = true;\n this._output.space_before_token = true;\n this.eatWhitespace(true);\n this.indent();\n }\n } else {\n // sass/less parent reference don't use a space\n // sass nested pseudo-class don't use a space\n\n // preserve space before pseudoclasses/pseudoelements, as it means \"in any child\"\n if (this._input.lookBack(\" \")) {\n this._output.space_before_token = true;\n }\n if (this._input.peek() === \":\") {\n // pseudo-element\n this._ch = this._input.next();\n this.print_string(\"::\");\n } else {\n // pseudo-class\n this.print_string(':');\n }\n }\n } else if (this._ch === '\"' || this._ch === '\\'') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch + this.eatString(this._ch));\n this.eatWhitespace(true);\n } else if (this._ch === ';') {\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n insideAtExtend = false;\n insideAtImport = false;\n this.print_string(this._ch);\n this.eatWhitespace(true);\n\n // This maintains single line comments on the same\n // line. Block comments are also affected, but\n // a new line is always output before one inside\n // that section\n if (this._input.peek() !== '/') {\n this._output.add_new_line();\n }\n } else if (this._ch === '(') { // may be a url\n if (this._input.lookBack(\"url\")) {\n this.print_string(this._ch);\n this.eatWhitespace();\n this._ch = this._input.next();\n if (this._ch === ')' || this._ch === '\"' || this._ch !== '\\'') {\n this._input.back();\n parenLevel++;\n } else if (this._ch) {\n this.print_string(this._ch + this.eatString(')'));\n }\n } else {\n parenLevel++;\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n this.eatWhitespace();\n }\n } else if (this._ch === ')') {\n this.print_string(this._ch);\n parenLevel--;\n } else if (this._ch === ',') {\n this.print_string(this._ch);\n this.eatWhitespace(true);\n if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel < 1 && !insideAtImport) {\n this._output.add_new_line();\n } else {\n this._output.space_before_token = true;\n }\n } else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel < 1) {\n //handle combinator spacing\n if (this._options.space_around_combinator) {\n this._output.space_before_token = true;\n this.print_string(this._ch);\n this._output.space_before_token = true;\n } else {\n this.print_string(this._ch);\n this.eatWhitespace();\n // squash extra whitespace\n if (this._ch && whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n }\n } else if (this._ch === ']') {\n this.print_string(this._ch);\n } else if (this._ch === '[') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n } else if (this._ch === '=') { // no whitespace before or after\n this.eatWhitespace();\n this.print_string('=');\n if (whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n } else if (this._ch === '!') { // !important\n this.print_string(' ');\n this.print_string(this._ch);\n } else {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n }\n }\n\n var sweetCode = this._output.get_code(this._options.end_with_newline, eol);\n\n return sweetCode;\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'css');\n\n this.selector_separator_newline = this._get_boolean('selector_separator_newline', true);\n this.newline_between_rules = this._get_boolean('newline_between_rules', true);\n var space_around_selector_separator = this._get_boolean('space_around_selector_separator');\n this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator;\n\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction style_html(html_source, options, js_beautify, css_beautify) {\n var beautifier = new Beautifier(html_source, options, js_beautify, css_beautify);\n return beautifier.beautify();\n}\n\nmodule.exports = style_html;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('../html/options').Options;\nvar Output = require('../core/output').Output;\nvar Tokenizer = require('../html/tokenizer').Tokenizer;\nvar TOKEN = require('../html/tokenizer').TOKEN;\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\nvar Printer = function(indent_string, base_indent_string, wrap_line_length, max_preserve_newlines, preserve_newlines) { //handles input/output and some other printing functions\n\n this.indent_level = 0;\n this.alignment_size = 0;\n this.wrap_line_length = wrap_line_length;\n this.max_preserve_newlines = max_preserve_newlines;\n this.preserve_newlines = preserve_newlines;\n\n this._output = new Output(indent_string, base_indent_string);\n\n};\n\nPrinter.prototype.current_line_has_match = function(pattern) {\n return this._output.current_line.has_match(pattern);\n};\n\nPrinter.prototype.set_space_before_token = function(value) {\n this._output.space_before_token = value;\n};\n\nPrinter.prototype.add_raw_token = function(token) {\n this._output.add_raw_token(token);\n};\n\nPrinter.prototype.traverse_whitespace = function(raw_token) {\n if (raw_token.whitespace_before || raw_token.newlines) {\n var newlines = 0;\n\n if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) {\n newlines = raw_token.newlines ? 1 : 0;\n }\n\n if (this.preserve_newlines) {\n newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1;\n }\n\n if (newlines) {\n for (var n = 0; n < newlines; n++) {\n this.print_newline(n > 0);\n }\n } else {\n this._output.space_before_token = true;\n this.print_space_or_wrap(raw_token.text);\n }\n return true;\n }\n return false;\n};\n\n// Append a space to the given content (string array) or, if we are\n// at the wrap_line_length, append a newline/indentation.\n// return true if a newline was added, false if a space was added\nPrinter.prototype.print_space_or_wrap = function(text) {\n if (this.wrap_line_length) {\n if (this._output.current_line.get_character_count() + text.length + 1 >= this.wrap_line_length) { //insert a line when the wrap_line_length is reached\n return this._output.add_new_line();\n }\n }\n return false;\n};\n\nPrinter.prototype.print_newline = function(force) {\n this._output.add_new_line(force);\n};\n\nPrinter.prototype.print_token = function(text) {\n if (text) {\n if (this._output.current_line.is_empty()) {\n this._output.set_indent(this.indent_level, this.alignment_size);\n }\n\n this._output.add_token(text);\n }\n};\n\nPrinter.prototype.print_raw_text = function(text) {\n this._output.current_line.push_raw(text);\n};\n\nPrinter.prototype.indent = function() {\n this.indent_level++;\n};\n\nPrinter.prototype.unindent = function() {\n if (this.indent_level > 0) {\n this.indent_level--;\n }\n};\n\nPrinter.prototype.get_full_indent = function(level) {\n level = this.indent_level + (level || 0);\n if (level < 1) {\n return '';\n }\n\n return this._output.get_indent_string(level);\n};\n\n\nvar uses_beautifier = function(tag_check, start_token) {\n var raw_token = start_token.next;\n if (!start_token.closed) {\n return false;\n }\n\n while (raw_token.type !== TOKEN.EOF && raw_token.closed !== start_token) {\n if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === 'type') {\n // For script and style tags that have a type attribute, only enable custom beautifiers for matching values\n var peekEquals = raw_token.next ? raw_token.next : raw_token;\n var peekValue = peekEquals.next ? peekEquals.next : peekEquals;\n if (peekEquals.type === TOKEN.EQUALS && peekValue.type === TOKEN.VALUE) {\n return (tag_check === 'style' && peekValue.text.search('text/css') > -1) ||\n (tag_check === 'script' && peekValue.text.search(/(text|application|dojo)\\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\\+)?json|method|aspect)/) > -1);\n }\n return false;\n }\n raw_token = raw_token.next;\n }\n\n return true;\n};\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction TagFrame(parent, parser_token, indent_level) {\n this.parent = parent || null;\n this.tag = parser_token ? parser_token.tag_name : '';\n this.indent_level = indent_level || 0;\n this.parser_token = parser_token || null;\n}\n\nfunction TagStack(printer) {\n this._printer = printer;\n this._current_frame = null;\n}\n\nTagStack.prototype.get_parser_token = function() {\n return this._current_frame ? this._current_frame.parser_token : null;\n};\n\nTagStack.prototype.record_tag = function(parser_token) { //function to record a tag and its parent in this.tags Object\n var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);\n this._current_frame = new_frame;\n};\n\nTagStack.prototype._try_pop_frame = function(frame) { //function to retrieve the opening tag to the corresponding closer\n var parser_token = null;\n\n if (frame) {\n parser_token = frame.parser_token;\n this._printer.indent_level = frame.indent_level;\n this._current_frame = frame.parent;\n }\n\n return parser_token;\n};\n\nTagStack.prototype._get_frame = function(tag_list, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._current_frame;\n\n while (frame) { //till we reach '' (the initial value);\n if (tag_list.indexOf(frame.tag) !== -1) { //if this is it use it\n break;\n } else if (stop_list && stop_list.indexOf(frame.tag) !== -1) {\n frame = null;\n break;\n }\n frame = frame.parent;\n }\n\n return frame;\n};\n\nTagStack.prototype.try_pop = function(tag, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._get_frame([tag], stop_list);\n return this._try_pop_frame(frame);\n};\n\nTagStack.prototype.indent_to_tag = function(tag_list) {\n var frame = this._get_frame(tag_list);\n if (frame) {\n this._printer.indent_level = frame.indent_level;\n }\n};\n\nfunction Beautifier(source_text, options, js_beautify, css_beautify) {\n //Wrapper function to invoke all the necessary constructors and deal with the output.\n this._source_text = source_text || '';\n options = options || {};\n this._js_beautify = js_beautify;\n this._css_beautify = css_beautify;\n this._tag_stack = null;\n\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n var optionHtml = new Options(options, 'html');\n\n this._options = optionHtml;\n\n this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 'force'.length) === 'force';\n this._is_wrap_attributes_force_expand_multiline = (this._options.wrap_attributes === 'force-expand-multiline');\n this._is_wrap_attributes_force_aligned = (this._options.wrap_attributes === 'force-aligned');\n this._is_wrap_attributes_aligned_multiple = (this._options.wrap_attributes === 'aligned-multiple');\n}\n\nBeautifier.prototype.beautify = function() {\n\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text)) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n // HACK: newline parsing inconsistent. This brute force normalizes the input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n var baseIndentString = '';\n\n if (this._options.base_indent_string) {\n baseIndentString = this._options.base_indent_string;\n } else {\n // Including commented out text would change existing beautifier behavior for v1.8.1 to autodetect base indent.\n // var match = source_text.match(/^[\\t ]*/);\n // baseIndentString = match[0];\n }\n\n var last_token = {\n text: '',\n type: ''\n };\n\n var last_tag_token = new TagOpenParserToken();\n\n var printer = new Printer(this._options.indent_string, baseIndentString,\n this._options.wrap_line_length, this._options.max_preserve_newlines, this._options.preserve_newlines);\n var tokens = new Tokenizer(source_text, this._options).tokenize();\n\n this._tag_stack = new TagStack(printer);\n\n var parser_token = null;\n var raw_token = tokens.next();\n while (raw_token.type !== TOKEN.EOF) {\n\n if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) {\n parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token);\n last_tag_token = parser_token;\n } else if ((raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE) ||\n (raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete)) {\n parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, tokens);\n } else if (raw_token.type === TOKEN.TAG_CLOSE) {\n parser_token = this._handle_tag_close(printer, raw_token, last_tag_token);\n } else if (raw_token.type === TOKEN.TEXT) {\n parser_token = this._handle_text(printer, raw_token, last_tag_token);\n } else {\n // This should never happen, but if it does. Print the raw token\n printer.add_raw_token(raw_token);\n }\n\n last_token = parser_token;\n\n raw_token = tokens.next();\n }\n var sweet_code = printer._output.get_code(this._options.end_with_newline, eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) {\n var parser_token = { text: raw_token.text, type: raw_token.type };\n printer.alignment_size = 0;\n last_tag_token.tag_complete = true;\n\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '');\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n if (last_tag_token.tag_start_char === '<') {\n printer.set_space_before_token(raw_token.text[0] === '/'); // space before />, no space before >\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) {\n printer.print_newline(false);\n }\n }\n printer.print_token(raw_token.text);\n }\n\n if (last_tag_token.indent_content &&\n !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {\n printer.indent();\n\n // only indent once per opened tag\n last_tag_token.indent_content = false;\n }\n return parser_token;\n};\n\nBeautifier.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, tokens) {\n var parser_token = { text: raw_token.text, type: raw_token.type };\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '');\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n if (last_tag_token.tag_start_char === '<') {\n if (raw_token.type === TOKEN.ATTRIBUTE) {\n printer.set_space_before_token(true);\n last_tag_token.attr_count += 1;\n } else if (raw_token.type === TOKEN.EQUALS) { //no space before =\n printer.set_space_before_token(false);\n } else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) { //no space before value\n printer.set_space_before_token(false);\n }\n }\n\n if (printer._output.space_before_token && last_tag_token.tag_start_char === '<') {\n var wrapped = printer.print_space_or_wrap(raw_token.text);\n if (raw_token.type === TOKEN.ATTRIBUTE) {\n var indentAttrs = wrapped && !this._is_wrap_attributes_force;\n\n if (this._is_wrap_attributes_force) {\n var force_first_attr_wrap = false;\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.attr_count === 1) {\n var is_only_attribute = true;\n var peek_index = 0;\n var peek_token;\n do {\n peek_token = tokens.peek(peek_index);\n if (peek_token.type === TOKEN.ATTRIBUTE) {\n is_only_attribute = false;\n break;\n }\n peek_index += 1;\n } while (peek_index < 4 && peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE);\n\n force_first_attr_wrap = !is_only_attribute;\n }\n\n if (last_tag_token.attr_count > 1 || force_first_attr_wrap) {\n printer.print_newline(false);\n indentAttrs = true;\n }\n }\n if (indentAttrs) {\n last_tag_token.has_wrapped_attrs = true;\n }\n }\n }\n printer.print_token(raw_token.text);\n }\n return parser_token;\n};\n\nBeautifier.prototype._handle_text = function(printer, raw_token, last_tag_token) {\n var parser_token = { text: raw_token.text, type: 'TK_CONTENT' };\n if (last_tag_token.custom_beautifier) { //check if we need to format javascript\n this._print_custom_beatifier_text(printer, raw_token, last_tag_token);\n } else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n printer.traverse_whitespace(raw_token);\n printer.print_token(raw_token.text);\n }\n return parser_token;\n};\n\nBeautifier.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) {\n if (raw_token.text !== '') {\n printer.print_newline(false);\n var text = raw_token.text,\n _beautifier,\n script_indent_level = 1;\n if (last_tag_token.tag_name === 'script') {\n _beautifier = typeof this._js_beautify === 'function' && this._js_beautify;\n } else if (last_tag_token.tag_name === 'style') {\n _beautifier = typeof this._css_beautify === 'function' && this._css_beautify;\n }\n\n if (this._options.indent_scripts === \"keep\") {\n script_indent_level = 0;\n } else if (this._options.indent_scripts === \"separate\") {\n script_indent_level = -printer.indent_level;\n }\n\n var indentation = printer.get_full_indent(script_indent_level);\n\n // if there is at least one empty line at the end of this text, strip it\n // we'll be adding one back after the text but before the containing tag.\n text = text.replace(/\\n[ \\t]*$/, '');\n\n if (_beautifier) {\n\n // call the Beautifier if avaliable\n var Child_options = function() {\n this.eol = '\\n';\n };\n Child_options.prototype = this._options.raw_options;\n var child_options = new Child_options();\n text = _beautifier(indentation + text, child_options);\n } else {\n // simply indent the string otherwise\n var white = text.match(/^\\s*/)[0];\n var _level = white.match(/[^\\n\\r]*$/)[0].split(this._options.indent_string).length - 1;\n var reindent = this._get_full_indent(script_indent_level - _level);\n text = (indentation + text.trim())\n .replace(/\\r\\n|\\r|\\n/g, '\\n' + reindent);\n }\n if (text) {\n printer.print_raw_text(text);\n printer.print_newline(true);\n }\n }\n};\n\nBeautifier.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token) {\n var parser_token = this._get_tag_open_token(raw_token);\n printer.traverse_whitespace(raw_token);\n\n this._set_tag_position(printer, raw_token, parser_token, last_tag_token, last_token);\n\n\n if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) &&\n raw_token.type === TOKEN.TAG_OPEN && raw_token.text.indexOf(']*)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n } else {\n tag_check_match = raw_token.text.match(/^{{\\#?([^\\s}]+)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n }\n this.tag_check = this.tag_check.toLowerCase();\n\n if (raw_token.type === TOKEN.COMMENT) {\n this.tag_complete = true;\n }\n\n this.is_start_tag = this.tag_check.charAt(0) !== '/';\n this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check;\n this.is_end_tag = !this.is_start_tag ||\n (raw_token.closed && raw_token.closed.text === '/>');\n\n // handlebars tags that don't start with # or ^ are single_tags, and so also start and end.\n this.is_end_tag = this.is_end_tag ||\n (this.tag_start_char === '{' && (this.text.length < 3 || (/[^#\\^]/.test(this.text.charAt(2)))));\n }\n};\n\nBeautifier.prototype._get_tag_open_token = function(raw_token) { //function to get a full tag and parse its type\n var parser_token = new TagOpenParserToken(this._tag_stack.get_parser_token(), raw_token);\n\n parser_token.alignment_size = this._options.wrap_attributes_indent_size;\n\n parser_token.is_end_tag = parser_token.is_end_tag ||\n in_array(parser_token.tag_check, this._options.void_elements);\n\n parser_token.is_empty_element = parser_token.tag_complete ||\n (parser_token.is_start_tag && parser_token.is_end_tag);\n\n parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted);\n parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted);\n parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_start_char === '{';\n\n return parser_token;\n};\n\nBeautifier.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) {\n\n if (!parser_token.is_empty_element) {\n if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name); //remove it and all ancestors\n } else { // it's a start-tag\n // check if this tag is starting an element that has optional end element\n // and do an ending needed\n this._do_optional_end_element(parser_token);\n\n this._tag_stack.record_tag(parser_token); //push it on the tag stack\n\n if ((parser_token.tag_name === 'script' || parser_token.tag_name === 'style') &&\n !(parser_token.is_unformatted || parser_token.is_content_unformatted)) {\n parser_token.custom_beautifier = uses_beautifier(parser_token.tag_check, raw_token);\n }\n }\n }\n\n if (in_array(parser_token.tag_check, this._options.extra_liners)) { //check if this double needs an extra line\n printer.print_newline(false);\n if (!printer._output.just_added_blankline()) {\n printer.print_newline(true);\n }\n }\n\n if (parser_token.is_empty_element) { //if this tag name is a single tag type (either in the list or has a closing /)\n\n // if you hit an else case, reset the indent level if you are inside an:\n // 'if', 'unless', or 'each' block.\n if (parser_token.tag_start_char === '{' && parser_token.tag_check === 'else') {\n this._tag_stack.indent_to_tag(['if', 'unless', 'each']);\n parser_token.indent_content = true;\n // Don't add a newline if opening {{#if}} tag is on the current line\n var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/);\n if (!foundIfOnCurrentLine) {\n printer.print_newline(false);\n }\n }\n\n // Don't add a newline before elements that should remain where they are.\n if (parser_token.tag_name === '!--' && last_token.type === TOKEN.TAG_CLOSE &&\n last_tag_token.is_end_tag && parser_token.text.indexOf('\\n') === -1) {\n //Do nothing. Leave comments on same line.\n } else if (!parser_token.is_inline_element && !parser_token.is_unformatted) {\n printer.print_newline(false);\n }\n } else if (parser_token.is_unformatted || parser_token.is_content_unformatted) {\n if (!parser_token.is_inline_element && !parser_token.is_unformatted) {\n printer.print_newline(false);\n }\n } else if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n if ((parser_token.start_tag_token && parser_token.start_tag_token.multiline_content) ||\n !(parser_token.is_inline_element ||\n (last_tag_token.is_inline_element) ||\n (last_token.type === TOKEN.TAG_CLOSE &&\n parser_token.start_tag_token === last_tag_token) ||\n (last_token.type === 'TK_CONTENT')\n )) {\n printer.print_newline(false);\n }\n } else { // it's a start-tag\n parser_token.indent_content = !parser_token.custom_beautifier;\n\n if (parser_token.tag_start_char === '<') {\n if (parser_token.tag_name === 'html') {\n parser_token.indent_content = this._options.indent_inner_html;\n } else if (parser_token.tag_name === 'head') {\n parser_token.indent_content = this._options.indent_head_inner_html;\n } else if (parser_token.tag_name === 'body') {\n parser_token.indent_content = this._options.indent_body_inner_html;\n }\n }\n\n if (!parser_token.is_inline_element && last_token.type !== 'TK_CONTENT') {\n if (parser_token.parent) {\n parser_token.parent.multiline_content = true;\n }\n printer.print_newline(false);\n }\n }\n};\n\n//To be used for

tag special case:\n//var p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'];\n\nBeautifier.prototype._do_optional_end_element = function(parser_token) {\n // NOTE: cases of \"if there is no more content in the parent element\"\n // are handled automatically by the beautifier.\n // It assumes parent or ancestor close tag closes all children.\n // https://www.w3.org/TR/html5/syntax.html#optional-tags\n if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) {\n return;\n\n } else if (parser_token.tag_name === 'body') {\n // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment.\n this._tag_stack.try_pop('head');\n\n //} else if (parser_token.tag_name === 'body') {\n // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment.\n\n } else if (parser_token.tag_name === 'li') {\n // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.\n this._tag_stack.try_pop('li', ['ol', 'ul']);\n\n } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') {\n // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element.\n // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element.\n this._tag_stack.try_pop('dt', ['dl']);\n this._tag_stack.try_pop('dd', ['dl']);\n\n //} else if (p_closers.indexOf(parser_token.tag_name) !== -1) {\n //TODO: THIS IS A BUG FARM. We are not putting this into 1.8.0 as it is likely to blow up.\n //A p element’s end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, details, div, dl, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hr, main, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is an HTML element that is not an a, audio, del, ins, map, noscript, or video element, or an autonomous custom element.\n //this._tag_stack.try_pop('p', ['body']);\n\n } else if (parser_token.tag_name === 'rp' || parser_token.tag_name === 'rt') {\n // An rt element’s end tag may be omitted if the rt element is immediately followed by an rt or rp element, or if there is no more content in the parent element.\n // An rp element’s end tag may be omitted if the rp element is immediately followed by an rt or rp element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('rt', ['ruby', 'rtc']);\n this._tag_stack.try_pop('rp', ['ruby', 'rtc']);\n\n } else if (parser_token.tag_name === 'optgroup') {\n // An optgroup element’s end tag may be omitted if the optgroup element is immediately followed by another optgroup element, or if there is no more content in the parent element.\n // An option element’s end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('optgroup', ['select']);\n //this._tag_stack.try_pop('option', ['select']);\n\n } else if (parser_token.tag_name === 'option') {\n // An option element’s end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('option', ['select', 'datalist', 'optgroup']);\n\n } else if (parser_token.tag_name === 'colgroup') {\n // DONE: A colgroup element’s end tag may be omitted if the colgroup element is not immediately followed by a space character or a comment.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n\n } else if (parser_token.tag_name === 'thead') {\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n\n //} else if (parser_token.tag_name === 'caption') {\n // DONE: A caption element’s end tag may be omitted if the caption element is not immediately followed by a space character or a comment.\n\n } else if (parser_token.tag_name === 'tbody' || parser_token.tag_name === 'tfoot') {\n // A thead element’s end tag may be omitted if the thead element is immediately followed by a tbody or tfoot element.\n // A tbody element’s end tag may be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element.\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n this._tag_stack.try_pop('thead', ['table']);\n this._tag_stack.try_pop('tbody', ['table']);\n\n //} else if (parser_token.tag_name === 'tfoot') {\n // DONE: A tfoot element’s end tag may be omitted if there is no more content in the parent element.\n\n } else if (parser_token.tag_name === 'tr') {\n // A tr element’s end tag may be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element.\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n this._tag_stack.try_pop('tr', ['table', 'thead', 'tbody', 'tfoot']);\n\n } else if (parser_token.tag_name === 'th' || parser_token.tag_name === 'td') {\n // A td element’s end tag may be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element.\n // A th element’s end tag may be omitted if the th element is immediately followed by a td or th element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('td', ['tr']);\n this._tag_stack.try_pop('th', ['tr']);\n }\n\n // Start element omission not handled currently\n // A head element’s start tag may be omitted if the element is empty, or if the first thing inside the head element is an element.\n // A tbody element’s start tag may be omitted if the first thing inside the tbody element is a tr element, and if the element is not immediately preceded by a tbody, thead, or tfoot element whose end tag has been omitted. (It can’t be omitted if the element is empty.)\n // A colgroup element’s start tag may be omitted if the first thing inside the colgroup element is a col element, and if the element is not immediately preceded by another colgroup element whose end tag has been omitted. (It can’t be omitted if the element is empty.)\n\n // Fix up the parent of the parser token\n parser_token.parent = this._tag_stack.get_parser_token();\n\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'html');\n\n this.indent_inner_html = this._get_boolean('indent_inner_html');\n this.indent_body_inner_html = this._get_boolean('indent_body_inner_html', true);\n this.indent_head_inner_html = this._get_boolean('indent_head_inner_html', true);\n\n this.indent_handlebars = this._get_boolean('indent_handlebars', true);\n this.wrap_attributes = this._get_selection('wrap_attributes',\n ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple'])[0];\n this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size);\n this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']);\n\n this.inline = this._get_array('inline', [\n // https://www.w3.org/TR/html5/dom.html#phrasing-content\n 'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite',\n 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img',\n 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript',\n 'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small',\n 'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var',\n 'video', 'wbr', 'text',\n // prexisting - not sure of full effect of removing, leaving in\n 'acronym', 'address', 'big', 'dt', 'ins', 'strike', 'tt'\n ]);\n this.void_elements = this._get_array('void_elements', [\n // HTLM void elements - aka self-closing tags - aka singletons\n // https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',\n 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr',\n // NOTE: Optional tags are too complex for a simple list\n // they are hard coded in _do_optional_end_element\n\n // Doctype and xml elements\n '!doctype', '?xml',\n // ?php and ?= tags\n '?php', '?=',\n // other tags that were in this list, keeping just in case\n 'basefont', 'isindex'\n ]);\n this.unformatted = this._get_array('unformatted', []);\n this.content_unformatted = this._get_array('content_unformatted', [\n 'pre', 'textarea'\n ]);\n this.indent_scripts = this._get_selection('indent_scripts', ['normal', 'keep', 'separate']);\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\n\nvar TOKEN = {\n TAG_OPEN: 'TK_TAG_OPEN',\n TAG_CLOSE: 'TK_TAG_CLOSE',\n ATTRIBUTE: 'TK_ATTRIBUTE',\n EQUALS: 'TK_EQUALS',\n VALUE: 'TK_VALUE',\n COMMENT: 'TK_COMMENT',\n TEXT: 'TK_TEXT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\nvar directives_core = new Directives(/<\\!--/, /-->/);\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n this._current_tag_name = '';\n\n // Words end at whitespace or when a tag starts\n // if we are indenting handlebars, they are considered tags\n this._word_pattern = this._options.indent_handlebars ? /[\\n\\r\\t <]|{{/g : /[\\n\\r\\t <]/g;\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false; //current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.TAG_OPEN;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return current_token.type === TOKEN.TAG_CLOSE &&\n (open_token && (\n ((current_token.text === '>' || current_token.text === '/>') && open_token.text[0] === '<') ||\n (current_token.text === '}}' && open_token.text[0] === '{' && open_token.text[1] === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n this._current_tag_name = '';\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var token = null;\n var c = this._input.peek();\n\n if (c === null) {\n return this._create_token(TOKEN.EOF, '');\n }\n\n token = token || this._read_attribute(c, previous_token, open_token);\n token = token || this._read_raw_content(previous_token, open_token);\n token = token || this._read_comment(c);\n token = token || this._read_open(c, open_token);\n token = token || this._read_close(c, open_token);\n token = token || this._read_content_word();\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_comment = function(c) { // jshint unused:false\n var token = null;\n if (c === '<' || c === '{') {\n var peek1 = this._input.peek(1);\n var peek2 = this._input.peek(2);\n if ((c === '<' && (peek1 === '!' || peek1 === '?' || peek1 === '%')) ||\n this._options.indent_handlebars && c === '{' && peek1 === '{' && peek2 === '!') {\n //if we're in a comment, do something special\n // We treat all comments as literals, even more than preformatted tags\n // we just look for the appropriate close tag\n\n // this is will have very poor perf, but will work for now.\n var comment = '',\n delimiter = '>',\n matched = false;\n\n var input_char = this._input.next();\n\n while (input_char) {\n comment += input_char;\n\n // only need to check for the delimiter if the last chars match\n if (comment.charAt(comment.length - 1) === delimiter.charAt(delimiter.length - 1) &&\n comment.indexOf(delimiter) !== -1) {\n break;\n }\n\n // only need to search for custom delimiter for the first few characters\n if (!matched) {\n matched = comment.length > 10;\n if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('{{!--') === 0) { // {{!-- handlebars comment\n delimiter = '--}}';\n matched = true;\n } else if (comment.indexOf('{{!') === 0) { // {{! handlebars comment\n if (comment.length === 5 && comment.indexOf('{{!--') === -1) {\n delimiter = '}}';\n matched = true;\n }\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('<%') === 0) { // {{! handlebars comment\n delimiter = '%>';\n matched = true;\n }\n }\n\n input_char = this._input.next();\n }\n\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n token = this._create_token(TOKEN.COMMENT, comment);\n token.directives = directives;\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_open = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (!open_token) {\n if (c === '<') {\n resulting_string = this._input.read(/<(?:[^\\n\\r\\t >{][^\\n\\r\\t >{/]*)?/g);\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n } else if (this._options.indent_handlebars && c === '{' && this._input.peek(1) === '{') {\n resulting_string = this._input.readUntil(/[\\n\\r\\t }]/g);\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_close = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (open_token) {\n if (open_token.text[0] === '<' && (c === '>' || (c === '/' && this._input.peek(1) === '>'))) {\n resulting_string = this._input.next();\n if (c === '/') { // for close tag \"/>\"\n resulting_string += this._input.next();\n }\n token = this._create_token(TOKEN.TAG_CLOSE, resulting_string);\n } else if (open_token.text[0] === '{' && c === '}' && this._input.peek(1) === '}') {\n this._input.next();\n this._input.next();\n token = this._create_token(TOKEN.TAG_CLOSE, '}}');\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_attribute = function(c, previous_token, open_token) {\n var token = null;\n var resulting_string = '';\n if (open_token && open_token.text[0] === '<') {\n\n if (c === '=') {\n token = this._create_token(TOKEN.EQUALS, this._input.next());\n } else if (c === '\"' || c === \"'\") {\n var content = this._input.next();\n var input_string = '';\n var string_pattern = new RegExp(c + '|{{', 'g');\n while (this._input.hasNext()) {\n input_string = this._input.readUntilAfter(string_pattern);\n content += input_string;\n if (input_string[input_string.length - 1] === '\"' || input_string[input_string.length - 1] === \"'\") {\n break;\n } else if (this._input.hasNext()) {\n content += this._input.readUntilAfter(/}}/g);\n }\n }\n\n token = this._create_token(TOKEN.VALUE, content);\n } else {\n if (c === '{' && this._input.peek(1) === '{') {\n resulting_string = this._input.readUntilAfter(/}}/g);\n } else {\n resulting_string = this._input.readUntil(/[\\n\\r\\t =\\/>]/g);\n }\n\n if (resulting_string) {\n if (previous_token.type === TOKEN.EQUALS) {\n token = this._create_token(TOKEN.VALUE, resulting_string);\n } else {\n token = this._create_token(TOKEN.ATTRIBUTE, resulting_string);\n }\n }\n }\n }\n return token;\n};\n\nTokenizer.prototype._is_content_unformatted = function(tag_name) {\n // void_elements have no content and so cannot have unformatted content\n // script and style tags should always be read as unformatted content\n // finally content_unformatted and unformatted element contents are unformatted\n return this._options.void_elements.indexOf(tag_name) === -1 &&\n (tag_name === 'script' || tag_name === 'style' ||\n this._options.content_unformatted.indexOf(tag_name) !== -1 ||\n this._options.unformatted.indexOf(tag_name) !== -1);\n};\n\n\nTokenizer.prototype._read_raw_content = function(previous_token, open_token) { // jshint unused:false\n var resulting_string = '';\n if (open_token && open_token.text[0] === '{') {\n resulting_string = this._input.readUntil(/}}/g);\n } else if (previous_token.type === TOKEN.TAG_CLOSE && (previous_token.opened.text[0] === '<')) {\n var tag_name = previous_token.opened.text.substr(1).toLowerCase();\n if (this._is_content_unformatted(tag_name)) {\n resulting_string = this._input.readUntil(new RegExp('', 'ig'));\n }\n }\n\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._read_content_word = function() {\n // if we get here and we see handlebars treat them as plain text\n var resulting_string = this._input.readUntil(this._word_pattern);\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://beautifier/webpack/universalModuleDefinition","webpack://beautifier/webpack/bootstrap","webpack://beautifier/./js/src/index.js","webpack://beautifier/./js/src/javascript/index.js","webpack://beautifier/./js/src/javascript/beautifier.js","webpack://beautifier/./js/src/core/output.js","webpack://beautifier/./js/src/core/token.js","webpack://beautifier/./js/src/javascript/acorn.js","webpack://beautifier/./js/src/javascript/options.js","webpack://beautifier/./js/src/core/options.js","webpack://beautifier/./js/src/javascript/tokenizer.js","webpack://beautifier/./js/src/core/inputscanner.js","webpack://beautifier/./js/src/core/tokenizer.js","webpack://beautifier/./js/src/core/tokenstream.js","webpack://beautifier/./js/src/core/directives.js","webpack://beautifier/./js/src/css/index.js","webpack://beautifier/./js/src/css/beautifier.js","webpack://beautifier/./js/src/css/options.js","webpack://beautifier/./js/src/html/index.js","webpack://beautifier/./js/src/html/beautifier.js","webpack://beautifier/./js/src/html/options.js","webpack://beautifier/./js/src/html/tokenizer.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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a;AACrC,oBAAoB,mBAAO,CAAC,CAAa;AACzC,6BAA6B,mBAAO,CAAC,CAAa;AAClD,YAAY,mBAAO,CAAC,CAAa;;AAEjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ,SAAS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,4BAA4B;AAC5B;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA,iFAAiF;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,+BAA+B,UAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4GAA4G;AAC5G;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF;;AAExF;AACA;;AAEA;;AAEA,wCAAwC;AACxC;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH,4CAA4C;AAC5C;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,0EAA0E;AAC1E;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,OAAO;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,kDAAkD;AAClD;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,iDAAiD,KAAK;AACtD,iGAAiG;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,sFAAsF;AACtF;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,2CAA2C;AAC3C,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,yIAAyI;AAC5I,yBAAyB,KAAK;AAC9B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,0CAA0C;AAC1C,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,yCAAyC,uCAAuC;AAChF,UAAU,KAAK;AACf,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uC;;;;;;;AC12CA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA,uDAAuD,wBAAwB;AAC/E;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+B;;;;;;;ACpTA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,8BAA8B;;;AAG9B,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,6B;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;AAGA,+EAA+E;;AAE/E;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kE;;;;;;;ACvDA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,kBAAkB,mBAAO,CAAC,CAAiB;;AAE3C;;AAEA;AACA;;AAEA;AACA;AACA,4CAA4C;AAC5C;AACA,GAAG,2DAA2D;AAC9D;AACA,GAAG,8DAA8D;AACjE;AACA,QAAQ,6BAA6B;AACrC;AACA;;AAEA;AACA;;AAEA;;AAEA,qCAAqC;AACrC;;AAEA,kBAAkB,+BAA+B;AACjD;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;AAIA,iC;;;;;;;AC1FA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,iCAAiC,4CAA4C,EAAE;AAC/E;;;AAGA;AACA,mBAAmB,UAAU;AAC7B;AACA;AACA,sBAAsB,UAAU;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sC;;;;;;;ACjLA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,mBAAmB,mBAAO,CAAC,CAAsB;AACjD,oBAAoB,mBAAO,CAAC,EAAmB;AAC/C,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C,iBAAiB,mBAAO,CAAC,EAAoB;AAC7C,YAAY,mBAAO,CAAC,CAAS;;AAE7B;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8BAA8B;AAC9B;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2BAA2B;AAC3D;;AAEA;AACA;AACA;;AAEA,4EAA4E;AAC5E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG,kBAAkB;AACrB;AACA,GAAG,kBAAkB;AACrB;AACA,GAAG,kBAAkB;AACrB;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO,mCAAmC,+BAA+B;AACzE,oBAAoB;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oEAAoE;AACpE,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,4CAA4C,SAAS,6BAA6B,SAAS,iEAAiE,SAAS;AACrK,kDAAkD,SAAS,6BAA6B,SAAS,iEAAiE,SAAS;;AAE3K;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ,gBAAgB,MAAM;AACtE,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,QAAQ,gBAAgB,MAAM;AACnG;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,oCAAoC,EAAE;AACtC;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kDAAkD,EAAE;AACpD,OAAO;AACP,kDAAkD,EAAE;AACpD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA,0DAA0D;AAC1D,OAAO;AACP,0FAA0F;AAC1F;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qD;;;;;;;ACrhBA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA,2C;;;;;;;ACnJA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,mBAAmB,mBAAO,CAAC,CAAsB;AACjD,YAAY,mBAAO,CAAC,CAAe;AACnC,kBAAkB,mBAAO,CAAC,EAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA,2DAA2D;AAC3D;AACA;;AAEA,2DAA2D;AAC3D;AACA;;AAEA,uEAAuE;AACvE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA,6B;;;;;;;ACvJA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yC;;;;;;;AC7EA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA,uC;;;;;;;AC7DA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,iBAAiB,mBAAO,CAAC,EAAc;;AAEvC;AACA;AACA;AACA;;AAEA,8B;;;;;;;ACrCA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,cAAc,mBAAO,CAAC,EAAW;AACjC,aAAa,mBAAO,CAAC,CAAgB;AACrC,mBAAmB,mBAAO,CAAC,CAAsB;;AAEjD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK,mBAAmB,cAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA,yCAAyC;AACzC,mCAAmC;AACnC,sDAAsD;AACtD,OAAO;AACP;;AAEA;AACA,gEAAgE;;AAEhE;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK,uDAAuD;AAC5D;AACA,oDAAoD;AACpD,KAAK,yBAAyB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,oFAAoF;AACpF;AACA;AACA;AACA;AACA;AACA,KAAK,yBAAyB;AAC9B;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK,yBAAyB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,6BAA6B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK,6BAA6B;AAClC;AACA;AACA;AACA;AACA;AACA,KAAK,6BAA6B;AAClC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,uC;;;;;;;ACrbA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,kBAAkB,mBAAO,CAAC,CAAiB;;AAE3C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;AAIA,iC;;;;;;;AC7CA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,iBAAiB,mBAAO,CAAC,EAAc;;AAEvC;AACA;AACA;AACA;;AAEA,4B;;;;;;;ACrCA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,cAAc,mBAAO,CAAC,EAAiB;AACvC,aAAa,mBAAO,CAAC,CAAgB;AACrC,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C,YAAY,mBAAO,CAAC,EAAmB;;AAEvC;AACA;;AAEA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,qBAAqB,cAAc;AACnC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qGAAqG;AACrG;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wDAAwD;AACxD;AACA;AACA;;AAEA,qDAAqD;AACrD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+DAA+D;AAC/D;;AAEA,iBAAiB;AACjB,6CAA6C;AAC7C;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,uDAAuD;AACvD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO,4CAA4C;AACnD;AACA,OAAO,uFAAuF;AAC9F;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB;AACtB,yCAAyC;AACzC;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,iDAAiD,SAAS;AAC1D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;AACA;;AAEA,gEAAgE;AAChE;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8HAA8H;;AAE9H;AACA;;AAEA;;AAEA;AACA,kCAAkC;AAClC,oFAAoF;AACpF,KAAK,OAAO;AACZ;AACA;AACA;;AAEA,+CAA+C;;AAE/C;AACA;AACA;AACA;AACA;AACA;;AAEA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC;AACA;AACA,0CAA0C;AAC1C;AACA;AACA,0CAA0C,KAAK;AAC/C,mEAAmE;AACnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG,oCAAoC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,OAAO;AACV;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;;AAEA,OAAO;AACP;;AAEA,GAAG;AACH;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;;AAEA,GAAG;AACH;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;;AAEA,OAAO;AACP;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO;AACP;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uC;;;;;;;AC/tBA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,kBAAkB,mBAAO,CAAC,CAAiB;;AAE3C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA,iC;;;;;;;ACjFA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,oBAAoB,mBAAO,CAAC,EAAmB;AAC/C,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C,iBAAiB,mBAAO,CAAC,EAAoB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uEAAuE;AACvE;AACA;;AAEA,2DAA2D;AAC3D,eAAe;AACf;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC,8BAA8B,8BAA8B;AAC7F;;AAEA;AACA;AACA;;AAEA,4EAA4E;AAC5E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iDAAiD;AACjD;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,WAAW,+CAA+C;AAC1D;AACA;AACA,WAAW,yCAAyC;AACpD;AACA;AACA,WAAW,0CAA0C;AACrD;AACA;AACA,WAAW,6BAA6B,cAAc,MAAM;AAC5D,6BAA6B;AAC7B;AACA,WAAW,6BAA6B,YAAY,MAAM;AAC1D,2DAA2D;AAC3D,6BAA6B;AAC7B;AACA;AACA,WAAW,wCAAwC,MAAM;AACzD;AACA;AACA,WAAW,wCAAwC,MAAM;AACzD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0DAA0D,YAAY;AACtE;AACA,KAAK,qDAAqD,+BAA+B;AACzF,yDAAyD;AACzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,KAAK,mCAAmC,aAAa,+BAA+B;AACpF;AACA;AACA,qDAAqD;AACrD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mDAAmD;AACnD;AACA;;AAEA;AACA,KAAK;AACL,kBAAkB,+BAA+B;AACjD,yDAAyD;AACzD,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,8EAA8E;AAC9E;AACA,6CAA6C;AAC7C,gDAAgD;AAChD,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6B","file":"beautifier.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"beautifier\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"beautifier\"] = factory();\n\telse\n\t\troot[\"beautifier\"] = factory();\n})(typeof self !== 'undefined' ? self : typeof windows !== 'undefined' ? window : typeof global !== 'undefined' ? global : this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar js_beautify = require('./javascript/index');\nvar css_beautify = require('./css/index');\nvar html_beautify = require('./html/index');\n\nfunction style_html(html_source, options, js, css) {\n js = js || js_beautify;\n css = css || css_beautify;\n return html_beautify(html_source, options, js, css);\n}\n\nmodule.exports.js = js_beautify;\nmodule.exports.css = css_beautify;\nmodule.exports.html = style_html;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction js_beautify(js_source_text, options) {\n var beautifier = new Beautifier(js_source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = js_beautify;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Output = require('../core/output').Output;\nvar Token = require('../core/token').Token;\nvar acorn = require('./acorn');\nvar Options = require('./options').Options;\nvar Tokenizer = require('./tokenizer').Tokenizer;\nvar line_starters = require('./tokenizer').line_starters;\nvar positionable_operators = require('./tokenizer').positionable_operators;\nvar TOKEN = require('./tokenizer').TOKEN;\n\nfunction remove_redundant_indentation(output, frame) {\n // This implementation is effective but has some issues:\n // - can cause line wrap to happen too soon due to indent removal\n // after wrap points are calculated\n // These issues are minor compared to ugly indentation.\n\n if (frame.multiline_frame ||\n frame.mode === MODE.ForInitializer ||\n frame.mode === MODE.Conditional) {\n return;\n }\n\n // remove one indent from each line inside this section\n output.remove_indent(frame.start_line_index);\n}\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction ltrim(s) {\n return s.replace(/^\\s+/g, '');\n}\n\nfunction generateMapFromStrings(list) {\n var result = {};\n for (var x = 0; x < list.length; x++) {\n // make the mapped names underscored instead of dash\n result[list[x].replace(/-/g, '_')] = list[x];\n }\n return result;\n}\n\nfunction reserved_word(token, word) {\n return token && token.type === TOKEN.RESERVED && token.text === word;\n}\n\nfunction reserved_array(token, words) {\n return token && token.type === TOKEN.RESERVED && in_array(token.text, words);\n}\n// Unsure of what they mean, but they work. Worth cleaning up in future.\nvar special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async'];\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\n// Generate map from array\nvar OPERATOR_POSITION = generateMapFromStrings(validPositionValues);\n\nvar OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];\n\nvar MODE = {\n BlockStatement: 'BlockStatement', // 'BLOCK'\n Statement: 'Statement', // 'STATEMENT'\n ObjectLiteral: 'ObjectLiteral', // 'OBJECT',\n ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]',\n ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)',\n Conditional: 'Conditional', //'(COND-EXPRESSION)',\n Expression: 'Expression' //'(EXPRESSION)'\n};\n\n// we could use just string.split, but\n// IE doesn't like returning empty strings\nfunction split_linebreaks(s) {\n //return s.split(/\\x0d\\x0a|\\x0a/);\n\n s = s.replace(acorn.allLineBreaks, '\\n');\n var out = [],\n idx = s.indexOf(\"\\n\");\n while (idx !== -1) {\n out.push(s.substring(0, idx));\n s = s.substring(idx + 1);\n idx = s.indexOf(\"\\n\");\n }\n if (s.length) {\n out.push(s);\n }\n return out;\n}\n\nfunction is_array(mode) {\n return mode === MODE.ArrayLiteral;\n}\n\nfunction is_expression(mode) {\n return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);\n}\n\nfunction all_lines_start_with(lines, c) {\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i].trim();\n if (line.charAt(0) !== c) {\n return false;\n }\n }\n return true;\n}\n\nfunction each_line_matches_indent(lines, indent) {\n var i = 0,\n len = lines.length,\n line;\n for (; i < len; i++) {\n line = lines[i];\n // allow empty lines to pass through\n if (line && line.indexOf(indent) !== 0) {\n return false;\n }\n }\n return true;\n}\n\n\nfunction Beautifier(source_text, options) {\n options = options || {};\n this._source_text = source_text || '';\n\n this._output = null;\n this._tokens = null;\n this._last_last_text = null;\n this._flags = null;\n this._previous_flags = null;\n\n this._flag_store = null;\n this._options = new Options(options);\n}\n\nBeautifier.prototype.create_flags = function(flags_base, mode) {\n var next_indent_level = 0;\n if (flags_base) {\n next_indent_level = flags_base.indentation_level;\n if (!this._output.just_added_newline() &&\n flags_base.line_indent_level > next_indent_level) {\n next_indent_level = flags_base.line_indent_level;\n }\n }\n\n var next_flags = {\n mode: mode,\n parent: flags_base,\n last_token: flags_base ? flags_base.last_token : new Token(TOKEN.START_BLOCK, ''), // last token text\n last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed\n declaration_statement: false,\n declaration_assignment: false,\n multiline_frame: false,\n inline_frame: false,\n if_block: false,\n else_block: false,\n do_block: false,\n do_while: false,\n import_block: false,\n in_case_statement: false, // switch(..){ INSIDE HERE }\n in_case: false, // we're on the exact line with \"case 0:\"\n case_body: false, // the indented case-action block\n indentation_level: next_indent_level,\n line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,\n start_line_index: this._output.get_line_number(),\n ternary_depth: 0\n };\n return next_flags;\n};\n\nBeautifier.prototype._reset = function(source_text) {\n var baseIndentString = source_text.match(/^[\\t ]*/)[0];\n\n this._last_last_text = ''; // pre-last token text\n this._output = new Output(this._options, baseIndentString);\n\n // If testing the ignore directive, start with output disable set to true\n this._output.raw = this._options.test_output_raw;\n\n\n // Stack of parsing/formatting states, including MODE.\n // We tokenize, parse, and output in an almost purely a forward-only stream of token input\n // and formatted output. This makes the beautifier less accurate than full parsers\n // but also far more tolerant of syntax errors.\n //\n // For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type\n // MODE.BlockStatement on the the stack, even though it could be object literal. If we later\n // encounter a \":\", we'll switch to to MODE.ObjectLiteral. If we then see a \";\",\n // most full parsers would die, but the beautifier gracefully falls back to\n // MODE.BlockStatement and continues on.\n this._flag_store = [];\n this.set_mode(MODE.BlockStatement);\n var tokenizer = new Tokenizer(source_text, this._options);\n this._tokens = tokenizer.tokenize();\n return source_text;\n};\n\nBeautifier.prototype.beautify = function() {\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var sweet_code;\n var source_text = this._reset(this._source_text);\n\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && acorn.lineBreak.test(source_text || '')) {\n eol = source_text.match(acorn.lineBreak)[0];\n }\n }\n\n var current_token = this._tokens.next();\n while (current_token) {\n this.handle_token(current_token);\n\n this._last_last_text = this._flags.last_token.text;\n this._flags.last_token = current_token;\n\n current_token = this._tokens.next();\n }\n\n sweet_code = this._output.get_code(eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype.handle_token = function(current_token, preserve_statement_flags) {\n if (current_token.type === TOKEN.START_EXPR) {\n this.handle_start_expr(current_token);\n } else if (current_token.type === TOKEN.END_EXPR) {\n this.handle_end_expr(current_token);\n } else if (current_token.type === TOKEN.START_BLOCK) {\n this.handle_start_block(current_token);\n } else if (current_token.type === TOKEN.END_BLOCK) {\n this.handle_end_block(current_token);\n } else if (current_token.type === TOKEN.WORD) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.RESERVED) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.SEMICOLON) {\n this.handle_semicolon(current_token);\n } else if (current_token.type === TOKEN.STRING) {\n this.handle_string(current_token);\n } else if (current_token.type === TOKEN.EQUALS) {\n this.handle_equals(current_token);\n } else if (current_token.type === TOKEN.OPERATOR) {\n this.handle_operator(current_token);\n } else if (current_token.type === TOKEN.COMMA) {\n this.handle_comma(current_token);\n } else if (current_token.type === TOKEN.BLOCK_COMMENT) {\n this.handle_block_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.COMMENT) {\n this.handle_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.DOT) {\n this.handle_dot(current_token);\n } else if (current_token.type === TOKEN.EOF) {\n this.handle_eof(current_token);\n } else if (current_token.type === TOKEN.UNKNOWN) {\n this.handle_unknown(current_token, preserve_statement_flags);\n } else {\n this.handle_unknown(current_token, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) {\n var newlines = current_token.newlines;\n var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode);\n\n if (current_token.comments_before) {\n var comment_token = current_token.comments_before.next();\n while (comment_token) {\n // The cleanest handling of inline comments is to treat them as though they aren't there.\n // Just continue formatting and the behavior should be logical.\n // Also ignore unknown tokens. Again, this should result in better behavior.\n this.handle_whitespace_and_comments(comment_token, preserve_statement_flags);\n this.handle_token(comment_token, preserve_statement_flags);\n comment_token = current_token.comments_before.next();\n }\n }\n\n if (keep_whitespace) {\n for (var i = 0; i < newlines; i += 1) {\n this.print_newline(i > 0, preserve_statement_flags);\n }\n } else {\n if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) {\n newlines = this._options.max_preserve_newlines;\n }\n\n if (this._options.preserve_newlines) {\n if (newlines > 1) {\n this.print_newline(false, preserve_statement_flags);\n for (var j = 1; j < newlines; j += 1) {\n this.print_newline(true, preserve_statement_flags);\n }\n }\n }\n }\n\n};\n\nvar newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield'];\n\nBeautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) {\n force_linewrap = (force_linewrap === undefined) ? false : force_linewrap;\n\n // Never wrap the first token on a line\n if (this._output.just_added_newline()) {\n return;\n }\n\n var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap;\n var operatorLogicApplies = in_array(this._flags.last_token.text, positionable_operators) ||\n in_array(current_token.text, positionable_operators);\n\n if (operatorLogicApplies) {\n var shouldPrintOperatorNewline = (\n in_array(this._flags.last_token.text, positionable_operators) &&\n in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)\n ) ||\n in_array(current_token.text, positionable_operators);\n shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;\n }\n\n if (shouldPreserveOrForce) {\n this.print_newline(false, true);\n } else if (this._options.wrap_line_length) {\n if (reserved_array(this._flags.last_token, newline_restricted_tokens)) {\n // These tokens should never have a newline inserted\n // between them and the following expression.\n return;\n }\n var proposed_line_length = this._output.current_line.get_character_count() + current_token.text.length +\n (this._output.space_before_token ? 1 : 0);\n if (proposed_line_length >= this._options.wrap_line_length) {\n this.print_newline(false, true);\n }\n }\n};\n\nBeautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) {\n if (!preserve_statement_flags) {\n if (this._flags.last_token.text !== ';' && this._flags.last_token.text !== ',' && this._flags.last_token.text !== '=' && (this._flags.last_token.type !== TOKEN.OPERATOR || this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) {\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && reserved_word(next_token, 'else')) &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n }\n }\n\n if (this._output.add_new_line(force_newline)) {\n this._flags.multiline_frame = true;\n }\n};\n\nBeautifier.prototype.print_token_line_indentation = function(current_token) {\n if (this._output.just_added_newline()) {\n if (this._options.keep_array_indentation && is_array(this._flags.mode) && current_token.newlines) {\n this._output.current_line.push(current_token.whitespace_before);\n this._output.space_before_token = false;\n } else if (this._output.set_indent(this._flags.indentation_level)) {\n this._flags.line_indent_level = this._flags.indentation_level;\n }\n }\n};\n\nBeautifier.prototype.print_token = function(current_token, printable_token) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n return;\n }\n\n if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN.COMMA &&\n this._output.just_added_newline()) {\n if (this._output.previous_line.last() === ',') {\n var popped = this._output.previous_line.pop();\n // if the comma was already at the start of the line,\n // pull back onto that line and reprint the indentation\n if (this._output.previous_line.is_empty()) {\n this._output.previous_line.push(popped);\n this._output.trim(true);\n this._output.current_line.pop();\n this._output.trim();\n }\n\n // add the comma in front of the next token\n this.print_token_line_indentation(current_token);\n this._output.add_token(',');\n this._output.space_before_token = true;\n }\n }\n\n printable_token = printable_token || current_token.text;\n this.print_token_line_indentation(current_token);\n this._output.add_token(printable_token);\n};\n\nBeautifier.prototype.indent = function() {\n this._flags.indentation_level += 1;\n};\n\nBeautifier.prototype.deindent = function() {\n if (this._flags.indentation_level > 0 &&\n ((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) {\n this._flags.indentation_level -= 1;\n\n }\n};\n\nBeautifier.prototype.set_mode = function(mode) {\n if (this._flags) {\n this._flag_store.push(this._flags);\n this._previous_flags = this._flags;\n } else {\n this._previous_flags = this.create_flags(null, mode);\n }\n\n this._flags = this.create_flags(this._previous_flags, mode);\n};\n\n\nBeautifier.prototype.restore_mode = function() {\n if (this._flag_store.length > 0) {\n this._previous_flags = this._flags;\n this._flags = this._flag_store.pop();\n if (this._previous_flags.mode === MODE.Statement) {\n remove_redundant_indentation(this._output, this._previous_flags);\n }\n }\n};\n\nBeautifier.prototype.start_of_object_property = function() {\n return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && (\n (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set'])));\n};\n\nBeautifier.prototype.start_of_statement = function(current_token) {\n var start = false;\n start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD;\n start = start || reserved_word(this._flags.last_token, 'do');\n start = start || (reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines);\n start = start || reserved_word(this._flags.last_token, 'else') &&\n !(reserved_word(current_token, 'if') && !current_token.comments_before);\n start = start || (this._flags.last_token.type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional));\n start = start || (this._flags.last_token.type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement &&\n !this._flags.in_case &&\n !(current_token.text === '--' || current_token.text === '++') &&\n this._last_last_text !== 'function' &&\n current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED);\n start = start || (this._flags.mode === MODE.ObjectLiteral && (\n (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set'])));\n\n if (start) {\n this.set_mode(MODE.Statement);\n this.indent();\n\n this.handle_whitespace_and_comments(current_token, true);\n\n // Issue #276:\n // If starting a new statement with [if, for, while, do], push to a new line.\n // if (a) if (b) if(c) d(); else e(); else f();\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token,\n reserved_array(current_token, ['do', 'for', 'if', 'while']));\n }\n return true;\n }\n return false;\n};\n\nBeautifier.prototype.handle_start_expr = function(current_token) {\n // The conditional starts the statement if appropriate.\n if (!this.start_of_statement(current_token)) {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_mode = MODE.Expression;\n if (current_token.text === '[') {\n\n if (this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === ')') {\n // this is array index specifier, break immediately\n // a[x], fn()[x]\n if (reserved_array(this._flags.last_token, line_starters)) {\n this._output.space_before_token = true;\n }\n this.set_mode(next_mode);\n this.print_token(current_token);\n this.indent();\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n return;\n }\n\n next_mode = MODE.ArrayLiteral;\n if (is_array(this._flags.mode)) {\n if (this._flags.last_token.text === '[' ||\n (this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) {\n // ], [ goes to new line\n // }, [ goes to new line\n if (!this._options.keep_array_indentation) {\n this.print_newline();\n }\n }\n }\n\n if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) {\n this._output.space_before_token = true;\n }\n } else {\n if (this._flags.last_token.type === TOKEN.RESERVED) {\n if (this._flags.last_token.text === 'for') {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.ForInitializer;\n } else if (in_array(this._flags.last_token.text, ['if', 'while'])) {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.Conditional;\n } else if (in_array(this._flags.last_word, ['await', 'async'])) {\n // Should be a space between await and an IIFE, or async and an arrow function\n this._output.space_before_token = true;\n } else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') {\n this._output.space_before_token = false;\n } else if (in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') {\n this._output.space_before_token = true;\n }\n } else if (this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {\n // Support of this kind of newline preservation.\n // a = (b &&\n // (c || d));\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._flags.last_token.type === TOKEN.WORD) {\n this._output.space_before_token = false;\n } else {\n // Support preserving wrapped arrow function expressions\n // a.b('c',\n // () => d.e\n // )\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // function() vs function ()\n // yield*() vs yield* ()\n // function*() vs function* ()\n if ((this._flags.last_token.type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) ||\n (this._flags.last_token.text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n\n this._output.space_before_token = this._options.space_after_anon_function;\n }\n\n }\n\n if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN.START_BLOCK) {\n this.print_newline();\n } else if (this._flags.last_token.type === TOKEN.END_EXPR || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.END_BLOCK || this._flags.last_token.text === '.' || this._flags.last_token.type === TOKEN.COMMA) {\n // do nothing on (( and )( and ][ and ]( and .(\n // TODO: Consider whether forcing this is required. Review failing tests when removed.\n this.allow_wrap_or_preserved_newline(current_token, current_token.newlines);\n }\n\n this.set_mode(next_mode);\n this.print_token(current_token);\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n // In all cases, if we newline while inside an expression it should be indented.\n this.indent();\n};\n\nBeautifier.prototype.handle_end_expr = function(current_token) {\n // statements inside expressions are not valid syntax, but...\n // statements must all be closed when their container closes\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n this.handle_whitespace_and_comments(current_token);\n\n if (this._flags.multiline_frame) {\n this.allow_wrap_or_preserved_newline(current_token,\n current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation);\n }\n\n if (this._options.space_in_paren) {\n if (this._flags.last_token.type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) {\n // () [] no inner space in empty parens like these, ever, ref #320\n this._output.trim();\n this._output.space_before_token = false;\n } else {\n this._output.space_before_token = true;\n }\n }\n if (current_token.text === ']' && this._options.keep_array_indentation) {\n this.print_token(current_token);\n this.restore_mode();\n } else {\n this.restore_mode();\n this.print_token(current_token);\n }\n remove_redundant_indentation(this._output, this._previous_flags);\n\n // do {} while () // no statement required after\n if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) {\n this._previous_flags.mode = MODE.Expression;\n this._flags.do_block = false;\n this._flags.do_while = false;\n\n }\n};\n\nBeautifier.prototype.handle_start_block = function(current_token) {\n this.handle_whitespace_and_comments(current_token);\n\n // Check if this is should be treated as a ObjectLiteral\n var next_token = this._tokens.peek();\n var second_token = this._tokens.peek(1);\n if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN.END_EXPR) {\n this.set_mode(MODE.BlockStatement);\n this._flags.in_case_statement = true;\n } else if (second_token && (\n (in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) ||\n (in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED]))\n )) {\n // We don't support TypeScript,but we didn't break it for a very long time.\n // We'll try to keep not breaking it.\n if (!in_array(this._last_last_text, ['class', 'interface'])) {\n this.set_mode(MODE.ObjectLiteral);\n } else {\n this.set_mode(MODE.BlockStatement);\n }\n } else if (this._flags.last_token.type === TOKEN.OPERATOR && this._flags.last_token.text === '=>') {\n // arrow function: (param1, paramN) => { statements }\n this.set_mode(MODE.BlockStatement);\n } else if (in_array(this._flags.last_token.type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) ||\n reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default'])\n ) {\n // Detecting shorthand function syntax is difficult by scanning forward,\n // so check the surrounding context.\n // If the block is being returned, imported, export default, passed as arg,\n // assigned with = or assigned in a nested object, treat as an ObjectLiteral.\n this.set_mode(MODE.ObjectLiteral);\n } else {\n this.set_mode(MODE.BlockStatement);\n }\n\n var empty_braces = !next_token.comments_before && next_token.text === '}';\n var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' &&\n this._flags.last_token.type === TOKEN.END_EXPR;\n\n if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so\n {\n // search forward for a newline wanted inside this block\n var index = 0;\n var check_token = null;\n this._flags.inline_frame = true;\n do {\n index += 1;\n check_token = this._tokens.peek(index - 1);\n if (check_token.newlines) {\n this._flags.inline_frame = false;\n break;\n }\n } while (check_token.type !== TOKEN.EOF &&\n !(check_token.type === TOKEN.END_BLOCK && check_token.opened === current_token));\n }\n\n if ((this._options.brace_style === \"expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n if (this._flags.last_token.type !== TOKEN.OPERATOR &&\n (empty_anonymous_function ||\n this._flags.last_token.type === TOKEN.EQUALS ||\n (reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) {\n this._output.space_before_token = true;\n } else {\n this.print_newline(false, true);\n }\n } else { // collapse || inline_frame\n if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.COMMA)) {\n if (this._flags.last_token.type === TOKEN.COMMA || this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n if (this._flags.last_token.type === TOKEN.COMMA || (this._flags.last_token.type === TOKEN.START_EXPR && this._flags.inline_frame)) {\n this.allow_wrap_or_preserved_newline(current_token);\n this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame;\n this._flags.multiline_frame = false;\n }\n }\n if (this._flags.last_token.type !== TOKEN.OPERATOR && this._flags.last_token.type !== TOKEN.START_EXPR) {\n if (this._flags.last_token.type === TOKEN.START_BLOCK && !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.space_before_token = true;\n }\n }\n }\n this.print_token(current_token);\n this.indent();\n};\n\nBeautifier.prototype.handle_end_block = function(current_token) {\n // statements must all be closed when their container closes\n this.handle_whitespace_and_comments(current_token);\n\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n var empty_braces = this._flags.last_token.type === TOKEN.START_BLOCK;\n\n if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first\n this._output.space_before_token = true;\n } else if (this._options.brace_style === \"expand\") {\n if (!empty_braces) {\n this.print_newline();\n }\n } else {\n // skip {}\n if (!empty_braces) {\n if (is_array(this._flags.mode) && this._options.keep_array_indentation) {\n // we REALLY need a newline here, but newliner would skip that\n this._options.keep_array_indentation = false;\n this.print_newline();\n this._options.keep_array_indentation = true;\n\n } else {\n this.print_newline();\n }\n }\n }\n this.restore_mode();\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_word = function(current_token) {\n if (current_token.type === TOKEN.RESERVED) {\n if (in_array(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) {\n current_token.type = TOKEN.WORD;\n } else if (in_array(current_token.text, ['as', 'from']) && !this._flags.import_block) {\n current_token.type = TOKEN.WORD;\n } else if (this._flags.mode === MODE.ObjectLiteral) {\n var next_token = this._tokens.peek();\n if (next_token.text === ':') {\n current_token.type = TOKEN.WORD;\n }\n }\n }\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) {\n this._flags.declaration_statement = true;\n }\n } else if (current_token.newlines && !is_expression(this._flags.mode) &&\n (this._flags.last_token.type !== TOKEN.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) &&\n this._flags.last_token.type !== TOKEN.EQUALS &&\n (this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) {\n this.handle_whitespace_and_comments(current_token);\n this.print_newline();\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.do_block && !this._flags.do_while) {\n if (reserved_word(current_token, 'while')) {\n // do {} ## while ()\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n this._flags.do_while = true;\n return;\n } else {\n // do {} should always have while as the next word.\n // if we don't see the expected while, recover\n this.print_newline();\n this._flags.do_block = false;\n }\n }\n\n // if may be followed by else, or not\n // Bare/inline ifs are tricky\n // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();\n if (this._flags.if_block) {\n if (!this._flags.else_block && reserved_word(current_token, 'else')) {\n this._flags.else_block = true;\n } else {\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this._flags.if_block = false;\n this._flags.else_block = false;\n }\n }\n\n if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) {\n this.print_newline();\n if (this._flags.case_body || this._options.jslint_happy) {\n // switch cases following one another\n this.deindent();\n this._flags.case_body = false;\n }\n this.print_token(current_token);\n this._flags.in_case = true;\n return;\n }\n\n if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n }\n\n if (reserved_word(current_token, 'function')) {\n if (in_array(this._flags.last_token.text, ['}', ';']) ||\n (this._output.just_added_newline() && !(in_array(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN.OPERATOR))) {\n // make sure there is a nice clean space of at least one blank line\n // before a new function definition\n if (!this._output.just_added_blankline() && !current_token.comments_before) {\n this.print_newline();\n this.print_newline(true);\n }\n }\n if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD) {\n if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) ||\n reserved_array(this._flags.last_token, newline_restricted_tokens)) {\n this._output.space_before_token = true;\n } else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n } else if (this._flags.last_token.type === TOKEN.OPERATOR || this._flags.last_token.text === '=') {\n // foo = function\n this._output.space_before_token = true;\n } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) {\n // (function\n } else {\n this.print_newline();\n }\n\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n return;\n }\n\n var prefix = 'NONE';\n\n if (this._flags.last_token.type === TOKEN.END_BLOCK) {\n\n if (this._previous_flags.inline_frame) {\n prefix = 'SPACE';\n } else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) {\n prefix = 'NEWLINE';\n } else {\n if (this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) {\n prefix = 'NEWLINE';\n } else {\n prefix = 'SPACE';\n this._output.space_before_token = true;\n }\n }\n } else if (this._flags.last_token.type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) {\n // TODO: Should this be for STATEMENT as well?\n prefix = 'NEWLINE';\n } else if (this._flags.last_token.type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) {\n prefix = 'SPACE';\n } else if (this._flags.last_token.type === TOKEN.STRING) {\n prefix = 'NEWLINE';\n } else if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD ||\n (this._flags.last_token.text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n prefix = 'SPACE';\n } else if (this._flags.last_token.type === TOKEN.START_BLOCK) {\n if (this._flags.inline_frame) {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n } else if (this._flags.last_token.type === TOKEN.END_EXPR) {\n this._output.space_before_token = true;\n prefix = 'NEWLINE';\n }\n\n if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {\n if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n\n }\n\n if (reserved_array(current_token, ['else', 'catch', 'finally'])) {\n if ((!(this._flags.last_token.type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) ||\n this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.trim(true);\n var line = this._output.current_line;\n // If we trimmed and there's something other than a close block before us\n // put a newline back in. Handles '} // comment' scenario.\n if (line.last() !== '}') {\n this.print_newline();\n }\n this._output.space_before_token = true;\n }\n } else if (prefix === 'NEWLINE') {\n if (reserved_array(this._flags.last_token, special_words)) {\n // no newline between 'return nnn'\n this._output.space_before_token = true;\n } else if (this._flags.last_token.type !== TOKEN.END_EXPR) {\n if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') {\n // no need to force newline on 'var': for (var x = 0...)\n if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) {\n // no newline for } else if {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n }\n } else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {\n this.print_newline();\n }\n } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') {\n this.print_newline(); // }, in lists get a newline treatment\n } else if (prefix === 'SPACE') {\n this._output.space_before_token = true;\n }\n if (current_token.previous && (current_token.previous.type === TOKEN.WORD || current_token.previous.type === TOKEN.RESERVED)) {\n this._output.space_before_token = true;\n }\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n\n if (current_token.type === TOKEN.RESERVED) {\n if (current_token.text === 'do') {\n this._flags.do_block = true;\n } else if (current_token.text === 'if') {\n this._flags.if_block = true;\n } else if (current_token.text === 'import') {\n this._flags.import_block = true;\n } else if (this._flags.import_block && reserved_word(current_token, 'from')) {\n this._flags.import_block = false;\n }\n }\n};\n\nBeautifier.prototype.handle_semicolon = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // Semicolon can be the start (and end) of a statement\n this._output.space_before_token = false;\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && reserved_word(next_token, 'else')) &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n\n // hacky but effective for the moment\n if (this._flags.import_block) {\n this._flags.import_block = false;\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_string = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // One difference - strings want at least a space before\n this._output.space_before_token = true;\n } else {\n this.handle_whitespace_and_comments(current_token);\n if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.inline_frame) {\n this._output.space_before_token = true;\n } else if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else {\n this.print_newline();\n }\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_equals = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.declaration_statement) {\n // just got an '=' in a var-line, different formatting/line-breaking, etc will now be done\n this._flags.declaration_assignment = true;\n }\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n};\n\nBeautifier.prototype.handle_comma = function(current_token) {\n this.handle_whitespace_and_comments(current_token, true);\n\n this.print_token(current_token);\n this._output.space_before_token = true;\n if (this._flags.declaration_statement) {\n if (is_expression(this._flags.parent.mode)) {\n // do not break on comma, for(var a = 1, b = 2)\n this._flags.declaration_assignment = false;\n }\n\n if (this._flags.declaration_assignment) {\n this._flags.declaration_assignment = false;\n this.print_newline(false, true);\n } else if (this._options.comma_first) {\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._flags.mode === MODE.ObjectLiteral ||\n (this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) {\n if (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n if (!this._flags.inline_frame) {\n this.print_newline();\n }\n } else if (this._options.comma_first) {\n // EXPR or DO_BLOCK\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n};\n\nBeautifier.prototype.handle_operator = function(current_token) {\n var isGeneratorAsterisk = current_token.text === '*' &&\n (reserved_array(this._flags.last_token, ['function', 'yield']) ||\n (in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON]))\n );\n var isUnary = in_array(current_token.text, ['-', '+']) && (\n in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) ||\n in_array(this._flags.last_token.text, line_starters) ||\n this._flags.last_token.text === ','\n );\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n var preserve_statement_flags = !isGeneratorAsterisk;\n this.handle_whitespace_and_comments(current_token, preserve_statement_flags);\n }\n\n if (reserved_array(this._flags.last_token, special_words)) {\n // \"return\" had a special handling in TK_WORD. Now we need to return the favor\n this._output.space_before_token = true;\n this.print_token(current_token);\n return;\n }\n\n // hack for actionscript's import .*;\n if (current_token.text === '*' && this._flags.last_token.type === TOKEN.DOT) {\n this.print_token(current_token);\n return;\n }\n\n if (current_token.text === '::') {\n // no spaces around exotic namespacing syntax operator\n this.print_token(current_token);\n return;\n }\n\n // Allow line wrapping between operators when operator_position is\n // set to before or preserve\n if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n if (current_token.text === ':' && this._flags.in_case) {\n this._flags.case_body = true;\n this.indent();\n this.print_token(current_token);\n this.print_newline();\n this._flags.in_case = false;\n return;\n }\n\n var space_before = true;\n var space_after = true;\n var in_ternary = false;\n if (current_token.text === ':') {\n if (this._flags.ternary_depth === 0) {\n // Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant.\n space_before = false;\n } else {\n this._flags.ternary_depth -= 1;\n in_ternary = true;\n }\n } else if (current_token.text === '?') {\n this._flags.ternary_depth += 1;\n }\n\n // let's handle the operator_position option prior to any conflicting logic\n if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array(current_token.text, positionable_operators)) {\n var isColon = current_token.text === ':';\n var isTernaryColon = (isColon && in_ternary);\n var isOtherColon = (isColon && !in_ternary);\n\n switch (this._options.operator_position) {\n case OPERATOR_POSITION.before_newline:\n // if the current token is : and it's not a ternary statement then we set space_before to false\n this._output.space_before_token = !isOtherColon;\n\n this.print_token(current_token);\n\n if (!isColon || isTernaryColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.after_newline:\n // if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement,\n // then print a newline.\n\n this._output.space_before_token = true;\n\n if (!isColon || isTernaryColon) {\n if (this._tokens.peek().newlines) {\n this.print_newline(false, true);\n } else {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else {\n this._output.space_before_token = false;\n }\n\n this.print_token(current_token);\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.preserve_newline:\n if (!isOtherColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // if we just added a newline, or the current token is : and it's not a ternary statement,\n // then we set space_before to false\n space_before = !(this._output.just_added_newline() || isOtherColon);\n\n this._output.space_before_token = space_before;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n }\n }\n\n if (isGeneratorAsterisk) {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = false;\n var next_token = this._tokens.peek();\n space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]);\n } else if (current_token.text === '...') {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = this._flags.last_token.type === TOKEN.START_BLOCK;\n space_after = false;\n } else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) {\n // unary operators (and binary +/- pretending to be unary) special cases\n if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n space_before = false;\n space_after = false;\n\n // http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1\n // if there is a newline between -- or ++ and anything else we should preserve it.\n if (current_token.newlines && (current_token.text === '--' || current_token.text === '++')) {\n this.print_newline(false, true);\n }\n\n if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) {\n // for (;; ++i)\n // ^^^\n space_before = true;\n }\n\n if (this._flags.last_token.type === TOKEN.RESERVED) {\n space_before = true;\n } else if (this._flags.last_token.type === TOKEN.END_EXPR) {\n space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++'));\n } else if (this._flags.last_token.type === TOKEN.OPERATOR) {\n // a++ + ++b;\n // a - -b\n space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_token.text, ['--', '-', '++', '+']);\n // + and - are not unary when preceeded by -- or ++ operator\n // a-- + b\n // a * +b\n // a - -b\n if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_token.text, ['--', '++'])) {\n space_after = true;\n }\n }\n\n\n if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) &&\n (this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) {\n // { foo; --i }\n // foo(); --bar;\n this.print_newline();\n }\n }\n\n this._output.space_before_token = this._output.space_before_token || space_before;\n this.print_token(current_token);\n this._output.space_before_token = space_after;\n};\n\nBeautifier.prototype.handle_block_comment = function(current_token, preserve_statement_flags) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n if (current_token.directives && current_token.directives.preserve === 'end') {\n // If we're testing the raw output behavior, do not allow a directive to turn it off.\n this._output.raw = this._options.test_output_raw;\n }\n return;\n }\n\n if (current_token.directives) {\n this.print_newline(false, preserve_statement_flags);\n this.print_token(current_token);\n if (current_token.directives.preserve === 'start') {\n this._output.raw = true;\n }\n this.print_newline(false, true);\n return;\n }\n\n // inline block\n if (!acorn.newline.test(current_token.text) && !current_token.newlines) {\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n }\n\n var lines = split_linebreaks(current_token.text);\n var j; // iterator for this case\n var javadoc = false;\n var starless = false;\n var lastIndent = current_token.whitespace_before;\n var lastIndentLength = lastIndent.length;\n\n // block comment starts with a new line\n this.print_newline(false, preserve_statement_flags);\n if (lines.length > 1) {\n javadoc = all_lines_start_with(lines.slice(1), '*');\n starless = each_line_matches_indent(lines.slice(1), lastIndent);\n }\n\n // first line always indented\n this.print_token(current_token, lines[0]);\n for (j = 1; j < lines.length; j++) {\n this.print_newline(false, true);\n if (javadoc) {\n // javadoc: reformat and re-indent\n this.print_token(current_token, ' ' + ltrim(lines[j]));\n } else if (starless && lines[j].length > lastIndentLength) {\n // starless: re-indent non-empty content, avoiding trim\n this.print_token(current_token, lines[j].substring(lastIndentLength));\n } else {\n // normal comments output raw\n this._output.add_token(lines[j]);\n }\n }\n\n // for comments of more than one line, make sure there's a new line after\n this.print_newline(false, preserve_statement_flags);\n};\n\nBeautifier.prototype.handle_comment = function(current_token, preserve_statement_flags) {\n if (current_token.newlines) {\n this.print_newline(false, preserve_statement_flags);\n } else {\n this._output.trim(true);\n }\n\n this._output.space_before_token = true;\n this.print_token(current_token);\n this.print_newline(false, preserve_statement_flags);\n};\n\nBeautifier.prototype.handle_dot = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token, true);\n }\n\n if (this._options.unindent_chained_methods) {\n this.deindent();\n }\n\n if (reserved_array(this._flags.last_token, special_words)) {\n this._output.space_before_token = false;\n } else {\n // allow preserved newlines before dots in general\n // force newlines on dots after close paren when break_chained - for bar().baz()\n this.allow_wrap_or_preserved_newline(current_token,\n this._flags.last_token.text === ')' && this._options.break_chained_methods);\n }\n\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_unknown = function(current_token, preserve_statement_flags) {\n this.print_token(current_token);\n\n if (current_token.text[current_token.text.length - 1] === '\\n') {\n this.print_newline(false, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_eof = function(current_token) {\n // Unwind any open statements\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this.handle_whitespace_and_comments(current_token);\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n\n this.__items = [];\n}\n\nOutputLine.prototype.item = function(index) {\n if (index < 0) {\n return this.__items[this.__items.length + index];\n } else {\n return this.__items[index];\n }\n};\n\nOutputLine.prototype.has_match = function(pattern) {\n for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {\n if (this.__items[lastCheckedOutput].match(pattern)) {\n return true;\n }\n }\n return false;\n};\n\nOutputLine.prototype.set_indent = function(indent, alignment) {\n this.__indent_count = indent || 0;\n this.__alignment_count = alignment || 0;\n this.__character_count = this.__parent.baseIndentLength + this.__alignment_count + this.__indent_count * this.__parent.indent_length;\n};\n\nOutputLine.prototype.get_character_count = function() {\n return this.__character_count;\n};\n\nOutputLine.prototype.is_empty = function() {\n return this.__items.length === 0;\n};\n\nOutputLine.prototype.last = function() {\n if (!this.is_empty()) {\n return this.__items[this.__items.length - 1];\n } else {\n return null;\n }\n};\n\nOutputLine.prototype.push = function(item) {\n this.__items.push(item);\n this.__character_count += item.length;\n};\n\nOutputLine.prototype.push_raw = function(item) {\n this.push(item);\n var last_newline_index = item.lastIndexOf('\\n');\n if (last_newline_index !== -1) {\n this.__character_count = item.length - last_newline_index;\n }\n};\n\nOutputLine.prototype.pop = function() {\n var item = null;\n if (!this.is_empty()) {\n item = this.__items.pop();\n this.__character_count -= item.length;\n }\n return item;\n};\n\nOutputLine.prototype.remove_indent = function() {\n if (this.__indent_count > 0) {\n this.__indent_count -= 1;\n this.__character_count -= this.__parent.indent_length;\n }\n};\n\nOutputLine.prototype.trim = function() {\n while (this.last() === ' ') {\n this.__items.pop();\n this.__character_count -= 1;\n }\n};\n\nOutputLine.prototype.toString = function() {\n var result = '';\n if (!this.is_empty()) {\n if (this.__indent_count >= 0) {\n result = this.__parent.get_indent_string(this.__indent_count);\n }\n if (this.__alignment_count >= 0) {\n result += this.__parent.get_alignment_string(this.__alignment_count);\n }\n result += this.__items.join('');\n }\n return result;\n};\n\nfunction IndentCache(base_string, level_string) {\n this.__cache = [base_string];\n this.__level_string = level_string;\n}\n\nIndentCache.prototype.__ensure_cache = function(level) {\n while (level >= this.__cache.length) {\n this.__cache.push(this.__cache[this.__cache.length - 1] + this.__level_string);\n }\n};\n\nIndentCache.prototype.get_level_string = function(level) {\n this.__ensure_cache(level);\n return this.__cache[level];\n};\n\n\nfunction Output(options, baseIndentString) {\n var indent_string = options.indent_char;\n if (options.indent_size > 1) {\n indent_string = new Array(options.indent_size + 1).join(options.indent_char);\n }\n\n // Set to null to continue support for auto detection of base indent level.\n baseIndentString = baseIndentString || '';\n if (options.indent_level > 0) {\n baseIndentString = new Array(options.indent_level + 1).join(indent_string);\n }\n\n this.__indent_cache = new IndentCache(baseIndentString, indent_string);\n this.__alignment_cache = new IndentCache('', ' ');\n this.baseIndentLength = baseIndentString.length;\n this.indent_length = indent_string.length;\n this.raw = false;\n this._end_with_newline = options.end_with_newline;\n\n this.__lines = [];\n this.previous_line = null;\n this.current_line = null;\n this.space_before_token = false;\n // initialize\n this.__add_outputline();\n}\n\nOutput.prototype.__add_outputline = function() {\n this.previous_line = this.current_line;\n this.current_line = new OutputLine(this);\n this.__lines.push(this.current_line);\n};\n\nOutput.prototype.get_line_number = function() {\n return this.__lines.length;\n};\n\nOutput.prototype.get_indent_string = function(level) {\n return this.__indent_cache.get_level_string(level);\n};\n\nOutput.prototype.get_alignment_string = function(level) {\n return this.__alignment_cache.get_level_string(level);\n};\n\nOutput.prototype.is_empty = function() {\n return !this.previous_line && this.current_line.is_empty();\n};\n\nOutput.prototype.add_new_line = function(force_newline) {\n // never newline at the start of file\n // otherwise, newline only if we didn't just add one or we're forced\n if (this.is_empty() ||\n (!force_newline && this.just_added_newline())) {\n return false;\n }\n\n // if raw output is enabled, don't print additional newlines,\n // but still return True as though you had\n if (!this.raw) {\n this.__add_outputline();\n }\n return true;\n};\n\nOutput.prototype.get_code = function(eol) {\n var sweet_code = this.__lines.join('\\n').replace(/[\\r\\n\\t ]+$/, '');\n\n if (this._end_with_newline) {\n sweet_code += '\\n';\n }\n\n if (eol !== '\\n') {\n sweet_code = sweet_code.replace(/[\\n]/g, eol);\n }\n\n return sweet_code;\n};\n\nOutput.prototype.set_indent = function(indent, alignment) {\n indent = indent || 0;\n alignment = alignment || 0;\n\n // Never indent your first output indent at the start of the file\n if (this.__lines.length > 1) {\n this.current_line.set_indent(indent, alignment);\n return true;\n }\n this.current_line.set_indent();\n return false;\n};\n\nOutput.prototype.add_raw_token = function(token) {\n for (var x = 0; x < token.newlines; x++) {\n this.__add_outputline();\n }\n this.current_line.push(token.whitespace_before);\n this.current_line.push_raw(token.text);\n this.space_before_token = false;\n};\n\nOutput.prototype.add_token = function(printable_token) {\n this.add_space_before_token();\n this.current_line.push(printable_token);\n};\n\nOutput.prototype.add_space_before_token = function() {\n if (this.space_before_token && !this.just_added_newline()) {\n this.current_line.push(' ');\n }\n this.space_before_token = false;\n};\n\nOutput.prototype.remove_indent = function(index) {\n var output_length = this.__lines.length;\n while (index < output_length) {\n this.__lines[index].remove_indent();\n index++;\n }\n};\n\nOutput.prototype.trim = function(eat_newlines) {\n eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;\n\n this.current_line.trim(this.indent_string, this.baseIndentString);\n\n while (eat_newlines && this.__lines.length > 1 &&\n this.current_line.is_empty()) {\n this.__lines.pop();\n this.current_line = this.__lines[this.__lines.length - 1];\n this.current_line.trim();\n }\n\n this.previous_line = this.__lines.length > 1 ?\n this.__lines[this.__lines.length - 2] : null;\n};\n\nOutput.prototype.just_added_newline = function() {\n return this.current_line.is_empty();\n};\n\nOutput.prototype.just_added_blankline = function() {\n return this.is_empty() ||\n (this.current_line.is_empty() && this.previous_line.is_empty());\n};\n\nOutput.prototype.ensure_empty_line_above = function(starts_with, ends_with) {\n var index = this.__lines.length - 2;\n while (index >= 0) {\n var potentialEmptyLine = this.__lines[index];\n if (potentialEmptyLine.is_empty()) {\n break;\n } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&\n potentialEmptyLine.item(-1) !== ends_with) {\n this.__lines.splice(index + 1, 0, new OutputLine(this));\n this.previous_line = this.__lines[this.__lines.length - 2];\n break;\n }\n index--;\n }\n};\n\nmodule.exports.Output = Output;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}\n\n\nmodule.exports.Token = Token;","/* jshint node: true, curly: false */\n// Parts of this section of code is taken from acorn.\n//\n// Acorn was written by Marijn Haverbeke and released under an MIT\n// license. The Unicode regexps (for identifiers and whitespace) were\n// taken from [Esprima](http://esprima.org) by Ariya Hidayat.\n//\n// Git repositories for Acorn are available at\n//\n// http://marijnhaverbeke.nl/git/acorn\n// https://github.com/marijnh/acorn.git\n\n// ## Character categories\n\n\n'use strict';\n\n// acorn used char codes to squeeze the last bit of performance out\n// Beautifier is okay without that, so we're using regex\n// permit $ (36) and @ (64). @ is used in ES7 decorators.\n// 65 through 91 are uppercase letters.\n// permit _ (95).\n// 97 through 123 are lowercase letters.\nvar baseASCIIidentifierStartChars = \"\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a\";\n\n// inside an identifier @ is not allowed but 0-9 are.\nvar baseASCIIidentifierChars = \"\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\";\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 128.\nvar nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2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u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nvar nonASCIIidentifierChars = \"\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n//var nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\n//var nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n\nvar identifierStart = \"[\" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + \"]\";\nvar identifierChars = \"[\" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]*\";\n\nexports.identifier = new RegExp(identifierStart + identifierChars, 'g');\n\n\nvar nonASCIIwhitespace = /[\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/; // jshint ignore:line\n\n// Whether a single character denotes a newline.\n\nexports.newline = /[\\n\\r\\u2028\\u2029]/;\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\n// in javascript, these two differ\n// in python they are the same, different methods are called on them\nexports.lineBreak = new RegExp('\\r\\n|' + exports.newline.source);\nexports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'js');\n\n // compatibility, re\n var raw_brace_style = this.raw_options.brace_style || null;\n if (raw_brace_style === \"expand-strict\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"expand\";\n } else if (raw_brace_style === \"collapse-preserve-inline\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"collapse,preserve-inline\";\n } else if (this.raw_options.braces_on_own_line !== undefined) { //graceful handling of deprecated option\n this.raw_options.brace_style = this.raw_options.braces_on_own_line ? \"expand\" : \"collapse\";\n // } else if (!raw_brace_style) { //Nothing exists to set it\n // raw_brace_style = \"collapse\";\n }\n\n //preserve-inline in delimited string will trigger brace_preserve_inline, everything\n //else is considered a brace_style and the last one only will have an effect\n\n var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);\n\n this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option\n this.brace_style = \"collapse\";\n\n for (var bs = 0; bs < brace_style_split.length; bs++) {\n if (brace_style_split[bs] === \"preserve-inline\") {\n this.brace_preserve_inline = true;\n } else {\n this.brace_style = brace_style_split[bs];\n }\n }\n\n this.unindent_chained_methods = this._get_boolean('unindent_chained_methods');\n this.break_chained_methods = this._get_boolean('break_chained_methods');\n this.space_in_paren = this._get_boolean('space_in_paren');\n this.space_in_empty_paren = this._get_boolean('space_in_empty_paren');\n this.jslint_happy = this._get_boolean('jslint_happy');\n this.space_after_anon_function = this._get_boolean('space_after_anon_function');\n this.keep_array_indentation = this._get_boolean('keep_array_indentation');\n this.space_before_conditional = this._get_boolean('space_before_conditional', true);\n this.unescape_strings = this._get_boolean('unescape_strings');\n this.e4x = this._get_boolean('e4x');\n this.comma_first = this._get_boolean('comma_first');\n this.operator_position = this._get_selection('operator_position', validPositionValues);\n\n // For testing of beautify preserve:start directive\n this.test_output_raw = this._get_boolean('test_output_raw');\n\n // force this._options.space_after_anon_function to true if this._options.jslint_happy\n if (this.jslint_happy) {\n this.space_after_anon_function = true;\n }\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Options(options, merge_child_field) {\n options = _mergeOpts(options, merge_child_field);\n this.raw_options = _normalizeOpts(options);\n\n // Support passing the source text back with no change\n this.disabled = this._get_boolean('disabled');\n\n this.eol = this._get_characters('eol', 'auto');\n this.end_with_newline = this._get_boolean('end_with_newline');\n this.indent_size = this._get_number('indent_size', 4);\n this.indent_char = this._get_characters('indent_char', ' ');\n this.indent_level = this._get_number('indent_level');\n\n this.preserve_newlines = this._get_boolean('preserve_newlines', true);\n this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);\n if (!this.preserve_newlines) {\n this.max_preserve_newlines = 0;\n }\n\n this.indent_with_tabs = this._get_boolean('indent_with_tabs');\n if (this.indent_with_tabs) {\n this.indent_char = '\\t';\n this.indent_size = 1;\n }\n\n // Backwards compat with 1.3.x\n this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));\n\n}\n\nOptions.prototype._get_array = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || [];\n if (typeof option_value === 'object') {\n if (option_value !== null && typeof option_value.concat === 'function') {\n result = option_value.concat();\n }\n } else if (typeof option_value === 'string') {\n result = option_value.split(/[^a-zA-Z0-9_\\/\\-]+/);\n }\n return result;\n};\n\nOptions.prototype._get_boolean = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = option_value === undefined ? !!default_value : !!option_value;\n return result;\n};\n\nOptions.prototype._get_characters = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || '';\n if (typeof option_value === 'string') {\n result = option_value.replace(/\\\\r/, '\\r').replace(/\\\\n/, '\\n').replace(/\\\\t/, '\\t');\n }\n return result;\n};\n\nOptions.prototype._get_number = function(name, default_value) {\n var option_value = this.raw_options[name];\n default_value = parseInt(default_value, 10);\n if (isNaN(default_value)) {\n default_value = 0;\n }\n var result = parseInt(option_value, 10);\n if (isNaN(result)) {\n result = default_value;\n }\n return result;\n};\n\nOptions.prototype._get_selection = function(name, selection_list, default_value) {\n var result = this._get_selection_list(name, selection_list, default_value);\n if (result.length !== 1) {\n throw new Error(\n \"Invalid Option Value: The option '\" + name + \"' can only be one of the following values:\\n\" +\n selection_list + \"\\nYou passed in: '\" + this.raw_options[name] + \"'\");\n }\n\n return result[0];\n};\n\n\nOptions.prototype._get_selection_list = function(name, selection_list, default_value) {\n if (!selection_list || selection_list.length === 0) {\n throw new Error(\"Selection list cannot be empty.\");\n }\n\n default_value = default_value || [selection_list[0]];\n if (!this._is_valid_selection(default_value, selection_list)) {\n throw new Error(\"Invalid Default Value!\");\n }\n\n var result = this._get_array(name, default_value);\n if (!this._is_valid_selection(result, selection_list)) {\n throw new Error(\n \"Invalid Option Value: The option '\" + name + \"' can contain only the following values:\\n\" +\n selection_list + \"\\nYou passed in: '\" + this.raw_options[name] + \"'\");\n }\n\n return result;\n};\n\nOptions.prototype._is_valid_selection = function(result, selection_list) {\n return result.length && selection_list.length &&\n !result.some(function(item) { return selection_list.indexOf(item) === -1; });\n};\n\n\n// merges child options up with the parent options object\n// Example: obj = {a: 1, b: {a: 2}}\n// mergeOpts(obj, 'b')\n//\n// Returns: {a: 2, b: {a: 2}}\nfunction _mergeOpts(allOptions, childFieldName) {\n var finalOpts = {};\n allOptions = allOptions || {};\n var name;\n\n for (name in allOptions) {\n if (name !== childFieldName) {\n finalOpts[name] = allOptions[name];\n }\n }\n\n //merge in the per type settings for the childFieldName\n if (childFieldName && allOptions[childFieldName]) {\n for (name in allOptions[childFieldName]) {\n finalOpts[name] = allOptions[childFieldName][name];\n }\n }\n return finalOpts;\n}\n\nfunction _normalizeOpts(options) {\n var convertedOpts = {};\n var key;\n\n for (key in options) {\n var newKey = key.replace(/-/g, \"_\");\n convertedOpts[newKey] = options[key];\n }\n return convertedOpts;\n}\n\nmodule.exports.Options = Options;\nmodule.exports.normalizeOpts = _normalizeOpts;\nmodule.exports.mergeOpts = _mergeOpts;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\nvar acorn = require('./acorn');\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\n\nvar TOKEN = {\n START_EXPR: 'TK_START_EXPR',\n END_EXPR: 'TK_END_EXPR',\n START_BLOCK: 'TK_START_BLOCK',\n END_BLOCK: 'TK_END_BLOCK',\n WORD: 'TK_WORD',\n RESERVED: 'TK_RESERVED',\n SEMICOLON: 'TK_SEMICOLON',\n STRING: 'TK_STRING',\n EQUALS: 'TK_EQUALS',\n OPERATOR: 'TK_OPERATOR',\n COMMA: 'TK_COMMA',\n BLOCK_COMMENT: 'TK_BLOCK_COMMENT',\n COMMENT: 'TK_COMMENT',\n DOT: 'TK_DOT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\n\nvar directives_core = new Directives(/\\/\\*/, /\\*\\//);\n\nvar number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\\d+n|(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?/g;\n\nvar digit = /[0-9]/;\n\n// Dot \".\" must be distinguished from \"...\" and decimal\nvar dot_pattern = /[^\\d\\.]/;\n\nvar positionable_operators = (\n \">>> === !== \" +\n \"<< && >= ** != == <= >> || \" +\n \"< / - + > : & % ? ^ | *\").split(' ');\n\n// IMPORTANT: this must be sorted longest to shortest or tokenizing many not work.\n// Also, you must update possitionable operators separately from punct\nvar punct =\n \">>>= \" +\n \"... >>= <<= === >>> !== **= \" +\n \"=> ^= :: /= << <= == && -= >= >> != -- += ** || ++ %= &= *= |= \" +\n \"= ! ? > < : / ^ - + * & % ~ |\";\n\npunct = punct.replace(/[-[\\]{}()*+?.,\\\\^$|#]/g, \"\\\\$&\");\npunct = punct.replace(/ /g, '|');\n\nvar punct_pattern = new RegExp(punct, 'g');\n\n// words which should always start on new line.\nvar line_starters = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(',');\nvar reserved_words = line_starters.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as']);\nvar reserved_word_pattern = new RegExp('^(?:' + reserved_words.join('|') + ')$');\n\n// /* ... */ comment ends with nearest */ or end of file\nvar block_comment_pattern = /\\/\\*(?:[\\s\\S]*?)((?:\\*\\/)|$)/g;\n\n// comment ends just before nearest linefeed or end of file\nvar comment_pattern = /\\/\\/(?:[^\\n\\r\\u2028\\u2029]*)/g;\n\nvar template_pattern = /(?:(?:<\\?php|<\\?=)[\\s\\S]*?\\?>)|(?:<%[\\s\\S]*?%>)/g;\n\nvar in_html_comment;\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n\n this._whitespace_pattern = /[\\n\\r\\u2028\\u2029\\t\\u000B\\u00A0\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff ]+/g;\n this._newline_pattern = /([^\\n\\r\\u2028\\u2029]*)(\\r\\n|[\\n\\r\\u2028\\u2029])?/g;\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) {\n return current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.BLOCK_COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.START_BLOCK || current_token.type === TOKEN.START_EXPR;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return (current_token.type === TOKEN.END_BLOCK || current_token.type === TOKEN.END_EXPR) &&\n (open_token && (\n (current_token.text === ']' && open_token.text === '[') ||\n (current_token.text === ')' && open_token.text === '(') ||\n (current_token.text === '}' && open_token.text === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n in_html_comment = false;\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var token = null;\n var c = this._input.peek();\n\n token = token || this._read_singles(c);\n token = token || this._read_word(previous_token);\n token = token || this._read_comment(c);\n token = token || this._read_string(c);\n token = token || this._read_regexp(c, previous_token);\n token = token || this._read_xml(c, previous_token);\n token = token || this._read_non_javascript(c);\n token = token || this._read_punctuation();\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_word = function(previous_token) {\n var resulting_string;\n resulting_string = this._input.read(acorn.identifier);\n if (resulting_string !== '') {\n if (!(previous_token.type === TOKEN.DOT ||\n (previous_token.type === TOKEN.RESERVED && (previous_token.text === 'set' || previous_token.text === 'get'))) &&\n reserved_word_pattern.test(resulting_string)) {\n if (resulting_string === 'in' || resulting_string === 'of') { // hack for 'in' and 'of' operators\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n return this._create_token(TOKEN.RESERVED, resulting_string);\n }\n\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n\n resulting_string = this._input.read(number_pattern);\n if (resulting_string !== '') {\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n};\n\nTokenizer.prototype._read_singles = function(c) {\n var token = null;\n if (c === null) {\n token = this._create_token(TOKEN.EOF, '');\n } else if (c === '(' || c === '[') {\n token = this._create_token(TOKEN.START_EXPR, c);\n } else if (c === ')' || c === ']') {\n token = this._create_token(TOKEN.END_EXPR, c);\n } else if (c === '{') {\n token = this._create_token(TOKEN.START_BLOCK, c);\n } else if (c === '}') {\n token = this._create_token(TOKEN.END_BLOCK, c);\n } else if (c === ';') {\n token = this._create_token(TOKEN.SEMICOLON, c);\n } else if (c === '.' && dot_pattern.test(this._input.peek(1))) {\n token = this._create_token(TOKEN.DOT, c);\n } else if (c === ',') {\n token = this._create_token(TOKEN.COMMA, c);\n }\n\n if (token) {\n this._input.next();\n }\n return token;\n};\n\nTokenizer.prototype._read_punctuation = function() {\n var resulting_string = this._input.read(punct_pattern);\n\n if (resulting_string !== '') {\n if (resulting_string === '=') {\n return this._create_token(TOKEN.EQUALS, resulting_string);\n } else {\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n }\n};\n\nTokenizer.prototype._read_non_javascript = function(c) {\n var resulting_string = '';\n\n if (c === '#') {\n c = this._input.next();\n\n if (this._is_first_token() && this._input.peek() === '!') {\n // shebang\n resulting_string = c;\n while (this._input.hasNext() && c !== '\\n') {\n c = this._input.next();\n resulting_string += c;\n }\n return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\\n');\n }\n\n // Spidermonkey-specific sharp variables for circular references. Considered obsolete.\n var sharp = '#';\n if (this._input.hasNext() && this._input.testChar(digit)) {\n do {\n c = this._input.next();\n sharp += c;\n } while (this._input.hasNext() && c !== '#' && c !== '=');\n if (c === '#') {\n //\n } else if (this._input.peek() === '[' && this._input.peek(1) === ']') {\n sharp += '[]';\n this._input.next();\n this._input.next();\n } else if (this._input.peek() === '{' && this._input.peek(1) === '}') {\n sharp += '{}';\n this._input.next();\n this._input.next();\n }\n return this._create_token(TOKEN.WORD, sharp);\n }\n\n this._input.back();\n\n } else if (c === '<') {\n if (this._input.peek(1) === '?' || this._input.peek(1) === '%') {\n resulting_string = this._input.read(template_pattern);\n if (resulting_string) {\n resulting_string = resulting_string.replace(acorn.allLineBreaks, '\\n');\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n } else if (this._input.match(/<\\!--/g)) {\n c = '/g)) {\n in_html_comment = false;\n return this._create_token(TOKEN.COMMENT, '-->');\n }\n\n return null;\n};\n\nTokenizer.prototype._read_comment = function(c) {\n var token = null;\n if (c === '/') {\n var comment = '';\n if (this._input.peek(1) === '*') {\n // peek for comment /* ... */\n comment = this._input.read(block_comment_pattern);\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n comment = comment.replace(acorn.allLineBreaks, '\\n');\n token = this._create_token(TOKEN.BLOCK_COMMENT, comment);\n token.directives = directives;\n } else if (this._input.peek(1) === '/') {\n // peek for comment // ...\n comment = this._input.read(comment_pattern);\n token = this._create_token(TOKEN.COMMENT, comment);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_string = function(c) {\n if (c === '`' || c === \"'\" || c === '\"') {\n var resulting_string = this._input.next();\n this.has_char_escapes = false;\n\n if (c === '`') {\n resulting_string += this._read_string_recursive('`', true, '${');\n } else {\n resulting_string += this._read_string_recursive(c);\n }\n\n if (this.has_char_escapes && this._options.unescape_strings) {\n resulting_string = unescape_string(resulting_string);\n }\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n }\n\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._allow_regexp_or_xml = function(previous_token) {\n // regex and xml can only appear in specific locations during parsing\n return (previous_token.type === TOKEN.RESERVED && in_array(previous_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) ||\n (previous_token.type === TOKEN.END_EXPR && previous_token.text === ')' &&\n previous_token.opened.previous.type === TOKEN.RESERVED && in_array(previous_token.opened.previous.text, ['if', 'while', 'for'])) ||\n (in_array(previous_token.type, [TOKEN.COMMENT, TOKEN.START_EXPR, TOKEN.START_BLOCK, TOKEN.START,\n TOKEN.END_BLOCK, TOKEN.OPERATOR, TOKEN.EQUALS, TOKEN.EOF, TOKEN.SEMICOLON, TOKEN.COMMA\n ]));\n};\n\nTokenizer.prototype._read_regexp = function(c, previous_token) {\n\n if (c === '/' && this._allow_regexp_or_xml(previous_token)) {\n // handle regexp\n //\n var resulting_string = this._input.next();\n var esc = false;\n\n var in_char_class = false;\n while (this._input.hasNext() &&\n ((esc || in_char_class || this._input.peek() !== c) &&\n !this._input.testChar(acorn.newline))) {\n resulting_string += this._input.peek();\n if (!esc) {\n esc = this._input.peek() === '\\\\';\n if (this._input.peek() === '[') {\n in_char_class = true;\n } else if (this._input.peek() === ']') {\n in_char_class = false;\n }\n } else {\n esc = false;\n }\n this._input.next();\n }\n\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n\n // regexps may have modifiers /regexp/MOD , so fetch those, too\n // Only [gim] are valid, but if the user puts in garbage, do what we can to take it.\n resulting_string += this._input.read(acorn.identifier);\n }\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n return null;\n};\n\n\nvar startXmlRegExp = /<()([-a-zA-Z:0-9_.]+|{[\\s\\S]+?}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+{[\\s\\S]+?}|\\s+[-a-zA-Z:0-9_.]+|\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{[\\s\\S]+?}))*\\s*(\\/?)\\s*>/g;\nvar xmlRegExp = /[\\s\\S]*?<(\\/?)([-a-zA-Z:0-9_.]+|{[\\s\\S]+?}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+{[\\s\\S]+?}|\\s+[-a-zA-Z:0-9_.]+|\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{[\\s\\S]+?}))*\\s*(\\/?)\\s*>/g;\n\nTokenizer.prototype._read_xml = function(c, previous_token) {\n\n if (this._options.e4x && c === \"<\" && this._input.test(startXmlRegExp) && this._allow_regexp_or_xml(previous_token)) {\n // handle e4x xml literals\n //\n var xmlStr = '';\n var match = this._input.match(startXmlRegExp);\n if (match) {\n // Trim root tag to attempt to\n var rootTag = match[2].replace(/^{\\s+/, '{').replace(/\\s+}$/, '}');\n var isCurlyRoot = rootTag.indexOf('{') === 0;\n var depth = 0;\n while (match) {\n var isEndTag = !!match[1];\n var tagName = match[2];\n var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === \"![CDATA[\");\n if (!isSingletonTag &&\n (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\\s+/, '{').replace(/\\s+}$/, '}')))) {\n if (isEndTag) {\n --depth;\n } else {\n ++depth;\n }\n }\n xmlStr += match[0];\n if (depth <= 0) {\n break;\n }\n match = this._input.match(xmlRegExp);\n }\n // if we didn't close correctly, keep unformatted.\n if (!match) {\n xmlStr += this._input.match(/[\\s\\S]*/g)[0];\n }\n xmlStr = xmlStr.replace(acorn.allLineBreaks, '\\n');\n return this._create_token(TOKEN.STRING, xmlStr);\n }\n }\n\n return null;\n};\n\nfunction unescape_string(s) {\n // You think that a regex would work for this\n // return s.replace(/\\\\x([0-9a-f]{2})/gi, function(match, val) {\n // return String.fromCharCode(parseInt(val, 16));\n // })\n // However, dealing with '\\xff', '\\\\xff', '\\\\\\xff' makes this more fun.\n var out = '',\n escaped = 0;\n\n var input_scan = new InputScanner(s);\n var matched = null;\n\n while (input_scan.hasNext()) {\n // Keep any whitespace, non-slash characters\n // also keep slash pairs.\n matched = input_scan.match(/([\\s]|[^\\\\]|\\\\\\\\)+/g);\n\n if (matched) {\n out += matched[0];\n }\n\n if (input_scan.peek() === '\\\\') {\n input_scan.next();\n if (input_scan.peek() === 'x') {\n matched = input_scan.match(/x([0-9A-Fa-f]{2})/g);\n } else if (input_scan.peek() === 'u') {\n matched = input_scan.match(/u([0-9A-Fa-f]{4})/g);\n } else {\n out += '\\\\';\n if (input_scan.hasNext()) {\n out += input_scan.next();\n }\n continue;\n }\n\n // If there's some error decoding, return the original string\n if (!matched) {\n return s;\n }\n\n escaped = parseInt(matched[1], 16);\n\n if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) {\n // we bail out on \\x7f..\\xff,\n // leaving whole string escaped,\n // as it's probably completely binary\n return s;\n } else if (escaped >= 0x00 && escaped < 0x20) {\n // leave 0x00...0x1f escaped\n out += '\\\\' + matched[0];\n continue;\n } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) {\n // single-quote, apostrophe, backslash - escape these\n out += '\\\\' + String.fromCharCode(escaped);\n } else {\n out += String.fromCharCode(escaped);\n }\n }\n }\n\n return out;\n}\n\n// handle string\n//\nTokenizer.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) {\n // Template strings can travers lines without escape characters.\n // Other strings cannot\n var current_char;\n var resulting_string = '';\n var esc = false;\n while (this._input.hasNext()) {\n current_char = this._input.peek();\n if (!(esc || (current_char !== delimiter &&\n (allow_unescaped_newlines || !acorn.newline.test(current_char))))) {\n break;\n }\n\n // Handle \\r\\n linebreaks after escapes or in template strings\n if ((esc || allow_unescaped_newlines) && acorn.newline.test(current_char)) {\n if (current_char === '\\r' && this._input.peek(1) === '\\n') {\n this._input.next();\n current_char = this._input.peek();\n }\n resulting_string += '\\n';\n } else {\n resulting_string += current_char;\n }\n\n if (esc) {\n if (current_char === 'x' || current_char === 'u') {\n this.has_char_escapes = true;\n }\n esc = false;\n } else {\n esc = current_char === '\\\\';\n }\n\n this._input.next();\n\n if (start_sub && resulting_string.indexOf(start_sub, resulting_string.length - start_sub.length) !== -1) {\n if (delimiter === '`') {\n resulting_string += this._read_string_recursive('}', allow_unescaped_newlines, '`');\n } else {\n resulting_string += this._read_string_recursive('`', allow_unescaped_newlines, '${');\n }\n\n if (this._input.hasNext()) {\n resulting_string += this._input.next();\n }\n }\n }\n\n return resulting_string;\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;\nmodule.exports.positionable_operators = positionable_operators.slice();\nmodule.exports.line_starters = line_starters.slice();","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction InputScanner(input_string) {\n this.__input = input_string || '';\n this.__input_length = this.__input.length;\n this.__position = 0;\n}\n\nInputScanner.prototype.restart = function() {\n this.__position = 0;\n};\n\nInputScanner.prototype.back = function() {\n if (this.__position > 0) {\n this.__position -= 1;\n }\n};\n\nInputScanner.prototype.hasNext = function() {\n return this.__position < this.__input_length;\n};\n\nInputScanner.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__input.charAt(this.__position);\n this.__position += 1;\n }\n return val;\n};\n\nInputScanner.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__input_length) {\n val = this.__input.charAt(index);\n }\n return val;\n};\n\nInputScanner.prototype.test = function(pattern, index) {\n index = index || 0;\n index += this.__position;\n pattern.lastIndex = index;\n\n if (index >= 0 && index < this.__input_length) {\n var pattern_match = pattern.exec(this.__input);\n return pattern_match && pattern_match.index === index;\n } else {\n return false;\n }\n};\n\nInputScanner.prototype.testChar = function(pattern, index) {\n // test one character regex match\n var val = this.peek(index);\n return val !== null && pattern.test(val);\n};\n\nInputScanner.prototype.match = function(pattern) {\n pattern.lastIndex = this.__position;\n var pattern_match = pattern.exec(this.__input);\n if (pattern_match && pattern_match.index === this.__position) {\n this.__position += pattern_match[0].length;\n } else {\n pattern_match = null;\n }\n return pattern_match;\n};\n\nInputScanner.prototype.read = function(pattern) {\n var val = '';\n var match = this.match(pattern);\n if (match) {\n val = match[0];\n }\n return val;\n};\n\nInputScanner.prototype.readUntil = function(pattern, include_match) {\n var val = '';\n var match_index = this.__position;\n pattern.lastIndex = this.__position;\n var pattern_match = pattern.exec(this.__input);\n if (pattern_match) {\n if (include_match) {\n match_index = pattern_match.index + pattern_match[0].length;\n } else {\n match_index = pattern_match.index;\n }\n } else {\n match_index = this.__input_length;\n }\n\n val = this.__input.substring(this.__position, match_index);\n this.__position = match_index;\n return val;\n};\n\nInputScanner.prototype.readUntilAfter = function(pattern) {\n return this.readUntil(pattern, true);\n};\n\n/* css beautifier legacy helpers */\nInputScanner.prototype.peekUntilAfter = function(pattern) {\n var start = this.__position;\n var val = this.readUntilAfter(pattern);\n this.__position = start;\n return val;\n};\n\nInputScanner.prototype.lookBack = function(testVal) {\n var start = this.__position - 1;\n return start >= testVal.length && this.__input.substring(start - testVal.length, start)\n .toLowerCase() === testVal;\n};\n\n\nmodule.exports.InputScanner = InputScanner;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar Token = require('../core/token').Token;\nvar TokenStream = require('../core/tokenstream').TokenStream;\n\nvar TOKEN = {\n START: 'TK_START',\n RAW: 'TK_RAW',\n EOF: 'TK_EOF'\n};\n\nvar Tokenizer = function(input_string, options) {\n this._input = new InputScanner(input_string);\n this._options = options || {};\n this.__tokens = null;\n this.__newline_count = 0;\n this.__whitespace_before_token = '';\n\n this._whitespace_pattern = /[\\n\\r\\t ]+/g;\n this._newline_pattern = /([^\\n\\r]*)(\\r\\n|[\\n\\r])?/g;\n};\n\nTokenizer.prototype.tokenize = function() {\n this._input.restart();\n this.__tokens = new TokenStream();\n\n this._reset();\n\n var current;\n var previous = new Token(TOKEN.START, '');\n var open_token = null;\n var open_stack = [];\n var comments = new TokenStream();\n\n while (previous.type !== TOKEN.EOF) {\n current = this._get_next_token(previous, open_token);\n while (this._is_comment(current)) {\n comments.add(current);\n current = this._get_next_token(previous, open_token);\n }\n\n if (!comments.isEmpty()) {\n current.comments_before = comments;\n comments = new TokenStream();\n }\n\n current.parent = open_token;\n\n if (this._is_opening(current)) {\n open_stack.push(open_token);\n open_token = current;\n } else if (open_token && this._is_closing(current, open_token)) {\n current.opened = open_token;\n open_token.closed = current;\n open_token = open_stack.pop();\n current.parent = open_token;\n }\n\n current.previous = previous;\n previous.next = current;\n\n this.__tokens.add(current);\n previous = current;\n }\n\n return this.__tokens;\n};\n\n\nTokenizer.prototype._is_first_token = function() {\n return this.__tokens.isEmpty();\n};\n\nTokenizer.prototype._reset = function() {};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var resulting_string = this._input.read(/.+/g);\n if (resulting_string) {\n return this._create_token(TOKEN.RAW, resulting_string);\n } else {\n return this._create_token(TOKEN.EOF, '');\n }\n};\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_opening = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._create_token = function(type, text) {\n var token = new Token(type, text, this.__newline_count, this.__whitespace_before_token);\n this.__newline_count = 0;\n this.__whitespace_before_token = '';\n return token;\n};\n\nTokenizer.prototype._readWhitespace = function() {\n var resulting_string = this._input.read(this._whitespace_pattern);\n if (resulting_string === ' ') {\n this.__whitespace_before_token = resulting_string;\n } else if (resulting_string !== '') {\n this._newline_pattern.lastIndex = 0;\n var nextMatch = this._newline_pattern.exec(resulting_string);\n while (nextMatch[2]) {\n this.__newline_count += 1;\n nextMatch = this._newline_pattern.exec(resulting_string);\n }\n this.__whitespace_before_token = nextMatch[1];\n }\n};\n\n\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction TokenStream(parent_token) {\n // private\n this.__tokens = [];\n this.__tokens_length = this.__tokens.length;\n this.__position = 0;\n this.__parent_token = parent_token;\n}\n\nTokenStream.prototype.restart = function() {\n this.__position = 0;\n};\n\nTokenStream.prototype.isEmpty = function() {\n return this.__tokens_length === 0;\n};\n\nTokenStream.prototype.hasNext = function() {\n return this.__position < this.__tokens_length;\n};\n\nTokenStream.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__tokens[this.__position];\n this.__position += 1;\n }\n return val;\n};\n\nTokenStream.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__tokens_length) {\n val = this.__tokens[index];\n }\n return val;\n};\n\nTokenStream.prototype.add = function(token) {\n if (this.__parent_token) {\n token.parent = this.__parent_token;\n }\n this.__tokens.push(token);\n this.__tokens_length += 1;\n};\n\nmodule.exports.TokenStream = TokenStream;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Directives(start_block_pattern, end_block_pattern) {\n start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;\n end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;\n this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \\w+[:]\\w+)+ /.source + end_block_pattern, 'g');\n this.__directive_pattern = / (\\w+)[:](\\w+)/g;\n\n this.__directives_end_ignore_pattern = new RegExp('(?:[\\\\s\\\\S]*?)((?:' + start_block_pattern + /\\sbeautify\\signore:end\\s/.source + end_block_pattern + ')|$)', 'g');\n}\n\nDirectives.prototype.get_directives = function(text) {\n if (!text.match(this.__directives_block_pattern)) {\n return null;\n }\n\n var directives = {};\n this.__directive_pattern.lastIndex = 0;\n var directive_match = this.__directive_pattern.exec(text);\n\n while (directive_match) {\n directives[directive_match[1]] = directive_match[2];\n directive_match = this.__directive_pattern.exec(text);\n }\n\n return directives;\n};\n\nDirectives.prototype.readIgnored = function(input) {\n return input.read(this.__directives_end_ignore_pattern);\n};\n\n\nmodule.exports.Directives = Directives;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction css_beautify(source_text, options) {\n var beautifier = new Beautifier(source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = css_beautify;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('./options').Options;\nvar Output = require('../core/output').Output;\nvar InputScanner = require('../core/inputscanner').InputScanner;\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\n// tokenizer\nvar whitespaceChar = /\\s/;\nvar whitespacePattern = /(?:\\s|\\n)+/g;\nvar block_comment_pattern = /\\/\\*(?:[\\s\\S]*?)((?:\\*\\/)|$)/g;\nvar comment_pattern = /\\/\\/(?:[^\\n\\r\\u2028\\u2029]*)/g;\n\nfunction Beautifier(source_text, options) {\n this._source_text = source_text || '';\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n this._options = new Options(options);\n this._ch = null;\n this._input = null;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule\n this.NESTED_AT_RULE = {\n \"@page\": true,\n \"@font-face\": true,\n \"@keyframes\": true,\n // also in CONDITIONAL_GROUP_RULE below\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n this.CONDITIONAL_GROUP_RULE = {\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n\n}\n\nBeautifier.prototype.eatString = function(endChars) {\n var result = '';\n this._ch = this._input.next();\n while (this._ch) {\n result += this._ch;\n if (this._ch === \"\\\\\") {\n result += this._input.next();\n } else if (endChars.indexOf(this._ch) !== -1 || this._ch === \"\\n\") {\n break;\n }\n this._ch = this._input.next();\n }\n return result;\n};\n\n// Skips any white space in the source text from the current position.\n// When allowAtLeastOneNewLine is true, will output new lines for each\n// newline character found; if the user has preserve_newlines off, only\n// the first newline will be output\nBeautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {\n var result = whitespaceChar.test(this._input.peek());\n var isFirstNewLine = true;\n\n while (whitespaceChar.test(this._input.peek())) {\n this._ch = this._input.next();\n if (allowAtLeastOneNewLine && this._ch === '\\n') {\n if (this._options.preserve_newlines || isFirstNewLine) {\n isFirstNewLine = false;\n this._output.add_new_line(true);\n }\n }\n }\n return result;\n};\n\n// Nested pseudo-class if we are insideRule\n// and the next special character found opens\n// a new block\nBeautifier.prototype.foundNestedPseudoClass = function() {\n var openParen = 0;\n var i = 1;\n var ch = this._input.peek(i);\n while (ch) {\n if (ch === \"{\") {\n return true;\n } else if (ch === '(') {\n // pseudoclasses can contain ()\n openParen += 1;\n } else if (ch === ')') {\n if (openParen === 0) {\n return false;\n }\n openParen -= 1;\n } else if (ch === \";\" || ch === \"}\") {\n return false;\n }\n i++;\n ch = this._input.peek(i);\n }\n return false;\n};\n\nBeautifier.prototype.print_string = function(output_string) {\n if (this._output.just_added_newline()) {\n this._output.set_indent(this._indentLevel);\n }\n this._output.add_token(output_string);\n};\n\nBeautifier.prototype.preserveSingleSpace = function(isAfterSpace) {\n if (isAfterSpace) {\n this._output.space_before_token = true;\n }\n};\n\nBeautifier.prototype.indent = function() {\n this._indentLevel++;\n};\n\nBeautifier.prototype.outdent = function() {\n if (this._indentLevel > 0) {\n this._indentLevel--;\n }\n};\n\n/*_____________________--------------------_____________________*/\n\nBeautifier.prototype.beautify = function() {\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text || '')) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n\n // HACK: newline parsing inconsistent. This brute force normalizes the this._input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n\n // reset\n var baseIndentString = source_text.match(/^[\\t ]*/)[0];\n\n this._output = new Output(this._options, baseIndentString);\n this._input = new InputScanner(source_text);\n this._indentLevel = 0;\n this._nestedLevel = 0;\n\n this._ch = null;\n var parenLevel = 0;\n\n var insideRule = false;\n // This is the value side of a property value pair (blue in the following ex)\n // label { content: blue }\n var insidePropertyValue = false;\n var enteringConditionalGroup = false;\n var insideAtExtend = false;\n var insideAtImport = false;\n var topCharacter = this._ch;\n\n while (true) {\n var whitespace = this._input.read(whitespacePattern);\n var isAfterSpace = whitespace !== '';\n var previous_ch = topCharacter;\n this._ch = this._input.next();\n topCharacter = this._ch;\n\n if (!this._ch) {\n break;\n } else if (this._ch === '/' && this._input.peek() === '*') {\n // /* css comment */\n // Always start block comments on a new line.\n // This handles scenarios where a block comment immediately\n // follows a property definition on the same line or where\n // minified code is being beautified.\n this._output.add_new_line();\n this._input.back();\n this.print_string(this._input.read(block_comment_pattern));\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n\n // Block comments are followed by a new line so they don't\n // share a line with other properties\n this._output.add_new_line();\n } else if (this._ch === '/' && this._input.peek() === '/') {\n // // single line comment\n // Preserves the space before a comment\n // on the same line as a rule\n this._output.space_before_token = true;\n this._input.back();\n this.print_string(this._input.read(comment_pattern));\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n } else if (this._ch === '@') {\n this.preserveSingleSpace(isAfterSpace);\n\n // deal with less propery mixins @{...}\n if (this._input.peek() === '{') {\n this.print_string(this._ch + this.eatString('}'));\n } else {\n this.print_string(this._ch);\n\n // strip trailing space, if present, for hash property checks\n var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\\]\\/='\"]/g);\n\n if (variableOrRule.match(/[ :]$/)) {\n // we have a variable or pseudo-class, add it and insert one space before continuing\n variableOrRule = this.eatString(\": \").replace(/\\s$/, '');\n this.print_string(variableOrRule);\n this._output.space_before_token = true;\n }\n\n variableOrRule = variableOrRule.replace(/\\s$/, '');\n\n if (variableOrRule === 'extend') {\n insideAtExtend = true;\n } else if (variableOrRule === 'import') {\n insideAtImport = true;\n }\n\n // might be a nesting at-rule\n if (variableOrRule in this.NESTED_AT_RULE) {\n this._nestedLevel += 1;\n if (variableOrRule in this.CONDITIONAL_GROUP_RULE) {\n enteringConditionalGroup = true;\n }\n // might be less variable\n } else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) {\n insidePropertyValue = true;\n this.indent();\n }\n }\n } else if (this._ch === '#' && this._input.peek() === '{') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch + this.eatString('}'));\n } else if (this._ch === '{') {\n if (insidePropertyValue) {\n insidePropertyValue = false;\n this.outdent();\n }\n this.indent();\n this._output.space_before_token = true;\n this.print_string(this._ch);\n\n // when entering conditional groups, only rulesets are allowed\n if (enteringConditionalGroup) {\n enteringConditionalGroup = false;\n insideRule = (this._indentLevel > this._nestedLevel);\n } else {\n // otherwise, declarations are also allowed\n insideRule = (this._indentLevel >= this._nestedLevel);\n }\n if (this._options.newline_between_rules && insideRule) {\n if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') {\n this._output.ensure_empty_line_above('/', ',');\n }\n }\n this.eatWhitespace(true);\n this._output.add_new_line();\n } else if (this._ch === '}') {\n this.outdent();\n this._output.add_new_line();\n if (previous_ch === '{') {\n this._output.trim(true);\n }\n insideAtImport = false;\n insideAtExtend = false;\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n this.print_string(this._ch);\n insideRule = false;\n if (this._nestedLevel) {\n this._nestedLevel--;\n }\n\n this.eatWhitespace(true);\n this._output.add_new_line();\n\n if (this._options.newline_between_rules && !this._output.just_added_blankline()) {\n if (this._input.peek() !== '}') {\n this._output.add_new_line(true);\n }\n }\n } else if (this._ch === \":\") {\n if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack(\"&\") || this.foundNestedPseudoClass()) && !this._input.lookBack(\"(\") && !insideAtExtend) {\n // 'property: value' delimiter\n // which could be in a conditional group query\n this.print_string(':');\n if (!insidePropertyValue) {\n insidePropertyValue = true;\n this._output.space_before_token = true;\n this.eatWhitespace(true);\n this.indent();\n }\n } else {\n // sass/less parent reference don't use a space\n // sass nested pseudo-class don't use a space\n\n // preserve space before pseudoclasses/pseudoelements, as it means \"in any child\"\n if (this._input.lookBack(\" \")) {\n this._output.space_before_token = true;\n }\n if (this._input.peek() === \":\") {\n // pseudo-element\n this._ch = this._input.next();\n this.print_string(\"::\");\n } else {\n // pseudo-class\n this.print_string(':');\n }\n }\n } else if (this._ch === '\"' || this._ch === '\\'') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch + this.eatString(this._ch));\n this.eatWhitespace(true);\n } else if (this._ch === ';') {\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n insideAtExtend = false;\n insideAtImport = false;\n this.print_string(this._ch);\n this.eatWhitespace(true);\n\n // This maintains single line comments on the same\n // line. Block comments are also affected, but\n // a new line is always output before one inside\n // that section\n if (this._input.peek() !== '/') {\n this._output.add_new_line();\n }\n } else if (this._ch === '(') { // may be a url\n if (this._input.lookBack(\"url\")) {\n this.print_string(this._ch);\n this.eatWhitespace();\n this._ch = this._input.next();\n if (this._ch === ')' || this._ch === '\"' || this._ch !== '\\'') {\n this._input.back();\n parenLevel++;\n } else if (this._ch) {\n this.print_string(this._ch + this.eatString(')'));\n }\n } else {\n parenLevel++;\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n this.eatWhitespace();\n }\n } else if (this._ch === ')') {\n this.print_string(this._ch);\n parenLevel--;\n } else if (this._ch === ',') {\n this.print_string(this._ch);\n this.eatWhitespace(true);\n if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel < 1 && !insideAtImport) {\n this._output.add_new_line();\n } else {\n this._output.space_before_token = true;\n }\n } else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel < 1) {\n //handle combinator spacing\n if (this._options.space_around_combinator) {\n this._output.space_before_token = true;\n this.print_string(this._ch);\n this._output.space_before_token = true;\n } else {\n this.print_string(this._ch);\n this.eatWhitespace();\n // squash extra whitespace\n if (this._ch && whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n }\n } else if (this._ch === ']') {\n this.print_string(this._ch);\n } else if (this._ch === '[') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n } else if (this._ch === '=') { // no whitespace before or after\n this.eatWhitespace();\n this.print_string('=');\n if (whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n } else if (this._ch === '!') { // !important\n this.print_string(' ');\n this.print_string(this._ch);\n } else {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n }\n }\n\n var sweetCode = this._output.get_code(eol);\n\n return sweetCode;\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'css');\n\n this.selector_separator_newline = this._get_boolean('selector_separator_newline', true);\n this.newline_between_rules = this._get_boolean('newline_between_rules', true);\n var space_around_selector_separator = this._get_boolean('space_around_selector_separator');\n this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator;\n\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction style_html(html_source, options, js_beautify, css_beautify) {\n var beautifier = new Beautifier(html_source, options, js_beautify, css_beautify);\n return beautifier.beautify();\n}\n\nmodule.exports = style_html;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('../html/options').Options;\nvar Output = require('../core/output').Output;\nvar Tokenizer = require('../html/tokenizer').Tokenizer;\nvar TOKEN = require('../html/tokenizer').TOKEN;\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\nvar Printer = function(options, base_indent_string) { //handles input/output and some other printing functions\n\n this.indent_level = 0;\n this.alignment_size = 0;\n this.wrap_line_length = options.wrap_line_length;\n this.max_preserve_newlines = options.max_preserve_newlines;\n this.preserve_newlines = options.preserve_newlines;\n\n this._output = new Output(options, base_indent_string);\n\n};\n\nPrinter.prototype.current_line_has_match = function(pattern) {\n return this._output.current_line.has_match(pattern);\n};\n\nPrinter.prototype.set_space_before_token = function(value) {\n this._output.space_before_token = value;\n};\n\nPrinter.prototype.add_raw_token = function(token) {\n this._output.add_raw_token(token);\n};\n\nPrinter.prototype.traverse_whitespace = function(raw_token) {\n if (raw_token.whitespace_before || raw_token.newlines) {\n var newlines = 0;\n\n if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) {\n newlines = raw_token.newlines ? 1 : 0;\n }\n\n if (this.preserve_newlines) {\n newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1;\n }\n\n if (newlines) {\n for (var n = 0; n < newlines; n++) {\n this.print_newline(n > 0);\n }\n } else {\n this._output.space_before_token = true;\n this.print_space_or_wrap(raw_token.text);\n }\n return true;\n }\n return false;\n};\n\n// Append a space to the given content (string array) or, if we are\n// at the wrap_line_length, append a newline/indentation.\n// return true if a newline was added, false if a space was added\nPrinter.prototype.print_space_or_wrap = function(text) {\n if (this.wrap_line_length) {\n if (this._output.current_line.get_character_count() + text.length + 1 >= this.wrap_line_length) { //insert a line when the wrap_line_length is reached\n return this._output.add_new_line();\n }\n }\n return false;\n};\n\nPrinter.prototype.print_newline = function(force) {\n this._output.add_new_line(force);\n};\n\nPrinter.prototype.print_token = function(text) {\n if (text) {\n if (this._output.current_line.is_empty()) {\n this._output.set_indent(this.indent_level, this.alignment_size);\n }\n\n this._output.add_token(text);\n }\n};\n\nPrinter.prototype.print_raw_text = function(text) {\n this._output.current_line.push_raw(text);\n};\n\nPrinter.prototype.indent = function() {\n this.indent_level++;\n};\n\nPrinter.prototype.unindent = function() {\n if (this.indent_level > 0) {\n this.indent_level--;\n }\n};\n\nPrinter.prototype.get_full_indent = function(level) {\n level = this.indent_level + (level || 0);\n if (level < 1) {\n return '';\n }\n\n return this._output.get_indent_string(level);\n};\n\n\nvar uses_beautifier = function(tag_check, start_token) {\n var raw_token = start_token.next;\n if (!start_token.closed) {\n return false;\n }\n\n while (raw_token.type !== TOKEN.EOF && raw_token.closed !== start_token) {\n if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === 'type') {\n // For script and style tags that have a type attribute, only enable custom beautifiers for matching values\n var peekEquals = raw_token.next ? raw_token.next : raw_token;\n var peekValue = peekEquals.next ? peekEquals.next : peekEquals;\n if (peekEquals.type === TOKEN.EQUALS && peekValue.type === TOKEN.VALUE) {\n return (tag_check === 'style' && peekValue.text.search('text/css') > -1) ||\n (tag_check === 'script' && peekValue.text.search(/(text|application|dojo)\\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\\+)?json|method|aspect)/) > -1);\n }\n return false;\n }\n raw_token = raw_token.next;\n }\n\n return true;\n};\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction TagFrame(parent, parser_token, indent_level) {\n this.parent = parent || null;\n this.tag = parser_token ? parser_token.tag_name : '';\n this.indent_level = indent_level || 0;\n this.parser_token = parser_token || null;\n}\n\nfunction TagStack(printer) {\n this._printer = printer;\n this._current_frame = null;\n}\n\nTagStack.prototype.get_parser_token = function() {\n return this._current_frame ? this._current_frame.parser_token : null;\n};\n\nTagStack.prototype.record_tag = function(parser_token) { //function to record a tag and its parent in this.tags Object\n var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);\n this._current_frame = new_frame;\n};\n\nTagStack.prototype._try_pop_frame = function(frame) { //function to retrieve the opening tag to the corresponding closer\n var parser_token = null;\n\n if (frame) {\n parser_token = frame.parser_token;\n this._printer.indent_level = frame.indent_level;\n this._current_frame = frame.parent;\n }\n\n return parser_token;\n};\n\nTagStack.prototype._get_frame = function(tag_list, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._current_frame;\n\n while (frame) { //till we reach '' (the initial value);\n if (tag_list.indexOf(frame.tag) !== -1) { //if this is it use it\n break;\n } else if (stop_list && stop_list.indexOf(frame.tag) !== -1) {\n frame = null;\n break;\n }\n frame = frame.parent;\n }\n\n return frame;\n};\n\nTagStack.prototype.try_pop = function(tag, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._get_frame([tag], stop_list);\n return this._try_pop_frame(frame);\n};\n\nTagStack.prototype.indent_to_tag = function(tag_list) {\n var frame = this._get_frame(tag_list);\n if (frame) {\n this._printer.indent_level = frame.indent_level;\n }\n};\n\nfunction Beautifier(source_text, options, js_beautify, css_beautify) {\n //Wrapper function to invoke all the necessary constructors and deal with the output.\n this._source_text = source_text || '';\n options = options || {};\n this._js_beautify = js_beautify;\n this._css_beautify = css_beautify;\n this._tag_stack = null;\n\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n var optionHtml = new Options(options, 'html');\n\n this._options = optionHtml;\n\n this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 'force'.length) === 'force';\n this._is_wrap_attributes_force_expand_multiline = (this._options.wrap_attributes === 'force-expand-multiline');\n this._is_wrap_attributes_force_aligned = (this._options.wrap_attributes === 'force-aligned');\n this._is_wrap_attributes_aligned_multiple = (this._options.wrap_attributes === 'aligned-multiple');\n}\n\nBeautifier.prototype.beautify = function() {\n\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text)) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n // HACK: newline parsing inconsistent. This brute force normalizes the input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n var baseIndentString = '';\n\n // Including commented out text would change existing html beautifier behavior to autodetect base indent.\n // baseIndentString = source_text.match(/^[\\t ]*/)[0];\n\n var last_token = {\n text: '',\n type: ''\n };\n\n var last_tag_token = new TagOpenParserToken();\n\n var printer = new Printer(this._options, baseIndentString);\n var tokens = new Tokenizer(source_text, this._options).tokenize();\n\n this._tag_stack = new TagStack(printer);\n\n var parser_token = null;\n var raw_token = tokens.next();\n while (raw_token.type !== TOKEN.EOF) {\n\n if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) {\n parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token);\n last_tag_token = parser_token;\n } else if ((raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE) ||\n (raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete)) {\n parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, tokens);\n } else if (raw_token.type === TOKEN.TAG_CLOSE) {\n parser_token = this._handle_tag_close(printer, raw_token, last_tag_token);\n } else if (raw_token.type === TOKEN.TEXT) {\n parser_token = this._handle_text(printer, raw_token, last_tag_token);\n } else {\n // This should never happen, but if it does. Print the raw token\n printer.add_raw_token(raw_token);\n }\n\n last_token = parser_token;\n\n raw_token = tokens.next();\n }\n var sweet_code = printer._output.get_code(eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) {\n var parser_token = { text: raw_token.text, type: raw_token.type };\n printer.alignment_size = 0;\n last_tag_token.tag_complete = true;\n\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '');\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n if (last_tag_token.tag_start_char === '<') {\n printer.set_space_before_token(raw_token.text[0] === '/'); // space before />, no space before >\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) {\n printer.print_newline(false);\n }\n }\n printer.print_token(raw_token.text);\n }\n\n if (last_tag_token.indent_content &&\n !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {\n printer.indent();\n\n // only indent once per opened tag\n last_tag_token.indent_content = false;\n }\n return parser_token;\n};\n\nBeautifier.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, tokens) {\n var parser_token = { text: raw_token.text, type: raw_token.type };\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '');\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n if (last_tag_token.tag_start_char === '<') {\n if (raw_token.type === TOKEN.ATTRIBUTE) {\n printer.set_space_before_token(true);\n last_tag_token.attr_count += 1;\n } else if (raw_token.type === TOKEN.EQUALS) { //no space before =\n printer.set_space_before_token(false);\n } else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) { //no space before value\n printer.set_space_before_token(false);\n }\n }\n\n if (printer._output.space_before_token && last_tag_token.tag_start_char === '<') {\n var wrapped = printer.print_space_or_wrap(raw_token.text);\n if (raw_token.type === TOKEN.ATTRIBUTE) {\n var indentAttrs = wrapped && !this._is_wrap_attributes_force;\n\n if (this._is_wrap_attributes_force) {\n var force_first_attr_wrap = false;\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.attr_count === 1) {\n var is_only_attribute = true;\n var peek_index = 0;\n var peek_token;\n do {\n peek_token = tokens.peek(peek_index);\n if (peek_token.type === TOKEN.ATTRIBUTE) {\n is_only_attribute = false;\n break;\n }\n peek_index += 1;\n } while (peek_index < 4 && peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE);\n\n force_first_attr_wrap = !is_only_attribute;\n }\n\n if (last_tag_token.attr_count > 1 || force_first_attr_wrap) {\n printer.print_newline(false);\n indentAttrs = true;\n }\n }\n if (indentAttrs) {\n last_tag_token.has_wrapped_attrs = true;\n }\n }\n }\n printer.print_token(raw_token.text);\n }\n return parser_token;\n};\n\nBeautifier.prototype._handle_text = function(printer, raw_token, last_tag_token) {\n var parser_token = { text: raw_token.text, type: 'TK_CONTENT' };\n if (last_tag_token.custom_beautifier) { //check if we need to format javascript\n this._print_custom_beatifier_text(printer, raw_token, last_tag_token);\n } else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n printer.traverse_whitespace(raw_token);\n printer.print_token(raw_token.text);\n }\n return parser_token;\n};\n\nBeautifier.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) {\n if (raw_token.text !== '') {\n printer.print_newline(false);\n var text = raw_token.text,\n _beautifier,\n script_indent_level = 1;\n if (last_tag_token.tag_name === 'script') {\n _beautifier = typeof this._js_beautify === 'function' && this._js_beautify;\n } else if (last_tag_token.tag_name === 'style') {\n _beautifier = typeof this._css_beautify === 'function' && this._css_beautify;\n }\n\n if (this._options.indent_scripts === \"keep\") {\n script_indent_level = 0;\n } else if (this._options.indent_scripts === \"separate\") {\n script_indent_level = -printer.indent_level;\n }\n\n var indentation = printer.get_full_indent(script_indent_level);\n\n // if there is at least one empty line at the end of this text, strip it\n // we'll be adding one back after the text but before the containing tag.\n text = text.replace(/\\n[ \\t]*$/, '');\n\n if (_beautifier) {\n\n // call the Beautifier if avaliable\n var Child_options = function() {\n this.eol = '\\n';\n };\n Child_options.prototype = this._options.raw_options;\n var child_options = new Child_options();\n text = _beautifier(indentation + text, child_options);\n } else {\n // simply indent the string otherwise\n var white = text.match(/^\\s*/)[0];\n var _level = white.match(/[^\\n\\r]*$/)[0].split(this._options.indent_string).length - 1;\n var reindent = this._get_full_indent(script_indent_level - _level);\n text = (indentation + text.trim())\n .replace(/\\r\\n|\\r|\\n/g, '\\n' + reindent);\n }\n if (text) {\n printer.print_raw_text(text);\n printer.print_newline(true);\n }\n }\n};\n\nBeautifier.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token) {\n var parser_token = this._get_tag_open_token(raw_token);\n printer.traverse_whitespace(raw_token);\n\n this._set_tag_position(printer, raw_token, parser_token, last_tag_token, last_token);\n\n\n if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) &&\n raw_token.type === TOKEN.TAG_OPEN && raw_token.text.indexOf(']*)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n } else {\n tag_check_match = raw_token.text.match(/^{{\\#?([^\\s}]+)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n }\n this.tag_check = this.tag_check.toLowerCase();\n\n if (raw_token.type === TOKEN.COMMENT) {\n this.tag_complete = true;\n }\n\n this.is_start_tag = this.tag_check.charAt(0) !== '/';\n this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check;\n this.is_end_tag = !this.is_start_tag ||\n (raw_token.closed && raw_token.closed.text === '/>');\n\n // handlebars tags that don't start with # or ^ are single_tags, and so also start and end.\n this.is_end_tag = this.is_end_tag ||\n (this.tag_start_char === '{' && (this.text.length < 3 || (/[^#\\^]/.test(this.text.charAt(2)))));\n }\n};\n\nBeautifier.prototype._get_tag_open_token = function(raw_token) { //function to get a full tag and parse its type\n var parser_token = new TagOpenParserToken(this._tag_stack.get_parser_token(), raw_token);\n\n parser_token.alignment_size = this._options.wrap_attributes_indent_size;\n\n parser_token.is_end_tag = parser_token.is_end_tag ||\n in_array(parser_token.tag_check, this._options.void_elements);\n\n parser_token.is_empty_element = parser_token.tag_complete ||\n (parser_token.is_start_tag && parser_token.is_end_tag);\n\n parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted);\n parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted);\n parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_start_char === '{';\n\n return parser_token;\n};\n\nBeautifier.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) {\n\n if (!parser_token.is_empty_element) {\n if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name); //remove it and all ancestors\n } else { // it's a start-tag\n // check if this tag is starting an element that has optional end element\n // and do an ending needed\n this._do_optional_end_element(parser_token);\n\n this._tag_stack.record_tag(parser_token); //push it on the tag stack\n\n if ((parser_token.tag_name === 'script' || parser_token.tag_name === 'style') &&\n !(parser_token.is_unformatted || parser_token.is_content_unformatted)) {\n parser_token.custom_beautifier = uses_beautifier(parser_token.tag_check, raw_token);\n }\n }\n }\n\n if (in_array(parser_token.tag_check, this._options.extra_liners)) { //check if this double needs an extra line\n printer.print_newline(false);\n if (!printer._output.just_added_blankline()) {\n printer.print_newline(true);\n }\n }\n\n if (parser_token.is_empty_element) { //if this tag name is a single tag type (either in the list or has a closing /)\n\n // if you hit an else case, reset the indent level if you are inside an:\n // 'if', 'unless', or 'each' block.\n if (parser_token.tag_start_char === '{' && parser_token.tag_check === 'else') {\n this._tag_stack.indent_to_tag(['if', 'unless', 'each']);\n parser_token.indent_content = true;\n // Don't add a newline if opening {{#if}} tag is on the current line\n var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/);\n if (!foundIfOnCurrentLine) {\n printer.print_newline(false);\n }\n }\n\n // Don't add a newline before elements that should remain where they are.\n if (parser_token.tag_name === '!--' && last_token.type === TOKEN.TAG_CLOSE &&\n last_tag_token.is_end_tag && parser_token.text.indexOf('\\n') === -1) {\n //Do nothing. Leave comments on same line.\n } else if (!parser_token.is_inline_element && !parser_token.is_unformatted) {\n printer.print_newline(false);\n }\n } else if (parser_token.is_unformatted || parser_token.is_content_unformatted) {\n if (!parser_token.is_inline_element && !parser_token.is_unformatted) {\n printer.print_newline(false);\n }\n } else if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n if ((parser_token.start_tag_token && parser_token.start_tag_token.multiline_content) ||\n !(parser_token.is_inline_element ||\n (last_tag_token.is_inline_element) ||\n (last_token.type === TOKEN.TAG_CLOSE &&\n parser_token.start_tag_token === last_tag_token) ||\n (last_token.type === 'TK_CONTENT')\n )) {\n printer.print_newline(false);\n }\n } else { // it's a start-tag\n parser_token.indent_content = !parser_token.custom_beautifier;\n\n if (parser_token.tag_start_char === '<') {\n if (parser_token.tag_name === 'html') {\n parser_token.indent_content = this._options.indent_inner_html;\n } else if (parser_token.tag_name === 'head') {\n parser_token.indent_content = this._options.indent_head_inner_html;\n } else if (parser_token.tag_name === 'body') {\n parser_token.indent_content = this._options.indent_body_inner_html;\n }\n }\n\n if (!parser_token.is_inline_element && last_token.type !== 'TK_CONTENT') {\n if (parser_token.parent) {\n parser_token.parent.multiline_content = true;\n }\n printer.print_newline(false);\n }\n }\n};\n\n//To be used for

tag special case:\n//var p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'];\n\nBeautifier.prototype._do_optional_end_element = function(parser_token) {\n // NOTE: cases of \"if there is no more content in the parent element\"\n // are handled automatically by the beautifier.\n // It assumes parent or ancestor close tag closes all children.\n // https://www.w3.org/TR/html5/syntax.html#optional-tags\n if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) {\n return;\n\n } else if (parser_token.tag_name === 'body') {\n // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment.\n this._tag_stack.try_pop('head');\n\n //} else if (parser_token.tag_name === 'body') {\n // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment.\n\n } else if (parser_token.tag_name === 'li') {\n // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.\n this._tag_stack.try_pop('li', ['ol', 'ul']);\n\n } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') {\n // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element.\n // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element.\n this._tag_stack.try_pop('dt', ['dl']);\n this._tag_stack.try_pop('dd', ['dl']);\n\n //} else if (p_closers.indexOf(parser_token.tag_name) !== -1) {\n //TODO: THIS IS A BUG FARM. We are not putting this into 1.8.0 as it is likely to blow up.\n //A p element’s end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, details, div, dl, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hr, main, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is an HTML element that is not an a, audio, del, ins, map, noscript, or video element, or an autonomous custom element.\n //this._tag_stack.try_pop('p', ['body']);\n\n } else if (parser_token.tag_name === 'rp' || parser_token.tag_name === 'rt') {\n // An rt element’s end tag may be omitted if the rt element is immediately followed by an rt or rp element, or if there is no more content in the parent element.\n // An rp element’s end tag may be omitted if the rp element is immediately followed by an rt or rp element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('rt', ['ruby', 'rtc']);\n this._tag_stack.try_pop('rp', ['ruby', 'rtc']);\n\n } else if (parser_token.tag_name === 'optgroup') {\n // An optgroup element’s end tag may be omitted if the optgroup element is immediately followed by another optgroup element, or if there is no more content in the parent element.\n // An option element’s end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('optgroup', ['select']);\n //this._tag_stack.try_pop('option', ['select']);\n\n } else if (parser_token.tag_name === 'option') {\n // An option element’s end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('option', ['select', 'datalist', 'optgroup']);\n\n } else if (parser_token.tag_name === 'colgroup') {\n // DONE: A colgroup element’s end tag may be omitted if the colgroup element is not immediately followed by a space character or a comment.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n\n } else if (parser_token.tag_name === 'thead') {\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n\n //} else if (parser_token.tag_name === 'caption') {\n // DONE: A caption element’s end tag may be omitted if the caption element is not immediately followed by a space character or a comment.\n\n } else if (parser_token.tag_name === 'tbody' || parser_token.tag_name === 'tfoot') {\n // A thead element’s end tag may be omitted if the thead element is immediately followed by a tbody or tfoot element.\n // A tbody element’s end tag may be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element.\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n this._tag_stack.try_pop('thead', ['table']);\n this._tag_stack.try_pop('tbody', ['table']);\n\n //} else if (parser_token.tag_name === 'tfoot') {\n // DONE: A tfoot element’s end tag may be omitted if there is no more content in the parent element.\n\n } else if (parser_token.tag_name === 'tr') {\n // A tr element’s end tag may be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element.\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n this._tag_stack.try_pop('tr', ['table', 'thead', 'tbody', 'tfoot']);\n\n } else if (parser_token.tag_name === 'th' || parser_token.tag_name === 'td') {\n // A td element’s end tag may be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element.\n // A th element’s end tag may be omitted if the th element is immediately followed by a td or th element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('td', ['tr']);\n this._tag_stack.try_pop('th', ['tr']);\n }\n\n // Start element omission not handled currently\n // A head element’s start tag may be omitted if the element is empty, or if the first thing inside the head element is an element.\n // A tbody element’s start tag may be omitted if the first thing inside the tbody element is a tr element, and if the element is not immediately preceded by a tbody, thead, or tfoot element whose end tag has been omitted. (It can’t be omitted if the element is empty.)\n // A colgroup element’s start tag may be omitted if the first thing inside the colgroup element is a col element, and if the element is not immediately preceded by another colgroup element whose end tag has been omitted. (It can’t be omitted if the element is empty.)\n\n // Fix up the parent of the parser token\n parser_token.parent = this._tag_stack.get_parser_token();\n\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'html');\n\n this.indent_inner_html = this._get_boolean('indent_inner_html');\n this.indent_body_inner_html = this._get_boolean('indent_body_inner_html', true);\n this.indent_head_inner_html = this._get_boolean('indent_head_inner_html', true);\n\n this.indent_handlebars = this._get_boolean('indent_handlebars', true);\n this.wrap_attributes = this._get_selection('wrap_attributes',\n ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple']);\n this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size);\n this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']);\n\n this.inline = this._get_array('inline', [\n // https://www.w3.org/TR/html5/dom.html#phrasing-content\n 'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite',\n 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img',\n 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript',\n 'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small',\n 'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var',\n 'video', 'wbr', 'text',\n // prexisting - not sure of full effect of removing, leaving in\n 'acronym', 'address', 'big', 'dt', 'ins', 'strike', 'tt'\n ]);\n this.void_elements = this._get_array('void_elements', [\n // HTLM void elements - aka self-closing tags - aka singletons\n // https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',\n 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr',\n // NOTE: Optional tags are too complex for a simple list\n // they are hard coded in _do_optional_end_element\n\n // Doctype and xml elements\n '!doctype', '?xml',\n // ?php and ?= tags\n '?php', '?=',\n // other tags that were in this list, keeping just in case\n 'basefont', 'isindex'\n ]);\n this.unformatted = this._get_array('unformatted', []);\n this.content_unformatted = this._get_array('content_unformatted', [\n 'pre', 'textarea'\n ]);\n this.indent_scripts = this._get_selection('indent_scripts', ['normal', 'keep', 'separate']);\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\n\nvar TOKEN = {\n TAG_OPEN: 'TK_TAG_OPEN',\n TAG_CLOSE: 'TK_TAG_CLOSE',\n ATTRIBUTE: 'TK_ATTRIBUTE',\n EQUALS: 'TK_EQUALS',\n VALUE: 'TK_VALUE',\n COMMENT: 'TK_COMMENT',\n TEXT: 'TK_TEXT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\nvar directives_core = new Directives(/<\\!--/, /-->/);\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n this._current_tag_name = '';\n\n // Words end at whitespace or when a tag starts\n // if we are indenting handlebars, they are considered tags\n this._word_pattern = this._options.indent_handlebars ? /[\\n\\r\\t <]|{{/g : /[\\n\\r\\t <]/g;\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false; //current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.TAG_OPEN;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return current_token.type === TOKEN.TAG_CLOSE &&\n (open_token && (\n ((current_token.text === '>' || current_token.text === '/>') && open_token.text[0] === '<') ||\n (current_token.text === '}}' && open_token.text[0] === '{' && open_token.text[1] === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n this._current_tag_name = '';\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var token = null;\n var c = this._input.peek();\n\n if (c === null) {\n return this._create_token(TOKEN.EOF, '');\n }\n\n token = token || this._read_attribute(c, previous_token, open_token);\n token = token || this._read_raw_content(previous_token, open_token);\n token = token || this._read_comment(c);\n token = token || this._read_open(c, open_token);\n token = token || this._read_close(c, open_token);\n token = token || this._read_content_word();\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_comment = function(c) { // jshint unused:false\n var token = null;\n if (c === '<' || c === '{') {\n var peek1 = this._input.peek(1);\n var peek2 = this._input.peek(2);\n if ((c === '<' && (peek1 === '!' || peek1 === '?' || peek1 === '%')) ||\n this._options.indent_handlebars && c === '{' && peek1 === '{' && peek2 === '!') {\n //if we're in a comment, do something special\n // We treat all comments as literals, even more than preformatted tags\n // we just look for the appropriate close tag\n\n // this is will have very poor perf, but will work for now.\n var comment = '',\n delimiter = '>',\n matched = false;\n\n var input_char = this._input.next();\n\n while (input_char) {\n comment += input_char;\n\n // only need to check for the delimiter if the last chars match\n if (comment.charAt(comment.length - 1) === delimiter.charAt(delimiter.length - 1) &&\n comment.indexOf(delimiter) !== -1) {\n break;\n }\n\n // only need to search for custom delimiter for the first few characters\n if (!matched) {\n matched = comment.length > 10;\n if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('{{!--') === 0) { // {{!-- handlebars comment\n delimiter = '--}}';\n matched = true;\n } else if (comment.indexOf('{{!') === 0) { // {{! handlebars comment\n if (comment.length === 5 && comment.indexOf('{{!--') === -1) {\n delimiter = '}}';\n matched = true;\n }\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('<%') === 0) { // {{! handlebars comment\n delimiter = '%>';\n matched = true;\n }\n }\n\n input_char = this._input.next();\n }\n\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n token = this._create_token(TOKEN.COMMENT, comment);\n token.directives = directives;\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_open = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (!open_token) {\n if (c === '<') {\n resulting_string = this._input.read(/<(?:[^\\n\\r\\t >{][^\\n\\r\\t >{/]*)?/g);\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n } else if (this._options.indent_handlebars && c === '{' && this._input.peek(1) === '{') {\n resulting_string = this._input.readUntil(/[\\n\\r\\t }]/g);\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_close = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (open_token) {\n if (open_token.text[0] === '<' && (c === '>' || (c === '/' && this._input.peek(1) === '>'))) {\n resulting_string = this._input.next();\n if (c === '/') { // for close tag \"/>\"\n resulting_string += this._input.next();\n }\n token = this._create_token(TOKEN.TAG_CLOSE, resulting_string);\n } else if (open_token.text[0] === '{' && c === '}' && this._input.peek(1) === '}') {\n this._input.next();\n this._input.next();\n token = this._create_token(TOKEN.TAG_CLOSE, '}}');\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_attribute = function(c, previous_token, open_token) {\n var token = null;\n var resulting_string = '';\n if (open_token && open_token.text[0] === '<') {\n\n if (c === '=') {\n token = this._create_token(TOKEN.EQUALS, this._input.next());\n } else if (c === '\"' || c === \"'\") {\n var content = this._input.next();\n var input_string = '';\n var string_pattern = new RegExp(c + '|{{', 'g');\n while (this._input.hasNext()) {\n input_string = this._input.readUntilAfter(string_pattern);\n content += input_string;\n if (input_string[input_string.length - 1] === '\"' || input_string[input_string.length - 1] === \"'\") {\n break;\n } else if (this._input.hasNext()) {\n content += this._input.readUntilAfter(/}}/g);\n }\n }\n\n token = this._create_token(TOKEN.VALUE, content);\n } else {\n if (c === '{' && this._input.peek(1) === '{') {\n resulting_string = this._input.readUntilAfter(/}}/g);\n } else {\n resulting_string = this._input.readUntil(/[\\n\\r\\t =\\/>]/g);\n }\n\n if (resulting_string) {\n if (previous_token.type === TOKEN.EQUALS) {\n token = this._create_token(TOKEN.VALUE, resulting_string);\n } else {\n token = this._create_token(TOKEN.ATTRIBUTE, resulting_string);\n }\n }\n }\n }\n return token;\n};\n\nTokenizer.prototype._is_content_unformatted = function(tag_name) {\n // void_elements have no content and so cannot have unformatted content\n // script and style tags should always be read as unformatted content\n // finally content_unformatted and unformatted element contents are unformatted\n return this._options.void_elements.indexOf(tag_name) === -1 &&\n (tag_name === 'script' || tag_name === 'style' ||\n this._options.content_unformatted.indexOf(tag_name) !== -1 ||\n this._options.unformatted.indexOf(tag_name) !== -1);\n};\n\n\nTokenizer.prototype._read_raw_content = function(previous_token, open_token) { // jshint unused:false\n var resulting_string = '';\n if (open_token && open_token.text[0] === '{') {\n resulting_string = this._input.readUntil(/}}/g);\n } else if (previous_token.type === TOKEN.TAG_CLOSE && (previous_token.opened.text[0] === '<')) {\n var tag_name = previous_token.opened.text.substr(1).toLowerCase();\n if (this._is_content_unformatted(tag_name)) {\n resulting_string = this._input.readUntil(new RegExp('', 'ig'));\n }\n }\n\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._read_content_word = function() {\n // if we get here and we see handlebars treat them as plain text\n var resulting_string = this._input.readUntil(this._word_pattern);\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;"],"sourceRoot":""} \ No newline at end of file diff --git a/js/lib/beautifier.min.js b/js/lib/beautifier.min.js index ef2a8eb22..635487990 100644 --- a/js/lib/beautifier.min.js +++ b/js/lib/beautifier.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("beautifier",[],e):"object"==typeof exports?exports.beautifier=e():t.beautifier=e()}("undefined"!=typeof self?self:"undefined"!=typeof windows?window:"undefined"!=typeof global?global:this,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var _=e[n]={i:n,l:!1,exports:{}};return t[n].call(_.exports,_,_.exports,i),_.l=!0,_.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var _ in t)i.d(n,_,function(e){return t[e]}.bind(null,_));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=8)}([function(t,e,i){"use strict";var n=i(4).InputScanner,_=i(1).Tokenizer,s=i(1).TOKEN,r=i(6).Directives,o=i(5);function a(t,e){return-1!==e.indexOf(t)}var h={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},p=new r(/\/\*/,/\*\//),l=/0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/g,u=/[0-9]/,c=/[^\d\.]/,f=">>> === !== << && >= ** != == <= >> || < / - + > : & % ? ^ | *".split(" "),d=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ++ %= &= *= |= = ! ? > < : / ^ - + * & % ~ |";d=(d=d.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")).replace(/ /g,"|");var g,m=new RegExp(d,"g"),y="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),w=y.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),x=new RegExp("^(?:"+w.join("|")+")$"),k=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,E=/\/\/(?:[^\n\r\u2028\u2029]*)/g,b=/(?:(?:<\?php|<\?=)[\s\S]*?\?>)|(?:<%[\s\S]*?%>)/g,v=function(t,e){_.call(this,t,e),this._whitespace_pattern=/[\n\r\u2028\u2029\t\u000B\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff ]+/g,this._newline_pattern=/([^\n\r\u2028\u2029]*)(\r\n|[\n\r\u2028\u2029])?/g};(v.prototype=new _)._is_comment=function(t){return t.type===h.COMMENT||t.type===h.BLOCK_COMMENT||t.type===h.UNKNOWN},v.prototype._is_opening=function(t){return t.type===h.START_BLOCK||t.type===h.START_EXPR},v.prototype._is_closing=function(t,e){return(t.type===h.END_BLOCK||t.type===h.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},v.prototype._reset=function(){g=!1},v.prototype._get_next_token=function(t,e){this._readWhitespace();var i=null,n=this._input.peek();return i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_singles(n))||this._read_word(t))||this._read_comment(n))||this._read_string(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_non_javascript(n))||this._read_punctuation())||this._create_token(h.UNKNOWN,this._input.next())},v.prototype._read_word=function(t){var e;return""!==(e=this._input.read(o.identifier))?t.type!==h.DOT&&(t.type!==h.RESERVED||"set"!==t.text&&"get"!==t.text)&&x.test(e)?"in"===e||"of"===e?this._create_token(h.OPERATOR,e):this._create_token(h.RESERVED,e):this._create_token(h.WORD,e):""!==(e=this._input.read(l))?this._create_token(h.WORD,e):void 0},v.prototype._read_singles=function(t){var e=null;return null===t?e=this._create_token(h.EOF,""):"("===t||"["===t?e=this._create_token(h.START_EXPR,t):")"===t||"]"===t?e=this._create_token(h.END_EXPR,t):"{"===t?e=this._create_token(h.START_BLOCK,t):"}"===t?e=this._create_token(h.END_BLOCK,t):";"===t?e=this._create_token(h.SEMICOLON,t):"."===t&&c.test(this._input.peek(1))?e=this._create_token(h.DOT,t):","===t&&(e=this._create_token(h.COMMA,t)),e&&this._input.next(),e},v.prototype._read_punctuation=function(){var t=this._input.read(m);if(""!==t)return"="===t?this._create_token(h.EQUALS,t):this._create_token(h.OPERATOR,t)},v.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(t=this._input.next(),this._is_first_token()&&"!"===this._input.peek()){for(e=t;this._input.hasNext()&&"\n"!==t;)e+=t=this._input.next();return this._create_token(h.UNKNOWN,e.trim()+"\n")}var i="#";if(this._input.hasNext()&&this._input.testChar(u)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,i)}this._input.back()}else if("<"===t){if("?"===this._input.peek(1)||"%"===this._input.peek(1)){if(e=this._input.read(b))return e=e.replace(o.allLineBreaks,"\n"),this._create_token(h.STRING,e)}else if(this._input.match(/<\!--/g)){for(t="\x3c!--";this._input.hasNext()&&!this._input.testChar(o.newline);)t+=this._input.next();return g=!0,this._create_token(h.COMMENT,t)}}else if("-"===t&&g&&this._input.match(/-->/g))return g=!1,this._create_token(h.COMMENT,"--\x3e");return null},v.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this._input.read(k);var n=p.get_directives(i);n&&"start"===n.ignore&&(i+=p.readIgnored(this._input)),i=i.replace(o.allLineBreaks,"\n"),(e=this._create_token(h.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this._input.read(E),e=this._create_token(h.COMMENT,i))}return e},v.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,_=new n(t),s=null;for(;_.hasNext();)if((s=_.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=s[0]),"\\"===_.peek()){if(_.next(),"x"===_.peek())s=_.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==_.peek()){e+="\\",_.hasNext()&&(e+=_.next());continue}s=_.match(/u([0-9A-Fa-f]{4})/g)}if(!s)return t;if((i=parseInt(s[1],16))>126&&i<=255&&0===s[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+s[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),this._create_token(h.STRING,e)}return null},v.prototype._allow_regexp_or_xml=function(t){return t.type===h.RESERVED&&a(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===h.END_EXPR&&")"===t.text&&t.opened.previous.type===h.RESERVED&&a(t.opened.previous.text,["if","while","for"])||a(t.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},v.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,_=!1;this._input.hasNext()&&(n||_||this._input.peek()!==t)&&!this._input.testChar(o.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?_=!0:"]"===this._input.peek()&&(_=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(o.identifier)),this._create_token(h.STRING,i)}return null};var R=/<()([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/g,O=/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/g;v.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._input.test(R)&&this._allow_regexp_or_xml(e)){var i="",n=this._input.match(R);if(n){for(var _=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===_.indexOf("{"),r=0;n;){var a=!!n[1],p=n[2];if(!(!!n[n.length-1]||"![CDATA["===p.slice(0,8))&&(p===_||s&&p.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--r:++r),i+=n[0],r<=0)break;n=this._input.match(O)}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(o.allLineBreaks,"\n"),this._create_token(h.STRING,i)}}return null},v.prototype._read_string_recursive=function(t,e,i){for(var n,_="",s=!1;this._input.hasNext()&&(n=this._input.peek(),s||n!==t&&(e||!o.newline.test(n)));)(s||e)&&o.newline.test(n)?("\r"===n&&"\n"===this._input.peek(1)&&(this._input.next(),n=this._input.peek()),_+="\n"):_+=n,s?("x"!==n&&"u"!==n||(this.has_char_escapes=!0),s=!1):s="\\"===n,this._input.next(),i&&-1!==_.indexOf(i,_.length-i.length)&&(_+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(_+=this._input.next()));return _},t.exports.Tokenizer=v,t.exports.TOKEN=h,t.exports.positionable_operators=f.slice(),t.exports.line_starters=y.slice()},function(t,e,i){"use strict";var n=i(4).InputScanner,_=i(12).Token,s=i(13).TokenStream,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,e){this._input=new n(t),this._options=e||{},this.__tokens=null,this.__newline_count=0,this.__whitespace_before_token="",this._whitespace_pattern=/[\n\r\t ]+/g,this._newline_pattern=/([^\n\r]*)(\r\n|[\n\r])?/g};o.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new s,this._reset();for(var e=new _(r.START,""),i=null,n=[],o=new s;e.type!==r.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)o.add(t),t=this._get_next_token(e,i);o.isEmpty()||(t.comments_before=o,o=new s),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(r.RAW,i):this._create_token(r.EOF,"")},o.prototype._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return!1},o.prototype._is_closing=function(t,e){return!1},o.prototype._create_token=function(t,e){var i=new _(t,e,this.__newline_count,this.__whitespace_before_token);return this.__newline_count=0,this.__whitespace_before_token="",i},o.prototype._readWhitespace=function(){var t=this._input.read(this._whitespace_pattern);if(" "===t)this.__whitespace_before_token=t;else if(""!==t){this._newline_pattern.lastIndex=0;for(var e=this._newline_pattern.exec(t);e[2];)this.__newline_count+=1,e=this._newline_pattern.exec(t);this.__whitespace_before_token=e[1]}},t.exports.Tokenizer=o,t.exports.TOKEN=r},function(t,e,i){"use strict";function n(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__items=[]}function _(t,e){this.__cache=[t],this.__level_string=e}function s(t,e){e=e||"",this.__indent_cache=new _(e,t),this.__alignment_cache=new _(""," "),this.baseIndentLength=e.length,this.indent_length=t.length,this.raw=!1,this.__lines=[],this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.__add_outputline()}n.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},n.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},n.prototype.set_indent=function(t,e){this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.baseIndentLength+this.__alignment_count+this.__indent_count*this.__parent.indent_length},n.prototype.get_character_count=function(){return this.__character_count},n.prototype.is_empty=function(){return 0===this.__items.length},n.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},n.prototype.push=function(t){this.__items.push(t),this.__character_count+=t.length},n.prototype.push_raw=function(t){this.push(t);var e=t.lastIndexOf("\n");-1!==e&&(this.__character_count=t.length-e)},n.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},n.prototype.remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_length)},n.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},n.prototype.toString=function(){var t="";return this.is_empty()||(this.__indent_count>=0&&(t=this.__parent.get_indent_string(this.__indent_count)),this.__alignment_count>=0&&(t+=this.__parent.get_alignment_string(this.__alignment_count)),t+=this.__items.join("")),t},_.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__cache.push(this.__cache[this.__cache.length-1]+this.__level_string)},_.prototype.get_level_string=function(t){return this.__ensure_cache(t),this.__cache[t]},s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=new n(this),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(t){return this.__indent_cache.get_level_string(t)},s.prototype.get_alignment_string=function(t){return this.__alignment_cache.get_level_string(t)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(t,e){var i=this.__lines.join("\n").replace(/[\r\n\t ]+$/,"");return t&&(i+="\n"),"\n"!==e&&(i=i.replace(/[\n]/g,e)),i},s.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(t){for(var e=0;e1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var _=this.__lines[i];if(_.is_empty())break;if(0!==_.item(0).indexOf(t)&&_.item(-1)!==e){this.__lines.splice(i+1,0,new n(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},t.exports.Output=s},function(t,e,i){"use strict";function n(t,e){t=_(t,e),this.raw_options=s(t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs"),this.indent_with_tabs&&(this.indent_char="\t",this.indent_size=1),this.indent_string=this.indent_char,this.indent_size>1&&(this.indent_string=new Array(this.indent_size+1).join(this.indent_char)),this.base_indent_string=null,this.indent_level>0&&(this.base_indent_string=new Array(this.indent_level+1).join(this.indent_string)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char"))}function _(t,e){var i,n={};for(i in t=t||{})i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function s(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}n.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},n.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},n.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},n.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},n.prototype._get_selection=function(t,e,i){if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' must be one of the following values\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},n.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some(function(t){return-1===e.indexOf(t)})},t.exports.Options=n,t.exports.normalizeOpts=s,t.exports.mergeOpts=_},function(t,e,i){"use strict";function n(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position=0&&t=0&&e=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=n},function(t,e,i){"use strict";e.identifier=new RegExp("[$@A-Z_a-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ][$0-9A-Z_a-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]*","g");e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")},function(t,e,i){"use strict";function n(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp("(?:[\\s\\S]*?)((?:"+t+/\sbeautify\signore:end\s/.source+e+")|$)","g")}n.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},n.prototype.readIgnored=function(t){return t.read(this.__directives_end_ignore_pattern)},t.exports.Directives=n},function(t,e,i){"use strict";var n=i(1).Tokenizer,_=i(1).TOKEN,s=i(6).Directives,r={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:_.START,RAW:_.RAW,EOF:_.EOF},o=new s(/<\!--/,/-->/),a=function(t,e){n.call(this,t,e),this._current_tag_name="",this._word_pattern=this._options.indent_handlebars?/[\n\r\t <]|{{/g:/[\n\r\t <]/g};(a.prototype=new n)._is_comment=function(t){return!1},a.prototype._is_opening=function(t){return t.type===r.TAG_OPEN},a.prototype._is_closing=function(t,e){return t.type===r.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},a.prototype._reset=function(){this._current_tag_name=""},a.prototype._get_next_token=function(t,e){this._readWhitespace();var i=null,n=this._input.peek();return null===n?this._create_token(r.EOF,""):i=(i=(i=(i=(i=(i=(i=i||this._read_attribute(n,t,e))||this._read_raw_content(t,e))||this._read_comment(n))||this._read_open(n,e))||this._read_close(n,e))||this._read_content_word())||this._create_token(r.UNKNOWN,this._input.next())},a.prototype._read_comment=function(t){var e=null;if("<"===t||"{"===t){var i=this._input.peek(1),n=this._input.peek(2);if("<"===t&&("!"===i||"?"===i||"%"===i)||this._options.indent_handlebars&&"{"===t&&"{"===i&&"!"===n){for(var _="",s=">",a=!1,h=this._input.next();h&&((_+=h).charAt(_.length-1)!==s.charAt(s.length-1)||-1===_.indexOf(s));)a||(a=_.length>10,0===_.indexOf("",a=!0):0===_.indexOf("",a=!0):0===_.indexOf("",a=!0):0===_.indexOf("\x3c!--")?(s="--\x3e",a=!0):0===_.indexOf("{{!--")?(s="--}}",a=!0):0===_.indexOf("{{!")?5===_.length&&-1===_.indexOf("{{!--")&&(s="}}",a=!0):0===_.indexOf("",a=!0):0===_.indexOf("<%")&&(s="%>",a=!0)),h=this._input.next();var p=o.get_directives(_);p&&"start"===p.ignore&&(_+=o.readIgnored(this._input)),(e=this._create_token(r.COMMENT,_)).directives=p}}return e},a.prototype._read_open=function(t,e){var i=null,n=null;return e||("<"===t?(i=this._input.read(/<(?:[^\n\r\t >{][^\n\r\t >{/]*)?/g),n=this._create_token(r.TAG_OPEN,i)):this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&(i=this._input.readUntil(/[\n\r\t }]/g),n=this._create_token(r.TAG_OPEN,i))),n},a.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(r.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(r.TAG_CLOSE,"}}"))),n},a.prototype._read_attribute=function(t,e,i){var n=null,_="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(r.EQUALS,this._input.next());else if('"'===t||"'"===t){for(var s=this._input.next(),o="",a=new RegExp(t+"|{{","g");this._input.hasNext()&&(s+=o=this._input.readUntilAfter(a),'"'!==o[o.length-1]&&"'"!==o[o.length-1]);)this._input.hasNext()&&(s+=this._input.readUntilAfter(/}}/g));n=this._create_token(r.VALUE,s)}else(_="{"===t&&"{"===this._input.peek(1)?this._input.readUntilAfter(/}}/g):this._input.readUntil(/[\n\r\t =\/>]/g))&&(n=e.type===r.EQUALS?this._create_token(r.VALUE,_):this._create_token(r.ATTRIBUTE,_));return n},a.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&("script"===t||"style"===t||-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},a.prototype._read_raw_content=function(t,e){var i="";if(e&&"{"===e.text[0])i=this._input.readUntil(/}}/g);else if(t.type===r.TAG_CLOSE&&"<"===t.opened.text[0]){var n=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(n)&&(i=this._input.readUntil(new RegExp("","ig")))}return i?this._create_token(r.TEXT,i):null},a.prototype._read_content_word=function(){var t=this._input.readUntil(this._word_pattern);if(t)return this._create_token(r.TEXT,t)},t.exports.Tokenizer=a,t.exports.TOKEN=r},function(t,e,i){"use strict";var n=i(9),_=i(14),s=i(17);t.exports.js=n,t.exports.css=_,t.exports.html=function(t,e,i,r){return s(t,e,i=i||n,r=r||_)}},function(t,e,i){"use strict";var n=i(10).Beautifier;t.exports=function(t,e){return new n(t,e).beautify()}},function(t,e,i){"use strict";var n=i(2).Output,_=i(5),s=i(11).Options,r=i(0).Tokenizer,o=i(0).line_starters,a=i(0).positionable_operators,h=i(0).TOKEN;function p(t,e){e.multiline_frame||e.mode===d.ForInitializer||e.mode===d.Conditional||t.remove_indent(e.start_line_index)}function l(t,e){return-1!==e.indexOf(t)}function u(t){return t.replace(/^\s+/g,"")}var c=function(t){for(var e={},i=0;ii&&(i=t.line_indent_level)),{mode:e,parent:t,last_text:t?t.last_text:"",last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},w.prototype._reset=function(t){var e="";this._options.base_indent_string?e=this._options.base_indent_string:e=t.match(/^[\t ]*/)[0];this._last_type=h.START_BLOCK,this._last_last_text="",this._output=new n(this._options.indent_string,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var i=new r(t,this._options);return this._tokens=i.tokenize(),t},w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&_.lineBreak.test(t||"")&&(e=t.match(_.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_text,this._last_type=i.type,this._flags.last_text=i.text,i=this._tokens.next();return this._output.get_code(this._options.end_with_newline,e)},w.prototype.handle_token=function(t,e){t.type===h.START_EXPR?this.handle_start_expr(t):t.type===h.END_EXPR?this.handle_end_expr(t):t.type===h.START_BLOCK?this.handle_start_block(t):t.type===h.END_BLOCK?this.handle_end_block(t):t.type===h.WORD?this.handle_word(t):t.type===h.RESERVED?this.handle_word(t):t.type===h.SEMICOLON?this.handle_semicolon(t):t.type===h.STRING?this.handle_string(t):t.type===h.EQUALS?this.handle_equals(t):t.type===h.OPERATOR?this.handle_operator(t):t.type===h.COMMA?this.handle_comma(t):t.type===h.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===h.COMMENT?this.handle_comment(t,e):t.type===h.DOT?this.handle_dot(t):t.type===h.EOF?this.handle_eof(t):(t.type,h.UNKNOWN,this.handle_unknown(t,e))},w.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&g(this._flags.mode);if(t.comments_before)for(var _=t.comments_before.next();_;)this.handle_whitespace_and_comments(_,e),this.handle_token(_,e),_=t.comments_before.next();if(n)for(var s=0;s0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var r=1;r=this._options.wrap_line_length&&this.print_newline(!1,!0)}}},w.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_text&&","!==this._flags.last_text&&"="!==this._flags.last_text&&(this._last_type!==h.OPERATOR||"--"===this._flags.last_text||"++"===this._flags.last_text))for(var i=this._tokens.peek();!(this._flags.mode!==d.Statement||this._flags.if_block&&i&&i.type===h.RESERVED&&"else"===i.text||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},w.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g(this._flags.mode)&&t.newlines?(this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level)&&(this._flags.line_indent_level=this._flags.indentation_level))},w.prototype.print_token=function(t,e){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&this._last_type===h.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var i=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(i),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}e=e||t.text,this.print_token_line_indentation(t),this._output.add_token(e)}},w.prototype.indent=function(){this._flags.indentation_level+=1},w.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1)},w.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t)},w.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&p(this._output,this._previous_flags))},w.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(":"===this._flags.last_text&&0===this._flags.ternary_depth||this._last_type===h.RESERVED&&l(this._flags.last_text,["get","set"]))},w.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||this._last_type===h.RESERVED&&l(this._flags.last_text,["var","let","const"])&&t.type===h.WORD)||this._last_type===h.RESERVED&&"do"===this._flags.last_text)||this._last_type===h.RESERVED&&l(this._flags.last_text,x)&&!t.newlines)||this._last_type===h.RESERVED&&"else"===this._flags.last_text&&!(t.type===h.RESERVED&&"if"===t.text&&!t.comments_before))||this._last_type===h.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional))||this._last_type===h.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==h.WORD&&t.type!==h.RESERVED)||this._flags.mode===d.ObjectLiteral&&(":"===this._flags.last_text&&0===this._flags.ternary_depth||this._last_type===h.RESERVED&&l(this._flags.last_text,["get","set"])))&&(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,t.type===h.RESERVED&&l(t.text,["do","for","if","while"])),!0)},w.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=d.Expression;if("["===t.text){if(this._last_type===h.WORD||")"===this._flags.last_text)return this._last_type===h.RESERVED&&l(this._flags.last_text,o)&&(this._output.space_before_token=!0),this.set_mode(e),this.print_token(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=d.ArrayLiteral,g(this._flags.mode)&&("["!==this._flags.last_text&&(","!==this._flags.last_text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),l(this._last_type,[h.START_EXPR,h.END_EXPR,h.WORD,h.OPERATOR])||(this._output.space_before_token=!0)}else this._last_type===h.RESERVED?"for"===this._flags.last_text?(this._output.space_before_token=this._options.space_before_conditional,e=d.ForInitializer):l(this._flags.last_text,["if","while"])?(this._output.space_before_token=this._options.space_before_conditional,e=d.Conditional):l(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_text&&""===t.whitespace_before?this._output.space_before_token=!1:(l(this._flags.last_text,o)||"catch"===this._flags.last_text)&&(this._output.space_before_token=!0):this._last_type===h.EQUALS||this._last_type===h.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):this._last_type===h.WORD?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t),(this._last_type===h.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_text&&(l(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&l(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function);";"===this._flags.last_text||this._last_type===h.START_BLOCK?this.print_newline():this._last_type!==h.END_EXPR&&this._last_type!==h.START_EXPR&&this._last_type!==h.END_BLOCK&&"."!==this._flags.last_text&&this._last_type!==h.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.set_mode(e),this.print_token(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},w.prototype.handle_end_expr=function(t){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&g(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._last_type!==h.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),"]"===t.text&&this._options.keep_array_indentation?(this.print_token(t),this.restore_mode()):(this.restore_mode(),this.print_token(t)),p(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},w.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);i&&(l(i.text,[":",","])&&l(e.type,[h.STRING,h.WORD,h.RESERVED])||l(e.text,["get","set","..."])&&l(i.type,[h.WORD,h.RESERVED]))?l(this._last_last_text,["class","interface"])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._last_type===h.OPERATOR&&"=>"===this._flags.last_text?this.set_mode(d.BlockStatement):l(this._last_type,[h.EQUALS,h.START_EXPR,h.COMMA,h.OPERATOR])||this._last_type===h.RESERVED&&l(this._flags.last_text,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement);var n=!e.comments_before&&"}"===e.text&&"function"===this._flags.last_word&&this._last_type===h.END_EXPR;if(this._options.brace_preserve_inline){var _=0,s=null;this._flags.inline_frame=!0;do{if(_+=1,(s=this._tokens.peek(_-1)).newlines){this._flags.inline_frame=!1;break}}while(s.type!==h.EOF&&(s.type!==h.END_BLOCK||s.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._last_type!==h.OPERATOR&&(n||this._last_type===h.EQUALS||this._last_type===h.RESERVED&&y(this._flags.last_text)&&"else"!==this._flags.last_text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!g(this._previous_flags.mode)||this._last_type!==h.START_EXPR&&this._last_type!==h.COMMA||((this._last_type===h.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._last_type===h.COMMA||this._last_type===h.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._last_type!==h.OPERATOR&&this._last_type!==h.START_EXPR&&(this._last_type!==h.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent()},w.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===d.Statement;)this.restore_mode();var e=this._last_type===h.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(g(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},w.prototype.handle_word=function(t){if(t.type===h.RESERVED)if(l(t.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)t.type=h.WORD;else if(l(t.text,["as","from"])&&!this._flags.import_block)t.type=h.WORD;else if(this._flags.mode===d.ObjectLiteral){":"===this._tokens.peek().text&&(t.type=h.WORD)}if(this.start_of_statement(t)?this._last_type===h.RESERVED&&l(this._flags.last_text,["var","let","const"])&&t.type===h.WORD&&(this._flags.declaration_statement=!0):!t.newlines||m(this._flags.mode)||this._last_type===h.OPERATOR&&"--"!==this._flags.last_text&&"++"!==this._flags.last_text||this._last_type===h.EQUALS||!this._options.preserve_newlines&&this._last_type===h.RESERVED&&l(this._flags.last_text,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(t.type===h.RESERVED&&"while"===t.text)return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(this._flags.else_block||t.type!==h.RESERVED||"else"!==t.text){for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}else this._flags.else_block=!0;if(t.type===h.RESERVED&&("case"===t.text||"default"===t.text&&this._flags.in_case_statement))return this.print_newline(),(this._flags.case_body||this._options.jslint_happy)&&(this.deindent(),this._flags.case_body=!1),this.print_token(t),this._flags.in_case=!0,void(this._flags.in_case_statement=!0);if(this._last_type!==h.COMMA&&this._last_type!==h.START_EXPR&&this._last_type!==h.EQUALS&&this._last_type!==h.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),t.type===h.RESERVED&&"function"===t.text)return(l(this._flags.last_text,["}",";"])||this._output.just_added_newline()&&!l(this._flags.last_text,["(","[","{",":","=",","])&&this._last_type!==h.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._last_type===h.RESERVED||this._last_type===h.WORD?this._last_type===h.RESERVED&&(l(this._flags.last_text,["get","set","new","export"])||l(this._flags.last_text,x))?this._output.space_before_token=!0:this._last_type===h.RESERVED&&"default"===this._flags.last_text&&"export"===this._last_last_text?this._output.space_before_token=!0:this.print_newline():this._last_type===h.OPERATOR||"="===this._flags.last_text?this._output.space_before_token=!0:(this._flags.multiline_frame||!m(this._flags.mode)&&!g(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._last_type===h.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":t.type===h.RESERVED&&l(t.text,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._last_type===h.SEMICOLON&&this._flags.mode===d.BlockStatement?e="NEWLINE":this._last_type===h.SEMICOLON&&m(this._flags.mode)?e="SPACE":this._last_type===h.STRING?e="NEWLINE":this._last_type===h.RESERVED||this._last_type===h.WORD||"*"===this._flags.last_text&&(l(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&l(this._last_last_text,["{",","]))?e="SPACE":this._last_type===h.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._last_type===h.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),t.type===h.RESERVED&&l(t.text,o)&&")"!==this._flags.last_text&&(e=this._flags.inline_frame||"else"===this._flags.last_text||"export"===this._flags.last_text?"SPACE":"NEWLINE"),t.type===h.RESERVED&&l(t.text,["else","catch","finally"]))?(this._last_type!==h.END_BLOCK||this._previous_flags.mode!==d.BlockStatement||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?this._last_type===h.RESERVED&&y(this._flags.last_text)?this._output.space_before_token=!0:this._last_type!==h.END_EXPR?this._last_type===h.START_EXPR&&t.type===h.RESERVED&&l(t.text,["var","let","const"])||":"===this._flags.last_text||(t.type===h.RESERVED&&"if"===t.text&&"else"===this._flags.last_text?this._output.space_before_token=!0:this.print_newline()):t.type===h.RESERVED&&l(t.text,o)&&")"!==this._flags.last_text&&this.print_newline():this._flags.multiline_frame&&g(this._flags.mode)&&","===this._flags.last_text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);this._last_type!==h.WORD&&this._last_type!==h.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===h.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&t.type===h.RESERVED&&"from"===t.text&&(this._flags.import_block=!1))},w.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==d.Statement||this._flags.if_block&&e&&e.type===h.RESERVED&&"else"===e.text||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},w.prototype.handle_string=function(t){this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._last_type===h.RESERVED||this._last_type===h.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._last_type===h.COMMA||this._last_type===h.START_EXPR||this._last_type===h.EQUALS||this._last_type===h.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):this.print_newline()),this.print_token(t)},w.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},w.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(m(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},w.prototype.handle_operator=function(t){var e="*"===t.text&&(this._last_type===h.RESERVED&&l(this._flags.last_text,["function","yield"])||l(this._last_type,[h.START_BLOCK,h.COMMA,h.END_BLOCK,h.SEMICOLON])),i=l(t.text,["-","+"])&&(l(this._last_type,[h.START_BLOCK,h.START_EXPR,h.EQUALS,h.OPERATOR])||l(this._flags.last_text,o)||","===this._flags.last_text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(this._last_type===h.RESERVED&&y(this._flags.last_text))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._last_type!==h.DOT)if("::"!==t.text){if(this._last_type===h.OPERATOR&&l(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this._flags.case_body=!0,this.indent(),this.print_token(t),this.print_newline(),void(this._flags.in_case=!1);var _=!0,s=!0,r=!1;if(":"===t.text?0===this._flags.ternary_depth?_=!1:(this._flags.ternary_depth-=1,r=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&l(t.text,a)){var p=":"===t.text,u=p&&r,g=p&&!r;switch(this._options.operator_position){case c.before_newline:return this._output.space_before_token=!g,this.print_token(t),p&&!u||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case c.after_newline:return this._output.space_before_token=!0,!p||u?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case c.preserve_newline:return g||this.allow_wrap_or_preserved_newline(t),_=!(this._output.just_added_newline()||g),this._output.space_before_token=_,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),_=!1;var w=this._tokens.peek();s=w&&l(w.type,[h.WORD,h.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),_=this._last_type===h.START_BLOCK,s=!1):(l(t.text,["--","++","!","~"])||i)&&(this._last_type!==h.COMMA&&this._last_type!==h.START_EXPR||this.allow_wrap_or_preserved_newline(t),_=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_text&&m(this._flags.mode)&&(_=!0),this._last_type===h.RESERVED?_=!0:this._last_type===h.END_EXPR?_=!("]"===this._flags.last_text&&("--"===t.text||"++"===t.text)):this._last_type===h.OPERATOR&&(_=l(t.text,["--","-","++","+"])&&l(this._flags.last_text,["--","-","++","+"]),l(t.text,["+","-"])&&l(this._flags.last_text,["--","++"])&&(s=!0)),(this._flags.mode!==d.BlockStatement||this._flags.inline_frame)&&this._flags.mode!==d.Statement||"{"!==this._flags.last_text&&";"!==this._flags.last_text||this.print_newline());this._output.space_before_token=this._output.space_before_token||_,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},w.prototype.handle_block_comment=function(t,e){if(this._output.raw)return this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw));if(t.directives)return this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0);if(!_.newline.test(t.text)&&!t.newlines)return this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0);var i,n=function(t){for(var e=[],i=(t=t.replace(_.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),s=!1,r=!1,o=t.whitespace_before,a=o.length;for(this.print_newline(!1,e),n.length>1&&(s=function(t,e){for(var i=0;ia?this.print_token(t,n[i].substring(a)):this._output.add_token(n[i]);this.print_newline(!1,e)},w.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},w.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),this._options.unindent_chained_methods&&this.deindent(),this._last_type===h.RESERVED&&y(this._flags.last_text)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_text&&this._options.break_chained_methods),this.print_token(t)},w.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},w.prototype.handle_eof=function(t){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t)},t.exports.Beautifier=w},function(t,e,i){"use strict";var n=i(3).Options,_=["before-newline","after-newline","preserve-newline"];function s(t){n.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s=0&&t0&&this._indentLevel--},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&r.test(t||"")&&(e=t.match(r)[0])),t=t.replace(o,"\n");var i="";this._options.base_indent_string?i=this._options.base_indent_string:i=t.match(/^[\t ]*/)[0];this._output=new _(this._options.indent_string,i),this._input=new s(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n=0,u=!1,c=!1,f=!1,d=!1,g=!1,m=this._ch;;){var y=""!==this._input.read(h),w=m;if(this._ch=this._input.next(),m=this._ch,!this._ch)break;if("/"===this._ch&&"*"===this._input.peek())this._output.add_new_line(),this._input.back(),this.print_string(this._input.read(p)),this.eatWhitespace(!0),this._output.add_new_line();else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(l)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(y),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var x=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);x.match(/[ :]$/)&&(x=this.eatString(": ").replace(/\s$/,""),this.print_string(x),this._output.space_before_token=!0),"extend"===(x=x.replace(/\s$/,""))?d=!0:"import"===x&&(g=!0),x in this.NESTED_AT_RULE?(this._nestedLevel+=1,x in this.CONDITIONAL_GROUP_RULE&&(f=!0)):u||0!==n||-1===x.indexOf(":")||(c=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(y),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(c&&(c=!1,this.outdent()),this.indent(),this._output.space_before_token=!0,this.print_string(this._ch),f?(f=!1,u=this._indentLevel>this._nestedLevel):u=this._indentLevel>=this._nestedLevel,this._options.newline_between_rules&&u&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===w&&this._output.trim(!0),g=!1,d=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),u=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!u&&!f||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||d?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),c||(c=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(y),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?(c&&(this.outdent(),c=!1),d=!1,g=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"!==this._ch?(this._input.back(),n++):this._ch&&this.print_string(this._ch+this.eatString(")"))):(n++,this.preserveSingleSpace(y),this.print_string(this._ch),this.eatWhitespace()):")"===this._ch?(this.print_string(this._ch),n--):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&!c&&n<1&&!g?this._output.add_new_line():this._output.space_before_token=!0):(">"===this._ch||"+"===this._ch||"~"===this._ch)&&!c&&n<1?this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.test(this._ch)&&(this._ch="")):"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(y),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="")):"!"===this._ch?(this.print_string(" "),this.print_string(this._ch)):(this.preserveSingleSpace(y),this.print_string(this._ch))}return this._output.get_code(this._options.end_with_newline,e)},t.exports.Beautifier=u},function(t,e,i){"use strict";var n=i(3).Options;function _(t){n.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e}_.prototype=new n,t.exports.Options=_},function(t,e,i){"use strict";var n=i(18).Beautifier;t.exports=function(t,e,i,_){return new n(t,e,i,_).beautify()}},function(t,e,i){"use strict";var n=i(19).Options,_=i(2).Output,s=i(7).Tokenizer,r=i(7).TOKEN,o=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,h=function(t,e,i,n,s){this.indent_level=0,this.alignment_size=0,this.wrap_line_length=i,this.max_preserve_newlines=n,this.preserve_newlines=s,this._output=new _(t,e)};h.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},h.prototype.set_space_before_token=function(t){this._output.space_before_token=t},h.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},h.prototype.traverse_whitespace=function(t){if(t.whitespace_before||t.newlines){var e=0;if(t.type!==r.TEXT&&t.previous.type!==r.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines0);else this._output.space_before_token=!0,this.print_space_or_wrap(t.text);return!0}return!1},h.prototype.print_space_or_wrap=function(t){return!!(this.wrap_line_length&&this._output.current_line.get_character_count()+t.length+1>=this.wrap_line_length)&&this._output.add_new_line()},h.prototype.print_newline=function(t){this._output.add_new_line(t)},h.prototype.print_token=function(t){t&&(this._output.current_line.is_empty()&&this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t))},h.prototype.print_raw_text=function(t){this._output.current_line.push_raw(t)},h.prototype.indent=function(){this.indent_level++},h.prototype.unindent=function(){this.indent_level>0&&this.indent_level--},h.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};function p(t,e){return-1!==e.indexOf(t)}function l(t){this._printer=t,this._current_frame=null}function u(t,e,i,_){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=_,this._tag_stack=null;var s=new n(e,"html");this._options=s,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes}l.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},l.prototype.record_tag=function(t){var e=new function(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}(this._current_frame,t,this._printer.indent_level);this._current_frame=e},l.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},l.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},l.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},l.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&o.test(t)&&(e=t.match(o)[0])),t=t.replace(a,"\n");var i="";this._options.base_indent_string&&(i=this._options.base_indent_string);var n={text:"",type:""},_=new c,p=new h(this._options.indent_string,i,this._options.wrap_line_length,this._options.max_preserve_newlines,this._options.preserve_newlines),u=new s(t,this._options).tokenize();this._tag_stack=new l(p);for(var f=null,d=u.next();d.type!==r.EOF;)d.type===r.TAG_OPEN||d.type===r.COMMENT?_=f=this._handle_tag_open(p,d,_,n):d.type===r.ATTRIBUTE||d.type===r.EQUALS||d.type===r.VALUE||d.type===r.TEXT&&!_.tag_complete?f=this._handle_inside_tag(p,d,_,u):d.type===r.TAG_CLOSE?f=this._handle_tag_close(p,d,_):d.type===r.TEXT?f=this._handle_text(p,d,_):p.add_raw_token(d),n=f,d=u.next();return p._output.get_code(this._options.end_with_newline,e)},u.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0]),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e.text)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),n},u.prototype._handle_inside_tag=function(t,e,i,n){var _={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before),i.is_unformatted)t.add_raw_token(e);else{if("<"===i.tag_start_char&&(e.type===r.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):e.type===r.EQUALS?t.set_space_before_token(!1):e.type===r.VALUE&&e.previous.type===r.EQUALS&&t.set_space_before_token(!1)),t._output.space_before_token&&"<"===i.tag_start_char){var s=t.print_space_or_wrap(e.text);if(e.type===r.ATTRIBUTE){var o=s&&!this._is_wrap_attributes_force;if(this._is_wrap_attributes_force){var a=!1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var h,p=!0,l=0;do{if((h=n.peek(l)).type===r.ATTRIBUTE){p=!1;break}l+=1}while(l<4&&h.type!==r.EOF&&h.type!==r.TAG_CLOSE);a=!p}(i.attr_count>1||a)&&(t.print_newline(!1),o=!0)}o&&(i.has_wrapped_attrs=!0)}}t.print_token(e.text)}return _},u.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e.text)),n},u.prototype._print_custom_beatifier_text=function(t,e,i){if(""!==e.text){t.print_newline(!1);var n,_=e.text,s=1;"script"===i.tag_name?n="function"==typeof this._js_beautify&&this._js_beautify:"style"===i.tag_name&&(n="function"==typeof this._css_beautify&&this._css_beautify),"keep"===this._options.indent_scripts?s=0:"separate"===this._options.indent_scripts&&(s=-t.indent_level);var r=t.get_full_indent(s);if(_=_.replace(/\n[ \t]*$/,""),n){var o=function(){this.eol="\n"};o.prototype=this._options.raw_options,_=n(r+_,new o)}else{var a=_.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(this._options.indent_string).length-1,h=this._get_full_indent(s-a);_=(r+_.trim()).replace(/\r\n|\r|\n/g,"\n"+h)}_&&(t.print_raw_text(_),t.print_newline(!0))}},u.prototype._handle_tag_open=function(t,e,i,n){var _=this._get_tag_open_token(e);return t.traverse_whitespace(e),this._set_tag_position(t,e,_,i,n),(i.is_unformatted||i.is_content_unformatted)&&e.type===r.TAG_OPEN&&0===e.text.indexOf("]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{\#?([^\s}]+)/),this.tag_check=i?i[1]:""),this.tag_check=this.tag_check.toLowerCase(),e.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};u.prototype._get_tag_open_token=function(t){var e=new c(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||p(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&p(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&p(e.tag_check,this._options.content_unformatted),e.is_inline_element=p(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},u.prototype._set_tag_position=function(t,e,i,n,_){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier=function(t,e){var i=e.next;if(!e.closed)return!1;for(;i.type!==r.EOF&&i.closed!==e;){if(i.type===r.ATTRIBUTE&&"type"===i.text){var n=i.next?i.next:i,_=n.next?n.next:n;return n.type===r.EQUALS&&_.type===r.VALUE&&("style"===t&&_.text.search("text/css")>-1||"script"===t&&_.text.search(/(text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect)/)>-1)}i=i.next}return!0}(i.tag_check,e)))),p(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&_.type===r.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||i.is_inline_element||i.is_unformatted||t.print_newline(!1)}else i.is_unformatted||i.is_content_unformatted?i.is_inline_element||i.is_unformatted||t.print_newline(!1):i.is_end_tag?(i.start_tag_token&&i.start_tag_token.multiline_content||!(i.is_inline_element||n.is_inline_element||_.type===r.TAG_CLOSE&&i.start_tag_token===n||"TK_CONTENT"===_.type))&&t.print_newline(!1):(i.indent_content=!i.custom_beautifier,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||"TK_CONTENT"===_.type||(i.parent&&(i.parent.multiline_content=!0),t.print_newline(!1)))},u.prototype._do_optional_end_element=function(t){!t.is_empty_element&&t.is_start_tag&&t.parent&&("body"===t.tag_name?this._tag_stack.try_pop("head"):"li"===t.tag_name?this._tag_stack.try_pop("li",["ol","ul"]):"dd"===t.tag_name||"dt"===t.tag_name?(this._tag_stack.try_pop("dt",["dl"]),this._tag_stack.try_pop("dd",["dl"])):"rp"===t.tag_name||"rt"===t.tag_name?(this._tag_stack.try_pop("rt",["ruby","rtc"]),this._tag_stack.try_pop("rp",["ruby","rtc"])):"optgroup"===t.tag_name?this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?(this._tag_stack.try_pop("caption",["table"]),this._tag_stack.try_pop("colgroup",["table"])):"tbody"===t.tag_name||"tfoot"===t.tag_name?(this._tag_stack.try_pop("caption",["table"]),this._tag_stack.try_pop("colgroup",["table"]),this._tag_stack.try_pop("thead",["table"]),this._tag_stack.try_pop("tbody",["table"])):"tr"===t.tag_name?(this._tag_stack.try_pop("caption",["table"]),this._tag_stack.try_pop("colgroup",["table"]),this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):"th"!==t.tag_name&&"td"!==t.tag_name||(this._tag_stack.try_pop("td",["tr"]),this._tag_stack.try_pop("th",["tr"])),t.parent=this._tag_stack.get_parser_token())},t.exports.Beautifier=u},function(t,e,i){"use strict";var n=i(3).Options;function _(t){n.call(this,t,"html"),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple"])[0],this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","address","big","dt","ins","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","?php","?=","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}_.prototype=new n,t.exports.Options=_}])}); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("beautifier",[],e):"object"==typeof exports?exports.beautifier=e():t.beautifier=e()}("undefined"!=typeof self?self:"undefined"!=typeof windows?window:"undefined"!=typeof global?global:this,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=9)}([function(t,e,i){"use strict";var n=i(4).InputScanner,s=i(1).Tokenizer,_=i(1).TOKEN,o=i(7).Directives,r=i(6);function a(t,e){return-1!==e.indexOf(t)}var h={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:_.START,RAW:_.RAW,EOF:_.EOF},p=new o(/\/\*/,/\*\//),l=/0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/g,u=/[0-9]/,c=/[^\d\.]/,f=">>> === !== << && >= ** != == <= >> || < / - + > : & % ? ^ | *".split(" "),d=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ++ %= &= *= |= = ! ? > < : / ^ - + * & % ~ |";d=(d=d.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")).replace(/ /g,"|");var g,k=new RegExp(d,"g"),m="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),y=m.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),w=new RegExp("^(?:"+y.join("|")+")$"),x=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,v=/\/\/(?:[^\n\r\u2028\u2029]*)/g,b=/(?:(?:<\?php|<\?=)[\s\S]*?\?>)|(?:<%[\s\S]*?%>)/g,E=function(t,e){s.call(this,t,e),this._whitespace_pattern=/[\n\r\u2028\u2029\t\u000B\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff ]+/g,this._newline_pattern=/([^\n\r\u2028\u2029]*)(\r\n|[\n\r\u2028\u2029])?/g};(E.prototype=new s)._is_comment=function(t){return t.type===h.COMMENT||t.type===h.BLOCK_COMMENT||t.type===h.UNKNOWN},E.prototype._is_opening=function(t){return t.type===h.START_BLOCK||t.type===h.START_EXPR},E.prototype._is_closing=function(t,e){return(t.type===h.END_BLOCK||t.type===h.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},E.prototype._reset=function(){g=!1},E.prototype._get_next_token=function(t,e){this._readWhitespace();var i=null,n=this._input.peek();return i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_singles(n))||this._read_word(t))||this._read_comment(n))||this._read_string(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_non_javascript(n))||this._read_punctuation())||this._create_token(h.UNKNOWN,this._input.next())},E.prototype._read_word=function(t){var e;return""!==(e=this._input.read(r.identifier))?t.type!==h.DOT&&(t.type!==h.RESERVED||"set"!==t.text&&"get"!==t.text)&&w.test(e)?"in"===e||"of"===e?this._create_token(h.OPERATOR,e):this._create_token(h.RESERVED,e):this._create_token(h.WORD,e):""!==(e=this._input.read(l))?this._create_token(h.WORD,e):void 0},E.prototype._read_singles=function(t){var e=null;return null===t?e=this._create_token(h.EOF,""):"("===t||"["===t?e=this._create_token(h.START_EXPR,t):")"===t||"]"===t?e=this._create_token(h.END_EXPR,t):"{"===t?e=this._create_token(h.START_BLOCK,t):"}"===t?e=this._create_token(h.END_BLOCK,t):";"===t?e=this._create_token(h.SEMICOLON,t):"."===t&&c.test(this._input.peek(1))?e=this._create_token(h.DOT,t):","===t&&(e=this._create_token(h.COMMA,t)),e&&this._input.next(),e},E.prototype._read_punctuation=function(){var t=this._input.read(k);if(""!==t)return"="===t?this._create_token(h.EQUALS,t):this._create_token(h.OPERATOR,t)},E.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(t=this._input.next(),this._is_first_token()&&"!"===this._input.peek()){for(e=t;this._input.hasNext()&&"\n"!==t;)e+=t=this._input.next();return this._create_token(h.UNKNOWN,e.trim()+"\n")}var i="#";if(this._input.hasNext()&&this._input.testChar(u)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,i)}this._input.back()}else if("<"===t){if("?"===this._input.peek(1)||"%"===this._input.peek(1)){if(e=this._input.read(b))return e=e.replace(r.allLineBreaks,"\n"),this._create_token(h.STRING,e)}else if(this._input.match(/<\!--/g)){for(t="\x3c!--";this._input.hasNext()&&!this._input.testChar(r.newline);)t+=this._input.next();return g=!0,this._create_token(h.COMMENT,t)}}else if("-"===t&&g&&this._input.match(/-->/g))return g=!1,this._create_token(h.COMMENT,"--\x3e");return null},E.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this._input.read(x);var n=p.get_directives(i);n&&"start"===n.ignore&&(i+=p.readIgnored(this._input)),i=i.replace(r.allLineBreaks,"\n"),(e=this._create_token(h.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this._input.read(v),e=this._create_token(h.COMMENT,i))}return e},E.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,s=new n(t),_=null;for(;s.hasNext();)if((_=s.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=_[0]),"\\"===s.peek()){if(s.next(),"x"===s.peek())_=s.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==s.peek()){e+="\\",s.hasNext()&&(e+=s.next());continue}_=s.match(/u([0-9A-Fa-f]{4})/g)}if(!_)return t;if((i=parseInt(_[1],16))>126&&i<=255&&0===_[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+_[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),this._create_token(h.STRING,e)}return null},E.prototype._allow_regexp_or_xml=function(t){return t.type===h.RESERVED&&a(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===h.END_EXPR&&")"===t.text&&t.opened.previous.type===h.RESERVED&&a(t.opened.previous.text,["if","while","for"])||a(t.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},E.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,s=!1;this._input.hasNext()&&(n||s||this._input.peek()!==t)&&!this._input.testChar(r.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?s=!0:"]"===this._input.peek()&&(s=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(r.identifier)),this._create_token(h.STRING,i)}return null};var O=/<()([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/g,T=/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/g;E.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._input.test(O)&&this._allow_regexp_or_xml(e)){var i="",n=this._input.match(O);if(n){for(var s=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),_=0===s.indexOf("{"),o=0;n;){var a=!!n[1],p=n[2];if(!(!!n[n.length-1]||"![CDATA["===p.slice(0,8))&&(p===s||_&&p.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--o:++o),i+=n[0],o<=0)break;n=this._input.match(T)}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(r.allLineBreaks,"\n"),this._create_token(h.STRING,i)}}return null},E.prototype._read_string_recursive=function(t,e,i){for(var n,s="",_=!1;this._input.hasNext()&&(n=this._input.peek(),_||n!==t&&(e||!r.newline.test(n)));)(_||e)&&r.newline.test(n)?("\r"===n&&"\n"===this._input.peek(1)&&(this._input.next(),n=this._input.peek()),s+="\n"):s+=n,_?("x"!==n&&"u"!==n||(this.has_char_escapes=!0),_=!1):_="\\"===n,this._input.next(),i&&-1!==s.indexOf(i,s.length-i.length)&&(s+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(s+=this._input.next()));return s},t.exports.Tokenizer=E,t.exports.TOKEN=h,t.exports.positionable_operators=f.slice(),t.exports.line_starters=m.slice()},function(t,e,i){"use strict";var n=i(4).InputScanner,s=i(5).Token,_=i(13).TokenStream,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(t,e){this._input=new n(t),this._options=e||{},this.__tokens=null,this.__newline_count=0,this.__whitespace_before_token="",this._whitespace_pattern=/[\n\r\t ]+/g,this._newline_pattern=/([^\n\r]*)(\r\n|[\n\r])?/g};r.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new _,this._reset();for(var e=new s(o.START,""),i=null,n=[],r=new _;e.type!==o.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)r.add(t),t=this._get_next_token(e,i);r.isEmpty()||(t.comments_before=r,r=new _),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(o.RAW,i):this._create_token(o.EOF,"")},r.prototype._is_comment=function(t){return!1},r.prototype._is_opening=function(t){return!1},r.prototype._is_closing=function(t,e){return!1},r.prototype._create_token=function(t,e){var i=new s(t,e,this.__newline_count,this.__whitespace_before_token);return this.__newline_count=0,this.__whitespace_before_token="",i},r.prototype._readWhitespace=function(){var t=this._input.read(this._whitespace_pattern);if(" "===t)this.__whitespace_before_token=t;else if(""!==t){this._newline_pattern.lastIndex=0;for(var e=this._newline_pattern.exec(t);e[2];)this.__newline_count+=1,e=this._newline_pattern.exec(t);this.__whitespace_before_token=e[1]}},t.exports.Tokenizer=r,t.exports.TOKEN=o},function(t,e,i){"use strict";function n(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__items=[]}function s(t,e){this.__cache=[t],this.__level_string=e}function _(t,e){var i=t.indent_char;t.indent_size>1&&(i=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(i)),this.__indent_cache=new s(e,i),this.__alignment_cache=new s(""," "),this.baseIndentLength=e.length,this.indent_length=i.length,this.raw=!1,this._end_with_newline=t.end_with_newline,this.__lines=[],this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.__add_outputline()}n.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},n.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},n.prototype.set_indent=function(t,e){this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.baseIndentLength+this.__alignment_count+this.__indent_count*this.__parent.indent_length},n.prototype.get_character_count=function(){return this.__character_count},n.prototype.is_empty=function(){return 0===this.__items.length},n.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},n.prototype.push=function(t){this.__items.push(t),this.__character_count+=t.length},n.prototype.push_raw=function(t){this.push(t);var e=t.lastIndexOf("\n");-1!==e&&(this.__character_count=t.length-e)},n.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},n.prototype.remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_length)},n.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},n.prototype.toString=function(){var t="";return this.is_empty()||(this.__indent_count>=0&&(t=this.__parent.get_indent_string(this.__indent_count)),this.__alignment_count>=0&&(t+=this.__parent.get_alignment_string(this.__alignment_count)),t+=this.__items.join("")),t},s.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__cache.push(this.__cache[this.__cache.length-1]+this.__level_string)},s.prototype.get_level_string=function(t){return this.__ensure_cache(t),this.__cache[t]},_.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=new n(this),this.__lines.push(this.current_line)},_.prototype.get_line_number=function(){return this.__lines.length},_.prototype.get_indent_string=function(t){return this.__indent_cache.get_level_string(t)},_.prototype.get_alignment_string=function(t){return this.__alignment_cache.get_level_string(t)},_.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},_.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},_.prototype.get_code=function(t){var e=this.__lines.join("\n").replace(/[\r\n\t ]+$/,"");return this._end_with_newline&&(e+="\n"),"\n"!==t&&(e=e.replace(/[\n]/g,t)),e},_.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},_.prototype.add_raw_token=function(t){for(var e=0;e1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},_.prototype.just_added_newline=function(){return this.current_line.is_empty()},_.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},_.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var s=this.__lines[i];if(s.is_empty())break;if(0!==s.item(0).indexOf(t)&&s.item(-1)!==e){this.__lines.splice(i+1,0,new n(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},t.exports.Output=_},function(t,e,i){"use strict";function n(t,e){t=s(t,e),this.raw_options=_(t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs"),this.indent_with_tabs&&(this.indent_char="\t",this.indent_size=1),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char"))}function s(t,e){var i,n={};for(i in t=t||{})i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function _(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}n.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},n.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},n.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},n.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},n.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},n.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},n.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some(function(t){return-1===e.indexOf(t)})},t.exports.Options=n,t.exports.normalizeOpts=_,t.exports.mergeOpts=s},function(t,e,i){"use strict";function n(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position=0&&t=0&&e=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=n},function(t,e,i){"use strict";t.exports.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},function(t,e,i){"use strict";e.identifier=new RegExp("[$@A-Z_a-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ][$0-9A-Z_a-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]*","g");e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")},function(t,e,i){"use strict";function n(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp("(?:[\\s\\S]*?)((?:"+t+/\sbeautify\signore:end\s/.source+e+")|$)","g")}n.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},n.prototype.readIgnored=function(t){return t.read(this.__directives_end_ignore_pattern)},t.exports.Directives=n},function(t,e,i){"use strict";var n=i(1).Tokenizer,s=i(1).TOKEN,_=i(7).Directives,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},r=new _(/<\!--/,/-->/),a=function(t,e){n.call(this,t,e),this._current_tag_name="",this._word_pattern=this._options.indent_handlebars?/[\n\r\t <]|{{/g:/[\n\r\t <]/g};(a.prototype=new n)._is_comment=function(t){return!1},a.prototype._is_opening=function(t){return t.type===o.TAG_OPEN},a.prototype._is_closing=function(t,e){return t.type===o.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},a.prototype._reset=function(){this._current_tag_name=""},a.prototype._get_next_token=function(t,e){this._readWhitespace();var i=null,n=this._input.peek();return null===n?this._create_token(o.EOF,""):i=(i=(i=(i=(i=(i=(i=i||this._read_attribute(n,t,e))||this._read_raw_content(t,e))||this._read_comment(n))||this._read_open(n,e))||this._read_close(n,e))||this._read_content_word())||this._create_token(o.UNKNOWN,this._input.next())},a.prototype._read_comment=function(t){var e=null;if("<"===t||"{"===t){var i=this._input.peek(1),n=this._input.peek(2);if("<"===t&&("!"===i||"?"===i||"%"===i)||this._options.indent_handlebars&&"{"===t&&"{"===i&&"!"===n){for(var s="",_=">",a=!1,h=this._input.next();h&&((s+=h).charAt(s.length-1)!==_.charAt(_.length-1)||-1===s.indexOf(_));)a||(a=s.length>10,0===s.indexOf("",a=!0):0===s.indexOf("",a=!0):0===s.indexOf("",a=!0):0===s.indexOf("\x3c!--")?(_="--\x3e",a=!0):0===s.indexOf("{{!--")?(_="--}}",a=!0):0===s.indexOf("{{!")?5===s.length&&-1===s.indexOf("{{!--")&&(_="}}",a=!0):0===s.indexOf("",a=!0):0===s.indexOf("<%")&&(_="%>",a=!0)),h=this._input.next();var p=r.get_directives(s);p&&"start"===p.ignore&&(s+=r.readIgnored(this._input)),(e=this._create_token(o.COMMENT,s)).directives=p}}return e},a.prototype._read_open=function(t,e){var i=null,n=null;return e||("<"===t?(i=this._input.read(/<(?:[^\n\r\t >{][^\n\r\t >{/]*)?/g),n=this._create_token(o.TAG_OPEN,i)):this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&(i=this._input.readUntil(/[\n\r\t }]/g),n=this._create_token(o.TAG_OPEN,i))),n},a.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(o.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(o.TAG_CLOSE,"}}"))),n},a.prototype._read_attribute=function(t,e,i){var n=null,s="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(o.EQUALS,this._input.next());else if('"'===t||"'"===t){for(var _=this._input.next(),r="",a=new RegExp(t+"|{{","g");this._input.hasNext()&&(_+=r=this._input.readUntilAfter(a),'"'!==r[r.length-1]&&"'"!==r[r.length-1]);)this._input.hasNext()&&(_+=this._input.readUntilAfter(/}}/g));n=this._create_token(o.VALUE,_)}else(s="{"===t&&"{"===this._input.peek(1)?this._input.readUntilAfter(/}}/g):this._input.readUntil(/[\n\r\t =\/>]/g))&&(n=e.type===o.EQUALS?this._create_token(o.VALUE,s):this._create_token(o.ATTRIBUTE,s));return n},a.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&("script"===t||"style"===t||-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},a.prototype._read_raw_content=function(t,e){var i="";if(e&&"{"===e.text[0])i=this._input.readUntil(/}}/g);else if(t.type===o.TAG_CLOSE&&"<"===t.opened.text[0]){var n=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(n)&&(i=this._input.readUntil(new RegExp("","ig")))}return i?this._create_token(o.TEXT,i):null},a.prototype._read_content_word=function(){var t=this._input.readUntil(this._word_pattern);if(t)return this._create_token(o.TEXT,t)},t.exports.Tokenizer=a,t.exports.TOKEN=o},function(t,e,i){"use strict";var n=i(10),s=i(14),_=i(17);t.exports.js=n,t.exports.css=s,t.exports.html=function(t,e,i,o){return _(t,e,i=i||n,o=o||s)}},function(t,e,i){"use strict";var n=i(11).Beautifier;t.exports=function(t,e){return new n(t,e).beautify()}},function(t,e,i){"use strict";var n=i(2).Output,s=i(5).Token,_=i(6),o=i(12).Options,r=i(0).Tokenizer,a=i(0).line_starters,h=i(0).positionable_operators,p=i(0).TOKEN;function l(t,e){e.multiline_frame||e.mode===y.ForInitializer||e.mode===y.Conditional||t.remove_indent(e.start_line_index)}function u(t,e){return-1!==e.indexOf(t)}function c(t){return t.replace(/^\s+/g,"")}function f(t,e){return t&&t.type===p.RESERVED&&t.text===e}function d(t,e){return t&&t.type===p.RESERVED&&u(t.text,e)}var g=["case","return","do","if","throw","else","await","break","continue","async"],k=function(t){for(var e={},i=0;ii&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new s(p.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},v.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new n(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(y.BlockStatement);var i=new r(t,this._options);return this._tokens=i.tokenize(),t},v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&_.lineBreak.test(t||"")&&(e=t.match(_.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},v.prototype.handle_token=function(t,e){t.type===p.START_EXPR?this.handle_start_expr(t):t.type===p.END_EXPR?this.handle_end_expr(t):t.type===p.START_BLOCK?this.handle_start_block(t):t.type===p.END_BLOCK?this.handle_end_block(t):t.type===p.WORD?this.handle_word(t):t.type===p.RESERVED?this.handle_word(t):t.type===p.SEMICOLON?this.handle_semicolon(t):t.type===p.STRING?this.handle_string(t):t.type===p.EQUALS?this.handle_equals(t):t.type===p.OPERATOR?this.handle_operator(t):t.type===p.COMMA?this.handle_comma(t):t.type===p.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===p.COMMENT?this.handle_comment(t,e):t.type===p.DOT?this.handle_dot(t):t.type===p.EOF?this.handle_eof(t):(t.type,p.UNKNOWN,this.handle_unknown(t,e))},v.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&w(this._flags.mode);if(t.comments_before)for(var s=t.comments_before.next();s;)this.handle_whitespace_and_comments(s,e),this.handle_token(s,e),s=t.comments_before.next();if(n)for(var _=0;_0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var o=1;o=this._options.wrap_line_length&&this.print_newline(!1,!0)}}},v.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==p.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==y.Statement||this._flags.if_block&&f(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},v.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&w(this._flags.mode)&&t.newlines?(this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level)&&(this._flags.line_indent_level=this._flags.indentation_level))},v.prototype.print_token=function(t,e){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===p.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var i=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(i),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}e=e||t.text,this.print_token_line_indentation(t),this._output.add_token(e)}},v.prototype.indent=function(){this._flags.indentation_level+=1},v.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1)},v.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t)},v.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===y.Statement&&l(this._output,this._previous_flags))},v.prototype.start_of_object_property=function(){return this._flags.parent.mode===y.ObjectLiteral&&this._flags.mode===y.Statement&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"]))},v.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||d(this._flags.last_token,["var","let","const"])&&t.type===p.WORD)||f(this._flags.last_token,"do"))||d(this._flags.last_token,b)&&!t.newlines)||f(this._flags.last_token,"else")&&!(f(t,"if")&&!t.comments_before))||this._flags.last_token.type===p.END_EXPR&&(this._previous_flags.mode===y.ForInitializer||this._previous_flags.mode===y.Conditional))||this._flags.last_token.type===p.WORD&&this._flags.mode===y.BlockStatement&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==p.WORD&&t.type!==p.RESERVED)||this._flags.mode===y.ObjectLiteral&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"])))&&(this.set_mode(y.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,d(t,["do","for","if","while"])),!0)},v.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=y.Expression;if("["===t.text){if(this._flags.last_token.type===p.WORD||")"===this._flags.last_token.text)return d(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.set_mode(e),this.print_token(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=y.ArrayLiteral,w(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),u(this._flags.last_token.type,[p.START_EXPR,p.END_EXPR,p.WORD,p.OPERATOR])||(this._output.space_before_token=!0)}else this._flags.last_token.type===p.RESERVED?"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=y.ForInitializer):u(this._flags.last_token.text,["if","while"])?(this._output.space_before_token=this._options.space_before_conditional,e=y.Conditional):u(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(u(this._flags.last_token.text,a)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0):this._flags.last_token.type===p.EQUALS||this._flags.last_token.type===p.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):this._flags.last_token.type===p.WORD?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t),(this._flags.last_token.type===p.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(u(this._last_last_text,["function","yield"])||this._flags.mode===y.ObjectLiteral&&u(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function);";"===this._flags.last_token.text||this._flags.last_token.type===p.START_BLOCK?this.print_newline():this._flags.last_token.type!==p.END_EXPR&&this._flags.last_token.type!==p.START_EXPR&&this._flags.last_token.type!==p.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==p.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.set_mode(e),this.print_token(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},v.prototype.handle_end_expr=function(t){for(;this._flags.mode===y.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==p.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),"]"===t.text&&this._options.keep_array_indentation?(this.print_token(t),this.restore_mode()):(this.restore_mode(),this.print_token(t)),l(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===y.Conditional&&(this._previous_flags.mode=y.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},v.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===p.END_EXPR?(this.set_mode(y.BlockStatement),this._flags.in_case_statement=!0):i&&(u(i.text,[":",","])&&u(e.type,[p.STRING,p.WORD,p.RESERVED])||u(e.text,["get","set","..."])&&u(i.type,[p.WORD,p.RESERVED]))?u(this._last_last_text,["class","interface"])?this.set_mode(y.BlockStatement):this.set_mode(y.ObjectLiteral):this._flags.last_token.type===p.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(y.BlockStatement):u(this._flags.last_token.type,[p.EQUALS,p.START_EXPR,p.COMMA,p.OPERATOR])||d(this._flags.last_token,["return","throw","import","default"])?this.set_mode(y.ObjectLiteral):this.set_mode(y.BlockStatement);var n=!e.comments_before&&"}"===e.text&&"function"===this._flags.last_word&&this._flags.last_token.type===p.END_EXPR;if(this._options.brace_preserve_inline){var s=0,_=null;this._flags.inline_frame=!0;do{if(s+=1,(_=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(_.type!==p.EOF&&(_.type!==p.END_BLOCK||_.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==p.OPERATOR&&(n||this._flags.last_token.type===p.EQUALS||d(this._flags.last_token,g)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!w(this._previous_flags.mode)||this._flags.last_token.type!==p.START_EXPR&&this._flags.last_token.type!==p.COMMA||((this._flags.last_token.type===p.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===p.COMMA||this._flags.last_token.type===p.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==p.OPERATOR&&this._flags.last_token.type!==p.START_EXPR&&(this._flags.last_token.type!==p.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent()},v.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===y.Statement;)this.restore_mode();var e=this._flags.last_token.type===p.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(w(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},v.prototype.handle_word=function(t){if(t.type===p.RESERVED)if(u(t.text,["set","get"])&&this._flags.mode!==y.ObjectLiteral)t.type=p.WORD;else if(u(t.text,["as","from"])&&!this._flags.import_block)t.type=p.WORD;else if(this._flags.mode===y.ObjectLiteral){":"===this._tokens.peek().text&&(t.type=p.WORD)}if(this.start_of_statement(t)?d(this._flags.last_token,["var","let","const"])&&t.type===p.WORD&&(this._flags.declaration_statement=!0):!t.newlines||x(this._flags.mode)||this._flags.last_token.type===p.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===p.EQUALS||!this._options.preserve_newlines&&d(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(f(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&f(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===y.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&d(t,["case","default"]))return this.print_newline(),(this._flags.case_body||this._options.jslint_happy)&&(this.deindent(),this._flags.case_body=!1),this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==p.COMMA&&this._flags.last_token.type!==p.START_EXPR&&this._flags.last_token.type!==p.EQUALS&&this._flags.last_token.type!==p.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),f(t,"function"))return(u(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!u(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==p.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===p.RESERVED||this._flags.last_token.type===p.WORD?d(this._flags.last_token,["get","set","new","export"])||d(this._flags.last_token,b)?this._output.space_before_token=!0:f(this._flags.last_token,"default")&&"export"===this._last_last_text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===p.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!x(this._flags.mode)&&!w(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===p.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":d(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===p.SEMICOLON&&this._flags.mode===y.BlockStatement?e="NEWLINE":this._flags.last_token.type===p.SEMICOLON&&x(this._flags.mode)?e="SPACE":this._flags.last_token.type===p.STRING?e="NEWLINE":this._flags.last_token.type===p.RESERVED||this._flags.last_token.type===p.WORD||"*"===this._flags.last_token.text&&(u(this._last_last_text,["function","yield"])||this._flags.mode===y.ObjectLiteral&&u(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===p.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===p.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),d(t,a)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),d(t,["else","catch","finally"]))?(this._flags.last_token.type!==p.END_BLOCK||this._previous_flags.mode!==y.BlockStatement||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?d(this._flags.last_token,g)?this._output.space_before_token=!0:this._flags.last_token.type!==p.END_EXPR?this._flags.last_token.type===p.START_EXPR&&d(t,["var","let","const"])||":"===this._flags.last_token.text||(f(t,"if")&&f(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):d(t,a)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==p.WORD&&t.previous.type!==p.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===p.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&f(t,"from")&&(this._flags.import_block=!1))},v.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==y.Statement||this._flags.if_block&&f(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},v.prototype.handle_string=function(t){this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===p.RESERVED||this._flags.last_token.type===p.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===p.COMMA||this._flags.last_token.type===p.START_EXPR||this._flags.last_token.type===p.EQUALS||this._flags.last_token.type===p.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):this.print_newline()),this.print_token(t)},v.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},v.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(x(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===y.ObjectLiteral||this._flags.mode===y.Statement&&this._flags.parent.mode===y.ObjectLiteral?(this._flags.mode===y.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},v.prototype.handle_operator=function(t){var e="*"===t.text&&(d(this._flags.last_token,["function","yield"])||u(this._flags.last_token.type,[p.START_BLOCK,p.COMMA,p.END_BLOCK,p.SEMICOLON])),i=u(t.text,["-","+"])&&(u(this._flags.last_token.type,[p.START_BLOCK,p.START_EXPR,p.EQUALS,p.OPERATOR])||u(this._flags.last_token.text,a)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(d(this._flags.last_token,g))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==p.DOT)if("::"!==t.text){if(this._flags.last_token.type===p.OPERATOR&&u(this._options.operator_position,m)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this._flags.case_body=!0,this.indent(),this.print_token(t),this.print_newline(),void(this._flags.in_case=!1);var s=!0,_=!0,o=!1;if(":"===t.text?0===this._flags.ternary_depth?s=!1:(this._flags.ternary_depth-=1,o=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&u(t.text,h)){var r=":"===t.text,l=r&&o,c=r&&!o;switch(this._options.operator_position){case k.before_newline:return this._output.space_before_token=!c,this.print_token(t),r&&!l||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case k.after_newline:return this._output.space_before_token=!0,!r||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case k.preserve_newline:return c||this.allow_wrap_or_preserved_newline(t),s=!(this._output.just_added_newline()||c),this._output.space_before_token=s,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),s=!1;var f=this._tokens.peek();_=f&&u(f.type,[p.WORD,p.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),s=this._flags.last_token.type===p.START_BLOCK,_=!1):(u(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==p.COMMA&&this._flags.last_token.type!==p.START_EXPR||this.allow_wrap_or_preserved_newline(t),s=!1,_=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&x(this._flags.mode)&&(s=!0),this._flags.last_token.type===p.RESERVED?s=!0:this._flags.last_token.type===p.END_EXPR?s=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===p.OPERATOR&&(s=u(t.text,["--","-","++","+"])&&u(this._flags.last_token.text,["--","-","++","+"]),u(t.text,["+","-"])&&u(this._flags.last_token.text,["--","++"])&&(_=!0)),(this._flags.mode!==y.BlockStatement||this._flags.inline_frame)&&this._flags.mode!==y.Statement||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||s,this.print_token(t),this._output.space_before_token=_}else this.print_token(t);else this.print_token(t)},v.prototype.handle_block_comment=function(t,e){if(this._output.raw)return this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw));if(t.directives)return this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0);if(!_.newline.test(t.text)&&!t.newlines)return this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0);var i,n=function(t){for(var e=[],i=(t=t.replace(_.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),s=!1,o=!1,r=t.whitespace_before,a=r.length;for(this.print_newline(!1,e),n.length>1&&(s=function(t,e){for(var i=0;ia?this.print_token(t,n[i].substring(a)):this._output.add_token(n[i]);this.print_newline(!1,e)},v.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},v.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),this._options.unindent_chained_methods&&this.deindent(),d(this._flags.last_token,g)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this.print_token(t)},v.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},v.prototype.handle_eof=function(t){for(;this._flags.mode===y.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t)},t.exports.Beautifier=v},function(t,e,i){"use strict";var n=i(3).Options,s=["before-newline","after-newline","preserve-newline"];function _(t){n.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var _=0;_=0&&t0&&this._indentLevel--},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&o.test(t||"")&&(e=t.match(o)[0]));var i=(t=t.replace(r,"\n")).match(/^[\t ]*/)[0];this._output=new s(this._options,i),this._input=new _(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n=0,u=!1,c=!1,f=!1,d=!1,g=!1,k=this._ch;;){var m=""!==this._input.read(h),y=k;if(this._ch=this._input.next(),k=this._ch,!this._ch)break;if("/"===this._ch&&"*"===this._input.peek())this._output.add_new_line(),this._input.back(),this.print_string(this._input.read(p)),this.eatWhitespace(!0),this._output.add_new_line();else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(l)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(m),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var w=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);w.match(/[ :]$/)&&(w=this.eatString(": ").replace(/\s$/,""),this.print_string(w),this._output.space_before_token=!0),"extend"===(w=w.replace(/\s$/,""))?d=!0:"import"===w&&(g=!0),w in this.NESTED_AT_RULE?(this._nestedLevel+=1,w in this.CONDITIONAL_GROUP_RULE&&(f=!0)):u||0!==n||-1===w.indexOf(":")||(c=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(m),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(c&&(c=!1,this.outdent()),this.indent(),this._output.space_before_token=!0,this.print_string(this._ch),f?(f=!1,u=this._indentLevel>this._nestedLevel):u=this._indentLevel>=this._nestedLevel,this._options.newline_between_rules&&u&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===y&&this._output.trim(!0),g=!1,d=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),u=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!u&&!f||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||d?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),c||(c=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(m),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?(c&&(this.outdent(),c=!1),d=!1,g=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"!==this._ch?(this._input.back(),n++):this._ch&&this.print_string(this._ch+this.eatString(")"))):(n++,this.preserveSingleSpace(m),this.print_string(this._ch),this.eatWhitespace()):")"===this._ch?(this.print_string(this._ch),n--):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&!c&&n<1&&!g?this._output.add_new_line():this._output.space_before_token=!0):(">"===this._ch||"+"===this._ch||"~"===this._ch)&&!c&&n<1?this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.test(this._ch)&&(this._ch="")):"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(m),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="")):"!"===this._ch?(this.print_string(" "),this.print_string(this._ch)):(this.preserveSingleSpace(m),this.print_string(this._ch))}return this._output.get_code(e)},t.exports.Beautifier=u},function(t,e,i){"use strict";var n=i(3).Options;function s(t){n.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e}s.prototype=new n,t.exports.Options=s},function(t,e,i){"use strict";var n=i(18).Beautifier;t.exports=function(t,e,i,s){return new n(t,e,i,s).beautify()}},function(t,e,i){"use strict";var n=i(19).Options,s=i(2).Output,_=i(8).Tokenizer,o=i(8).TOKEN,r=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,h=function(t,e){this.indent_level=0,this.alignment_size=0,this.wrap_line_length=t.wrap_line_length,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new s(t,e)};h.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},h.prototype.set_space_before_token=function(t){this._output.space_before_token=t},h.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},h.prototype.traverse_whitespace=function(t){if(t.whitespace_before||t.newlines){var e=0;if(t.type!==o.TEXT&&t.previous.type!==o.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines0);else this._output.space_before_token=!0,this.print_space_or_wrap(t.text);return!0}return!1},h.prototype.print_space_or_wrap=function(t){return!!(this.wrap_line_length&&this._output.current_line.get_character_count()+t.length+1>=this.wrap_line_length)&&this._output.add_new_line()},h.prototype.print_newline=function(t){this._output.add_new_line(t)},h.prototype.print_token=function(t){t&&(this._output.current_line.is_empty()&&this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t))},h.prototype.print_raw_text=function(t){this._output.current_line.push_raw(t)},h.prototype.indent=function(){this.indent_level++},h.prototype.unindent=function(){this.indent_level>0&&this.indent_level--},h.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};function p(t,e){return-1!==e.indexOf(t)}function l(t){this._printer=t,this._current_frame=null}function u(t,e,i,s){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=s,this._tag_stack=null;var _=new n(e,"html");this._options=_,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes}l.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},l.prototype.record_tag=function(t){var e=new function(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}(this._current_frame,t,this._printer.indent_level);this._current_frame=e},l.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},l.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},l.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},l.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&r.test(t)&&(e=t.match(r)[0])),t=t.replace(a,"\n");var i={text:"",type:""},n=new c,s=new h(this._options,""),p=new _(t,this._options).tokenize();this._tag_stack=new l(s);for(var u=null,f=p.next();f.type!==o.EOF;)f.type===o.TAG_OPEN||f.type===o.COMMENT?n=u=this._handle_tag_open(s,f,n,i):f.type===o.ATTRIBUTE||f.type===o.EQUALS||f.type===o.VALUE||f.type===o.TEXT&&!n.tag_complete?u=this._handle_inside_tag(s,f,n,p):f.type===o.TAG_CLOSE?u=this._handle_tag_close(s,f,n):f.type===o.TEXT?u=this._handle_text(s,f,n):s.add_raw_token(f),i=u,f=p.next();return s._output.get_code(e)},u.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0]),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e.text)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),n},u.prototype._handle_inside_tag=function(t,e,i,n){var s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before),i.is_unformatted)t.add_raw_token(e);else{if("<"===i.tag_start_char&&(e.type===o.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):e.type===o.EQUALS?t.set_space_before_token(!1):e.type===o.VALUE&&e.previous.type===o.EQUALS&&t.set_space_before_token(!1)),t._output.space_before_token&&"<"===i.tag_start_char){var _=t.print_space_or_wrap(e.text);if(e.type===o.ATTRIBUTE){var r=_&&!this._is_wrap_attributes_force;if(this._is_wrap_attributes_force){var a=!1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var h,p=!0,l=0;do{if((h=n.peek(l)).type===o.ATTRIBUTE){p=!1;break}l+=1}while(l<4&&h.type!==o.EOF&&h.type!==o.TAG_CLOSE);a=!p}(i.attr_count>1||a)&&(t.print_newline(!1),r=!0)}r&&(i.has_wrapped_attrs=!0)}}t.print_token(e.text)}return s},u.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e.text)),n},u.prototype._print_custom_beatifier_text=function(t,e,i){if(""!==e.text){t.print_newline(!1);var n,s=e.text,_=1;"script"===i.tag_name?n="function"==typeof this._js_beautify&&this._js_beautify:"style"===i.tag_name&&(n="function"==typeof this._css_beautify&&this._css_beautify),"keep"===this._options.indent_scripts?_=0:"separate"===this._options.indent_scripts&&(_=-t.indent_level);var o=t.get_full_indent(_);if(s=s.replace(/\n[ \t]*$/,""),n){var r=function(){this.eol="\n"};r.prototype=this._options.raw_options,s=n(o+s,new r)}else{var a=s.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(this._options.indent_string).length-1,h=this._get_full_indent(_-a);s=(o+s.trim()).replace(/\r\n|\r|\n/g,"\n"+h)}s&&(t.print_raw_text(s),t.print_newline(!0))}},u.prototype._handle_tag_open=function(t,e,i,n){var s=this._get_tag_open_token(e);return t.traverse_whitespace(e),this._set_tag_position(t,e,s,i,n),(i.is_unformatted||i.is_content_unformatted)&&e.type===o.TAG_OPEN&&0===e.text.indexOf("]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{\#?([^\s}]+)/),this.tag_check=i?i[1]:""),this.tag_check=this.tag_check.toLowerCase(),e.type===o.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};u.prototype._get_tag_open_token=function(t){var e=new c(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||p(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&p(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&p(e.tag_check,this._options.content_unformatted),e.is_inline_element=p(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},u.prototype._set_tag_position=function(t,e,i,n,s){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier=function(t,e){var i=e.next;if(!e.closed)return!1;for(;i.type!==o.EOF&&i.closed!==e;){if(i.type===o.ATTRIBUTE&&"type"===i.text){var n=i.next?i.next:i,s=n.next?n.next:n;return n.type===o.EQUALS&&s.type===o.VALUE&&("style"===t&&s.text.search("text/css")>-1||"script"===t&&s.text.search(/(text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect)/)>-1)}i=i.next}return!0}(i.tag_check,e)))),p(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&s.type===o.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||i.is_inline_element||i.is_unformatted||t.print_newline(!1)}else i.is_unformatted||i.is_content_unformatted?i.is_inline_element||i.is_unformatted||t.print_newline(!1):i.is_end_tag?(i.start_tag_token&&i.start_tag_token.multiline_content||!(i.is_inline_element||n.is_inline_element||s.type===o.TAG_CLOSE&&i.start_tag_token===n||"TK_CONTENT"===s.type))&&t.print_newline(!1):(i.indent_content=!i.custom_beautifier,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||"TK_CONTENT"===s.type||(i.parent&&(i.parent.multiline_content=!0),t.print_newline(!1)))},u.prototype._do_optional_end_element=function(t){!t.is_empty_element&&t.is_start_tag&&t.parent&&("body"===t.tag_name?this._tag_stack.try_pop("head"):"li"===t.tag_name?this._tag_stack.try_pop("li",["ol","ul"]):"dd"===t.tag_name||"dt"===t.tag_name?(this._tag_stack.try_pop("dt",["dl"]),this._tag_stack.try_pop("dd",["dl"])):"rp"===t.tag_name||"rt"===t.tag_name?(this._tag_stack.try_pop("rt",["ruby","rtc"]),this._tag_stack.try_pop("rp",["ruby","rtc"])):"optgroup"===t.tag_name?this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?(this._tag_stack.try_pop("caption",["table"]),this._tag_stack.try_pop("colgroup",["table"])):"tbody"===t.tag_name||"tfoot"===t.tag_name?(this._tag_stack.try_pop("caption",["table"]),this._tag_stack.try_pop("colgroup",["table"]),this._tag_stack.try_pop("thead",["table"]),this._tag_stack.try_pop("tbody",["table"])):"tr"===t.tag_name?(this._tag_stack.try_pop("caption",["table"]),this._tag_stack.try_pop("colgroup",["table"]),this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):"th"!==t.tag_name&&"td"!==t.tag_name||(this._tag_stack.try_pop("td",["tr"]),this._tag_stack.try_pop("th",["tr"])),t.parent=this._tag_stack.get_parser_token())},t.exports.Beautifier=u},function(t,e,i){"use strict";var n=i(3).Options;function s(t){n.call(this,t,"html"),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","address","big","dt","ins","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","?php","?=","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}s.prototype=new n,t.exports.Options=s}])}); //# sourceMappingURL=beautifier.min.js.map \ No newline at end of file diff --git a/js/lib/beautifier.min.js.map b/js/lib/beautifier.min.js.map index c559d369f..3e1bea479 100644 --- a/js/lib/beautifier.min.js.map +++ b/js/lib/beautifier.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://beautifier/webpack/universalModuleDefinition","webpack://beautifier/webpack/bootstrap","webpack://beautifier/./js/src/javascript/tokenizer.js","webpack://beautifier/./js/src/core/tokenizer.js","webpack://beautifier/./js/src/core/output.js","webpack://beautifier/./js/src/core/options.js","webpack://beautifier/./js/src/core/inputscanner.js","webpack://beautifier/./js/src/javascript/acorn.js","webpack://beautifier/./js/src/core/directives.js","webpack://beautifier/./js/src/html/tokenizer.js","webpack://beautifier/./js/src/index.js","webpack://beautifier/./js/src/javascript/index.js","webpack://beautifier/./js/src/javascript/beautifier.js","webpack://beautifier/./js/src/javascript/options.js","webpack://beautifier/./js/src/core/token.js","webpack://beautifier/./js/src/core/tokenstream.js","webpack://beautifier/./js/src/css/index.js","webpack://beautifier/./js/src/css/beautifier.js","webpack://beautifier/./js/src/css/options.js","webpack://beautifier/./js/src/html/index.js","webpack://beautifier/./js/src/html/beautifier.js","webpack://beautifier/./js/src/html/options.js"],"names":["root","factory","exports","module","define","amd","self","windows","window","global","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","InputScanner","BaseTokenizer","Tokenizer","BASETOKEN","TOKEN","Directives","acorn","in_array","what","arr","indexOf","START_EXPR","END_EXPR","START_BLOCK","END_BLOCK","WORD","RESERVED","SEMICOLON","STRING","EQUALS","OPERATOR","COMMA","BLOCK_COMMENT","COMMENT","DOT","UNKNOWN","START","RAW","EOF","directives_core","number_pattern","digit","dot_pattern","positionable_operators","split","punct","replace","in_html_comment","punct_pattern","RegExp","line_starters","reserved_words","concat","reserved_word_pattern","join","block_comment_pattern","comment_pattern","template_pattern","input_string","options","_whitespace_pattern","_newline_pattern","_is_comment","current_token","type","_is_opening","_is_closing","open_token","text","_reset","_get_next_token","previous_token","_readWhitespace","token","_input","peek","_read_singles","_read_word","_read_comment","_read_string","_read_regexp","_read_xml","_read_non_javascript","_read_punctuation","_create_token","next","resulting_string","read","identifier","test","_is_first_token","hasNext","trim","sharp","testChar","back","allLineBreaks","match","newline","comment","directives","get_directives","ignore","readIgnored","has_char_escapes","_read_string_recursive","_options","unescape_strings","out","escaped","input_scan","matched","parseInt","String","fromCharCode","unescape_string","_allow_regexp_or_xml","opened","previous","esc","in_char_class","startXmlRegExp","xmlRegExp","e4x","xmlStr","rootTag","isCurlyRoot","depth","isEndTag","tagName","length","slice","delimiter","allow_unescaped_newlines","start_sub","current_char","Token","TokenStream","__tokens","__newline_count","__whitespace_before_token","tokenize","current","restart","open_stack","comments","add","isEmpty","comments_before","parent","push","closed","pop","lastIndex","nextMatch","exec","OutputLine","__parent","__character_count","__indent_count","__alignment_count","__items","IndentCache","base_string","level_string","__cache","__level_string","Output","indent_string","baseIndentString","__indent_cache","__alignment_cache","baseIndentLength","indent_length","raw","__lines","previous_line","current_line","space_before_token","__add_outputline","item","index","has_match","pattern","lastCheckedOutput","set_indent","indent","alignment","get_character_count","is_empty","last","push_raw","last_newline_index","lastIndexOf","remove_indent","toString","result","get_indent_string","get_alignment_string","__ensure_cache","level","get_level_string","get_line_number","add_new_line","force_newline","just_added_newline","get_code","end_with_newline","eol","sweet_code","add_raw_token","x","newlines","whitespace_before","add_token","printable_token","add_space_before_token","output_length","eat_newlines","undefined","just_added_blankline","ensure_empty_line_above","starts_with","ends_with","potentialEmptyLine","splice","Options","merge_child_field","_mergeOpts","raw_options","_normalizeOpts","disabled","_get_boolean","_get_characters","indent_size","_get_number","indent_char","indent_level","preserve_newlines","max_preserve_newlines","indent_with_tabs","Array","base_indent_string","wrap_line_length","allOptions","childFieldName","finalOpts","convertedOpts","_get_array","default_value","option_value","isNaN","_get_selection","selection_list","_is_valid_selection","Error","some","normalizeOpts","mergeOpts","__input","__input_length","__position","val","charAt","pattern_match","readUntil","include_match","match_index","substring","readUntilAfter","peekUntilAfter","start","lookBack","testVal","toLowerCase","identifierStart","lineBreak","source","start_block_pattern","end_block_pattern","__directives_block_pattern","__directive_pattern","__directives_end_ignore_pattern","directive_match","input","TAG_OPEN","TAG_CLOSE","ATTRIBUTE","VALUE","TEXT","_current_tag_name","_word_pattern","indent_handlebars","_read_attribute","_read_raw_content","_read_open","_read_close","_read_content_word","peek1","peek2","input_char","content","string_pattern","_is_content_unformatted","tag_name","void_elements","content_unformatted","unformatted","substr","js_beautify","css_beautify","html_beautify","js","css","html","html_source","Beautifier","js_source_text","beautify","remove_redundant_indentation","output","frame","multiline_frame","MODE","ForInitializer","Conditional","start_line_index","ltrim","OPERATOR_POSITION","list","generateMapFromStrings","OPERATOR_POSITION_BEFORE_OR_PRESERVE","before_newline","preserve_newline","BlockStatement","Statement","ObjectLiteral","ArrayLiteral","Expression","is_array","is_expression","is_special_word","word","source_text","_source_text","_output","_tokens","_last_type","_last_last_text","_flags","_previous_flags","_flag_store","create_flags","flags_base","next_indent_level","indentation_level","line_indent_level","last_text","last_word","declaration_statement","declaration_assignment","inline_frame","if_block","else_block","do_block","do_while","import_block","in_case_statement","in_case","case_body","ternary_depth","test_output_raw","set_mode","tokenizer","handle_token","preserve_statement_flags","handle_start_expr","handle_end_expr","handle_start_block","handle_end_block","handle_word","handle_semicolon","handle_string","handle_equals","handle_operator","handle_comma","handle_block_comment","handle_comment","handle_dot","handle_eof","handle_unknown","handle_whitespace_and_comments","keep_whitespace","keep_array_indentation","comment_token","print_newline","j","newline_restricted_tokens","allow_wrap_or_preserved_newline","force_linewrap","shouldPreserveOrForce","shouldPrintOperatorNewline","operator_position","next_token","restore_mode","print_token_line_indentation","print_token","comma_first","popped","deindent","start_of_object_property","start_of_statement","next_mode","space_in_paren","space_before_conditional","space_after_anon_function","space_in_empty_paren","second_token","empty_anonymous_function","brace_preserve_inline","check_token","brace_style","empty_braces","jslint_happy","prefix","isGeneratorAsterisk","isUnary","space_before","space_after","in_ternary","isColon","isTernaryColon","isOtherColon","after_newline","preserve","lines","idx","split_linebreaks","javadoc","starless","lastIndent","lastIndentLength","all_lines_start_with","line","len","each_line_matches_indent","unindent_chained_methods","break_chained_methods","BaseOptions","validPositionValues","raw_brace_style","braces_on_own_line","brace_style_split","bs","parent_token","__tokens_length","__parent_token","whitespaceChar","whitespacePattern","_ch","NESTED_AT_RULE","@page","@font-face","@keyframes","@media","@supports","@document","CONDITIONAL_GROUP_RULE","eatString","endChars","eatWhitespace","allowAtLeastOneNewLine","isFirstNewLine","foundNestedPseudoClass","openParen","ch","print_string","output_string","_indentLevel","preserveSingleSpace","isAfterSpace","outdent","_nestedLevel","parenLevel","insideRule","insidePropertyValue","enteringConditionalGroup","insideAtExtend","insideAtImport","topCharacter","previous_ch","variableOrRule","newline_between_rules","selector_separator_newline","space_around_combinator","space_around_selector_separator","Printer","alignment_size","current_line_has_match","set_space_before_token","traverse_whitespace","raw_token","print_space_or_wrap","force","print_raw_text","unindent","get_full_indent","TagStack","printer","_printer","_current_frame","_js_beautify","_css_beautify","_tag_stack","optionHtml","_is_wrap_attributes_force","wrap_attributes","_is_wrap_attributes_force_expand_multiline","_is_wrap_attributes_force_aligned","_is_wrap_attributes_aligned_multiple","get_parser_token","parser_token","record_tag","new_frame","tag","_try_pop_frame","_get_frame","tag_list","stop_list","try_pop","indent_to_tag","last_token","last_tag_token","TagOpenParserToken","tokens","_handle_tag_open","tag_complete","_handle_inside_tag","_handle_tag_close","_handle_text","is_unformatted","tag_start_char","has_wrapped_attrs","indent_content","is_content_unformatted","attr_count","wrapped","indentAttrs","force_first_attr_wrap","peek_token","is_only_attribute","peek_index","custom_beautifier","_print_custom_beatifier_text","_beautifier","script_indent_level","indent_scripts","indentation","Child_options","_level","reindent","_get_full_indent","_get_tag_open_token","_set_tag_position","tag_check_match","is_inline_element","is_empty_element","is_start_tag","is_end_tag","multiline_content","start_tag_token","tag_check","wrap_attributes_indent_size","inline","_do_optional_end_element","start_token","peekEquals","peekValue","search","uses_beautifier","extra_liners","indent_inner_html","indent_head_inner_html","indent_body_inner_html"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,gBAAAH,GACA,iBAAAC,QACAA,QAAA,WAAAD,IAEAD,EAAA,WAAAC,IARA,CASC,oBAAAK,UAAA,oBAAAC,QAAAC,OAAA,oBAAAC,cAAAC,KAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAX,QAGA,IAAAC,EAAAQ,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAb,YAUA,OANAc,EAAAH,GAAAI,KAAAd,EAAAD,QAAAC,IAAAD,QAAAU,GAGAT,EAAAY,GAAA,EAGAZ,EAAAD,QA0DA,OArDAU,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAlB,EAAAmB,EAAAC,GACAV,EAAAW,EAAArB,EAAAmB,IACAG,OAAAC,eAAAvB,EAAAmB,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAA1B,GACA,oBAAA2B,eAAAC,aACAN,OAAAC,eAAAvB,EAAA2B,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAvB,EAAA,cAAiD6B,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE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AAzN,WAGH1U,KAAA2hB,WAAAgB,QAAA,aACA3iB,KAAA2hB,WAAAgB,QAAA,cASAR,EAAApX,OAAA/K,KAAA2hB,WAAAO,qBAIAziB,EAAAD,QAAA8V,2CCvsBA,IAAAoI,EAAkBxd,EAAQ,GAAiB0P,QAE3C,SAAAA,EAAAvK,GACAqY,EAAAnd,KAAAP,KAAAqF,EAAA,QAEArF,KAAA+lB,kBAAA/lB,KAAAkQ,aAAA,qBACAlQ,KAAAimB,uBAAAjmB,KAAAkQ,aAAA,6BACAlQ,KAAAgmB,uBAAAhmB,KAAAkQ,aAAA,6BAEAlQ,KAAA8T,kBAAA9T,KAAAkQ,aAAA,wBACAlQ,KAAA8hB,gBAAA9hB,KAAAsR,eAAA,mBACA,gFACAtR,KAAAslB,4BAAAtlB,KAAAqQ,YAAA,8BAAArQ,KAAAoQ,aACApQ,KAAA8lB,aAAA9lB,KAAAkR,WAAA,wCAEAlR,KAAAulB,OAAAvlB,KAAAkR,WAAA,UAEA,wEACA,qEACA,4EACA,oEACA,yEACA,qBAEA,qDAEAlR,KAAA2U,cAAA3U,KAAAkR,WAAA,iBAGA,6DACA,wDAKA,kBAEA,YAEA,uBAEAlR,KAAA6U,YAAA7U,KAAAkR,WAAA,kBACAlR,KAAA4U,oBAAA5U,KAAAkR,WAAA,uBACA,mBAEAlR,KAAAskB,eAAAtkB,KAAAsR,eAAA,+CAEA1B,EAAA5N,UAAA,IAAA0b,EAIAje,EAAAD,QAAAoQ","file":"beautifier.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"beautifier\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"beautifier\"] = factory();\n\telse\n\t\troot[\"beautifier\"] = factory();\n})(typeof self !== 'undefined' ? self : typeof windows !== 'undefined' ? window : typeof global !== 'undefined' ? global : this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 8);\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\nvar acorn = require('./acorn');\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\n\nvar TOKEN = {\n START_EXPR: 'TK_START_EXPR',\n END_EXPR: 'TK_END_EXPR',\n START_BLOCK: 'TK_START_BLOCK',\n END_BLOCK: 'TK_END_BLOCK',\n WORD: 'TK_WORD',\n RESERVED: 'TK_RESERVED',\n SEMICOLON: 'TK_SEMICOLON',\n STRING: 'TK_STRING',\n EQUALS: 'TK_EQUALS',\n OPERATOR: 'TK_OPERATOR',\n COMMA: 'TK_COMMA',\n BLOCK_COMMENT: 'TK_BLOCK_COMMENT',\n COMMENT: 'TK_COMMENT',\n DOT: 'TK_DOT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\n\nvar directives_core = new Directives(/\\/\\*/, /\\*\\//);\n\nvar number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\\d+n|(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?/g;\n\nvar digit = /[0-9]/;\n\n// Dot \".\" must be distinguished from \"...\" and decimal\nvar dot_pattern = /[^\\d\\.]/;\n\nvar positionable_operators = (\n \">>> === !== \" +\n \"<< && >= ** != == <= >> || \" +\n \"< / - + > : & % ? ^ | *\").split(' ');\n\n// IMPORTANT: this must be sorted longest to shortest or tokenizing many not work.\n// Also, you must update possitionable operators separately from punct\nvar punct =\n \">>>= \" +\n \"... >>= <<= === >>> !== **= \" +\n \"=> ^= :: /= << <= == && -= >= >> != -- += ** || ++ %= &= *= |= \" +\n \"= ! ? > < : / ^ - + * & % ~ |\";\n\npunct = punct.replace(/[-[\\]{}()*+?.,\\\\^$|#]/g, \"\\\\$&\");\npunct = punct.replace(/ /g, '|');\n\nvar punct_pattern = new RegExp(punct, 'g');\n\n// words which should always start on new line.\nvar line_starters = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(',');\nvar reserved_words = line_starters.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as']);\nvar reserved_word_pattern = new RegExp('^(?:' + reserved_words.join('|') + ')$');\n\n// /* ... */ comment ends with nearest */ or end of file\nvar block_comment_pattern = /\\/\\*(?:[\\s\\S]*?)((?:\\*\\/)|$)/g;\n\n// comment ends just before nearest linefeed or end of file\nvar comment_pattern = /\\/\\/(?:[^\\n\\r\\u2028\\u2029]*)/g;\n\nvar template_pattern = /(?:(?:<\\?php|<\\?=)[\\s\\S]*?\\?>)|(?:<%[\\s\\S]*?%>)/g;\n\nvar in_html_comment;\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n\n this._whitespace_pattern = /[\\n\\r\\u2028\\u2029\\t\\u000B\\u00A0\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff ]+/g;\n this._newline_pattern = /([^\\n\\r\\u2028\\u2029]*)(\\r\\n|[\\n\\r\\u2028\\u2029])?/g;\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) {\n return current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.BLOCK_COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.START_BLOCK || current_token.type === TOKEN.START_EXPR;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return (current_token.type === TOKEN.END_BLOCK || current_token.type === TOKEN.END_EXPR) &&\n (open_token && (\n (current_token.text === ']' && open_token.text === '[') ||\n (current_token.text === ')' && open_token.text === '(') ||\n (current_token.text === '}' && open_token.text === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n in_html_comment = false;\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var token = null;\n var c = this._input.peek();\n\n token = token || this._read_singles(c);\n token = token || this._read_word(previous_token);\n token = token || this._read_comment(c);\n token = token || this._read_string(c);\n token = token || this._read_regexp(c, previous_token);\n token = token || this._read_xml(c, previous_token);\n token = token || this._read_non_javascript(c);\n token = token || this._read_punctuation();\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_word = function(previous_token) {\n var resulting_string;\n resulting_string = this._input.read(acorn.identifier);\n if (resulting_string !== '') {\n if (!(previous_token.type === TOKEN.DOT ||\n (previous_token.type === TOKEN.RESERVED && (previous_token.text === 'set' || previous_token.text === 'get'))) &&\n reserved_word_pattern.test(resulting_string)) {\n if (resulting_string === 'in' || resulting_string === 'of') { // hack for 'in' and 'of' operators\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n return this._create_token(TOKEN.RESERVED, resulting_string);\n }\n\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n\n resulting_string = this._input.read(number_pattern);\n if (resulting_string !== '') {\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n};\n\nTokenizer.prototype._read_singles = function(c) {\n var token = null;\n if (c === null) {\n token = this._create_token(TOKEN.EOF, '');\n } else if (c === '(' || c === '[') {\n token = this._create_token(TOKEN.START_EXPR, c);\n } else if (c === ')' || c === ']') {\n token = this._create_token(TOKEN.END_EXPR, c);\n } else if (c === '{') {\n token = this._create_token(TOKEN.START_BLOCK, c);\n } else if (c === '}') {\n token = this._create_token(TOKEN.END_BLOCK, c);\n } else if (c === ';') {\n token = this._create_token(TOKEN.SEMICOLON, c);\n } else if (c === '.' && dot_pattern.test(this._input.peek(1))) {\n token = this._create_token(TOKEN.DOT, c);\n } else if (c === ',') {\n token = this._create_token(TOKEN.COMMA, c);\n }\n\n if (token) {\n this._input.next();\n }\n return token;\n};\n\nTokenizer.prototype._read_punctuation = function() {\n var resulting_string = this._input.read(punct_pattern);\n\n if (resulting_string !== '') {\n if (resulting_string === '=') {\n return this._create_token(TOKEN.EQUALS, resulting_string);\n } else {\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n }\n};\n\nTokenizer.prototype._read_non_javascript = function(c) {\n var resulting_string = '';\n\n if (c === '#') {\n c = this._input.next();\n\n if (this._is_first_token() && this._input.peek() === '!') {\n // shebang\n resulting_string = c;\n while (this._input.hasNext() && c !== '\\n') {\n c = this._input.next();\n resulting_string += c;\n }\n return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\\n');\n }\n\n // Spidermonkey-specific sharp variables for circular references. Considered obsolete.\n var sharp = '#';\n if (this._input.hasNext() && this._input.testChar(digit)) {\n do {\n c = this._input.next();\n sharp += c;\n } while (this._input.hasNext() && c !== '#' && c !== '=');\n if (c === '#') {\n //\n } else if (this._input.peek() === '[' && this._input.peek(1) === ']') {\n sharp += '[]';\n this._input.next();\n this._input.next();\n } else if (this._input.peek() === '{' && this._input.peek(1) === '}') {\n sharp += '{}';\n this._input.next();\n this._input.next();\n }\n return this._create_token(TOKEN.WORD, sharp);\n }\n\n this._input.back();\n\n } else if (c === '<') {\n if (this._input.peek(1) === '?' || this._input.peek(1) === '%') {\n resulting_string = this._input.read(template_pattern);\n if (resulting_string) {\n resulting_string = resulting_string.replace(acorn.allLineBreaks, '\\n');\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n } else if (this._input.match(/<\\!--/g)) {\n c = '/g)) {\n in_html_comment = false;\n return this._create_token(TOKEN.COMMENT, '-->');\n }\n\n return null;\n};\n\nTokenizer.prototype._read_comment = function(c) {\n var token = null;\n if (c === '/') {\n var comment = '';\n if (this._input.peek(1) === '*') {\n // peek for comment /* ... */\n comment = this._input.read(block_comment_pattern);\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n comment = comment.replace(acorn.allLineBreaks, '\\n');\n token = this._create_token(TOKEN.BLOCK_COMMENT, comment);\n token.directives = directives;\n } else if (this._input.peek(1) === '/') {\n // peek for comment // ...\n comment = this._input.read(comment_pattern);\n token = this._create_token(TOKEN.COMMENT, comment);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_string = function(c) {\n if (c === '`' || c === \"'\" || c === '\"') {\n var resulting_string = this._input.next();\n this.has_char_escapes = false;\n\n if (c === '`') {\n resulting_string += this._read_string_recursive('`', true, '${');\n } else {\n resulting_string += this._read_string_recursive(c);\n }\n\n if (this.has_char_escapes && this._options.unescape_strings) {\n resulting_string = unescape_string(resulting_string);\n }\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n }\n\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._allow_regexp_or_xml = function(previous_token) {\n // regex and xml can only appear in specific locations during parsing\n return (previous_token.type === TOKEN.RESERVED && in_array(previous_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) ||\n (previous_token.type === TOKEN.END_EXPR && previous_token.text === ')' &&\n previous_token.opened.previous.type === TOKEN.RESERVED && in_array(previous_token.opened.previous.text, ['if', 'while', 'for'])) ||\n (in_array(previous_token.type, [TOKEN.COMMENT, TOKEN.START_EXPR, TOKEN.START_BLOCK, TOKEN.START,\n TOKEN.END_BLOCK, TOKEN.OPERATOR, TOKEN.EQUALS, TOKEN.EOF, TOKEN.SEMICOLON, TOKEN.COMMA\n ]));\n};\n\nTokenizer.prototype._read_regexp = function(c, previous_token) {\n\n if (c === '/' && this._allow_regexp_or_xml(previous_token)) {\n // handle regexp\n //\n var resulting_string = this._input.next();\n var esc = false;\n\n var in_char_class = false;\n while (this._input.hasNext() &&\n ((esc || in_char_class || this._input.peek() !== c) &&\n !this._input.testChar(acorn.newline))) {\n resulting_string += this._input.peek();\n if (!esc) {\n esc = this._input.peek() === '\\\\';\n if (this._input.peek() === '[') {\n in_char_class = true;\n } else if (this._input.peek() === ']') {\n in_char_class = false;\n }\n } else {\n esc = false;\n }\n this._input.next();\n }\n\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n\n // regexps may have modifiers /regexp/MOD , so fetch those, too\n // Only [gim] are valid, but if the user puts in garbage, do what we can to take it.\n resulting_string += this._input.read(acorn.identifier);\n }\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n return null;\n};\n\n\nvar startXmlRegExp = /<()([-a-zA-Z:0-9_.]+|{[\\s\\S]+?}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+{[\\s\\S]+?}|\\s+[-a-zA-Z:0-9_.]+|\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{[\\s\\S]+?}))*\\s*(\\/?)\\s*>/g;\nvar xmlRegExp = /[\\s\\S]*?<(\\/?)([-a-zA-Z:0-9_.]+|{[\\s\\S]+?}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+{[\\s\\S]+?}|\\s+[-a-zA-Z:0-9_.]+|\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{[\\s\\S]+?}))*\\s*(\\/?)\\s*>/g;\n\nTokenizer.prototype._read_xml = function(c, previous_token) {\n\n if (this._options.e4x && c === \"<\" && this._input.test(startXmlRegExp) && this._allow_regexp_or_xml(previous_token)) {\n // handle e4x xml literals\n //\n var xmlStr = '';\n var match = this._input.match(startXmlRegExp);\n if (match) {\n // Trim root tag to attempt to\n var rootTag = match[2].replace(/^{\\s+/, '{').replace(/\\s+}$/, '}');\n var isCurlyRoot = rootTag.indexOf('{') === 0;\n var depth = 0;\n while (match) {\n var isEndTag = !!match[1];\n var tagName = match[2];\n var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === \"![CDATA[\");\n if (!isSingletonTag &&\n (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\\s+/, '{').replace(/\\s+}$/, '}')))) {\n if (isEndTag) {\n --depth;\n } else {\n ++depth;\n }\n }\n xmlStr += match[0];\n if (depth <= 0) {\n break;\n }\n match = this._input.match(xmlRegExp);\n }\n // if we didn't close correctly, keep unformatted.\n if (!match) {\n xmlStr += this._input.match(/[\\s\\S]*/g)[0];\n }\n xmlStr = xmlStr.replace(acorn.allLineBreaks, '\\n');\n return this._create_token(TOKEN.STRING, xmlStr);\n }\n }\n\n return null;\n};\n\nfunction unescape_string(s) {\n // You think that a regex would work for this\n // return s.replace(/\\\\x([0-9a-f]{2})/gi, function(match, val) {\n // return String.fromCharCode(parseInt(val, 16));\n // })\n // However, dealing with '\\xff', '\\\\xff', '\\\\\\xff' makes this more fun.\n var out = '',\n escaped = 0;\n\n var input_scan = new InputScanner(s);\n var matched = null;\n\n while (input_scan.hasNext()) {\n // Keep any whitespace, non-slash characters\n // also keep slash pairs.\n matched = input_scan.match(/([\\s]|[^\\\\]|\\\\\\\\)+/g);\n\n if (matched) {\n out += matched[0];\n }\n\n if (input_scan.peek() === '\\\\') {\n input_scan.next();\n if (input_scan.peek() === 'x') {\n matched = input_scan.match(/x([0-9A-Fa-f]{2})/g);\n } else if (input_scan.peek() === 'u') {\n matched = input_scan.match(/u([0-9A-Fa-f]{4})/g);\n } else {\n out += '\\\\';\n if (input_scan.hasNext()) {\n out += input_scan.next();\n }\n continue;\n }\n\n // If there's some error decoding, return the original string\n if (!matched) {\n return s;\n }\n\n escaped = parseInt(matched[1], 16);\n\n if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) {\n // we bail out on \\x7f..\\xff,\n // leaving whole string escaped,\n // as it's probably completely binary\n return s;\n } else if (escaped >= 0x00 && escaped < 0x20) {\n // leave 0x00...0x1f escaped\n out += '\\\\' + matched[0];\n continue;\n } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) {\n // single-quote, apostrophe, backslash - escape these\n out += '\\\\' + String.fromCharCode(escaped);\n } else {\n out += String.fromCharCode(escaped);\n }\n }\n }\n\n return out;\n}\n\n// handle string\n//\nTokenizer.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) {\n // Template strings can travers lines without escape characters.\n // Other strings cannot\n var current_char;\n var resulting_string = '';\n var esc = false;\n while (this._input.hasNext()) {\n current_char = this._input.peek();\n if (!(esc || (current_char !== delimiter &&\n (allow_unescaped_newlines || !acorn.newline.test(current_char))))) {\n break;\n }\n\n // Handle \\r\\n linebreaks after escapes or in template strings\n if ((esc || allow_unescaped_newlines) && acorn.newline.test(current_char)) {\n if (current_char === '\\r' && this._input.peek(1) === '\\n') {\n this._input.next();\n current_char = this._input.peek();\n }\n resulting_string += '\\n';\n } else {\n resulting_string += current_char;\n }\n\n if (esc) {\n if (current_char === 'x' || current_char === 'u') {\n this.has_char_escapes = true;\n }\n esc = false;\n } else {\n esc = current_char === '\\\\';\n }\n\n this._input.next();\n\n if (start_sub && resulting_string.indexOf(start_sub, resulting_string.length - start_sub.length) !== -1) {\n if (delimiter === '`') {\n resulting_string += this._read_string_recursive('}', allow_unescaped_newlines, '`');\n } else {\n resulting_string += this._read_string_recursive('`', allow_unescaped_newlines, '${');\n }\n\n if (this._input.hasNext()) {\n resulting_string += this._input.next();\n }\n }\n }\n\n return resulting_string;\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;\nmodule.exports.positionable_operators = positionable_operators.slice();\nmodule.exports.line_starters = line_starters.slice();","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar Token = require('../core/token').Token;\nvar TokenStream = require('../core/tokenstream').TokenStream;\n\nvar TOKEN = {\n START: 'TK_START',\n RAW: 'TK_RAW',\n EOF: 'TK_EOF'\n};\n\nvar Tokenizer = function(input_string, options) {\n this._input = new InputScanner(input_string);\n this._options = options || {};\n this.__tokens = null;\n this.__newline_count = 0;\n this.__whitespace_before_token = '';\n\n this._whitespace_pattern = /[\\n\\r\\t ]+/g;\n this._newline_pattern = /([^\\n\\r]*)(\\r\\n|[\\n\\r])?/g;\n};\n\nTokenizer.prototype.tokenize = function() {\n this._input.restart();\n this.__tokens = new TokenStream();\n\n this._reset();\n\n var current;\n var previous = new Token(TOKEN.START, '');\n var open_token = null;\n var open_stack = [];\n var comments = new TokenStream();\n\n while (previous.type !== TOKEN.EOF) {\n current = this._get_next_token(previous, open_token);\n while (this._is_comment(current)) {\n comments.add(current);\n current = this._get_next_token(previous, open_token);\n }\n\n if (!comments.isEmpty()) {\n current.comments_before = comments;\n comments = new TokenStream();\n }\n\n current.parent = open_token;\n\n if (this._is_opening(current)) {\n open_stack.push(open_token);\n open_token = current;\n } else if (open_token && this._is_closing(current, open_token)) {\n current.opened = open_token;\n open_token.closed = current;\n open_token = open_stack.pop();\n current.parent = open_token;\n }\n\n current.previous = previous;\n previous.next = current;\n\n this.__tokens.add(current);\n previous = current;\n }\n\n return this.__tokens;\n};\n\n\nTokenizer.prototype._is_first_token = function() {\n return this.__tokens.isEmpty();\n};\n\nTokenizer.prototype._reset = function() {};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var resulting_string = this._input.read(/.+/g);\n if (resulting_string) {\n return this._create_token(TOKEN.RAW, resulting_string);\n } else {\n return this._create_token(TOKEN.EOF, '');\n }\n};\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_opening = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._create_token = function(type, text) {\n var token = new Token(type, text, this.__newline_count, this.__whitespace_before_token);\n this.__newline_count = 0;\n this.__whitespace_before_token = '';\n return token;\n};\n\nTokenizer.prototype._readWhitespace = function() {\n var resulting_string = this._input.read(this._whitespace_pattern);\n if (resulting_string === ' ') {\n this.__whitespace_before_token = resulting_string;\n } else if (resulting_string !== '') {\n this._newline_pattern.lastIndex = 0;\n var nextMatch = this._newline_pattern.exec(resulting_string);\n while (nextMatch[2]) {\n this.__newline_count += 1;\n nextMatch = this._newline_pattern.exec(resulting_string);\n }\n this.__whitespace_before_token = nextMatch[1];\n }\n};\n\n\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n\n this.__items = [];\n}\n\nOutputLine.prototype.item = function(index) {\n if (index < 0) {\n return this.__items[this.__items.length + index];\n } else {\n return this.__items[index];\n }\n};\n\nOutputLine.prototype.has_match = function(pattern) {\n for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {\n if (this.__items[lastCheckedOutput].match(pattern)) {\n return true;\n }\n }\n return false;\n};\n\nOutputLine.prototype.set_indent = function(indent, alignment) {\n this.__indent_count = indent || 0;\n this.__alignment_count = alignment || 0;\n this.__character_count = this.__parent.baseIndentLength + this.__alignment_count + this.__indent_count * this.__parent.indent_length;\n};\n\nOutputLine.prototype.get_character_count = function() {\n return this.__character_count;\n};\n\nOutputLine.prototype.is_empty = function() {\n return this.__items.length === 0;\n};\n\nOutputLine.prototype.last = function() {\n if (!this.is_empty()) {\n return this.__items[this.__items.length - 1];\n } else {\n return null;\n }\n};\n\nOutputLine.prototype.push = function(item) {\n this.__items.push(item);\n this.__character_count += item.length;\n};\n\nOutputLine.prototype.push_raw = function(item) {\n this.push(item);\n var last_newline_index = item.lastIndexOf('\\n');\n if (last_newline_index !== -1) {\n this.__character_count = item.length - last_newline_index;\n }\n};\n\nOutputLine.prototype.pop = function() {\n var item = null;\n if (!this.is_empty()) {\n item = this.__items.pop();\n this.__character_count -= item.length;\n }\n return item;\n};\n\nOutputLine.prototype.remove_indent = function() {\n if (this.__indent_count > 0) {\n this.__indent_count -= 1;\n this.__character_count -= this.__parent.indent_length;\n }\n};\n\nOutputLine.prototype.trim = function() {\n while (this.last() === ' ') {\n this.__items.pop();\n this.__character_count -= 1;\n }\n};\n\nOutputLine.prototype.toString = function() {\n var result = '';\n if (!this.is_empty()) {\n if (this.__indent_count >= 0) {\n result = this.__parent.get_indent_string(this.__indent_count);\n }\n if (this.__alignment_count >= 0) {\n result += this.__parent.get_alignment_string(this.__alignment_count);\n }\n result += this.__items.join('');\n }\n return result;\n};\n\nfunction IndentCache(base_string, level_string) {\n this.__cache = [base_string];\n this.__level_string = level_string;\n}\n\nIndentCache.prototype.__ensure_cache = function(level) {\n while (level >= this.__cache.length) {\n this.__cache.push(this.__cache[this.__cache.length - 1] + this.__level_string);\n }\n};\n\nIndentCache.prototype.get_level_string = function(level) {\n this.__ensure_cache(level);\n return this.__cache[level];\n};\n\n\nfunction Output(indent_string, baseIndentString) {\n baseIndentString = baseIndentString || '';\n this.__indent_cache = new IndentCache(baseIndentString, indent_string);\n this.__alignment_cache = new IndentCache('', ' ');\n this.baseIndentLength = baseIndentString.length;\n this.indent_length = indent_string.length;\n this.raw = false;\n\n this.__lines = [];\n this.previous_line = null;\n this.current_line = null;\n this.space_before_token = false;\n // initialize\n this.__add_outputline();\n}\n\nOutput.prototype.__add_outputline = function() {\n this.previous_line = this.current_line;\n this.current_line = new OutputLine(this);\n this.__lines.push(this.current_line);\n};\n\nOutput.prototype.get_line_number = function() {\n return this.__lines.length;\n};\n\nOutput.prototype.get_indent_string = function(level) {\n return this.__indent_cache.get_level_string(level);\n};\n\nOutput.prototype.get_alignment_string = function(level) {\n return this.__alignment_cache.get_level_string(level);\n};\n\nOutput.prototype.is_empty = function() {\n return !this.previous_line && this.current_line.is_empty();\n};\n\nOutput.prototype.add_new_line = function(force_newline) {\n // never newline at the start of file\n // otherwise, newline only if we didn't just add one or we're forced\n if (this.is_empty() ||\n (!force_newline && this.just_added_newline())) {\n return false;\n }\n\n // if raw output is enabled, don't print additional newlines,\n // but still return True as though you had\n if (!this.raw) {\n this.__add_outputline();\n }\n return true;\n};\n\nOutput.prototype.get_code = function(end_with_newline, eol) {\n var sweet_code = this.__lines.join('\\n').replace(/[\\r\\n\\t ]+$/, '');\n\n if (end_with_newline) {\n sweet_code += '\\n';\n }\n\n if (eol !== '\\n') {\n sweet_code = sweet_code.replace(/[\\n]/g, eol);\n }\n\n return sweet_code;\n};\n\nOutput.prototype.set_indent = function(indent, alignment) {\n indent = indent || 0;\n alignment = alignment || 0;\n\n // Never indent your first output indent at the start of the file\n if (this.__lines.length > 1) {\n this.current_line.set_indent(indent, alignment);\n return true;\n }\n this.current_line.set_indent();\n return false;\n};\n\nOutput.prototype.add_raw_token = function(token) {\n for (var x = 0; x < token.newlines; x++) {\n this.__add_outputline();\n }\n this.current_line.push(token.whitespace_before);\n this.current_line.push_raw(token.text);\n this.space_before_token = false;\n};\n\nOutput.prototype.add_token = function(printable_token) {\n this.add_space_before_token();\n this.current_line.push(printable_token);\n};\n\nOutput.prototype.add_space_before_token = function() {\n if (this.space_before_token && !this.just_added_newline()) {\n this.current_line.push(' ');\n }\n this.space_before_token = false;\n};\n\nOutput.prototype.remove_indent = function(index) {\n var output_length = this.__lines.length;\n while (index < output_length) {\n this.__lines[index].remove_indent();\n index++;\n }\n};\n\nOutput.prototype.trim = function(eat_newlines) {\n eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;\n\n this.current_line.trim(this.indent_string, this.baseIndentString);\n\n while (eat_newlines && this.__lines.length > 1 &&\n this.current_line.is_empty()) {\n this.__lines.pop();\n this.current_line = this.__lines[this.__lines.length - 1];\n this.current_line.trim();\n }\n\n this.previous_line = this.__lines.length > 1 ?\n this.__lines[this.__lines.length - 2] : null;\n};\n\nOutput.prototype.just_added_newline = function() {\n return this.current_line.is_empty();\n};\n\nOutput.prototype.just_added_blankline = function() {\n return this.is_empty() ||\n (this.current_line.is_empty() && this.previous_line.is_empty());\n};\n\nOutput.prototype.ensure_empty_line_above = function(starts_with, ends_with) {\n var index = this.__lines.length - 2;\n while (index >= 0) {\n var potentialEmptyLine = this.__lines[index];\n if (potentialEmptyLine.is_empty()) {\n break;\n } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&\n potentialEmptyLine.item(-1) !== ends_with) {\n this.__lines.splice(index + 1, 0, new OutputLine(this));\n this.previous_line = this.__lines[this.__lines.length - 2];\n break;\n }\n index--;\n }\n};\n\nmodule.exports.Output = Output;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Options(options, merge_child_field) {\n options = _mergeOpts(options, merge_child_field);\n this.raw_options = _normalizeOpts(options);\n\n // Support passing the source text back with no change\n this.disabled = this._get_boolean('disabled');\n\n this.eol = this._get_characters('eol', 'auto');\n this.end_with_newline = this._get_boolean('end_with_newline');\n this.indent_size = this._get_number('indent_size', 4);\n this.indent_char = this._get_characters('indent_char', ' ');\n this.indent_level = this._get_number('indent_level');\n\n this.preserve_newlines = this._get_boolean('preserve_newlines', true);\n this.max_preserve_newlines = this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);\n if (!this.preserve_newlines) {\n this.max_preserve_newlines = 0;\n }\n\n this.indent_with_tabs = this._get_boolean('indent_with_tabs');\n if (this.indent_with_tabs) {\n this.indent_char = '\\t';\n this.indent_size = 1;\n }\n\n this.indent_string = this.indent_char;\n if (this.indent_size > 1) {\n this.indent_string = new Array(this.indent_size + 1).join(this.indent_char);\n }\n // Set to null to continue support for auto detection of base indent level.\n this.base_indent_string = null;\n if (this.indent_level > 0) {\n this.base_indent_string = new Array(this.indent_level + 1).join(this.indent_string);\n }\n\n // Backwards compat with 1.3.x\n this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));\n\n}\n\nOptions.prototype._get_array = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || [];\n if (typeof option_value === 'object') {\n if (option_value !== null && typeof option_value.concat === 'function') {\n result = option_value.concat();\n }\n } else if (typeof option_value === 'string') {\n result = option_value.split(/[^a-zA-Z0-9_\\/\\-]+/);\n }\n return result;\n};\n\nOptions.prototype._get_boolean = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = option_value === undefined ? !!default_value : !!option_value;\n return result;\n};\n\nOptions.prototype._get_characters = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || '';\n if (typeof option_value === 'string') {\n result = option_value.replace(/\\\\r/, '\\r').replace(/\\\\n/, '\\n').replace(/\\\\t/, '\\t');\n }\n return result;\n};\n\nOptions.prototype._get_number = function(name, default_value) {\n var option_value = this.raw_options[name];\n default_value = parseInt(default_value, 10);\n if (isNaN(default_value)) {\n default_value = 0;\n }\n var result = parseInt(option_value, 10);\n if (isNaN(result)) {\n result = default_value;\n }\n return result;\n};\n\nOptions.prototype._get_selection = function(name, selection_list, default_value) {\n default_value = default_value || [selection_list[0]];\n if (!this._is_valid_selection(default_value, selection_list)) {\n throw new Error(\"Invalid Default Value!\");\n }\n\n var result = this._get_array(name, default_value);\n if (!this._is_valid_selection(result, selection_list)) {\n throw new Error(\n \"Invalid Option Value: The option '\" + name + \"' must be one of the following values\\n\" + selection_list + \"\\nYou passed in: '\" + this.raw_options[name] + \"'\");\n }\n\n return result;\n};\n\nOptions.prototype._is_valid_selection = function(result, selection_list) {\n return result.length && selection_list.length &&\n !result.some(function(item) { return selection_list.indexOf(item) === -1; });\n};\n\n\n// merges child options up with the parent options object\n// Example: obj = {a: 1, b: {a: 2}}\n// mergeOpts(obj, 'b')\n//\n// Returns: {a: 2, b: {a: 2}}\nfunction _mergeOpts(allOptions, childFieldName) {\n var finalOpts = {};\n allOptions = allOptions || {};\n var name;\n\n for (name in allOptions) {\n if (name !== childFieldName) {\n finalOpts[name] = allOptions[name];\n }\n }\n\n //merge in the per type settings for the childFieldName\n if (childFieldName && allOptions[childFieldName]) {\n for (name in allOptions[childFieldName]) {\n finalOpts[name] = allOptions[childFieldName][name];\n }\n }\n return finalOpts;\n}\n\nfunction _normalizeOpts(options) {\n var convertedOpts = {};\n var key;\n\n for (key in options) {\n var newKey = key.replace(/-/g, \"_\");\n convertedOpts[newKey] = options[key];\n }\n return convertedOpts;\n}\n\nmodule.exports.Options = Options;\nmodule.exports.normalizeOpts = _normalizeOpts;\nmodule.exports.mergeOpts = _mergeOpts;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction InputScanner(input_string) {\n this.__input = input_string || '';\n this.__input_length = this.__input.length;\n this.__position = 0;\n}\n\nInputScanner.prototype.restart = function() {\n this.__position = 0;\n};\n\nInputScanner.prototype.back = function() {\n if (this.__position > 0) {\n this.__position -= 1;\n }\n};\n\nInputScanner.prototype.hasNext = function() {\n return this.__position < this.__input_length;\n};\n\nInputScanner.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__input.charAt(this.__position);\n this.__position += 1;\n }\n return val;\n};\n\nInputScanner.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__input_length) {\n val = this.__input.charAt(index);\n }\n return val;\n};\n\nInputScanner.prototype.test = function(pattern, index) {\n index = index || 0;\n index += this.__position;\n pattern.lastIndex = index;\n\n if (index >= 0 && index < this.__input_length) {\n var pattern_match = pattern.exec(this.__input);\n return pattern_match && pattern_match.index === index;\n } else {\n return false;\n }\n};\n\nInputScanner.prototype.testChar = function(pattern, index) {\n // test one character regex match\n var val = this.peek(index);\n return val !== null && pattern.test(val);\n};\n\nInputScanner.prototype.match = function(pattern) {\n pattern.lastIndex = this.__position;\n var pattern_match = pattern.exec(this.__input);\n if (pattern_match && pattern_match.index === this.__position) {\n this.__position += pattern_match[0].length;\n } else {\n pattern_match = null;\n }\n return pattern_match;\n};\n\nInputScanner.prototype.read = function(pattern) {\n var val = '';\n var match = this.match(pattern);\n if (match) {\n val = match[0];\n }\n return val;\n};\n\nInputScanner.prototype.readUntil = function(pattern, include_match) {\n var val = '';\n var match_index = this.__position;\n pattern.lastIndex = this.__position;\n var pattern_match = pattern.exec(this.__input);\n if (pattern_match) {\n if (include_match) {\n match_index = pattern_match.index + pattern_match[0].length;\n } else {\n match_index = pattern_match.index;\n }\n } else {\n match_index = this.__input_length;\n }\n\n val = this.__input.substring(this.__position, match_index);\n this.__position = match_index;\n return val;\n};\n\nInputScanner.prototype.readUntilAfter = function(pattern) {\n return this.readUntil(pattern, true);\n};\n\n/* css beautifier legacy helpers */\nInputScanner.prototype.peekUntilAfter = function(pattern) {\n var start = this.__position;\n var val = this.readUntilAfter(pattern);\n this.__position = start;\n return val;\n};\n\nInputScanner.prototype.lookBack = function(testVal) {\n var start = this.__position - 1;\n return start >= testVal.length && this.__input.substring(start - testVal.length, start)\n .toLowerCase() === testVal;\n};\n\n\nmodule.exports.InputScanner = InputScanner;","/* jshint node: true, curly: false */\n// Parts of this section of code is taken from acorn.\n//\n// Acorn was written by Marijn Haverbeke and released under an MIT\n// license. The Unicode regexps (for identifiers and whitespace) were\n// taken from [Esprima](http://esprima.org) by Ariya Hidayat.\n//\n// Git repositories for Acorn are available at\n//\n// http://marijnhaverbeke.nl/git/acorn\n// https://github.com/marijnh/acorn.git\n\n// ## Character categories\n\n\n'use strict';\n\n// acorn used char codes to squeeze the last bit of performance out\n// Beautifier is okay without that, so we're using regex\n// permit $ (36) and @ (64). @ is used in ES7 decorators.\n// 65 through 91 are uppercase letters.\n// permit _ (95).\n// 97 through 123 are lowercase letters.\nvar baseASCIIidentifierStartChars = \"\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a\";\n\n// inside an identifier @ is not allowed but 0-9 are.\nvar baseASCIIidentifierChars = \"\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\";\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 128.\nvar nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nvar nonASCIIidentifierChars = \"\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n//var nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\n//var nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n\nvar identifierStart = \"[\" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + \"]\";\nvar identifierChars = \"[\" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]*\";\n\nexports.identifier = new RegExp(identifierStart + identifierChars, 'g');\n\n\nvar nonASCIIwhitespace = /[\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/; // jshint ignore:line\n\n// Whether a single character denotes a newline.\n\nexports.newline = /[\\n\\r\\u2028\\u2029]/;\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\n// in javascript, these two differ\n// in python they are the same, different methods are called on them\nexports.lineBreak = new RegExp('\\r\\n|' + exports.newline.source);\nexports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Directives(start_block_pattern, end_block_pattern) {\n start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;\n end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;\n this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \\w+[:]\\w+)+ /.source + end_block_pattern, 'g');\n this.__directive_pattern = / (\\w+)[:](\\w+)/g;\n\n this.__directives_end_ignore_pattern = new RegExp('(?:[\\\\s\\\\S]*?)((?:' + start_block_pattern + /\\sbeautify\\signore:end\\s/.source + end_block_pattern + ')|$)', 'g');\n}\n\nDirectives.prototype.get_directives = function(text) {\n if (!text.match(this.__directives_block_pattern)) {\n return null;\n }\n\n var directives = {};\n this.__directive_pattern.lastIndex = 0;\n var directive_match = this.__directive_pattern.exec(text);\n\n while (directive_match) {\n directives[directive_match[1]] = directive_match[2];\n directive_match = this.__directive_pattern.exec(text);\n }\n\n return directives;\n};\n\nDirectives.prototype.readIgnored = function(input) {\n return input.read(this.__directives_end_ignore_pattern);\n};\n\n\nmodule.exports.Directives = Directives;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\n\nvar TOKEN = {\n TAG_OPEN: 'TK_TAG_OPEN',\n TAG_CLOSE: 'TK_TAG_CLOSE',\n ATTRIBUTE: 'TK_ATTRIBUTE',\n EQUALS: 'TK_EQUALS',\n VALUE: 'TK_VALUE',\n COMMENT: 'TK_COMMENT',\n TEXT: 'TK_TEXT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\nvar directives_core = new Directives(/<\\!--/, /-->/);\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n this._current_tag_name = '';\n\n // Words end at whitespace or when a tag starts\n // if we are indenting handlebars, they are considered tags\n this._word_pattern = this._options.indent_handlebars ? /[\\n\\r\\t <]|{{/g : /[\\n\\r\\t <]/g;\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false; //current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.TAG_OPEN;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return current_token.type === TOKEN.TAG_CLOSE &&\n (open_token && (\n ((current_token.text === '>' || current_token.text === '/>') && open_token.text[0] === '<') ||\n (current_token.text === '}}' && open_token.text[0] === '{' && open_token.text[1] === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n this._current_tag_name = '';\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var token = null;\n var c = this._input.peek();\n\n if (c === null) {\n return this._create_token(TOKEN.EOF, '');\n }\n\n token = token || this._read_attribute(c, previous_token, open_token);\n token = token || this._read_raw_content(previous_token, open_token);\n token = token || this._read_comment(c);\n token = token || this._read_open(c, open_token);\n token = token || this._read_close(c, open_token);\n token = token || this._read_content_word();\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_comment = function(c) { // jshint unused:false\n var token = null;\n if (c === '<' || c === '{') {\n var peek1 = this._input.peek(1);\n var peek2 = this._input.peek(2);\n if ((c === '<' && (peek1 === '!' || peek1 === '?' || peek1 === '%')) ||\n this._options.indent_handlebars && c === '{' && peek1 === '{' && peek2 === '!') {\n //if we're in a comment, do something special\n // We treat all comments as literals, even more than preformatted tags\n // we just look for the appropriate close tag\n\n // this is will have very poor perf, but will work for now.\n var comment = '',\n delimiter = '>',\n matched = false;\n\n var input_char = this._input.next();\n\n while (input_char) {\n comment += input_char;\n\n // only need to check for the delimiter if the last chars match\n if (comment.charAt(comment.length - 1) === delimiter.charAt(delimiter.length - 1) &&\n comment.indexOf(delimiter) !== -1) {\n break;\n }\n\n // only need to search for custom delimiter for the first few characters\n if (!matched) {\n matched = comment.length > 10;\n if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('{{!--') === 0) { // {{!-- handlebars comment\n delimiter = '--}}';\n matched = true;\n } else if (comment.indexOf('{{!') === 0) { // {{! handlebars comment\n if (comment.length === 5 && comment.indexOf('{{!--') === -1) {\n delimiter = '}}';\n matched = true;\n }\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('<%') === 0) { // {{! handlebars comment\n delimiter = '%>';\n matched = true;\n }\n }\n\n input_char = this._input.next();\n }\n\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n token = this._create_token(TOKEN.COMMENT, comment);\n token.directives = directives;\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_open = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (!open_token) {\n if (c === '<') {\n resulting_string = this._input.read(/<(?:[^\\n\\r\\t >{][^\\n\\r\\t >{/]*)?/g);\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n } else if (this._options.indent_handlebars && c === '{' && this._input.peek(1) === '{') {\n resulting_string = this._input.readUntil(/[\\n\\r\\t }]/g);\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_close = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (open_token) {\n if (open_token.text[0] === '<' && (c === '>' || (c === '/' && this._input.peek(1) === '>'))) {\n resulting_string = this._input.next();\n if (c === '/') { // for close tag \"/>\"\n resulting_string += this._input.next();\n }\n token = this._create_token(TOKEN.TAG_CLOSE, resulting_string);\n } else if (open_token.text[0] === '{' && c === '}' && this._input.peek(1) === '}') {\n this._input.next();\n this._input.next();\n token = this._create_token(TOKEN.TAG_CLOSE, '}}');\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_attribute = function(c, previous_token, open_token) {\n var token = null;\n var resulting_string = '';\n if (open_token && open_token.text[0] === '<') {\n\n if (c === '=') {\n token = this._create_token(TOKEN.EQUALS, this._input.next());\n } else if (c === '\"' || c === \"'\") {\n var content = this._input.next();\n var input_string = '';\n var string_pattern = new RegExp(c + '|{{', 'g');\n while (this._input.hasNext()) {\n input_string = this._input.readUntilAfter(string_pattern);\n content += input_string;\n if (input_string[input_string.length - 1] === '\"' || input_string[input_string.length - 1] === \"'\") {\n break;\n } else if (this._input.hasNext()) {\n content += this._input.readUntilAfter(/}}/g);\n }\n }\n\n token = this._create_token(TOKEN.VALUE, content);\n } else {\n if (c === '{' && this._input.peek(1) === '{') {\n resulting_string = this._input.readUntilAfter(/}}/g);\n } else {\n resulting_string = this._input.readUntil(/[\\n\\r\\t =\\/>]/g);\n }\n\n if (resulting_string) {\n if (previous_token.type === TOKEN.EQUALS) {\n token = this._create_token(TOKEN.VALUE, resulting_string);\n } else {\n token = this._create_token(TOKEN.ATTRIBUTE, resulting_string);\n }\n }\n }\n }\n return token;\n};\n\nTokenizer.prototype._is_content_unformatted = function(tag_name) {\n // void_elements have no content and so cannot have unformatted content\n // script and style tags should always be read as unformatted content\n // finally content_unformatted and unformatted element contents are unformatted\n return this._options.void_elements.indexOf(tag_name) === -1 &&\n (tag_name === 'script' || tag_name === 'style' ||\n this._options.content_unformatted.indexOf(tag_name) !== -1 ||\n this._options.unformatted.indexOf(tag_name) !== -1);\n};\n\n\nTokenizer.prototype._read_raw_content = function(previous_token, open_token) { // jshint unused:false\n var resulting_string = '';\n if (open_token && open_token.text[0] === '{') {\n resulting_string = this._input.readUntil(/}}/g);\n } else if (previous_token.type === TOKEN.TAG_CLOSE && (previous_token.opened.text[0] === '<')) {\n var tag_name = previous_token.opened.text.substr(1).toLowerCase();\n if (this._is_content_unformatted(tag_name)) {\n resulting_string = this._input.readUntil(new RegExp('', 'ig'));\n }\n }\n\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._read_content_word = function() {\n // if we get here and we see handlebars treat them as plain text\n var resulting_string = this._input.readUntil(this._word_pattern);\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar js_beautify = require('./javascript/index');\nvar css_beautify = require('./css/index');\nvar html_beautify = require('./html/index');\n\nfunction style_html(html_source, options, js, css) {\n js = js || js_beautify;\n css = css || css_beautify;\n return html_beautify(html_source, options, js, css);\n}\n\nmodule.exports.js = js_beautify;\nmodule.exports.css = css_beautify;\nmodule.exports.html = style_html;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction js_beautify(js_source_text, options) {\n var beautifier = new Beautifier(js_source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = js_beautify;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Output = require('../core/output').Output;\nvar acorn = require('./acorn');\nvar Options = require('./options').Options;\nvar Tokenizer = require('./tokenizer').Tokenizer;\nvar line_starters = require('./tokenizer').line_starters;\nvar positionable_operators = require('./tokenizer').positionable_operators;\nvar TOKEN = require('./tokenizer').TOKEN;\n\nfunction remove_redundant_indentation(output, frame) {\n // This implementation is effective but has some issues:\n // - can cause line wrap to happen too soon due to indent removal\n // after wrap points are calculated\n // These issues are minor compared to ugly indentation.\n\n if (frame.multiline_frame ||\n frame.mode === MODE.ForInitializer ||\n frame.mode === MODE.Conditional) {\n return;\n }\n\n // remove one indent from each line inside this section\n output.remove_indent(frame.start_line_index);\n}\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction ltrim(s) {\n return s.replace(/^\\s+/g, '');\n}\n\nfunction generateMapFromStrings(list) {\n var result = {};\n for (var x = 0; x < list.length; x++) {\n // make the mapped names underscored instead of dash\n result[list[x].replace(/-/g, '_')] = list[x];\n }\n return result;\n}\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\n// Generate map from array\nvar OPERATOR_POSITION = generateMapFromStrings(validPositionValues);\n\nvar OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];\n\nvar MODE = {\n BlockStatement: 'BlockStatement', // 'BLOCK'\n Statement: 'Statement', // 'STATEMENT'\n ObjectLiteral: 'ObjectLiteral', // 'OBJECT',\n ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]',\n ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)',\n Conditional: 'Conditional', //'(COND-EXPRESSION)',\n Expression: 'Expression' //'(EXPRESSION)'\n};\n\n// we could use just string.split, but\n// IE doesn't like returning empty strings\nfunction split_linebreaks(s) {\n //return s.split(/\\x0d\\x0a|\\x0a/);\n\n s = s.replace(acorn.allLineBreaks, '\\n');\n var out = [],\n idx = s.indexOf(\"\\n\");\n while (idx !== -1) {\n out.push(s.substring(0, idx));\n s = s.substring(idx + 1);\n idx = s.indexOf(\"\\n\");\n }\n if (s.length) {\n out.push(s);\n }\n return out;\n}\n\nfunction is_array(mode) {\n return mode === MODE.ArrayLiteral;\n}\n\nfunction is_expression(mode) {\n return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);\n}\n\nfunction all_lines_start_with(lines, c) {\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i].trim();\n if (line.charAt(0) !== c) {\n return false;\n }\n }\n return true;\n}\n\nfunction each_line_matches_indent(lines, indent) {\n var i = 0,\n len = lines.length,\n line;\n for (; i < len; i++) {\n line = lines[i];\n // allow empty lines to pass through\n if (line && line.indexOf(indent) !== 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction is_special_word(word) {\n return in_array(word, ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async']);\n}\n\nfunction Beautifier(source_text, options) {\n options = options || {};\n this._source_text = source_text || '';\n\n this._output = null;\n this._tokens = null;\n this._last_type = null;\n this._last_last_text = null;\n this._flags = null;\n this._previous_flags = null;\n\n this._flag_store = null;\n this._options = new Options(options);\n}\n\nBeautifier.prototype.create_flags = function(flags_base, mode) {\n var next_indent_level = 0;\n if (flags_base) {\n next_indent_level = flags_base.indentation_level;\n if (!this._output.just_added_newline() &&\n flags_base.line_indent_level > next_indent_level) {\n next_indent_level = flags_base.line_indent_level;\n }\n }\n\n var next_flags = {\n mode: mode,\n parent: flags_base,\n last_text: flags_base ? flags_base.last_text : '', // last token text\n last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed\n declaration_statement: false,\n declaration_assignment: false,\n multiline_frame: false,\n inline_frame: false,\n if_block: false,\n else_block: false,\n do_block: false,\n do_while: false,\n import_block: false,\n in_case_statement: false, // switch(..){ INSIDE HERE }\n in_case: false, // we're on the exact line with \"case 0:\"\n case_body: false, // the indented case-action block\n indentation_level: next_indent_level,\n line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,\n start_line_index: this._output.get_line_number(),\n ternary_depth: 0\n };\n return next_flags;\n};\n\nBeautifier.prototype._reset = function(source_text) {\n var baseIndentString = '';\n\n if (this._options.base_indent_string) {\n baseIndentString = this._options.base_indent_string;\n } else {\n var match = source_text.match(/^[\\t ]*/);\n baseIndentString = match[0];\n }\n\n\n this._last_type = TOKEN.START_BLOCK; // last token type\n this._last_last_text = ''; // pre-last token text\n this._output = new Output(this._options.indent_string, baseIndentString);\n\n // If testing the ignore directive, start with output disable set to true\n this._output.raw = this._options.test_output_raw;\n\n\n // Stack of parsing/formatting states, including MODE.\n // We tokenize, parse, and output in an almost purely a forward-only stream of token input\n // and formatted output. This makes the beautifier less accurate than full parsers\n // but also far more tolerant of syntax errors.\n //\n // For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type\n // MODE.BlockStatement on the the stack, even though it could be object literal. If we later\n // encounter a \":\", we'll switch to to MODE.ObjectLiteral. If we then see a \";\",\n // most full parsers would die, but the beautifier gracefully falls back to\n // MODE.BlockStatement and continues on.\n this._flag_store = [];\n this.set_mode(MODE.BlockStatement);\n var tokenizer = new Tokenizer(source_text, this._options);\n this._tokens = tokenizer.tokenize();\n return source_text;\n};\n\nBeautifier.prototype.beautify = function() {\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var sweet_code;\n var source_text = this._reset(this._source_text);\n\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && acorn.lineBreak.test(source_text || '')) {\n eol = source_text.match(acorn.lineBreak)[0];\n }\n }\n\n var current_token = this._tokens.next();\n while (current_token) {\n this.handle_token(current_token);\n\n this._last_last_text = this._flags.last_text;\n this._last_type = current_token.type;\n this._flags.last_text = current_token.text;\n\n current_token = this._tokens.next();\n }\n\n sweet_code = this._output.get_code(this._options.end_with_newline, eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype.handle_token = function(current_token, preserve_statement_flags) {\n if (current_token.type === TOKEN.START_EXPR) {\n this.handle_start_expr(current_token);\n } else if (current_token.type === TOKEN.END_EXPR) {\n this.handle_end_expr(current_token);\n } else if (current_token.type === TOKEN.START_BLOCK) {\n this.handle_start_block(current_token);\n } else if (current_token.type === TOKEN.END_BLOCK) {\n this.handle_end_block(current_token);\n } else if (current_token.type === TOKEN.WORD) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.RESERVED) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.SEMICOLON) {\n this.handle_semicolon(current_token);\n } else if (current_token.type === TOKEN.STRING) {\n this.handle_string(current_token);\n } else if (current_token.type === TOKEN.EQUALS) {\n this.handle_equals(current_token);\n } else if (current_token.type === TOKEN.OPERATOR) {\n this.handle_operator(current_token);\n } else if (current_token.type === TOKEN.COMMA) {\n this.handle_comma(current_token);\n } else if (current_token.type === TOKEN.BLOCK_COMMENT) {\n this.handle_block_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.COMMENT) {\n this.handle_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.DOT) {\n this.handle_dot(current_token);\n } else if (current_token.type === TOKEN.EOF) {\n this.handle_eof(current_token);\n } else if (current_token.type === TOKEN.UNKNOWN) {\n this.handle_unknown(current_token, preserve_statement_flags);\n } else {\n this.handle_unknown(current_token, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) {\n var newlines = current_token.newlines;\n var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode);\n\n if (current_token.comments_before) {\n var comment_token = current_token.comments_before.next();\n while (comment_token) {\n // The cleanest handling of inline comments is to treat them as though they aren't there.\n // Just continue formatting and the behavior should be logical.\n // Also ignore unknown tokens. Again, this should result in better behavior.\n this.handle_whitespace_and_comments(comment_token, preserve_statement_flags);\n this.handle_token(comment_token, preserve_statement_flags);\n comment_token = current_token.comments_before.next();\n }\n }\n\n if (keep_whitespace) {\n for (var i = 0; i < newlines; i += 1) {\n this.print_newline(i > 0, preserve_statement_flags);\n }\n } else {\n if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) {\n newlines = this._options.max_preserve_newlines;\n }\n\n if (this._options.preserve_newlines) {\n if (newlines > 1) {\n this.print_newline(false, preserve_statement_flags);\n for (var j = 1; j < newlines; j += 1) {\n this.print_newline(true, preserve_statement_flags);\n }\n }\n }\n }\n\n};\n\nvar newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield'];\n\nBeautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) {\n force_linewrap = (force_linewrap === undefined) ? false : force_linewrap;\n\n // Never wrap the first token on a line\n if (this._output.just_added_newline()) {\n return;\n }\n\n var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap;\n var operatorLogicApplies = in_array(this._flags.last_text, positionable_operators) ||\n in_array(current_token.text, positionable_operators);\n\n if (operatorLogicApplies) {\n var shouldPrintOperatorNewline = (\n in_array(this._flags.last_text, positionable_operators) &&\n in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)\n ) ||\n in_array(current_token.text, positionable_operators);\n shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;\n }\n\n if (shouldPreserveOrForce) {\n this.print_newline(false, true);\n } else if (this._options.wrap_line_length) {\n if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, newline_restricted_tokens)) {\n // These tokens should never have a newline inserted\n // between them and the following expression.\n return;\n }\n var proposed_line_length = this._output.current_line.get_character_count() + current_token.text.length +\n (this._output.space_before_token ? 1 : 0);\n if (proposed_line_length >= this._options.wrap_line_length) {\n this.print_newline(false, true);\n }\n }\n};\n\nBeautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) {\n if (!preserve_statement_flags) {\n if (this._flags.last_text !== ';' && this._flags.last_text !== ',' && this._flags.last_text !== '=' && (this._last_type !== TOKEN.OPERATOR || this._flags.last_text === '--' || this._flags.last_text === '++')) {\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && next_token && next_token.type === TOKEN.RESERVED && next_token.text === 'else') &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n }\n }\n\n if (this._output.add_new_line(force_newline)) {\n this._flags.multiline_frame = true;\n }\n};\n\nBeautifier.prototype.print_token_line_indentation = function(current_token) {\n if (this._output.just_added_newline()) {\n if (this._options.keep_array_indentation && is_array(this._flags.mode) && current_token.newlines) {\n this._output.current_line.push(current_token.whitespace_before);\n this._output.space_before_token = false;\n } else if (this._output.set_indent(this._flags.indentation_level)) {\n this._flags.line_indent_level = this._flags.indentation_level;\n }\n }\n};\n\nBeautifier.prototype.print_token = function(current_token, printable_token) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n return;\n }\n\n if (this._options.comma_first && this._last_type === TOKEN.COMMA &&\n this._output.just_added_newline()) {\n if (this._output.previous_line.last() === ',') {\n var popped = this._output.previous_line.pop();\n // if the comma was already at the start of the line,\n // pull back onto that line and reprint the indentation\n if (this._output.previous_line.is_empty()) {\n this._output.previous_line.push(popped);\n this._output.trim(true);\n this._output.current_line.pop();\n this._output.trim();\n }\n\n // add the comma in front of the next token\n this.print_token_line_indentation(current_token);\n this._output.add_token(',');\n this._output.space_before_token = true;\n }\n }\n\n printable_token = printable_token || current_token.text;\n this.print_token_line_indentation(current_token);\n this._output.add_token(printable_token);\n};\n\nBeautifier.prototype.indent = function() {\n this._flags.indentation_level += 1;\n};\n\nBeautifier.prototype.deindent = function() {\n if (this._flags.indentation_level > 0 &&\n ((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) {\n this._flags.indentation_level -= 1;\n\n }\n};\n\nBeautifier.prototype.set_mode = function(mode) {\n if (this._flags) {\n this._flag_store.push(this._flags);\n this._previous_flags = this._flags;\n } else {\n this._previous_flags = this.create_flags(null, mode);\n }\n\n this._flags = this.create_flags(this._previous_flags, mode);\n};\n\n\nBeautifier.prototype.restore_mode = function() {\n if (this._flag_store.length > 0) {\n this._previous_flags = this._flags;\n this._flags = this._flag_store.pop();\n if (this._previous_flags.mode === MODE.Statement) {\n remove_redundant_indentation(this._output, this._previous_flags);\n }\n }\n};\n\nBeautifier.prototype.start_of_object_property = function() {\n return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && (\n (this._flags.last_text === ':' && this._flags.ternary_depth === 0) || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['get', 'set'])));\n};\n\nBeautifier.prototype.start_of_statement = function(current_token) {\n var start = false;\n start = start || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD);\n start = start || (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'do');\n start = start || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, newline_restricted_tokens) && !current_token.newlines);\n start = start || (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'else' &&\n !(current_token.type === TOKEN.RESERVED && current_token.text === 'if' && !current_token.comments_before));\n start = start || (this._last_type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional));\n start = start || (this._last_type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement &&\n !this._flags.in_case &&\n !(current_token.text === '--' || current_token.text === '++') &&\n this._last_last_text !== 'function' &&\n current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED);\n start = start || (this._flags.mode === MODE.ObjectLiteral && (\n (this._flags.last_text === ':' && this._flags.ternary_depth === 0) || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['get', 'set']))));\n\n if (start) {\n this.set_mode(MODE.Statement);\n this.indent();\n\n this.handle_whitespace_and_comments(current_token, true);\n\n // Issue #276:\n // If starting a new statement with [if, for, while, do], push to a new line.\n // if (a) if (b) if(c) d(); else e(); else f();\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token,\n current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['do', 'for', 'if', 'while']));\n }\n\n return true;\n }\n return false;\n};\n\nBeautifier.prototype.handle_start_expr = function(current_token) {\n // The conditional starts the statement if appropriate.\n if (!this.start_of_statement(current_token)) {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_mode = MODE.Expression;\n if (current_token.text === '[') {\n\n if (this._last_type === TOKEN.WORD || this._flags.last_text === ')') {\n // this is array index specifier, break immediately\n // a[x], fn()[x]\n if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, line_starters)) {\n this._output.space_before_token = true;\n }\n this.set_mode(next_mode);\n this.print_token(current_token);\n this.indent();\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n return;\n }\n\n next_mode = MODE.ArrayLiteral;\n if (is_array(this._flags.mode)) {\n if (this._flags.last_text === '[' ||\n (this._flags.last_text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) {\n // ], [ goes to new line\n // }, [ goes to new line\n if (!this._options.keep_array_indentation) {\n this.print_newline();\n }\n }\n }\n\n if (!in_array(this._last_type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) {\n this._output.space_before_token = true;\n }\n } else {\n if (this._last_type === TOKEN.RESERVED) {\n if (this._flags.last_text === 'for') {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.ForInitializer;\n } else if (in_array(this._flags.last_text, ['if', 'while'])) {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.Conditional;\n } else if (in_array(this._flags.last_word, ['await', 'async'])) {\n // Should be a space between await and an IIFE, or async and an arrow function\n this._output.space_before_token = true;\n } else if (this._flags.last_text === 'import' && current_token.whitespace_before === '') {\n this._output.space_before_token = false;\n } else if (in_array(this._flags.last_text, line_starters) || this._flags.last_text === 'catch') {\n this._output.space_before_token = true;\n }\n } else if (this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) {\n // Support of this kind of newline preservation.\n // a = (b &&\n // (c || d));\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._last_type === TOKEN.WORD) {\n this._output.space_before_token = false;\n } else {\n // Support preserving wrapped arrow function expressions\n // a.b('c',\n // () => d.e\n // )\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // function() vs function ()\n // yield*() vs yield* ()\n // function*() vs function* ()\n if ((this._last_type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) ||\n (this._flags.last_text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n\n this._output.space_before_token = this._options.space_after_anon_function;\n }\n\n }\n\n if (this._flags.last_text === ';' || this._last_type === TOKEN.START_BLOCK) {\n this.print_newline();\n } else if (this._last_type === TOKEN.END_EXPR || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.END_BLOCK || this._flags.last_text === '.' || this._last_type === TOKEN.COMMA) {\n // do nothing on (( and )( and ][ and ]( and .(\n // TODO: Consider whether forcing this is required. Review failing tests when removed.\n this.allow_wrap_or_preserved_newline(current_token, current_token.newlines);\n }\n\n this.set_mode(next_mode);\n this.print_token(current_token);\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n // In all cases, if we newline while inside an expression it should be indented.\n this.indent();\n};\n\nBeautifier.prototype.handle_end_expr = function(current_token) {\n // statements inside expressions are not valid syntax, but...\n // statements must all be closed when their container closes\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n this.handle_whitespace_and_comments(current_token);\n\n if (this._flags.multiline_frame) {\n this.allow_wrap_or_preserved_newline(current_token,\n current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation);\n }\n\n if (this._options.space_in_paren) {\n if (this._last_type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) {\n // () [] no inner space in empty parens like these, ever, ref #320\n this._output.trim();\n this._output.space_before_token = false;\n } else {\n this._output.space_before_token = true;\n }\n }\n if (current_token.text === ']' && this._options.keep_array_indentation) {\n this.print_token(current_token);\n this.restore_mode();\n } else {\n this.restore_mode();\n this.print_token(current_token);\n }\n remove_redundant_indentation(this._output, this._previous_flags);\n\n // do {} while () // no statement required after\n if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) {\n this._previous_flags.mode = MODE.Expression;\n this._flags.do_block = false;\n this._flags.do_while = false;\n\n }\n};\n\nBeautifier.prototype.handle_start_block = function(current_token) {\n this.handle_whitespace_and_comments(current_token);\n\n // Check if this is should be treated as a ObjectLiteral\n var next_token = this._tokens.peek();\n var second_token = this._tokens.peek(1);\n if (second_token && (\n (in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) ||\n (in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED]))\n )) {\n // We don't support TypeScript,but we didn't break it for a very long time.\n // We'll try to keep not breaking it.\n if (!in_array(this._last_last_text, ['class', 'interface'])) {\n this.set_mode(MODE.ObjectLiteral);\n } else {\n this.set_mode(MODE.BlockStatement);\n }\n } else if (this._last_type === TOKEN.OPERATOR && this._flags.last_text === '=>') {\n // arrow function: (param1, paramN) => { statements }\n this.set_mode(MODE.BlockStatement);\n } else if (in_array(this._last_type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) ||\n (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['return', 'throw', 'import', 'default']))\n ) {\n // Detecting shorthand function syntax is difficult by scanning forward,\n // so check the surrounding context.\n // If the block is being returned, imported, export default, passed as arg,\n // assigned with = or assigned in a nested object, treat as an ObjectLiteral.\n this.set_mode(MODE.ObjectLiteral);\n } else {\n this.set_mode(MODE.BlockStatement);\n }\n\n var empty_braces = !next_token.comments_before && next_token.text === '}';\n var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' &&\n this._last_type === TOKEN.END_EXPR;\n\n if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so\n {\n // search forward for a newline wanted inside this block\n var index = 0;\n var check_token = null;\n this._flags.inline_frame = true;\n do {\n index += 1;\n check_token = this._tokens.peek(index - 1);\n if (check_token.newlines) {\n this._flags.inline_frame = false;\n break;\n }\n } while (check_token.type !== TOKEN.EOF &&\n !(check_token.type === TOKEN.END_BLOCK && check_token.opened === current_token));\n }\n\n if ((this._options.brace_style === \"expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n if (this._last_type !== TOKEN.OPERATOR &&\n (empty_anonymous_function ||\n this._last_type === TOKEN.EQUALS ||\n (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text) && this._flags.last_text !== 'else'))) {\n this._output.space_before_token = true;\n } else {\n this.print_newline(false, true);\n }\n } else { // collapse || inline_frame\n if (is_array(this._previous_flags.mode) && (this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.COMMA)) {\n if (this._last_type === TOKEN.COMMA || this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n if (this._last_type === TOKEN.COMMA || (this._last_type === TOKEN.START_EXPR && this._flags.inline_frame)) {\n this.allow_wrap_or_preserved_newline(current_token);\n this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame;\n this._flags.multiline_frame = false;\n }\n }\n if (this._last_type !== TOKEN.OPERATOR && this._last_type !== TOKEN.START_EXPR) {\n if (this._last_type === TOKEN.START_BLOCK && !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.space_before_token = true;\n }\n }\n }\n this.print_token(current_token);\n this.indent();\n};\n\nBeautifier.prototype.handle_end_block = function(current_token) {\n // statements must all be closed when their container closes\n this.handle_whitespace_and_comments(current_token);\n\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n var empty_braces = this._last_type === TOKEN.START_BLOCK;\n\n if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first\n this._output.space_before_token = true;\n } else if (this._options.brace_style === \"expand\") {\n if (!empty_braces) {\n this.print_newline();\n }\n } else {\n // skip {}\n if (!empty_braces) {\n if (is_array(this._flags.mode) && this._options.keep_array_indentation) {\n // we REALLY need a newline here, but newliner would skip that\n this._options.keep_array_indentation = false;\n this.print_newline();\n this._options.keep_array_indentation = true;\n\n } else {\n this.print_newline();\n }\n }\n }\n this.restore_mode();\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_word = function(current_token) {\n if (current_token.type === TOKEN.RESERVED) {\n if (in_array(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) {\n current_token.type = TOKEN.WORD;\n } else if (in_array(current_token.text, ['as', 'from']) && !this._flags.import_block) {\n current_token.type = TOKEN.WORD;\n } else if (this._flags.mode === MODE.ObjectLiteral) {\n var next_token = this._tokens.peek();\n if (next_token.text === ':') {\n current_token.type = TOKEN.WORD;\n }\n }\n }\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) {\n this._flags.declaration_statement = true;\n }\n } else if (current_token.newlines && !is_expression(this._flags.mode) &&\n (this._last_type !== TOKEN.OPERATOR || (this._flags.last_text === '--' || this._flags.last_text === '++')) &&\n this._last_type !== TOKEN.EQUALS &&\n (this._options.preserve_newlines || !(this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const', 'set', 'get'])))) {\n this.handle_whitespace_and_comments(current_token);\n this.print_newline();\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.do_block && !this._flags.do_while) {\n if (current_token.type === TOKEN.RESERVED && current_token.text === 'while') {\n // do {} ## while ()\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n this._flags.do_while = true;\n return;\n } else {\n // do {} should always have while as the next word.\n // if we don't see the expected while, recover\n this.print_newline();\n this._flags.do_block = false;\n }\n }\n\n // if may be followed by else, or not\n // Bare/inline ifs are tricky\n // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();\n if (this._flags.if_block) {\n if (!this._flags.else_block && (current_token.type === TOKEN.RESERVED && current_token.text === 'else')) {\n this._flags.else_block = true;\n } else {\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this._flags.if_block = false;\n this._flags.else_block = false;\n }\n }\n\n if (current_token.type === TOKEN.RESERVED && (current_token.text === 'case' || (current_token.text === 'default' && this._flags.in_case_statement))) {\n this.print_newline();\n if (this._flags.case_body || this._options.jslint_happy) {\n // switch cases following one another\n this.deindent();\n this._flags.case_body = false;\n }\n this.print_token(current_token);\n this._flags.in_case = true;\n this._flags.in_case_statement = true;\n return;\n }\n\n if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n }\n\n if (current_token.type === TOKEN.RESERVED && current_token.text === 'function') {\n if (in_array(this._flags.last_text, ['}', ';']) ||\n (this._output.just_added_newline() && !(in_array(this._flags.last_text, ['(', '[', '{', ':', '=', ',']) || this._last_type === TOKEN.OPERATOR))) {\n // make sure there is a nice clean space of at least one blank line\n // before a new function definition\n if (!this._output.just_added_blankline() && !current_token.comments_before) {\n this.print_newline();\n this.print_newline(true);\n }\n }\n if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD) {\n if (this._last_type === TOKEN.RESERVED && (\n in_array(this._flags.last_text, ['get', 'set', 'new', 'export']) ||\n in_array(this._flags.last_text, newline_restricted_tokens))) {\n this._output.space_before_token = true;\n } else if (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'default' && this._last_last_text === 'export') {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n } else if (this._last_type === TOKEN.OPERATOR || this._flags.last_text === '=') {\n // foo = function\n this._output.space_before_token = true;\n } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) {\n // (function\n } else {\n this.print_newline();\n }\n\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n return;\n }\n\n var prefix = 'NONE';\n\n if (this._last_type === TOKEN.END_BLOCK) {\n\n if (this._previous_flags.inline_frame) {\n prefix = 'SPACE';\n } else if (!(current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['else', 'catch', 'finally', 'from']))) {\n prefix = 'NEWLINE';\n } else {\n if (this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) {\n prefix = 'NEWLINE';\n } else {\n prefix = 'SPACE';\n this._output.space_before_token = true;\n }\n }\n } else if (this._last_type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) {\n // TODO: Should this be for STATEMENT as well?\n prefix = 'NEWLINE';\n } else if (this._last_type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) {\n prefix = 'SPACE';\n } else if (this._last_type === TOKEN.STRING) {\n prefix = 'NEWLINE';\n } else if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD ||\n (this._flags.last_text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n prefix = 'SPACE';\n } else if (this._last_type === TOKEN.START_BLOCK) {\n if (this._flags.inline_frame) {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n } else if (this._last_type === TOKEN.END_EXPR) {\n this._output.space_before_token = true;\n prefix = 'NEWLINE';\n }\n\n if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, line_starters) && this._flags.last_text !== ')') {\n if (this._flags.inline_frame || this._flags.last_text === 'else' || this._flags.last_text === 'export') {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n\n }\n\n if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['else', 'catch', 'finally'])) {\n if ((!(this._last_type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) ||\n this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.trim(true);\n var line = this._output.current_line;\n // If we trimmed and there's something other than a close block before us\n // put a newline back in. Handles '} // comment' scenario.\n if (line.last() !== '}') {\n this.print_newline();\n }\n this._output.space_before_token = true;\n }\n } else if (prefix === 'NEWLINE') {\n if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) {\n // no newline between 'return nnn'\n this._output.space_before_token = true;\n } else if (this._last_type !== TOKEN.END_EXPR) {\n if ((this._last_type !== TOKEN.START_EXPR || !(current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['var', 'let', 'const']))) && this._flags.last_text !== ':') {\n // no need to force newline on 'var': for (var x = 0...)\n if (current_token.type === TOKEN.RESERVED && current_token.text === 'if' && this._flags.last_text === 'else') {\n // no newline for } else if {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n }\n } else if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, line_starters) && this._flags.last_text !== ')') {\n this.print_newline();\n }\n } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_text === ',' && this._last_last_text === '}') {\n this.print_newline(); // }, in lists get a newline treatment\n } else if (prefix === 'SPACE') {\n this._output.space_before_token = true;\n }\n if (this._last_type === TOKEN.WORD || this._last_type === TOKEN.RESERVED) {\n this._output.space_before_token = true;\n }\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n\n if (current_token.type === TOKEN.RESERVED) {\n if (current_token.text === 'do') {\n this._flags.do_block = true;\n } else if (current_token.text === 'if') {\n this._flags.if_block = true;\n } else if (current_token.text === 'import') {\n this._flags.import_block = true;\n } else if (this._flags.import_block && current_token.type === TOKEN.RESERVED && current_token.text === 'from') {\n this._flags.import_block = false;\n }\n }\n};\n\nBeautifier.prototype.handle_semicolon = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // Semicolon can be the start (and end) of a statement\n this._output.space_before_token = false;\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && next_token && next_token.type === TOKEN.RESERVED && next_token.text === 'else') &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n\n // hacky but effective for the moment\n if (this._flags.import_block) {\n this._flags.import_block = false;\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_string = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // One difference - strings want at least a space before\n this._output.space_before_token = true;\n } else {\n this.handle_whitespace_and_comments(current_token);\n if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD || this._flags.inline_frame) {\n this._output.space_before_token = true;\n } else if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else {\n this.print_newline();\n }\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_equals = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.declaration_statement) {\n // just got an '=' in a var-line, different formatting/line-breaking, etc will now be done\n this._flags.declaration_assignment = true;\n }\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n};\n\nBeautifier.prototype.handle_comma = function(current_token) {\n this.handle_whitespace_and_comments(current_token, true);\n\n this.print_token(current_token);\n this._output.space_before_token = true;\n if (this._flags.declaration_statement) {\n if (is_expression(this._flags.parent.mode)) {\n // do not break on comma, for(var a = 1, b = 2)\n this._flags.declaration_assignment = false;\n }\n\n if (this._flags.declaration_assignment) {\n this._flags.declaration_assignment = false;\n this.print_newline(false, true);\n } else if (this._options.comma_first) {\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._flags.mode === MODE.ObjectLiteral ||\n (this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) {\n if (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n if (!this._flags.inline_frame) {\n this.print_newline();\n }\n } else if (this._options.comma_first) {\n // EXPR or DO_BLOCK\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n};\n\nBeautifier.prototype.handle_operator = function(current_token) {\n var isGeneratorAsterisk = current_token.text === '*' &&\n ((this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['function', 'yield'])) ||\n (in_array(this._last_type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON]))\n );\n var isUnary = in_array(current_token.text, ['-', '+']) && (\n in_array(this._last_type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) ||\n in_array(this._flags.last_text, line_starters) ||\n this._flags.last_text === ','\n );\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n var preserve_statement_flags = !isGeneratorAsterisk;\n this.handle_whitespace_and_comments(current_token, preserve_statement_flags);\n }\n\n if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) {\n // \"return\" had a special handling in TK_WORD. Now we need to return the favor\n this._output.space_before_token = true;\n this.print_token(current_token);\n return;\n }\n\n // hack for actionscript's import .*;\n if (current_token.text === '*' && this._last_type === TOKEN.DOT) {\n this.print_token(current_token);\n return;\n }\n\n if (current_token.text === '::') {\n // no spaces around exotic namespacing syntax operator\n this.print_token(current_token);\n return;\n }\n\n // Allow line wrapping between operators when operator_position is\n // set to before or preserve\n if (this._last_type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n if (current_token.text === ':' && this._flags.in_case) {\n this._flags.case_body = true;\n this.indent();\n this.print_token(current_token);\n this.print_newline();\n this._flags.in_case = false;\n return;\n }\n\n var space_before = true;\n var space_after = true;\n var in_ternary = false;\n if (current_token.text === ':') {\n if (this._flags.ternary_depth === 0) {\n // Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant.\n space_before = false;\n } else {\n this._flags.ternary_depth -= 1;\n in_ternary = true;\n }\n } else if (current_token.text === '?') {\n this._flags.ternary_depth += 1;\n }\n\n // let's handle the operator_position option prior to any conflicting logic\n if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array(current_token.text, positionable_operators)) {\n var isColon = current_token.text === ':';\n var isTernaryColon = (isColon && in_ternary);\n var isOtherColon = (isColon && !in_ternary);\n\n switch (this._options.operator_position) {\n case OPERATOR_POSITION.before_newline:\n // if the current token is : and it's not a ternary statement then we set space_before to false\n this._output.space_before_token = !isOtherColon;\n\n this.print_token(current_token);\n\n if (!isColon || isTernaryColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.after_newline:\n // if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement,\n // then print a newline.\n\n this._output.space_before_token = true;\n\n if (!isColon || isTernaryColon) {\n if (this._tokens.peek().newlines) {\n this.print_newline(false, true);\n } else {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else {\n this._output.space_before_token = false;\n }\n\n this.print_token(current_token);\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.preserve_newline:\n if (!isOtherColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // if we just added a newline, or the current token is : and it's not a ternary statement,\n // then we set space_before to false\n space_before = !(this._output.just_added_newline() || isOtherColon);\n\n this._output.space_before_token = space_before;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n }\n }\n\n if (isGeneratorAsterisk) {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = false;\n var next_token = this._tokens.peek();\n space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]);\n } else if (current_token.text === '...') {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = this._last_type === TOKEN.START_BLOCK;\n space_after = false;\n } else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) {\n // unary operators (and binary +/- pretending to be unary) special cases\n if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n space_before = false;\n space_after = false;\n\n // http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1\n // if there is a newline between -- or ++ and anything else we should preserve it.\n if (current_token.newlines && (current_token.text === '--' || current_token.text === '++')) {\n this.print_newline(false, true);\n }\n\n if (this._flags.last_text === ';' && is_expression(this._flags.mode)) {\n // for (;; ++i)\n // ^^^\n space_before = true;\n }\n\n if (this._last_type === TOKEN.RESERVED) {\n space_before = true;\n } else if (this._last_type === TOKEN.END_EXPR) {\n space_before = !(this._flags.last_text === ']' && (current_token.text === '--' || current_token.text === '++'));\n } else if (this._last_type === TOKEN.OPERATOR) {\n // a++ + ++b;\n // a - -b\n space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_text, ['--', '-', '++', '+']);\n // + and - are not unary when preceeded by -- or ++ operator\n // a-- + b\n // a * +b\n // a - -b\n if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_text, ['--', '++'])) {\n space_after = true;\n }\n }\n\n\n if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) &&\n (this._flags.last_text === '{' || this._flags.last_text === ';')) {\n // { foo; --i }\n // foo(); --bar;\n this.print_newline();\n }\n }\n\n this._output.space_before_token = this._output.space_before_token || space_before;\n this.print_token(current_token);\n this._output.space_before_token = space_after;\n};\n\nBeautifier.prototype.handle_block_comment = function(current_token, preserve_statement_flags) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n if (current_token.directives && current_token.directives.preserve === 'end') {\n // If we're testing the raw output behavior, do not allow a directive to turn it off.\n this._output.raw = this._options.test_output_raw;\n }\n return;\n }\n\n if (current_token.directives) {\n this.print_newline(false, preserve_statement_flags);\n this.print_token(current_token);\n if (current_token.directives.preserve === 'start') {\n this._output.raw = true;\n }\n this.print_newline(false, true);\n return;\n }\n\n // inline block\n if (!acorn.newline.test(current_token.text) && !current_token.newlines) {\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n }\n\n var lines = split_linebreaks(current_token.text);\n var j; // iterator for this case\n var javadoc = false;\n var starless = false;\n var lastIndent = current_token.whitespace_before;\n var lastIndentLength = lastIndent.length;\n\n // block comment starts with a new line\n this.print_newline(false, preserve_statement_flags);\n if (lines.length > 1) {\n javadoc = all_lines_start_with(lines.slice(1), '*');\n starless = each_line_matches_indent(lines.slice(1), lastIndent);\n }\n\n // first line always indented\n this.print_token(current_token, lines[0]);\n for (j = 1; j < lines.length; j++) {\n this.print_newline(false, true);\n if (javadoc) {\n // javadoc: reformat and re-indent\n this.print_token(current_token, ' ' + ltrim(lines[j]));\n } else if (starless && lines[j].length > lastIndentLength) {\n // starless: re-indent non-empty content, avoiding trim\n this.print_token(current_token, lines[j].substring(lastIndentLength));\n } else {\n // normal comments output raw\n this._output.add_token(lines[j]);\n }\n }\n\n // for comments of more than one line, make sure there's a new line after\n this.print_newline(false, preserve_statement_flags);\n};\n\nBeautifier.prototype.handle_comment = function(current_token, preserve_statement_flags) {\n if (current_token.newlines) {\n this.print_newline(false, preserve_statement_flags);\n } else {\n this._output.trim(true);\n }\n\n this._output.space_before_token = true;\n this.print_token(current_token);\n this.print_newline(false, preserve_statement_flags);\n};\n\nBeautifier.prototype.handle_dot = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token, true);\n }\n\n if (this._options.unindent_chained_methods) {\n this.deindent();\n }\n\n if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) {\n this._output.space_before_token = false;\n } else {\n // allow preserved newlines before dots in general\n // force newlines on dots after close paren when break_chained - for bar().baz()\n this.allow_wrap_or_preserved_newline(current_token,\n this._flags.last_text === ')' && this._options.break_chained_methods);\n }\n\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_unknown = function(current_token, preserve_statement_flags) {\n this.print_token(current_token);\n\n if (current_token.text[current_token.text.length - 1] === '\\n') {\n this.print_newline(false, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_eof = function(current_token) {\n // Unwind any open statements\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this.handle_whitespace_and_comments(current_token);\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'js');\n\n // compatibility, re\n var raw_brace_style = this.raw_options.brace_style || null;\n if (raw_brace_style === \"expand-strict\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"expand\";\n } else if (raw_brace_style === \"collapse-preserve-inline\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"collapse,preserve-inline\";\n } else if (this.raw_options.braces_on_own_line !== undefined) { //graceful handling of deprecated option\n this.raw_options.brace_style = this.raw_options.braces_on_own_line ? \"expand\" : \"collapse\";\n // } else if (!raw_brace_style) { //Nothing exists to set it\n // raw_brace_style = \"collapse\";\n }\n\n //preserve-inline in delimited string will trigger brace_preserve_inline, everything\n //else is considered a brace_style and the last one only will have an effect\n\n var brace_style_split = this._get_selection('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);\n\n this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option\n this.brace_style = \"collapse\";\n\n for (var bs = 0; bs < brace_style_split.length; bs++) {\n if (brace_style_split[bs] === \"preserve-inline\") {\n this.brace_preserve_inline = true;\n } else {\n this.brace_style = brace_style_split[bs];\n }\n }\n\n this.unindent_chained_methods = this._get_boolean('unindent_chained_methods');\n this.break_chained_methods = this._get_boolean('break_chained_methods');\n this.space_in_paren = this._get_boolean('space_in_paren');\n this.space_in_empty_paren = this._get_boolean('space_in_empty_paren');\n this.jslint_happy = this._get_boolean('jslint_happy');\n this.space_after_anon_function = this._get_boolean('space_after_anon_function');\n this.keep_array_indentation = this._get_boolean('keep_array_indentation');\n this.space_before_conditional = this._get_boolean('space_before_conditional', true);\n this.unescape_strings = this._get_boolean('unescape_strings');\n this.e4x = this._get_boolean('e4x');\n this.comma_first = this._get_boolean('comma_first');\n this.operator_position = this._get_selection('operator_position', validPositionValues)[0];\n\n // For testing of beautify preserve:start directive\n this.test_output_raw = this._get_boolean('test_output_raw');\n\n // force this._options.space_after_anon_function to true if this._options.jslint_happy\n if (this.jslint_happy) {\n this.space_after_anon_function = true;\n }\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}\n\n\nmodule.exports.Token = Token;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction TokenStream(parent_token) {\n // private\n this.__tokens = [];\n this.__tokens_length = this.__tokens.length;\n this.__position = 0;\n this.__parent_token = parent_token;\n}\n\nTokenStream.prototype.restart = function() {\n this.__position = 0;\n};\n\nTokenStream.prototype.isEmpty = function() {\n return this.__tokens_length === 0;\n};\n\nTokenStream.prototype.hasNext = function() {\n return this.__position < this.__tokens_length;\n};\n\nTokenStream.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__tokens[this.__position];\n this.__position += 1;\n }\n return val;\n};\n\nTokenStream.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__tokens_length) {\n val = this.__tokens[index];\n }\n return val;\n};\n\nTokenStream.prototype.add = function(token) {\n if (this.__parent_token) {\n token.parent = this.__parent_token;\n }\n this.__tokens.push(token);\n this.__tokens_length += 1;\n};\n\nmodule.exports.TokenStream = TokenStream;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction css_beautify(source_text, options) {\n var beautifier = new Beautifier(source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = css_beautify;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('./options').Options;\nvar Output = require('../core/output').Output;\nvar InputScanner = require('../core/inputscanner').InputScanner;\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\n// tokenizer\nvar whitespaceChar = /\\s/;\nvar whitespacePattern = /(?:\\s|\\n)+/g;\nvar block_comment_pattern = /\\/\\*(?:[\\s\\S]*?)((?:\\*\\/)|$)/g;\nvar comment_pattern = /\\/\\/(?:[^\\n\\r\\u2028\\u2029]*)/g;\n\nfunction Beautifier(source_text, options) {\n this._source_text = source_text || '';\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n this._options = new Options(options);\n this._ch = null;\n this._input = null;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule\n this.NESTED_AT_RULE = {\n \"@page\": true,\n \"@font-face\": true,\n \"@keyframes\": true,\n // also in CONDITIONAL_GROUP_RULE below\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n this.CONDITIONAL_GROUP_RULE = {\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n\n}\n\nBeautifier.prototype.eatString = function(endChars) {\n var result = '';\n this._ch = this._input.next();\n while (this._ch) {\n result += this._ch;\n if (this._ch === \"\\\\\") {\n result += this._input.next();\n } else if (endChars.indexOf(this._ch) !== -1 || this._ch === \"\\n\") {\n break;\n }\n this._ch = this._input.next();\n }\n return result;\n};\n\n// Skips any white space in the source text from the current position.\n// When allowAtLeastOneNewLine is true, will output new lines for each\n// newline character found; if the user has preserve_newlines off, only\n// the first newline will be output\nBeautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {\n var result = whitespaceChar.test(this._input.peek());\n var isFirstNewLine = true;\n\n while (whitespaceChar.test(this._input.peek())) {\n this._ch = this._input.next();\n if (allowAtLeastOneNewLine && this._ch === '\\n') {\n if (this._options.preserve_newlines || isFirstNewLine) {\n isFirstNewLine = false;\n this._output.add_new_line(true);\n }\n }\n }\n return result;\n};\n\n// Nested pseudo-class if we are insideRule\n// and the next special character found opens\n// a new block\nBeautifier.prototype.foundNestedPseudoClass = function() {\n var openParen = 0;\n var i = 1;\n var ch = this._input.peek(i);\n while (ch) {\n if (ch === \"{\") {\n return true;\n } else if (ch === '(') {\n // pseudoclasses can contain ()\n openParen += 1;\n } else if (ch === ')') {\n if (openParen === 0) {\n return false;\n }\n openParen -= 1;\n } else if (ch === \";\" || ch === \"}\") {\n return false;\n }\n i++;\n ch = this._input.peek(i);\n }\n return false;\n};\n\nBeautifier.prototype.print_string = function(output_string) {\n if (this._output.just_added_newline()) {\n this._output.set_indent(this._indentLevel);\n }\n this._output.add_token(output_string);\n};\n\nBeautifier.prototype.preserveSingleSpace = function(isAfterSpace) {\n if (isAfterSpace) {\n this._output.space_before_token = true;\n }\n};\n\nBeautifier.prototype.indent = function() {\n this._indentLevel++;\n};\n\nBeautifier.prototype.outdent = function() {\n if (this._indentLevel > 0) {\n this._indentLevel--;\n }\n};\n\n/*_____________________--------------------_____________________*/\n\nBeautifier.prototype.beautify = function() {\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text || '')) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n\n // HACK: newline parsing inconsistent. This brute force normalizes the this._input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n\n // reset\n var baseIndentString = '';\n if (this._options.base_indent_string) {\n baseIndentString = this._options.base_indent_string;\n } else {\n var match = source_text.match(/^[\\t ]*/);\n baseIndentString = match[0];\n }\n\n this._output = new Output(this._options.indent_string, baseIndentString);\n this._input = new InputScanner(source_text);\n this._indentLevel = 0;\n this._nestedLevel = 0;\n\n this._ch = null;\n var parenLevel = 0;\n\n var insideRule = false;\n // This is the value side of a property value pair (blue in the following ex)\n // label { content: blue }\n var insidePropertyValue = false;\n var enteringConditionalGroup = false;\n var insideAtExtend = false;\n var insideAtImport = false;\n var topCharacter = this._ch;\n\n while (true) {\n var whitespace = this._input.read(whitespacePattern);\n var isAfterSpace = whitespace !== '';\n var previous_ch = topCharacter;\n this._ch = this._input.next();\n topCharacter = this._ch;\n\n if (!this._ch) {\n break;\n } else if (this._ch === '/' && this._input.peek() === '*') {\n // /* css comment */\n // Always start block comments on a new line.\n // This handles scenarios where a block comment immediately\n // follows a property definition on the same line or where\n // minified code is being beautified.\n this._output.add_new_line();\n this._input.back();\n this.print_string(this._input.read(block_comment_pattern));\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n\n // Block comments are followed by a new line so they don't\n // share a line with other properties\n this._output.add_new_line();\n } else if (this._ch === '/' && this._input.peek() === '/') {\n // // single line comment\n // Preserves the space before a comment\n // on the same line as a rule\n this._output.space_before_token = true;\n this._input.back();\n this.print_string(this._input.read(comment_pattern));\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n } else if (this._ch === '@') {\n this.preserveSingleSpace(isAfterSpace);\n\n // deal with less propery mixins @{...}\n if (this._input.peek() === '{') {\n this.print_string(this._ch + this.eatString('}'));\n } else {\n this.print_string(this._ch);\n\n // strip trailing space, if present, for hash property checks\n var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\\]\\/='\"]/g);\n\n if (variableOrRule.match(/[ :]$/)) {\n // we have a variable or pseudo-class, add it and insert one space before continuing\n variableOrRule = this.eatString(\": \").replace(/\\s$/, '');\n this.print_string(variableOrRule);\n this._output.space_before_token = true;\n }\n\n variableOrRule = variableOrRule.replace(/\\s$/, '');\n\n if (variableOrRule === 'extend') {\n insideAtExtend = true;\n } else if (variableOrRule === 'import') {\n insideAtImport = true;\n }\n\n // might be a nesting at-rule\n if (variableOrRule in this.NESTED_AT_RULE) {\n this._nestedLevel += 1;\n if (variableOrRule in this.CONDITIONAL_GROUP_RULE) {\n enteringConditionalGroup = true;\n }\n // might be less variable\n } else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) {\n insidePropertyValue = true;\n this.indent();\n }\n }\n } else if (this._ch === '#' && this._input.peek() === '{') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch + this.eatString('}'));\n } else if (this._ch === '{') {\n if (insidePropertyValue) {\n insidePropertyValue = false;\n this.outdent();\n }\n this.indent();\n this._output.space_before_token = true;\n this.print_string(this._ch);\n\n // when entering conditional groups, only rulesets are allowed\n if (enteringConditionalGroup) {\n enteringConditionalGroup = false;\n insideRule = (this._indentLevel > this._nestedLevel);\n } else {\n // otherwise, declarations are also allowed\n insideRule = (this._indentLevel >= this._nestedLevel);\n }\n if (this._options.newline_between_rules && insideRule) {\n if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') {\n this._output.ensure_empty_line_above('/', ',');\n }\n }\n this.eatWhitespace(true);\n this._output.add_new_line();\n } else if (this._ch === '}') {\n this.outdent();\n this._output.add_new_line();\n if (previous_ch === '{') {\n this._output.trim(true);\n }\n insideAtImport = false;\n insideAtExtend = false;\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n this.print_string(this._ch);\n insideRule = false;\n if (this._nestedLevel) {\n this._nestedLevel--;\n }\n\n this.eatWhitespace(true);\n this._output.add_new_line();\n\n if (this._options.newline_between_rules && !this._output.just_added_blankline()) {\n if (this._input.peek() !== '}') {\n this._output.add_new_line(true);\n }\n }\n } else if (this._ch === \":\") {\n if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack(\"&\") || this.foundNestedPseudoClass()) && !this._input.lookBack(\"(\") && !insideAtExtend) {\n // 'property: value' delimiter\n // which could be in a conditional group query\n this.print_string(':');\n if (!insidePropertyValue) {\n insidePropertyValue = true;\n this._output.space_before_token = true;\n this.eatWhitespace(true);\n this.indent();\n }\n } else {\n // sass/less parent reference don't use a space\n // sass nested pseudo-class don't use a space\n\n // preserve space before pseudoclasses/pseudoelements, as it means \"in any child\"\n if (this._input.lookBack(\" \")) {\n this._output.space_before_token = true;\n }\n if (this._input.peek() === \":\") {\n // pseudo-element\n this._ch = this._input.next();\n this.print_string(\"::\");\n } else {\n // pseudo-class\n this.print_string(':');\n }\n }\n } else if (this._ch === '\"' || this._ch === '\\'') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch + this.eatString(this._ch));\n this.eatWhitespace(true);\n } else if (this._ch === ';') {\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n insideAtExtend = false;\n insideAtImport = false;\n this.print_string(this._ch);\n this.eatWhitespace(true);\n\n // This maintains single line comments on the same\n // line. Block comments are also affected, but\n // a new line is always output before one inside\n // that section\n if (this._input.peek() !== '/') {\n this._output.add_new_line();\n }\n } else if (this._ch === '(') { // may be a url\n if (this._input.lookBack(\"url\")) {\n this.print_string(this._ch);\n this.eatWhitespace();\n this._ch = this._input.next();\n if (this._ch === ')' || this._ch === '\"' || this._ch !== '\\'') {\n this._input.back();\n parenLevel++;\n } else if (this._ch) {\n this.print_string(this._ch + this.eatString(')'));\n }\n } else {\n parenLevel++;\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n this.eatWhitespace();\n }\n } else if (this._ch === ')') {\n this.print_string(this._ch);\n parenLevel--;\n } else if (this._ch === ',') {\n this.print_string(this._ch);\n this.eatWhitespace(true);\n if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel < 1 && !insideAtImport) {\n this._output.add_new_line();\n } else {\n this._output.space_before_token = true;\n }\n } else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel < 1) {\n //handle combinator spacing\n if (this._options.space_around_combinator) {\n this._output.space_before_token = true;\n this.print_string(this._ch);\n this._output.space_before_token = true;\n } else {\n this.print_string(this._ch);\n this.eatWhitespace();\n // squash extra whitespace\n if (this._ch && whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n }\n } else if (this._ch === ']') {\n this.print_string(this._ch);\n } else if (this._ch === '[') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n } else if (this._ch === '=') { // no whitespace before or after\n this.eatWhitespace();\n this.print_string('=');\n if (whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n } else if (this._ch === '!') { // !important\n this.print_string(' ');\n this.print_string(this._ch);\n } else {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n }\n }\n\n var sweetCode = this._output.get_code(this._options.end_with_newline, eol);\n\n return sweetCode;\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'css');\n\n this.selector_separator_newline = this._get_boolean('selector_separator_newline', true);\n this.newline_between_rules = this._get_boolean('newline_between_rules', true);\n var space_around_selector_separator = this._get_boolean('space_around_selector_separator');\n this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator;\n\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction style_html(html_source, options, js_beautify, css_beautify) {\n var beautifier = new Beautifier(html_source, options, js_beautify, css_beautify);\n return beautifier.beautify();\n}\n\nmodule.exports = style_html;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('../html/options').Options;\nvar Output = require('../core/output').Output;\nvar Tokenizer = require('../html/tokenizer').Tokenizer;\nvar TOKEN = require('../html/tokenizer').TOKEN;\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\nvar Printer = function(indent_string, base_indent_string, wrap_line_length, max_preserve_newlines, preserve_newlines) { //handles input/output and some other printing functions\n\n this.indent_level = 0;\n this.alignment_size = 0;\n this.wrap_line_length = wrap_line_length;\n this.max_preserve_newlines = max_preserve_newlines;\n this.preserve_newlines = preserve_newlines;\n\n this._output = new Output(indent_string, base_indent_string);\n\n};\n\nPrinter.prototype.current_line_has_match = function(pattern) {\n return this._output.current_line.has_match(pattern);\n};\n\nPrinter.prototype.set_space_before_token = function(value) {\n this._output.space_before_token = value;\n};\n\nPrinter.prototype.add_raw_token = function(token) {\n this._output.add_raw_token(token);\n};\n\nPrinter.prototype.traverse_whitespace = function(raw_token) {\n if (raw_token.whitespace_before || raw_token.newlines) {\n var newlines = 0;\n\n if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) {\n newlines = raw_token.newlines ? 1 : 0;\n }\n\n if (this.preserve_newlines) {\n newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1;\n }\n\n if (newlines) {\n for (var n = 0; n < newlines; n++) {\n this.print_newline(n > 0);\n }\n } else {\n this._output.space_before_token = true;\n this.print_space_or_wrap(raw_token.text);\n }\n return true;\n }\n return false;\n};\n\n// Append a space to the given content (string array) or, if we are\n// at the wrap_line_length, append a newline/indentation.\n// return true if a newline was added, false if a space was added\nPrinter.prototype.print_space_or_wrap = function(text) {\n if (this.wrap_line_length) {\n if (this._output.current_line.get_character_count() + text.length + 1 >= this.wrap_line_length) { //insert a line when the wrap_line_length is reached\n return this._output.add_new_line();\n }\n }\n return false;\n};\n\nPrinter.prototype.print_newline = function(force) {\n this._output.add_new_line(force);\n};\n\nPrinter.prototype.print_token = function(text) {\n if (text) {\n if (this._output.current_line.is_empty()) {\n this._output.set_indent(this.indent_level, this.alignment_size);\n }\n\n this._output.add_token(text);\n }\n};\n\nPrinter.prototype.print_raw_text = function(text) {\n this._output.current_line.push_raw(text);\n};\n\nPrinter.prototype.indent = function() {\n this.indent_level++;\n};\n\nPrinter.prototype.unindent = function() {\n if (this.indent_level > 0) {\n this.indent_level--;\n }\n};\n\nPrinter.prototype.get_full_indent = function(level) {\n level = this.indent_level + (level || 0);\n if (level < 1) {\n return '';\n }\n\n return this._output.get_indent_string(level);\n};\n\n\nvar uses_beautifier = function(tag_check, start_token) {\n var raw_token = start_token.next;\n if (!start_token.closed) {\n return false;\n }\n\n while (raw_token.type !== TOKEN.EOF && raw_token.closed !== start_token) {\n if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === 'type') {\n // For script and style tags that have a type attribute, only enable custom beautifiers for matching values\n var peekEquals = raw_token.next ? raw_token.next : raw_token;\n var peekValue = peekEquals.next ? peekEquals.next : peekEquals;\n if (peekEquals.type === TOKEN.EQUALS && peekValue.type === TOKEN.VALUE) {\n return (tag_check === 'style' && peekValue.text.search('text/css') > -1) ||\n (tag_check === 'script' && peekValue.text.search(/(text|application|dojo)\\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\\+)?json|method|aspect)/) > -1);\n }\n return false;\n }\n raw_token = raw_token.next;\n }\n\n return true;\n};\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction TagFrame(parent, parser_token, indent_level) {\n this.parent = parent || null;\n this.tag = parser_token ? parser_token.tag_name : '';\n this.indent_level = indent_level || 0;\n this.parser_token = parser_token || null;\n}\n\nfunction TagStack(printer) {\n this._printer = printer;\n this._current_frame = null;\n}\n\nTagStack.prototype.get_parser_token = function() {\n return this._current_frame ? this._current_frame.parser_token : null;\n};\n\nTagStack.prototype.record_tag = function(parser_token) { //function to record a tag and its parent in this.tags Object\n var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);\n this._current_frame = new_frame;\n};\n\nTagStack.prototype._try_pop_frame = function(frame) { //function to retrieve the opening tag to the corresponding closer\n var parser_token = null;\n\n if (frame) {\n parser_token = frame.parser_token;\n this._printer.indent_level = frame.indent_level;\n this._current_frame = frame.parent;\n }\n\n return parser_token;\n};\n\nTagStack.prototype._get_frame = function(tag_list, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._current_frame;\n\n while (frame) { //till we reach '' (the initial value);\n if (tag_list.indexOf(frame.tag) !== -1) { //if this is it use it\n break;\n } else if (stop_list && stop_list.indexOf(frame.tag) !== -1) {\n frame = null;\n break;\n }\n frame = frame.parent;\n }\n\n return frame;\n};\n\nTagStack.prototype.try_pop = function(tag, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._get_frame([tag], stop_list);\n return this._try_pop_frame(frame);\n};\n\nTagStack.prototype.indent_to_tag = function(tag_list) {\n var frame = this._get_frame(tag_list);\n if (frame) {\n this._printer.indent_level = frame.indent_level;\n }\n};\n\nfunction Beautifier(source_text, options, js_beautify, css_beautify) {\n //Wrapper function to invoke all the necessary constructors and deal with the output.\n this._source_text = source_text || '';\n options = options || {};\n this._js_beautify = js_beautify;\n this._css_beautify = css_beautify;\n this._tag_stack = null;\n\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n var optionHtml = new Options(options, 'html');\n\n this._options = optionHtml;\n\n this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 'force'.length) === 'force';\n this._is_wrap_attributes_force_expand_multiline = (this._options.wrap_attributes === 'force-expand-multiline');\n this._is_wrap_attributes_force_aligned = (this._options.wrap_attributes === 'force-aligned');\n this._is_wrap_attributes_aligned_multiple = (this._options.wrap_attributes === 'aligned-multiple');\n}\n\nBeautifier.prototype.beautify = function() {\n\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text)) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n // HACK: newline parsing inconsistent. This brute force normalizes the input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n var baseIndentString = '';\n\n if (this._options.base_indent_string) {\n baseIndentString = this._options.base_indent_string;\n } else {\n // Including commented out text would change existing beautifier behavior for v1.8.1 to autodetect base indent.\n // var match = source_text.match(/^[\\t ]*/);\n // baseIndentString = match[0];\n }\n\n var last_token = {\n text: '',\n type: ''\n };\n\n var last_tag_token = new TagOpenParserToken();\n\n var printer = new Printer(this._options.indent_string, baseIndentString,\n this._options.wrap_line_length, this._options.max_preserve_newlines, this._options.preserve_newlines);\n var tokens = new Tokenizer(source_text, this._options).tokenize();\n\n this._tag_stack = new TagStack(printer);\n\n var parser_token = null;\n var raw_token = tokens.next();\n while (raw_token.type !== TOKEN.EOF) {\n\n if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) {\n parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token);\n last_tag_token = parser_token;\n } else if ((raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE) ||\n (raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete)) {\n parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, tokens);\n } else if (raw_token.type === TOKEN.TAG_CLOSE) {\n parser_token = this._handle_tag_close(printer, raw_token, last_tag_token);\n } else if (raw_token.type === TOKEN.TEXT) {\n parser_token = this._handle_text(printer, raw_token, last_tag_token);\n } else {\n // This should never happen, but if it does. Print the raw token\n printer.add_raw_token(raw_token);\n }\n\n last_token = parser_token;\n\n raw_token = tokens.next();\n }\n var sweet_code = printer._output.get_code(this._options.end_with_newline, eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) {\n var parser_token = { text: raw_token.text, type: raw_token.type };\n printer.alignment_size = 0;\n last_tag_token.tag_complete = true;\n\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '');\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n if (last_tag_token.tag_start_char === '<') {\n printer.set_space_before_token(raw_token.text[0] === '/'); // space before />, no space before >\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) {\n printer.print_newline(false);\n }\n }\n printer.print_token(raw_token.text);\n }\n\n if (last_tag_token.indent_content &&\n !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {\n printer.indent();\n\n // only indent once per opened tag\n last_tag_token.indent_content = false;\n }\n return parser_token;\n};\n\nBeautifier.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, tokens) {\n var parser_token = { text: raw_token.text, type: raw_token.type };\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '');\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n if (last_tag_token.tag_start_char === '<') {\n if (raw_token.type === TOKEN.ATTRIBUTE) {\n printer.set_space_before_token(true);\n last_tag_token.attr_count += 1;\n } else if (raw_token.type === TOKEN.EQUALS) { //no space before =\n printer.set_space_before_token(false);\n } else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) { //no space before value\n printer.set_space_before_token(false);\n }\n }\n\n if (printer._output.space_before_token && last_tag_token.tag_start_char === '<') {\n var wrapped = printer.print_space_or_wrap(raw_token.text);\n if (raw_token.type === TOKEN.ATTRIBUTE) {\n var indentAttrs = wrapped && !this._is_wrap_attributes_force;\n\n if (this._is_wrap_attributes_force) {\n var force_first_attr_wrap = false;\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.attr_count === 1) {\n var is_only_attribute = true;\n var peek_index = 0;\n var peek_token;\n do {\n peek_token = tokens.peek(peek_index);\n if (peek_token.type === TOKEN.ATTRIBUTE) {\n is_only_attribute = false;\n break;\n }\n peek_index += 1;\n } while (peek_index < 4 && peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE);\n\n force_first_attr_wrap = !is_only_attribute;\n }\n\n if (last_tag_token.attr_count > 1 || force_first_attr_wrap) {\n printer.print_newline(false);\n indentAttrs = true;\n }\n }\n if (indentAttrs) {\n last_tag_token.has_wrapped_attrs = true;\n }\n }\n }\n printer.print_token(raw_token.text);\n }\n return parser_token;\n};\n\nBeautifier.prototype._handle_text = function(printer, raw_token, last_tag_token) {\n var parser_token = { text: raw_token.text, type: 'TK_CONTENT' };\n if (last_tag_token.custom_beautifier) { //check if we need to format javascript\n this._print_custom_beatifier_text(printer, raw_token, last_tag_token);\n } else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n printer.traverse_whitespace(raw_token);\n printer.print_token(raw_token.text);\n }\n return parser_token;\n};\n\nBeautifier.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) {\n if (raw_token.text !== '') {\n printer.print_newline(false);\n var text = raw_token.text,\n _beautifier,\n script_indent_level = 1;\n if (last_tag_token.tag_name === 'script') {\n _beautifier = typeof this._js_beautify === 'function' && this._js_beautify;\n } else if (last_tag_token.tag_name === 'style') {\n _beautifier = typeof this._css_beautify === 'function' && this._css_beautify;\n }\n\n if (this._options.indent_scripts === \"keep\") {\n script_indent_level = 0;\n } else if (this._options.indent_scripts === \"separate\") {\n script_indent_level = -printer.indent_level;\n }\n\n var indentation = printer.get_full_indent(script_indent_level);\n\n // if there is at least one empty line at the end of this text, strip it\n // we'll be adding one back after the text but before the containing tag.\n text = text.replace(/\\n[ \\t]*$/, '');\n\n if (_beautifier) {\n\n // call the Beautifier if avaliable\n var Child_options = function() {\n this.eol = '\\n';\n };\n Child_options.prototype = this._options.raw_options;\n var child_options = new Child_options();\n text = _beautifier(indentation + text, child_options);\n } else {\n // simply indent the string otherwise\n var white = text.match(/^\\s*/)[0];\n var _level = white.match(/[^\\n\\r]*$/)[0].split(this._options.indent_string).length - 1;\n var reindent = this._get_full_indent(script_indent_level - _level);\n text = (indentation + text.trim())\n .replace(/\\r\\n|\\r|\\n/g, '\\n' + reindent);\n }\n if (text) {\n printer.print_raw_text(text);\n printer.print_newline(true);\n }\n }\n};\n\nBeautifier.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token) {\n var parser_token = this._get_tag_open_token(raw_token);\n printer.traverse_whitespace(raw_token);\n\n this._set_tag_position(printer, raw_token, parser_token, last_tag_token, last_token);\n\n\n if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) &&\n raw_token.type === TOKEN.TAG_OPEN && raw_token.text.indexOf(']*)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n } else {\n tag_check_match = raw_token.text.match(/^{{\\#?([^\\s}]+)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n }\n this.tag_check = this.tag_check.toLowerCase();\n\n if (raw_token.type === TOKEN.COMMENT) {\n this.tag_complete = true;\n }\n\n this.is_start_tag = this.tag_check.charAt(0) !== '/';\n this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check;\n this.is_end_tag = !this.is_start_tag ||\n (raw_token.closed && raw_token.closed.text === '/>');\n\n // handlebars tags that don't start with # or ^ are single_tags, and so also start and end.\n this.is_end_tag = this.is_end_tag ||\n (this.tag_start_char === '{' && (this.text.length < 3 || (/[^#\\^]/.test(this.text.charAt(2)))));\n }\n};\n\nBeautifier.prototype._get_tag_open_token = function(raw_token) { //function to get a full tag and parse its type\n var parser_token = new TagOpenParserToken(this._tag_stack.get_parser_token(), raw_token);\n\n parser_token.alignment_size = this._options.wrap_attributes_indent_size;\n\n parser_token.is_end_tag = parser_token.is_end_tag ||\n in_array(parser_token.tag_check, this._options.void_elements);\n\n parser_token.is_empty_element = parser_token.tag_complete ||\n (parser_token.is_start_tag && parser_token.is_end_tag);\n\n parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted);\n parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted);\n parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_start_char === '{';\n\n return parser_token;\n};\n\nBeautifier.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) {\n\n if (!parser_token.is_empty_element) {\n if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name); //remove it and all ancestors\n } else { // it's a start-tag\n // check if this tag is starting an element that has optional end element\n // and do an ending needed\n this._do_optional_end_element(parser_token);\n\n this._tag_stack.record_tag(parser_token); //push it on the tag stack\n\n if ((parser_token.tag_name === 'script' || parser_token.tag_name === 'style') &&\n !(parser_token.is_unformatted || parser_token.is_content_unformatted)) {\n parser_token.custom_beautifier = uses_beautifier(parser_token.tag_check, raw_token);\n }\n }\n }\n\n if (in_array(parser_token.tag_check, this._options.extra_liners)) { //check if this double needs an extra line\n printer.print_newline(false);\n if (!printer._output.just_added_blankline()) {\n printer.print_newline(true);\n }\n }\n\n if (parser_token.is_empty_element) { //if this tag name is a single tag type (either in the list or has a closing /)\n\n // if you hit an else case, reset the indent level if you are inside an:\n // 'if', 'unless', or 'each' block.\n if (parser_token.tag_start_char === '{' && parser_token.tag_check === 'else') {\n this._tag_stack.indent_to_tag(['if', 'unless', 'each']);\n parser_token.indent_content = true;\n // Don't add a newline if opening {{#if}} tag is on the current line\n var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/);\n if (!foundIfOnCurrentLine) {\n printer.print_newline(false);\n }\n }\n\n // Don't add a newline before elements that should remain where they are.\n if (parser_token.tag_name === '!--' && last_token.type === TOKEN.TAG_CLOSE &&\n last_tag_token.is_end_tag && parser_token.text.indexOf('\\n') === -1) {\n //Do nothing. Leave comments on same line.\n } else if (!parser_token.is_inline_element && !parser_token.is_unformatted) {\n printer.print_newline(false);\n }\n } else if (parser_token.is_unformatted || parser_token.is_content_unformatted) {\n if (!parser_token.is_inline_element && !parser_token.is_unformatted) {\n printer.print_newline(false);\n }\n } else if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n if ((parser_token.start_tag_token && parser_token.start_tag_token.multiline_content) ||\n !(parser_token.is_inline_element ||\n (last_tag_token.is_inline_element) ||\n (last_token.type === TOKEN.TAG_CLOSE &&\n parser_token.start_tag_token === last_tag_token) ||\n (last_token.type === 'TK_CONTENT')\n )) {\n printer.print_newline(false);\n }\n } else { // it's a start-tag\n parser_token.indent_content = !parser_token.custom_beautifier;\n\n if (parser_token.tag_start_char === '<') {\n if (parser_token.tag_name === 'html') {\n parser_token.indent_content = this._options.indent_inner_html;\n } else if (parser_token.tag_name === 'head') {\n parser_token.indent_content = this._options.indent_head_inner_html;\n } else if (parser_token.tag_name === 'body') {\n parser_token.indent_content = this._options.indent_body_inner_html;\n }\n }\n\n if (!parser_token.is_inline_element && last_token.type !== 'TK_CONTENT') {\n if (parser_token.parent) {\n parser_token.parent.multiline_content = true;\n }\n printer.print_newline(false);\n }\n }\n};\n\n//To be used for

tag special case:\n//var p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'];\n\nBeautifier.prototype._do_optional_end_element = function(parser_token) {\n // NOTE: cases of \"if there is no more content in the parent element\"\n // are handled automatically by the beautifier.\n // It assumes parent or ancestor close tag closes all children.\n // https://www.w3.org/TR/html5/syntax.html#optional-tags\n if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) {\n return;\n\n } else if (parser_token.tag_name === 'body') {\n // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment.\n this._tag_stack.try_pop('head');\n\n //} else if (parser_token.tag_name === 'body') {\n // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment.\n\n } else if (parser_token.tag_name === 'li') {\n // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.\n this._tag_stack.try_pop('li', ['ol', 'ul']);\n\n } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') {\n // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element.\n // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element.\n this._tag_stack.try_pop('dt', ['dl']);\n this._tag_stack.try_pop('dd', ['dl']);\n\n //} else if (p_closers.indexOf(parser_token.tag_name) !== -1) {\n //TODO: THIS IS A BUG FARM. We are not putting this into 1.8.0 as it is likely to blow up.\n //A p element’s end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, details, div, dl, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hr, main, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is an HTML element that is not an a, audio, del, ins, map, noscript, or video element, or an autonomous custom element.\n //this._tag_stack.try_pop('p', ['body']);\n\n } else if (parser_token.tag_name === 'rp' || parser_token.tag_name === 'rt') {\n // An rt element’s end tag may be omitted if the rt element is immediately followed by an rt or rp element, or if there is no more content in the parent element.\n // An rp element’s end tag may be omitted if the rp element is immediately followed by an rt or rp element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('rt', ['ruby', 'rtc']);\n this._tag_stack.try_pop('rp', ['ruby', 'rtc']);\n\n } else if (parser_token.tag_name === 'optgroup') {\n // An optgroup element’s end tag may be omitted if the optgroup element is immediately followed by another optgroup element, or if there is no more content in the parent element.\n // An option element’s end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('optgroup', ['select']);\n //this._tag_stack.try_pop('option', ['select']);\n\n } else if (parser_token.tag_name === 'option') {\n // An option element’s end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('option', ['select', 'datalist', 'optgroup']);\n\n } else if (parser_token.tag_name === 'colgroup') {\n // DONE: A colgroup element’s end tag may be omitted if the colgroup element is not immediately followed by a space character or a comment.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n\n } else if (parser_token.tag_name === 'thead') {\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n\n //} else if (parser_token.tag_name === 'caption') {\n // DONE: A caption element’s end tag may be omitted if the caption element is not immediately followed by a space character or a comment.\n\n } else if (parser_token.tag_name === 'tbody' || parser_token.tag_name === 'tfoot') {\n // A thead element’s end tag may be omitted if the thead element is immediately followed by a tbody or tfoot element.\n // A tbody element’s end tag may be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element.\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n this._tag_stack.try_pop('thead', ['table']);\n this._tag_stack.try_pop('tbody', ['table']);\n\n //} else if (parser_token.tag_name === 'tfoot') {\n // DONE: A tfoot element’s end tag may be omitted if there is no more content in the parent element.\n\n } else if (parser_token.tag_name === 'tr') {\n // A tr element’s end tag may be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element.\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n this._tag_stack.try_pop('tr', ['table', 'thead', 'tbody', 'tfoot']);\n\n } else if (parser_token.tag_name === 'th' || parser_token.tag_name === 'td') {\n // A td element’s end tag may be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element.\n // A th element’s end tag may be omitted if the th element is immediately followed by a td or th element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('td', ['tr']);\n this._tag_stack.try_pop('th', ['tr']);\n }\n\n // Start element omission not handled currently\n // A head element’s start tag may be omitted if the element is empty, or if the first thing inside the head element is an element.\n // A tbody element’s start tag may be omitted if the first thing inside the tbody element is a tr element, and if the element is not immediately preceded by a tbody, thead, or tfoot element whose end tag has been omitted. (It can’t be omitted if the element is empty.)\n // A colgroup element’s start tag may be omitted if the first thing inside the colgroup element is a col element, and if the element is not immediately preceded by another colgroup element whose end tag has been omitted. (It can’t be omitted if the element is empty.)\n\n // Fix up the parent of the parser token\n parser_token.parent = this._tag_stack.get_parser_token();\n\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'html');\n\n this.indent_inner_html = this._get_boolean('indent_inner_html');\n this.indent_body_inner_html = this._get_boolean('indent_body_inner_html', true);\n this.indent_head_inner_html = this._get_boolean('indent_head_inner_html', true);\n\n this.indent_handlebars = this._get_boolean('indent_handlebars', true);\n this.wrap_attributes = this._get_selection('wrap_attributes',\n ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple'])[0];\n this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size);\n this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']);\n\n this.inline = this._get_array('inline', [\n // https://www.w3.org/TR/html5/dom.html#phrasing-content\n 'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite',\n 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img',\n 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript',\n 'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small',\n 'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var',\n 'video', 'wbr', 'text',\n // prexisting - not sure of full effect of removing, leaving in\n 'acronym', 'address', 'big', 'dt', 'ins', 'strike', 'tt'\n ]);\n this.void_elements = this._get_array('void_elements', [\n // HTLM void elements - aka self-closing tags - aka singletons\n // https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',\n 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr',\n // NOTE: Optional tags are too complex for a simple list\n // they are hard coded in _do_optional_end_element\n\n // Doctype and xml elements\n '!doctype', '?xml',\n // ?php and ?= tags\n '?php', '?=',\n // other tags that were in this list, keeping just in case\n 'basefont', 'isindex'\n ]);\n this.unformatted = this._get_array('unformatted', []);\n this.content_unformatted = this._get_array('content_unformatted', [\n 'pre', 'textarea'\n ]);\n this.indent_scripts = this._get_selection('indent_scripts', ['normal', 'keep', 'separate']);\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://beautifier/webpack/universalModuleDefinition","webpack://beautifier/webpack/bootstrap","webpack://beautifier/./js/src/javascript/tokenizer.js","webpack://beautifier/./js/src/core/tokenizer.js","webpack://beautifier/./js/src/core/output.js","webpack://beautifier/./js/src/core/options.js","webpack://beautifier/./js/src/core/inputscanner.js","webpack://beautifier/./js/src/core/token.js","webpack://beautifier/./js/src/javascript/acorn.js","webpack://beautifier/./js/src/core/directives.js","webpack://beautifier/./js/src/html/tokenizer.js","webpack://beautifier/./js/src/index.js","webpack://beautifier/./js/src/javascript/index.js","webpack://beautifier/./js/src/javascript/beautifier.js","webpack://beautifier/./js/src/javascript/options.js","webpack://beautifier/./js/src/core/tokenstream.js","webpack://beautifier/./js/src/css/index.js","webpack://beautifier/./js/src/css/beautifier.js","webpack://beautifier/./js/src/css/options.js","webpack://beautifier/./js/src/html/index.js","webpack://beautifier/./js/src/html/beautifier.js","webpack://beautifier/./js/src/html/options.js"],"names":["root","factory","exports","module","define","amd","self","windows","window","global","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","InputScanner","BaseTokenizer","Tokenizer","BASETOKEN","TOKEN","Directives","acorn","in_array","what","arr","indexOf","START_EXPR","END_EXPR","START_BLOCK","END_BLOCK","WORD","RESERVED","SEMICOLON","STRING","EQUALS","OPERATOR","COMMA","BLOCK_COMMENT","COMMENT","DOT","UNKNOWN","START","RAW","EOF","directives_core","number_pattern","digit","dot_pattern","positionable_operators","split","punct","replace","in_html_comment","punct_pattern","RegExp","line_starters","reserved_words","concat","reserved_word_pattern","join","block_comment_pattern","comment_pattern","template_pattern","input_string","options","_whitespace_pattern","_newline_pattern","_is_comment","current_token","type","_is_opening","_is_closing","open_token","text","_reset","_get_next_token","previous_token","_readWhitespace","token","_input","peek","_read_singles","_read_word","_read_comment","_read_string","_read_regexp","_read_xml","_read_non_javascript","_read_punctuation","_create_token","next","resulting_string","read","identifier","test","_is_first_token","hasNext","trim","sharp","testChar","back","allLineBreaks","match","newline","comment","directives","get_directives","ignore","readIgnored","has_char_escapes","_read_string_recursive","_options","unescape_strings","out","escaped","input_scan","matched","parseInt","String","fromCharCode","unescape_string","_allow_regexp_or_xml","opened","previous","esc","in_char_class","startXmlRegExp","xmlRegExp","e4x","xmlStr","rootTag","isCurlyRoot","depth","isEndTag","tagName","length","slice","delimiter","allow_unescaped_newlines","start_sub","current_char","Token","TokenStream","__tokens","__newline_count","__whitespace_before_token","tokenize","current","restart","open_stack","comments","add","isEmpty","comments_before","parent","push","closed","pop","lastIndex","nextMatch","exec","OutputLine","__parent","__character_count","__indent_count","__alignment_count","__items","IndentCache","base_string","level_string","__cache","__level_string","Output","baseIndentString","indent_string","indent_char","indent_size","Array","indent_level","__indent_cache","__alignment_cache","baseIndentLength","indent_length","raw","_end_with_newline","end_with_newline","__lines","previous_line","current_line","space_before_token","__add_outputline","item","index","has_match","pattern","lastCheckedOutput","set_indent","indent","alignment","get_character_count","is_empty","last","push_raw","last_newline_index","lastIndexOf","remove_indent","toString","result","get_indent_string","get_alignment_string","__ensure_cache","level","get_level_string","get_line_number","add_new_line","force_newline","just_added_newline","get_code","eol","sweet_code","add_raw_token","x","newlines","whitespace_before","add_token","printable_token","add_space_before_token","output_length","eat_newlines","undefined","just_added_blankline","ensure_empty_line_above","starts_with","ends_with","potentialEmptyLine","splice","Options","merge_child_field","_mergeOpts","raw_options","_normalizeOpts","disabled","_get_boolean","_get_characters","_get_number","preserve_newlines","max_preserve_newlines","indent_with_tabs","wrap_line_length","allOptions","childFieldName","finalOpts","convertedOpts","_get_array","default_value","option_value","isNaN","_get_selection","selection_list","_get_selection_list","Error","_is_valid_selection","some","normalizeOpts","mergeOpts","__input","__input_length","__position","val","charAt","pattern_match","readUntil","include_match","match_index","substring","readUntilAfter","peekUntilAfter","start","lookBack","testVal","toLowerCase","identifierStart","lineBreak","source","start_block_pattern","end_block_pattern","__directives_block_pattern","__directive_pattern","__directives_end_ignore_pattern","directive_match","input","TAG_OPEN","TAG_CLOSE","ATTRIBUTE","VALUE","TEXT","_current_tag_name","_word_pattern","indent_handlebars","_read_attribute","_read_raw_content","_read_open","_read_close","_read_content_word","peek1","peek2","input_char","content","string_pattern","_is_content_unformatted","tag_name","void_elements","content_unformatted","unformatted","substr","js_beautify","css_beautify","html_beautify","js","css","html","html_source","Beautifier","js_source_text","beautify","remove_redundant_indentation","output","frame","multiline_frame","MODE","ForInitializer","Conditional","start_line_index","ltrim","reserved_word","word","reserved_array","words","special_words","OPERATOR_POSITION","list","generateMapFromStrings","OPERATOR_POSITION_BEFORE_OR_PRESERVE","before_newline","preserve_newline","BlockStatement","Statement","ObjectLiteral","ArrayLiteral","Expression","is_array","is_expression","source_text","_source_text","_output","_tokens","_last_last_text","_flags","_previous_flags","_flag_store","create_flags","flags_base","next_indent_level","indentation_level","line_indent_level","last_token","last_word","declaration_statement","declaration_assignment","inline_frame","if_block","else_block","do_block","do_while","import_block","in_case_statement","in_case","case_body","ternary_depth","test_output_raw","set_mode","tokenizer","handle_token","preserve_statement_flags","handle_start_expr","handle_end_expr","handle_start_block","handle_end_block","handle_word","handle_semicolon","handle_string","handle_equals","handle_operator","handle_comma","handle_block_comment","handle_comment","handle_dot","handle_eof","handle_unknown","handle_whitespace_and_comments","keep_whitespace","keep_array_indentation","comment_token","print_newline","j","newline_restricted_tokens","allow_wrap_or_preserved_newline","force_linewrap","shouldPreserveOrForce","shouldPrintOperatorNewline","operator_position","next_token","restore_mode","print_token_line_indentation","print_token","comma_first","popped","deindent","start_of_object_property","start_of_statement","next_mode","space_in_paren","space_before_conditional","space_after_anon_function","space_in_empty_paren","second_token","empty_anonymous_function","brace_preserve_inline","check_token","brace_style","empty_braces","jslint_happy","prefix","isGeneratorAsterisk","isUnary","space_before","space_after","in_ternary","isColon","isTernaryColon","isOtherColon","after_newline","preserve","lines","idx","split_linebreaks","javadoc","starless","lastIndent","lastIndentLength","all_lines_start_with","line","len","each_line_matches_indent","unindent_chained_methods","break_chained_methods","BaseOptions","validPositionValues","raw_brace_style","braces_on_own_line","brace_style_split","bs","parent_token","__tokens_length","__parent_token","whitespaceChar","whitespacePattern","_ch","NESTED_AT_RULE","@page","@font-face","@keyframes","@media","@supports","@document","CONDITIONAL_GROUP_RULE","eatString","endChars","eatWhitespace","allowAtLeastOneNewLine","isFirstNewLine","foundNestedPseudoClass","openParen","ch","print_string","output_string","_indentLevel","preserveSingleSpace","isAfterSpace","outdent","_nestedLevel","parenLevel","insideRule","insidePropertyValue","enteringConditionalGroup","insideAtExtend","insideAtImport","topCharacter","previous_ch","variableOrRule","newline_between_rules","selector_separator_newline","space_around_combinator","space_around_selector_separator","Printer","base_indent_string","alignment_size","current_line_has_match","set_space_before_token","traverse_whitespace","raw_token","print_space_or_wrap","force","print_raw_text","unindent","get_full_indent","TagStack","printer","_printer","_current_frame","_js_beautify","_css_beautify","_tag_stack","optionHtml","_is_wrap_attributes_force","wrap_attributes","_is_wrap_attributes_force_expand_multiline","_is_wrap_attributes_force_aligned","_is_wrap_attributes_aligned_multiple","get_parser_token","parser_token","record_tag","new_frame","tag","_try_pop_frame","_get_frame","tag_list","stop_list","try_pop","indent_to_tag","last_tag_token","TagOpenParserToken","tokens","_handle_tag_open","tag_complete","_handle_inside_tag","_handle_tag_close","_handle_text","is_unformatted","tag_start_char","has_wrapped_attrs","indent_content","is_content_unformatted","attr_count","wrapped","indentAttrs","force_first_attr_wrap","peek_token","is_only_attribute","peek_index","custom_beautifier","_print_custom_beatifier_text","_beautifier","script_indent_level","indent_scripts","indentation","Child_options","_level","reindent","_get_full_indent","_get_tag_open_token","_set_tag_position","tag_check_match","is_inline_element","is_empty_element","is_start_tag","is_end_tag","multiline_content","start_tag_token","tag_check","wrap_attributes_indent_size","inline","_do_optional_end_element","start_token","peekEquals","peekValue","search","uses_beautifier","extra_liners","indent_inner_html","indent_head_inner_html","indent_body_inner_html"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,gBAAAH,GACA,iBAAAC,QACAA,QAAA,WAAAD,IAEAD,EAAA,WAAAC,IARA,CASC,oBAAAK,UAAA,oBAAAC,QAAAC,OAAA,oBAAAC,cAAAC,KAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAX,QAGA,IAAAC,EAAAQ,EAAAE,IACAC,EAAAD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,qBAIA7iB,EAAAD,QAAA+V,2CCjsBA,IAAAsI,EAAkB3d,EAAQ,GAAiB+P,QAE3C,SAAAA,EAAA5K,GACAwY,EAAAtd,KAAAP,KAAAqF,EAAA,QAEArF,KAAAkmB,kBAAAlmB,KAAAuQ,aAAA,qBACAvQ,KAAAomB,uBAAApmB,KAAAuQ,aAAA,6BACAvQ,KAAAmmB,uBAAAnmB,KAAAuQ,aAAA,6BAEAvQ,KAAA+T,kBAAA/T,KAAAuQ,aAAA,wBACAvQ,KAAAkiB,gBAAAliB,KAAAsR,eAAA,mBACA,6EACAtR,KAAAylB,4BAAAzlB,KAAAyQ,YAAA,8BAAAzQ,KAAAqM,aACArM,KAAAimB,aAAAjmB,KAAAkR,WAAA,wCAEAlR,KAAA0lB,OAAA1lB,KAAAkR,WAAA,UAEA,wEACA,qEACA,4EACA,oEACA,yEACA,qBAEA,qDAEAlR,KAAA4U,cAAA5U,KAAAkR,WAAA,iBAGA,6DACA,wDAKA,kBAEA,YAEA,uBAEAlR,KAAA8U,YAAA9U,KAAAkR,WAAA,kBACAlR,KAAA6U,oBAAA7U,KAAAkR,WAAA,uBACA,mBAEAlR,KAAAykB,eAAAzkB,KAAAsR,eAAA,+CAEArB,EAAAjO,UAAA,IAAA6b,EAIApe,EAAAD,QAAAyQ","file":"beautifier.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"beautifier\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"beautifier\"] = factory();\n\telse\n\t\troot[\"beautifier\"] = factory();\n})(typeof self !== 'undefined' ? self : typeof windows !== 'undefined' ? window : typeof global !== 'undefined' ? global : this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\nvar acorn = require('./acorn');\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\n\nvar TOKEN = {\n START_EXPR: 'TK_START_EXPR',\n END_EXPR: 'TK_END_EXPR',\n START_BLOCK: 'TK_START_BLOCK',\n END_BLOCK: 'TK_END_BLOCK',\n WORD: 'TK_WORD',\n RESERVED: 'TK_RESERVED',\n SEMICOLON: 'TK_SEMICOLON',\n STRING: 'TK_STRING',\n EQUALS: 'TK_EQUALS',\n OPERATOR: 'TK_OPERATOR',\n COMMA: 'TK_COMMA',\n BLOCK_COMMENT: 'TK_BLOCK_COMMENT',\n COMMENT: 'TK_COMMENT',\n DOT: 'TK_DOT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\n\nvar directives_core = new Directives(/\\/\\*/, /\\*\\//);\n\nvar number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\\d+n|(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?/g;\n\nvar digit = /[0-9]/;\n\n// Dot \".\" must be distinguished from \"...\" and decimal\nvar dot_pattern = /[^\\d\\.]/;\n\nvar positionable_operators = (\n \">>> === !== \" +\n \"<< && >= ** != == <= >> || \" +\n \"< / - + > : & % ? ^ | *\").split(' ');\n\n// IMPORTANT: this must be sorted longest to shortest or tokenizing many not work.\n// Also, you must update possitionable operators separately from punct\nvar punct =\n \">>>= \" +\n \"... >>= <<= === >>> !== **= \" +\n \"=> ^= :: /= << <= == && -= >= >> != -- += ** || ++ %= &= *= |= \" +\n \"= ! ? > < : / ^ - + * & % ~ |\";\n\npunct = punct.replace(/[-[\\]{}()*+?.,\\\\^$|#]/g, \"\\\\$&\");\npunct = punct.replace(/ /g, '|');\n\nvar punct_pattern = new RegExp(punct, 'g');\n\n// words which should always start on new line.\nvar line_starters = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(',');\nvar reserved_words = line_starters.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as']);\nvar reserved_word_pattern = new RegExp('^(?:' + reserved_words.join('|') + ')$');\n\n// /* ... */ comment ends with nearest */ or end of file\nvar block_comment_pattern = /\\/\\*(?:[\\s\\S]*?)((?:\\*\\/)|$)/g;\n\n// comment ends just before nearest linefeed or end of file\nvar comment_pattern = /\\/\\/(?:[^\\n\\r\\u2028\\u2029]*)/g;\n\nvar template_pattern = /(?:(?:<\\?php|<\\?=)[\\s\\S]*?\\?>)|(?:<%[\\s\\S]*?%>)/g;\n\nvar in_html_comment;\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n\n this._whitespace_pattern = /[\\n\\r\\u2028\\u2029\\t\\u000B\\u00A0\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff ]+/g;\n this._newline_pattern = /([^\\n\\r\\u2028\\u2029]*)(\\r\\n|[\\n\\r\\u2028\\u2029])?/g;\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) {\n return current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.BLOCK_COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.START_BLOCK || current_token.type === TOKEN.START_EXPR;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return (current_token.type === TOKEN.END_BLOCK || current_token.type === TOKEN.END_EXPR) &&\n (open_token && (\n (current_token.text === ']' && open_token.text === '[') ||\n (current_token.text === ')' && open_token.text === '(') ||\n (current_token.text === '}' && open_token.text === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n in_html_comment = false;\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var token = null;\n var c = this._input.peek();\n\n token = token || this._read_singles(c);\n token = token || this._read_word(previous_token);\n token = token || this._read_comment(c);\n token = token || this._read_string(c);\n token = token || this._read_regexp(c, previous_token);\n token = token || this._read_xml(c, previous_token);\n token = token || this._read_non_javascript(c);\n token = token || this._read_punctuation();\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_word = function(previous_token) {\n var resulting_string;\n resulting_string = this._input.read(acorn.identifier);\n if (resulting_string !== '') {\n if (!(previous_token.type === TOKEN.DOT ||\n (previous_token.type === TOKEN.RESERVED && (previous_token.text === 'set' || previous_token.text === 'get'))) &&\n reserved_word_pattern.test(resulting_string)) {\n if (resulting_string === 'in' || resulting_string === 'of') { // hack for 'in' and 'of' operators\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n return this._create_token(TOKEN.RESERVED, resulting_string);\n }\n\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n\n resulting_string = this._input.read(number_pattern);\n if (resulting_string !== '') {\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n};\n\nTokenizer.prototype._read_singles = function(c) {\n var token = null;\n if (c === null) {\n token = this._create_token(TOKEN.EOF, '');\n } else if (c === '(' || c === '[') {\n token = this._create_token(TOKEN.START_EXPR, c);\n } else if (c === ')' || c === ']') {\n token = this._create_token(TOKEN.END_EXPR, c);\n } else if (c === '{') {\n token = this._create_token(TOKEN.START_BLOCK, c);\n } else if (c === '}') {\n token = this._create_token(TOKEN.END_BLOCK, c);\n } else if (c === ';') {\n token = this._create_token(TOKEN.SEMICOLON, c);\n } else if (c === '.' && dot_pattern.test(this._input.peek(1))) {\n token = this._create_token(TOKEN.DOT, c);\n } else if (c === ',') {\n token = this._create_token(TOKEN.COMMA, c);\n }\n\n if (token) {\n this._input.next();\n }\n return token;\n};\n\nTokenizer.prototype._read_punctuation = function() {\n var resulting_string = this._input.read(punct_pattern);\n\n if (resulting_string !== '') {\n if (resulting_string === '=') {\n return this._create_token(TOKEN.EQUALS, resulting_string);\n } else {\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n }\n};\n\nTokenizer.prototype._read_non_javascript = function(c) {\n var resulting_string = '';\n\n if (c === '#') {\n c = this._input.next();\n\n if (this._is_first_token() && this._input.peek() === '!') {\n // shebang\n resulting_string = c;\n while (this._input.hasNext() && c !== '\\n') {\n c = this._input.next();\n resulting_string += c;\n }\n return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\\n');\n }\n\n // Spidermonkey-specific sharp variables for circular references. Considered obsolete.\n var sharp = '#';\n if (this._input.hasNext() && this._input.testChar(digit)) {\n do {\n c = this._input.next();\n sharp += c;\n } while (this._input.hasNext() && c !== '#' && c !== '=');\n if (c === '#') {\n //\n } else if (this._input.peek() === '[' && this._input.peek(1) === ']') {\n sharp += '[]';\n this._input.next();\n this._input.next();\n } else if (this._input.peek() === '{' && this._input.peek(1) === '}') {\n sharp += '{}';\n this._input.next();\n this._input.next();\n }\n return this._create_token(TOKEN.WORD, sharp);\n }\n\n this._input.back();\n\n } else if (c === '<') {\n if (this._input.peek(1) === '?' || this._input.peek(1) === '%') {\n resulting_string = this._input.read(template_pattern);\n if (resulting_string) {\n resulting_string = resulting_string.replace(acorn.allLineBreaks, '\\n');\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n } else if (this._input.match(/<\\!--/g)) {\n c = '/g)) {\n in_html_comment = false;\n return this._create_token(TOKEN.COMMENT, '-->');\n }\n\n return null;\n};\n\nTokenizer.prototype._read_comment = function(c) {\n var token = null;\n if (c === '/') {\n var comment = '';\n if (this._input.peek(1) === '*') {\n // peek for comment /* ... */\n comment = this._input.read(block_comment_pattern);\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n comment = comment.replace(acorn.allLineBreaks, '\\n');\n token = this._create_token(TOKEN.BLOCK_COMMENT, comment);\n token.directives = directives;\n } else if (this._input.peek(1) === '/') {\n // peek for comment // ...\n comment = this._input.read(comment_pattern);\n token = this._create_token(TOKEN.COMMENT, comment);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_string = function(c) {\n if (c === '`' || c === \"'\" || c === '\"') {\n var resulting_string = this._input.next();\n this.has_char_escapes = false;\n\n if (c === '`') {\n resulting_string += this._read_string_recursive('`', true, '${');\n } else {\n resulting_string += this._read_string_recursive(c);\n }\n\n if (this.has_char_escapes && this._options.unescape_strings) {\n resulting_string = unescape_string(resulting_string);\n }\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n }\n\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._allow_regexp_or_xml = function(previous_token) {\n // regex and xml can only appear in specific locations during parsing\n return (previous_token.type === TOKEN.RESERVED && in_array(previous_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) ||\n (previous_token.type === TOKEN.END_EXPR && previous_token.text === ')' &&\n previous_token.opened.previous.type === TOKEN.RESERVED && in_array(previous_token.opened.previous.text, ['if', 'while', 'for'])) ||\n (in_array(previous_token.type, [TOKEN.COMMENT, TOKEN.START_EXPR, TOKEN.START_BLOCK, TOKEN.START,\n TOKEN.END_BLOCK, TOKEN.OPERATOR, TOKEN.EQUALS, TOKEN.EOF, TOKEN.SEMICOLON, TOKEN.COMMA\n ]));\n};\n\nTokenizer.prototype._read_regexp = function(c, previous_token) {\n\n if (c === '/' && this._allow_regexp_or_xml(previous_token)) {\n // handle regexp\n //\n var resulting_string = this._input.next();\n var esc = false;\n\n var in_char_class = false;\n while (this._input.hasNext() &&\n ((esc || in_char_class || this._input.peek() !== c) &&\n !this._input.testChar(acorn.newline))) {\n resulting_string += this._input.peek();\n if (!esc) {\n esc = this._input.peek() === '\\\\';\n if (this._input.peek() === '[') {\n in_char_class = true;\n } else if (this._input.peek() === ']') {\n in_char_class = false;\n }\n } else {\n esc = false;\n }\n this._input.next();\n }\n\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n\n // regexps may have modifiers /regexp/MOD , so fetch those, too\n // Only [gim] are valid, but if the user puts in garbage, do what we can to take it.\n resulting_string += this._input.read(acorn.identifier);\n }\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n return null;\n};\n\n\nvar startXmlRegExp = /<()([-a-zA-Z:0-9_.]+|{[\\s\\S]+?}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+{[\\s\\S]+?}|\\s+[-a-zA-Z:0-9_.]+|\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{[\\s\\S]+?}))*\\s*(\\/?)\\s*>/g;\nvar xmlRegExp = /[\\s\\S]*?<(\\/?)([-a-zA-Z:0-9_.]+|{[\\s\\S]+?}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+{[\\s\\S]+?}|\\s+[-a-zA-Z:0-9_.]+|\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{[\\s\\S]+?}))*\\s*(\\/?)\\s*>/g;\n\nTokenizer.prototype._read_xml = function(c, previous_token) {\n\n if (this._options.e4x && c === \"<\" && this._input.test(startXmlRegExp) && this._allow_regexp_or_xml(previous_token)) {\n // handle e4x xml literals\n //\n var xmlStr = '';\n var match = this._input.match(startXmlRegExp);\n if (match) {\n // Trim root tag to attempt to\n var rootTag = match[2].replace(/^{\\s+/, '{').replace(/\\s+}$/, '}');\n var isCurlyRoot = rootTag.indexOf('{') === 0;\n var depth = 0;\n while (match) {\n var isEndTag = !!match[1];\n var tagName = match[2];\n var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === \"![CDATA[\");\n if (!isSingletonTag &&\n (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\\s+/, '{').replace(/\\s+}$/, '}')))) {\n if (isEndTag) {\n --depth;\n } else {\n ++depth;\n }\n }\n xmlStr += match[0];\n if (depth <= 0) {\n break;\n }\n match = this._input.match(xmlRegExp);\n }\n // if we didn't close correctly, keep unformatted.\n if (!match) {\n xmlStr += this._input.match(/[\\s\\S]*/g)[0];\n }\n xmlStr = xmlStr.replace(acorn.allLineBreaks, '\\n');\n return this._create_token(TOKEN.STRING, xmlStr);\n }\n }\n\n return null;\n};\n\nfunction unescape_string(s) {\n // You think that a regex would work for this\n // return s.replace(/\\\\x([0-9a-f]{2})/gi, function(match, val) {\n // return String.fromCharCode(parseInt(val, 16));\n // })\n // However, dealing with '\\xff', '\\\\xff', '\\\\\\xff' makes this more fun.\n var out = '',\n escaped = 0;\n\n var input_scan = new InputScanner(s);\n var matched = null;\n\n while (input_scan.hasNext()) {\n // Keep any whitespace, non-slash characters\n // also keep slash pairs.\n matched = input_scan.match(/([\\s]|[^\\\\]|\\\\\\\\)+/g);\n\n if (matched) {\n out += matched[0];\n }\n\n if (input_scan.peek() === '\\\\') {\n input_scan.next();\n if (input_scan.peek() === 'x') {\n matched = input_scan.match(/x([0-9A-Fa-f]{2})/g);\n } else if (input_scan.peek() === 'u') {\n matched = input_scan.match(/u([0-9A-Fa-f]{4})/g);\n } else {\n out += '\\\\';\n if (input_scan.hasNext()) {\n out += input_scan.next();\n }\n continue;\n }\n\n // If there's some error decoding, return the original string\n if (!matched) {\n return s;\n }\n\n escaped = parseInt(matched[1], 16);\n\n if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) {\n // we bail out on \\x7f..\\xff,\n // leaving whole string escaped,\n // as it's probably completely binary\n return s;\n } else if (escaped >= 0x00 && escaped < 0x20) {\n // leave 0x00...0x1f escaped\n out += '\\\\' + matched[0];\n continue;\n } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) {\n // single-quote, apostrophe, backslash - escape these\n out += '\\\\' + String.fromCharCode(escaped);\n } else {\n out += String.fromCharCode(escaped);\n }\n }\n }\n\n return out;\n}\n\n// handle string\n//\nTokenizer.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) {\n // Template strings can travers lines without escape characters.\n // Other strings cannot\n var current_char;\n var resulting_string = '';\n var esc = false;\n while (this._input.hasNext()) {\n current_char = this._input.peek();\n if (!(esc || (current_char !== delimiter &&\n (allow_unescaped_newlines || !acorn.newline.test(current_char))))) {\n break;\n }\n\n // Handle \\r\\n linebreaks after escapes or in template strings\n if ((esc || allow_unescaped_newlines) && acorn.newline.test(current_char)) {\n if (current_char === '\\r' && this._input.peek(1) === '\\n') {\n this._input.next();\n current_char = this._input.peek();\n }\n resulting_string += '\\n';\n } else {\n resulting_string += current_char;\n }\n\n if (esc) {\n if (current_char === 'x' || current_char === 'u') {\n this.has_char_escapes = true;\n }\n esc = false;\n } else {\n esc = current_char === '\\\\';\n }\n\n this._input.next();\n\n if (start_sub && resulting_string.indexOf(start_sub, resulting_string.length - start_sub.length) !== -1) {\n if (delimiter === '`') {\n resulting_string += this._read_string_recursive('}', allow_unescaped_newlines, '`');\n } else {\n resulting_string += this._read_string_recursive('`', allow_unescaped_newlines, '${');\n }\n\n if (this._input.hasNext()) {\n resulting_string += this._input.next();\n }\n }\n }\n\n return resulting_string;\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;\nmodule.exports.positionable_operators = positionable_operators.slice();\nmodule.exports.line_starters = line_starters.slice();","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar Token = require('../core/token').Token;\nvar TokenStream = require('../core/tokenstream').TokenStream;\n\nvar TOKEN = {\n START: 'TK_START',\n RAW: 'TK_RAW',\n EOF: 'TK_EOF'\n};\n\nvar Tokenizer = function(input_string, options) {\n this._input = new InputScanner(input_string);\n this._options = options || {};\n this.__tokens = null;\n this.__newline_count = 0;\n this.__whitespace_before_token = '';\n\n this._whitespace_pattern = /[\\n\\r\\t ]+/g;\n this._newline_pattern = /([^\\n\\r]*)(\\r\\n|[\\n\\r])?/g;\n};\n\nTokenizer.prototype.tokenize = function() {\n this._input.restart();\n this.__tokens = new TokenStream();\n\n this._reset();\n\n var current;\n var previous = new Token(TOKEN.START, '');\n var open_token = null;\n var open_stack = [];\n var comments = new TokenStream();\n\n while (previous.type !== TOKEN.EOF) {\n current = this._get_next_token(previous, open_token);\n while (this._is_comment(current)) {\n comments.add(current);\n current = this._get_next_token(previous, open_token);\n }\n\n if (!comments.isEmpty()) {\n current.comments_before = comments;\n comments = new TokenStream();\n }\n\n current.parent = open_token;\n\n if (this._is_opening(current)) {\n open_stack.push(open_token);\n open_token = current;\n } else if (open_token && this._is_closing(current, open_token)) {\n current.opened = open_token;\n open_token.closed = current;\n open_token = open_stack.pop();\n current.parent = open_token;\n }\n\n current.previous = previous;\n previous.next = current;\n\n this.__tokens.add(current);\n previous = current;\n }\n\n return this.__tokens;\n};\n\n\nTokenizer.prototype._is_first_token = function() {\n return this.__tokens.isEmpty();\n};\n\nTokenizer.prototype._reset = function() {};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var resulting_string = this._input.read(/.+/g);\n if (resulting_string) {\n return this._create_token(TOKEN.RAW, resulting_string);\n } else {\n return this._create_token(TOKEN.EOF, '');\n }\n};\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_opening = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._create_token = function(type, text) {\n var token = new Token(type, text, this.__newline_count, this.__whitespace_before_token);\n this.__newline_count = 0;\n this.__whitespace_before_token = '';\n return token;\n};\n\nTokenizer.prototype._readWhitespace = function() {\n var resulting_string = this._input.read(this._whitespace_pattern);\n if (resulting_string === ' ') {\n this.__whitespace_before_token = resulting_string;\n } else if (resulting_string !== '') {\n this._newline_pattern.lastIndex = 0;\n var nextMatch = this._newline_pattern.exec(resulting_string);\n while (nextMatch[2]) {\n this.__newline_count += 1;\n nextMatch = this._newline_pattern.exec(resulting_string);\n }\n this.__whitespace_before_token = nextMatch[1];\n }\n};\n\n\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n\n this.__items = [];\n}\n\nOutputLine.prototype.item = function(index) {\n if (index < 0) {\n return this.__items[this.__items.length + index];\n } else {\n return this.__items[index];\n }\n};\n\nOutputLine.prototype.has_match = function(pattern) {\n for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {\n if (this.__items[lastCheckedOutput].match(pattern)) {\n return true;\n }\n }\n return false;\n};\n\nOutputLine.prototype.set_indent = function(indent, alignment) {\n this.__indent_count = indent || 0;\n this.__alignment_count = alignment || 0;\n this.__character_count = this.__parent.baseIndentLength + this.__alignment_count + this.__indent_count * this.__parent.indent_length;\n};\n\nOutputLine.prototype.get_character_count = function() {\n return this.__character_count;\n};\n\nOutputLine.prototype.is_empty = function() {\n return this.__items.length === 0;\n};\n\nOutputLine.prototype.last = function() {\n if (!this.is_empty()) {\n return this.__items[this.__items.length - 1];\n } else {\n return null;\n }\n};\n\nOutputLine.prototype.push = function(item) {\n this.__items.push(item);\n this.__character_count += item.length;\n};\n\nOutputLine.prototype.push_raw = function(item) {\n this.push(item);\n var last_newline_index = item.lastIndexOf('\\n');\n if (last_newline_index !== -1) {\n this.__character_count = item.length - last_newline_index;\n }\n};\n\nOutputLine.prototype.pop = function() {\n var item = null;\n if (!this.is_empty()) {\n item = this.__items.pop();\n this.__character_count -= item.length;\n }\n return item;\n};\n\nOutputLine.prototype.remove_indent = function() {\n if (this.__indent_count > 0) {\n this.__indent_count -= 1;\n this.__character_count -= this.__parent.indent_length;\n }\n};\n\nOutputLine.prototype.trim = function() {\n while (this.last() === ' ') {\n this.__items.pop();\n this.__character_count -= 1;\n }\n};\n\nOutputLine.prototype.toString = function() {\n var result = '';\n if (!this.is_empty()) {\n if (this.__indent_count >= 0) {\n result = this.__parent.get_indent_string(this.__indent_count);\n }\n if (this.__alignment_count >= 0) {\n result += this.__parent.get_alignment_string(this.__alignment_count);\n }\n result += this.__items.join('');\n }\n return result;\n};\n\nfunction IndentCache(base_string, level_string) {\n this.__cache = [base_string];\n this.__level_string = level_string;\n}\n\nIndentCache.prototype.__ensure_cache = function(level) {\n while (level >= this.__cache.length) {\n this.__cache.push(this.__cache[this.__cache.length - 1] + this.__level_string);\n }\n};\n\nIndentCache.prototype.get_level_string = function(level) {\n this.__ensure_cache(level);\n return this.__cache[level];\n};\n\n\nfunction Output(options, baseIndentString) {\n var indent_string = options.indent_char;\n if (options.indent_size > 1) {\n indent_string = new Array(options.indent_size + 1).join(options.indent_char);\n }\n\n // Set to null to continue support for auto detection of base indent level.\n baseIndentString = baseIndentString || '';\n if (options.indent_level > 0) {\n baseIndentString = new Array(options.indent_level + 1).join(indent_string);\n }\n\n this.__indent_cache = new IndentCache(baseIndentString, indent_string);\n this.__alignment_cache = new IndentCache('', ' ');\n this.baseIndentLength = baseIndentString.length;\n this.indent_length = indent_string.length;\n this.raw = false;\n this._end_with_newline = options.end_with_newline;\n\n this.__lines = [];\n this.previous_line = null;\n this.current_line = null;\n this.space_before_token = false;\n // initialize\n this.__add_outputline();\n}\n\nOutput.prototype.__add_outputline = function() {\n this.previous_line = this.current_line;\n this.current_line = new OutputLine(this);\n this.__lines.push(this.current_line);\n};\n\nOutput.prototype.get_line_number = function() {\n return this.__lines.length;\n};\n\nOutput.prototype.get_indent_string = function(level) {\n return this.__indent_cache.get_level_string(level);\n};\n\nOutput.prototype.get_alignment_string = function(level) {\n return this.__alignment_cache.get_level_string(level);\n};\n\nOutput.prototype.is_empty = function() {\n return !this.previous_line && this.current_line.is_empty();\n};\n\nOutput.prototype.add_new_line = function(force_newline) {\n // never newline at the start of file\n // otherwise, newline only if we didn't just add one or we're forced\n if (this.is_empty() ||\n (!force_newline && this.just_added_newline())) {\n return false;\n }\n\n // if raw output is enabled, don't print additional newlines,\n // but still return True as though you had\n if (!this.raw) {\n this.__add_outputline();\n }\n return true;\n};\n\nOutput.prototype.get_code = function(eol) {\n var sweet_code = this.__lines.join('\\n').replace(/[\\r\\n\\t ]+$/, '');\n\n if (this._end_with_newline) {\n sweet_code += '\\n';\n }\n\n if (eol !== '\\n') {\n sweet_code = sweet_code.replace(/[\\n]/g, eol);\n }\n\n return sweet_code;\n};\n\nOutput.prototype.set_indent = function(indent, alignment) {\n indent = indent || 0;\n alignment = alignment || 0;\n\n // Never indent your first output indent at the start of the file\n if (this.__lines.length > 1) {\n this.current_line.set_indent(indent, alignment);\n return true;\n }\n this.current_line.set_indent();\n return false;\n};\n\nOutput.prototype.add_raw_token = function(token) {\n for (var x = 0; x < token.newlines; x++) {\n this.__add_outputline();\n }\n this.current_line.push(token.whitespace_before);\n this.current_line.push_raw(token.text);\n this.space_before_token = false;\n};\n\nOutput.prototype.add_token = function(printable_token) {\n this.add_space_before_token();\n this.current_line.push(printable_token);\n};\n\nOutput.prototype.add_space_before_token = function() {\n if (this.space_before_token && !this.just_added_newline()) {\n this.current_line.push(' ');\n }\n this.space_before_token = false;\n};\n\nOutput.prototype.remove_indent = function(index) {\n var output_length = this.__lines.length;\n while (index < output_length) {\n this.__lines[index].remove_indent();\n index++;\n }\n};\n\nOutput.prototype.trim = function(eat_newlines) {\n eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;\n\n this.current_line.trim(this.indent_string, this.baseIndentString);\n\n while (eat_newlines && this.__lines.length > 1 &&\n this.current_line.is_empty()) {\n this.__lines.pop();\n this.current_line = this.__lines[this.__lines.length - 1];\n this.current_line.trim();\n }\n\n this.previous_line = this.__lines.length > 1 ?\n this.__lines[this.__lines.length - 2] : null;\n};\n\nOutput.prototype.just_added_newline = function() {\n return this.current_line.is_empty();\n};\n\nOutput.prototype.just_added_blankline = function() {\n return this.is_empty() ||\n (this.current_line.is_empty() && this.previous_line.is_empty());\n};\n\nOutput.prototype.ensure_empty_line_above = function(starts_with, ends_with) {\n var index = this.__lines.length - 2;\n while (index >= 0) {\n var potentialEmptyLine = this.__lines[index];\n if (potentialEmptyLine.is_empty()) {\n break;\n } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&\n potentialEmptyLine.item(-1) !== ends_with) {\n this.__lines.splice(index + 1, 0, new OutputLine(this));\n this.previous_line = this.__lines[this.__lines.length - 2];\n break;\n }\n index--;\n }\n};\n\nmodule.exports.Output = Output;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Options(options, merge_child_field) {\n options = _mergeOpts(options, merge_child_field);\n this.raw_options = _normalizeOpts(options);\n\n // Support passing the source text back with no change\n this.disabled = this._get_boolean('disabled');\n\n this.eol = this._get_characters('eol', 'auto');\n this.end_with_newline = this._get_boolean('end_with_newline');\n this.indent_size = this._get_number('indent_size', 4);\n this.indent_char = this._get_characters('indent_char', ' ');\n this.indent_level = this._get_number('indent_level');\n\n this.preserve_newlines = this._get_boolean('preserve_newlines', true);\n this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);\n if (!this.preserve_newlines) {\n this.max_preserve_newlines = 0;\n }\n\n this.indent_with_tabs = this._get_boolean('indent_with_tabs');\n if (this.indent_with_tabs) {\n this.indent_char = '\\t';\n this.indent_size = 1;\n }\n\n // Backwards compat with 1.3.x\n this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));\n\n}\n\nOptions.prototype._get_array = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || [];\n if (typeof option_value === 'object') {\n if (option_value !== null && typeof option_value.concat === 'function') {\n result = option_value.concat();\n }\n } else if (typeof option_value === 'string') {\n result = option_value.split(/[^a-zA-Z0-9_\\/\\-]+/);\n }\n return result;\n};\n\nOptions.prototype._get_boolean = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = option_value === undefined ? !!default_value : !!option_value;\n return result;\n};\n\nOptions.prototype._get_characters = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || '';\n if (typeof option_value === 'string') {\n result = option_value.replace(/\\\\r/, '\\r').replace(/\\\\n/, '\\n').replace(/\\\\t/, '\\t');\n }\n return result;\n};\n\nOptions.prototype._get_number = function(name, default_value) {\n var option_value = this.raw_options[name];\n default_value = parseInt(default_value, 10);\n if (isNaN(default_value)) {\n default_value = 0;\n }\n var result = parseInt(option_value, 10);\n if (isNaN(result)) {\n result = default_value;\n }\n return result;\n};\n\nOptions.prototype._get_selection = function(name, selection_list, default_value) {\n var result = this._get_selection_list(name, selection_list, default_value);\n if (result.length !== 1) {\n throw new Error(\n \"Invalid Option Value: The option '\" + name + \"' can only be one of the following values:\\n\" +\n selection_list + \"\\nYou passed in: '\" + this.raw_options[name] + \"'\");\n }\n\n return result[0];\n};\n\n\nOptions.prototype._get_selection_list = function(name, selection_list, default_value) {\n if (!selection_list || selection_list.length === 0) {\n throw new Error(\"Selection list cannot be empty.\");\n }\n\n default_value = default_value || [selection_list[0]];\n if (!this._is_valid_selection(default_value, selection_list)) {\n throw new Error(\"Invalid Default Value!\");\n }\n\n var result = this._get_array(name, default_value);\n if (!this._is_valid_selection(result, selection_list)) {\n throw new Error(\n \"Invalid Option Value: The option '\" + name + \"' can contain only the following values:\\n\" +\n selection_list + \"\\nYou passed in: '\" + this.raw_options[name] + \"'\");\n }\n\n return result;\n};\n\nOptions.prototype._is_valid_selection = function(result, selection_list) {\n return result.length && selection_list.length &&\n !result.some(function(item) { return selection_list.indexOf(item) === -1; });\n};\n\n\n// merges child options up with the parent options object\n// Example: obj = {a: 1, b: {a: 2}}\n// mergeOpts(obj, 'b')\n//\n// Returns: {a: 2, b: {a: 2}}\nfunction _mergeOpts(allOptions, childFieldName) {\n var finalOpts = {};\n allOptions = allOptions || {};\n var name;\n\n for (name in allOptions) {\n if (name !== childFieldName) {\n finalOpts[name] = allOptions[name];\n }\n }\n\n //merge in the per type settings for the childFieldName\n if (childFieldName && allOptions[childFieldName]) {\n for (name in allOptions[childFieldName]) {\n finalOpts[name] = allOptions[childFieldName][name];\n }\n }\n return finalOpts;\n}\n\nfunction _normalizeOpts(options) {\n var convertedOpts = {};\n var key;\n\n for (key in options) {\n var newKey = key.replace(/-/g, \"_\");\n convertedOpts[newKey] = options[key];\n }\n return convertedOpts;\n}\n\nmodule.exports.Options = Options;\nmodule.exports.normalizeOpts = _normalizeOpts;\nmodule.exports.mergeOpts = _mergeOpts;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction InputScanner(input_string) {\n this.__input = input_string || '';\n this.__input_length = this.__input.length;\n this.__position = 0;\n}\n\nInputScanner.prototype.restart = function() {\n this.__position = 0;\n};\n\nInputScanner.prototype.back = function() {\n if (this.__position > 0) {\n this.__position -= 1;\n }\n};\n\nInputScanner.prototype.hasNext = function() {\n return this.__position < this.__input_length;\n};\n\nInputScanner.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__input.charAt(this.__position);\n this.__position += 1;\n }\n return val;\n};\n\nInputScanner.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__input_length) {\n val = this.__input.charAt(index);\n }\n return val;\n};\n\nInputScanner.prototype.test = function(pattern, index) {\n index = index || 0;\n index += this.__position;\n pattern.lastIndex = index;\n\n if (index >= 0 && index < this.__input_length) {\n var pattern_match = pattern.exec(this.__input);\n return pattern_match && pattern_match.index === index;\n } else {\n return false;\n }\n};\n\nInputScanner.prototype.testChar = function(pattern, index) {\n // test one character regex match\n var val = this.peek(index);\n return val !== null && pattern.test(val);\n};\n\nInputScanner.prototype.match = function(pattern) {\n pattern.lastIndex = this.__position;\n var pattern_match = pattern.exec(this.__input);\n if (pattern_match && pattern_match.index === this.__position) {\n this.__position += pattern_match[0].length;\n } else {\n pattern_match = null;\n }\n return pattern_match;\n};\n\nInputScanner.prototype.read = function(pattern) {\n var val = '';\n var match = this.match(pattern);\n if (match) {\n val = match[0];\n }\n return val;\n};\n\nInputScanner.prototype.readUntil = function(pattern, include_match) {\n var val = '';\n var match_index = this.__position;\n pattern.lastIndex = this.__position;\n var pattern_match = pattern.exec(this.__input);\n if (pattern_match) {\n if (include_match) {\n match_index = pattern_match.index + pattern_match[0].length;\n } else {\n match_index = pattern_match.index;\n }\n } else {\n match_index = this.__input_length;\n }\n\n val = this.__input.substring(this.__position, match_index);\n this.__position = match_index;\n return val;\n};\n\nInputScanner.prototype.readUntilAfter = function(pattern) {\n return this.readUntil(pattern, true);\n};\n\n/* css beautifier legacy helpers */\nInputScanner.prototype.peekUntilAfter = function(pattern) {\n var start = this.__position;\n var val = this.readUntilAfter(pattern);\n this.__position = start;\n return val;\n};\n\nInputScanner.prototype.lookBack = function(testVal) {\n var start = this.__position - 1;\n return start >= testVal.length && this.__input.substring(start - testVal.length, start)\n .toLowerCase() === testVal;\n};\n\n\nmodule.exports.InputScanner = InputScanner;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}\n\n\nmodule.exports.Token = Token;","/* jshint node: true, curly: false */\n// Parts of this section of code is taken from acorn.\n//\n// Acorn was written by Marijn Haverbeke and released under an MIT\n// license. The Unicode regexps (for identifiers and whitespace) were\n// taken from [Esprima](http://esprima.org) by Ariya Hidayat.\n//\n// Git repositories for Acorn are available at\n//\n// http://marijnhaverbeke.nl/git/acorn\n// https://github.com/marijnh/acorn.git\n\n// ## Character categories\n\n\n'use strict';\n\n// acorn used char codes to squeeze the last bit of performance out\n// Beautifier is okay without that, so we're using regex\n// permit $ (36) and @ (64). @ is used in ES7 decorators.\n// 65 through 91 are uppercase letters.\n// permit _ (95).\n// 97 through 123 are lowercase letters.\nvar baseASCIIidentifierStartChars = \"\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a\";\n\n// inside an identifier @ is not allowed but 0-9 are.\nvar baseASCIIidentifierChars = \"\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\";\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 128.\nvar nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nvar nonASCIIidentifierChars = \"\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n//var nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\n//var nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n\nvar identifierStart = \"[\" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + \"]\";\nvar identifierChars = \"[\" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]*\";\n\nexports.identifier = new RegExp(identifierStart + identifierChars, 'g');\n\n\nvar nonASCIIwhitespace = /[\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/; // jshint ignore:line\n\n// Whether a single character denotes a newline.\n\nexports.newline = /[\\n\\r\\u2028\\u2029]/;\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\n// in javascript, these two differ\n// in python they are the same, different methods are called on them\nexports.lineBreak = new RegExp('\\r\\n|' + exports.newline.source);\nexports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Directives(start_block_pattern, end_block_pattern) {\n start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;\n end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;\n this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \\w+[:]\\w+)+ /.source + end_block_pattern, 'g');\n this.__directive_pattern = / (\\w+)[:](\\w+)/g;\n\n this.__directives_end_ignore_pattern = new RegExp('(?:[\\\\s\\\\S]*?)((?:' + start_block_pattern + /\\sbeautify\\signore:end\\s/.source + end_block_pattern + ')|$)', 'g');\n}\n\nDirectives.prototype.get_directives = function(text) {\n if (!text.match(this.__directives_block_pattern)) {\n return null;\n }\n\n var directives = {};\n this.__directive_pattern.lastIndex = 0;\n var directive_match = this.__directive_pattern.exec(text);\n\n while (directive_match) {\n directives[directive_match[1]] = directive_match[2];\n directive_match = this.__directive_pattern.exec(text);\n }\n\n return directives;\n};\n\nDirectives.prototype.readIgnored = function(input) {\n return input.read(this.__directives_end_ignore_pattern);\n};\n\n\nmodule.exports.Directives = Directives;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\n\nvar TOKEN = {\n TAG_OPEN: 'TK_TAG_OPEN',\n TAG_CLOSE: 'TK_TAG_CLOSE',\n ATTRIBUTE: 'TK_ATTRIBUTE',\n EQUALS: 'TK_EQUALS',\n VALUE: 'TK_VALUE',\n COMMENT: 'TK_COMMENT',\n TEXT: 'TK_TEXT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\nvar directives_core = new Directives(/<\\!--/, /-->/);\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n this._current_tag_name = '';\n\n // Words end at whitespace or when a tag starts\n // if we are indenting handlebars, they are considered tags\n this._word_pattern = this._options.indent_handlebars ? /[\\n\\r\\t <]|{{/g : /[\\n\\r\\t <]/g;\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false; //current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.TAG_OPEN;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return current_token.type === TOKEN.TAG_CLOSE &&\n (open_token && (\n ((current_token.text === '>' || current_token.text === '/>') && open_token.text[0] === '<') ||\n (current_token.text === '}}' && open_token.text[0] === '{' && open_token.text[1] === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n this._current_tag_name = '';\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var token = null;\n var c = this._input.peek();\n\n if (c === null) {\n return this._create_token(TOKEN.EOF, '');\n }\n\n token = token || this._read_attribute(c, previous_token, open_token);\n token = token || this._read_raw_content(previous_token, open_token);\n token = token || this._read_comment(c);\n token = token || this._read_open(c, open_token);\n token = token || this._read_close(c, open_token);\n token = token || this._read_content_word();\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_comment = function(c) { // jshint unused:false\n var token = null;\n if (c === '<' || c === '{') {\n var peek1 = this._input.peek(1);\n var peek2 = this._input.peek(2);\n if ((c === '<' && (peek1 === '!' || peek1 === '?' || peek1 === '%')) ||\n this._options.indent_handlebars && c === '{' && peek1 === '{' && peek2 === '!') {\n //if we're in a comment, do something special\n // We treat all comments as literals, even more than preformatted tags\n // we just look for the appropriate close tag\n\n // this is will have very poor perf, but will work for now.\n var comment = '',\n delimiter = '>',\n matched = false;\n\n var input_char = this._input.next();\n\n while (input_char) {\n comment += input_char;\n\n // only need to check for the delimiter if the last chars match\n if (comment.charAt(comment.length - 1) === delimiter.charAt(delimiter.length - 1) &&\n comment.indexOf(delimiter) !== -1) {\n break;\n }\n\n // only need to search for custom delimiter for the first few characters\n if (!matched) {\n matched = comment.length > 10;\n if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('{{!--') === 0) { // {{!-- handlebars comment\n delimiter = '--}}';\n matched = true;\n } else if (comment.indexOf('{{!') === 0) { // {{! handlebars comment\n if (comment.length === 5 && comment.indexOf('{{!--') === -1) {\n delimiter = '}}';\n matched = true;\n }\n } else if (comment.indexOf('';\n matched = true;\n } else if (comment.indexOf('<%') === 0) { // {{! handlebars comment\n delimiter = '%>';\n matched = true;\n }\n }\n\n input_char = this._input.next();\n }\n\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n token = this._create_token(TOKEN.COMMENT, comment);\n token.directives = directives;\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_open = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (!open_token) {\n if (c === '<') {\n resulting_string = this._input.read(/<(?:[^\\n\\r\\t >{][^\\n\\r\\t >{/]*)?/g);\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n } else if (this._options.indent_handlebars && c === '{' && this._input.peek(1) === '{') {\n resulting_string = this._input.readUntil(/[\\n\\r\\t }]/g);\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_close = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (open_token) {\n if (open_token.text[0] === '<' && (c === '>' || (c === '/' && this._input.peek(1) === '>'))) {\n resulting_string = this._input.next();\n if (c === '/') { // for close tag \"/>\"\n resulting_string += this._input.next();\n }\n token = this._create_token(TOKEN.TAG_CLOSE, resulting_string);\n } else if (open_token.text[0] === '{' && c === '}' && this._input.peek(1) === '}') {\n this._input.next();\n this._input.next();\n token = this._create_token(TOKEN.TAG_CLOSE, '}}');\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_attribute = function(c, previous_token, open_token) {\n var token = null;\n var resulting_string = '';\n if (open_token && open_token.text[0] === '<') {\n\n if (c === '=') {\n token = this._create_token(TOKEN.EQUALS, this._input.next());\n } else if (c === '\"' || c === \"'\") {\n var content = this._input.next();\n var input_string = '';\n var string_pattern = new RegExp(c + '|{{', 'g');\n while (this._input.hasNext()) {\n input_string = this._input.readUntilAfter(string_pattern);\n content += input_string;\n if (input_string[input_string.length - 1] === '\"' || input_string[input_string.length - 1] === \"'\") {\n break;\n } else if (this._input.hasNext()) {\n content += this._input.readUntilAfter(/}}/g);\n }\n }\n\n token = this._create_token(TOKEN.VALUE, content);\n } else {\n if (c === '{' && this._input.peek(1) === '{') {\n resulting_string = this._input.readUntilAfter(/}}/g);\n } else {\n resulting_string = this._input.readUntil(/[\\n\\r\\t =\\/>]/g);\n }\n\n if (resulting_string) {\n if (previous_token.type === TOKEN.EQUALS) {\n token = this._create_token(TOKEN.VALUE, resulting_string);\n } else {\n token = this._create_token(TOKEN.ATTRIBUTE, resulting_string);\n }\n }\n }\n }\n return token;\n};\n\nTokenizer.prototype._is_content_unformatted = function(tag_name) {\n // void_elements have no content and so cannot have unformatted content\n // script and style tags should always be read as unformatted content\n // finally content_unformatted and unformatted element contents are unformatted\n return this._options.void_elements.indexOf(tag_name) === -1 &&\n (tag_name === 'script' || tag_name === 'style' ||\n this._options.content_unformatted.indexOf(tag_name) !== -1 ||\n this._options.unformatted.indexOf(tag_name) !== -1);\n};\n\n\nTokenizer.prototype._read_raw_content = function(previous_token, open_token) { // jshint unused:false\n var resulting_string = '';\n if (open_token && open_token.text[0] === '{') {\n resulting_string = this._input.readUntil(/}}/g);\n } else if (previous_token.type === TOKEN.TAG_CLOSE && (previous_token.opened.text[0] === '<')) {\n var tag_name = previous_token.opened.text.substr(1).toLowerCase();\n if (this._is_content_unformatted(tag_name)) {\n resulting_string = this._input.readUntil(new RegExp('', 'ig'));\n }\n }\n\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._read_content_word = function() {\n // if we get here and we see handlebars treat them as plain text\n var resulting_string = this._input.readUntil(this._word_pattern);\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar js_beautify = require('./javascript/index');\nvar css_beautify = require('./css/index');\nvar html_beautify = require('./html/index');\n\nfunction style_html(html_source, options, js, css) {\n js = js || js_beautify;\n css = css || css_beautify;\n return html_beautify(html_source, options, js, css);\n}\n\nmodule.exports.js = js_beautify;\nmodule.exports.css = css_beautify;\nmodule.exports.html = style_html;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction js_beautify(js_source_text, options) {\n var beautifier = new Beautifier(js_source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = js_beautify;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Output = require('../core/output').Output;\nvar Token = require('../core/token').Token;\nvar acorn = require('./acorn');\nvar Options = require('./options').Options;\nvar Tokenizer = require('./tokenizer').Tokenizer;\nvar line_starters = require('./tokenizer').line_starters;\nvar positionable_operators = require('./tokenizer').positionable_operators;\nvar TOKEN = require('./tokenizer').TOKEN;\n\nfunction remove_redundant_indentation(output, frame) {\n // This implementation is effective but has some issues:\n // - can cause line wrap to happen too soon due to indent removal\n // after wrap points are calculated\n // These issues are minor compared to ugly indentation.\n\n if (frame.multiline_frame ||\n frame.mode === MODE.ForInitializer ||\n frame.mode === MODE.Conditional) {\n return;\n }\n\n // remove one indent from each line inside this section\n output.remove_indent(frame.start_line_index);\n}\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction ltrim(s) {\n return s.replace(/^\\s+/g, '');\n}\n\nfunction generateMapFromStrings(list) {\n var result = {};\n for (var x = 0; x < list.length; x++) {\n // make the mapped names underscored instead of dash\n result[list[x].replace(/-/g, '_')] = list[x];\n }\n return result;\n}\n\nfunction reserved_word(token, word) {\n return token && token.type === TOKEN.RESERVED && token.text === word;\n}\n\nfunction reserved_array(token, words) {\n return token && token.type === TOKEN.RESERVED && in_array(token.text, words);\n}\n// Unsure of what they mean, but they work. Worth cleaning up in future.\nvar special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async'];\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\n// Generate map from array\nvar OPERATOR_POSITION = generateMapFromStrings(validPositionValues);\n\nvar OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];\n\nvar MODE = {\n BlockStatement: 'BlockStatement', // 'BLOCK'\n Statement: 'Statement', // 'STATEMENT'\n ObjectLiteral: 'ObjectLiteral', // 'OBJECT',\n ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]',\n ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)',\n Conditional: 'Conditional', //'(COND-EXPRESSION)',\n Expression: 'Expression' //'(EXPRESSION)'\n};\n\n// we could use just string.split, but\n// IE doesn't like returning empty strings\nfunction split_linebreaks(s) {\n //return s.split(/\\x0d\\x0a|\\x0a/);\n\n s = s.replace(acorn.allLineBreaks, '\\n');\n var out = [],\n idx = s.indexOf(\"\\n\");\n while (idx !== -1) {\n out.push(s.substring(0, idx));\n s = s.substring(idx + 1);\n idx = s.indexOf(\"\\n\");\n }\n if (s.length) {\n out.push(s);\n }\n return out;\n}\n\nfunction is_array(mode) {\n return mode === MODE.ArrayLiteral;\n}\n\nfunction is_expression(mode) {\n return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);\n}\n\nfunction all_lines_start_with(lines, c) {\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i].trim();\n if (line.charAt(0) !== c) {\n return false;\n }\n }\n return true;\n}\n\nfunction each_line_matches_indent(lines, indent) {\n var i = 0,\n len = lines.length,\n line;\n for (; i < len; i++) {\n line = lines[i];\n // allow empty lines to pass through\n if (line && line.indexOf(indent) !== 0) {\n return false;\n }\n }\n return true;\n}\n\n\nfunction Beautifier(source_text, options) {\n options = options || {};\n this._source_text = source_text || '';\n\n this._output = null;\n this._tokens = null;\n this._last_last_text = null;\n this._flags = null;\n this._previous_flags = null;\n\n this._flag_store = null;\n this._options = new Options(options);\n}\n\nBeautifier.prototype.create_flags = function(flags_base, mode) {\n var next_indent_level = 0;\n if (flags_base) {\n next_indent_level = flags_base.indentation_level;\n if (!this._output.just_added_newline() &&\n flags_base.line_indent_level > next_indent_level) {\n next_indent_level = flags_base.line_indent_level;\n }\n }\n\n var next_flags = {\n mode: mode,\n parent: flags_base,\n last_token: flags_base ? flags_base.last_token : new Token(TOKEN.START_BLOCK, ''), // last token text\n last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed\n declaration_statement: false,\n declaration_assignment: false,\n multiline_frame: false,\n inline_frame: false,\n if_block: false,\n else_block: false,\n do_block: false,\n do_while: false,\n import_block: false,\n in_case_statement: false, // switch(..){ INSIDE HERE }\n in_case: false, // we're on the exact line with \"case 0:\"\n case_body: false, // the indented case-action block\n indentation_level: next_indent_level,\n line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,\n start_line_index: this._output.get_line_number(),\n ternary_depth: 0\n };\n return next_flags;\n};\n\nBeautifier.prototype._reset = function(source_text) {\n var baseIndentString = source_text.match(/^[\\t ]*/)[0];\n\n this._last_last_text = ''; // pre-last token text\n this._output = new Output(this._options, baseIndentString);\n\n // If testing the ignore directive, start with output disable set to true\n this._output.raw = this._options.test_output_raw;\n\n\n // Stack of parsing/formatting states, including MODE.\n // We tokenize, parse, and output in an almost purely a forward-only stream of token input\n // and formatted output. This makes the beautifier less accurate than full parsers\n // but also far more tolerant of syntax errors.\n //\n // For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type\n // MODE.BlockStatement on the the stack, even though it could be object literal. If we later\n // encounter a \":\", we'll switch to to MODE.ObjectLiteral. If we then see a \";\",\n // most full parsers would die, but the beautifier gracefully falls back to\n // MODE.BlockStatement and continues on.\n this._flag_store = [];\n this.set_mode(MODE.BlockStatement);\n var tokenizer = new Tokenizer(source_text, this._options);\n this._tokens = tokenizer.tokenize();\n return source_text;\n};\n\nBeautifier.prototype.beautify = function() {\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var sweet_code;\n var source_text = this._reset(this._source_text);\n\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && acorn.lineBreak.test(source_text || '')) {\n eol = source_text.match(acorn.lineBreak)[0];\n }\n }\n\n var current_token = this._tokens.next();\n while (current_token) {\n this.handle_token(current_token);\n\n this._last_last_text = this._flags.last_token.text;\n this._flags.last_token = current_token;\n\n current_token = this._tokens.next();\n }\n\n sweet_code = this._output.get_code(eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype.handle_token = function(current_token, preserve_statement_flags) {\n if (current_token.type === TOKEN.START_EXPR) {\n this.handle_start_expr(current_token);\n } else if (current_token.type === TOKEN.END_EXPR) {\n this.handle_end_expr(current_token);\n } else if (current_token.type === TOKEN.START_BLOCK) {\n this.handle_start_block(current_token);\n } else if (current_token.type === TOKEN.END_BLOCK) {\n this.handle_end_block(current_token);\n } else if (current_token.type === TOKEN.WORD) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.RESERVED) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.SEMICOLON) {\n this.handle_semicolon(current_token);\n } else if (current_token.type === TOKEN.STRING) {\n this.handle_string(current_token);\n } else if (current_token.type === TOKEN.EQUALS) {\n this.handle_equals(current_token);\n } else if (current_token.type === TOKEN.OPERATOR) {\n this.handle_operator(current_token);\n } else if (current_token.type === TOKEN.COMMA) {\n this.handle_comma(current_token);\n } else if (current_token.type === TOKEN.BLOCK_COMMENT) {\n this.handle_block_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.COMMENT) {\n this.handle_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.DOT) {\n this.handle_dot(current_token);\n } else if (current_token.type === TOKEN.EOF) {\n this.handle_eof(current_token);\n } else if (current_token.type === TOKEN.UNKNOWN) {\n this.handle_unknown(current_token, preserve_statement_flags);\n } else {\n this.handle_unknown(current_token, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) {\n var newlines = current_token.newlines;\n var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode);\n\n if (current_token.comments_before) {\n var comment_token = current_token.comments_before.next();\n while (comment_token) {\n // The cleanest handling of inline comments is to treat them as though they aren't there.\n // Just continue formatting and the behavior should be logical.\n // Also ignore unknown tokens. Again, this should result in better behavior.\n this.handle_whitespace_and_comments(comment_token, preserve_statement_flags);\n this.handle_token(comment_token, preserve_statement_flags);\n comment_token = current_token.comments_before.next();\n }\n }\n\n if (keep_whitespace) {\n for (var i = 0; i < newlines; i += 1) {\n this.print_newline(i > 0, preserve_statement_flags);\n }\n } else {\n if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) {\n newlines = this._options.max_preserve_newlines;\n }\n\n if (this._options.preserve_newlines) {\n if (newlines > 1) {\n this.print_newline(false, preserve_statement_flags);\n for (var j = 1; j < newlines; j += 1) {\n this.print_newline(true, preserve_statement_flags);\n }\n }\n }\n }\n\n};\n\nvar newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield'];\n\nBeautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) {\n force_linewrap = (force_linewrap === undefined) ? false : force_linewrap;\n\n // Never wrap the first token on a line\n if (this._output.just_added_newline()) {\n return;\n }\n\n var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap;\n var operatorLogicApplies = in_array(this._flags.last_token.text, positionable_operators) ||\n in_array(current_token.text, positionable_operators);\n\n if (operatorLogicApplies) {\n var shouldPrintOperatorNewline = (\n in_array(this._flags.last_token.text, positionable_operators) &&\n in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)\n ) ||\n in_array(current_token.text, positionable_operators);\n shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;\n }\n\n if (shouldPreserveOrForce) {\n this.print_newline(false, true);\n } else if (this._options.wrap_line_length) {\n if (reserved_array(this._flags.last_token, newline_restricted_tokens)) {\n // These tokens should never have a newline inserted\n // between them and the following expression.\n return;\n }\n var proposed_line_length = this._output.current_line.get_character_count() + current_token.text.length +\n (this._output.space_before_token ? 1 : 0);\n if (proposed_line_length >= this._options.wrap_line_length) {\n this.print_newline(false, true);\n }\n }\n};\n\nBeautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) {\n if (!preserve_statement_flags) {\n if (this._flags.last_token.text !== ';' && this._flags.last_token.text !== ',' && this._flags.last_token.text !== '=' && (this._flags.last_token.type !== TOKEN.OPERATOR || this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) {\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && reserved_word(next_token, 'else')) &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n }\n }\n\n if (this._output.add_new_line(force_newline)) {\n this._flags.multiline_frame = true;\n }\n};\n\nBeautifier.prototype.print_token_line_indentation = function(current_token) {\n if (this._output.just_added_newline()) {\n if (this._options.keep_array_indentation && is_array(this._flags.mode) && current_token.newlines) {\n this._output.current_line.push(current_token.whitespace_before);\n this._output.space_before_token = false;\n } else if (this._output.set_indent(this._flags.indentation_level)) {\n this._flags.line_indent_level = this._flags.indentation_level;\n }\n }\n};\n\nBeautifier.prototype.print_token = function(current_token, printable_token) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n return;\n }\n\n if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN.COMMA &&\n this._output.just_added_newline()) {\n if (this._output.previous_line.last() === ',') {\n var popped = this._output.previous_line.pop();\n // if the comma was already at the start of the line,\n // pull back onto that line and reprint the indentation\n if (this._output.previous_line.is_empty()) {\n this._output.previous_line.push(popped);\n this._output.trim(true);\n this._output.current_line.pop();\n this._output.trim();\n }\n\n // add the comma in front of the next token\n this.print_token_line_indentation(current_token);\n this._output.add_token(',');\n this._output.space_before_token = true;\n }\n }\n\n printable_token = printable_token || current_token.text;\n this.print_token_line_indentation(current_token);\n this._output.add_token(printable_token);\n};\n\nBeautifier.prototype.indent = function() {\n this._flags.indentation_level += 1;\n};\n\nBeautifier.prototype.deindent = function() {\n if (this._flags.indentation_level > 0 &&\n ((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) {\n this._flags.indentation_level -= 1;\n\n }\n};\n\nBeautifier.prototype.set_mode = function(mode) {\n if (this._flags) {\n this._flag_store.push(this._flags);\n this._previous_flags = this._flags;\n } else {\n this._previous_flags = this.create_flags(null, mode);\n }\n\n this._flags = this.create_flags(this._previous_flags, mode);\n};\n\n\nBeautifier.prototype.restore_mode = function() {\n if (this._flag_store.length > 0) {\n this._previous_flags = this._flags;\n this._flags = this._flag_store.pop();\n if (this._previous_flags.mode === MODE.Statement) {\n remove_redundant_indentation(this._output, this._previous_flags);\n }\n }\n};\n\nBeautifier.prototype.start_of_object_property = function() {\n return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && (\n (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set'])));\n};\n\nBeautifier.prototype.start_of_statement = function(current_token) {\n var start = false;\n start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD;\n start = start || reserved_word(this._flags.last_token, 'do');\n start = start || (reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines);\n start = start || reserved_word(this._flags.last_token, 'else') &&\n !(reserved_word(current_token, 'if') && !current_token.comments_before);\n start = start || (this._flags.last_token.type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional));\n start = start || (this._flags.last_token.type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement &&\n !this._flags.in_case &&\n !(current_token.text === '--' || current_token.text === '++') &&\n this._last_last_text !== 'function' &&\n current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED);\n start = start || (this._flags.mode === MODE.ObjectLiteral && (\n (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set'])));\n\n if (start) {\n this.set_mode(MODE.Statement);\n this.indent();\n\n this.handle_whitespace_and_comments(current_token, true);\n\n // Issue #276:\n // If starting a new statement with [if, for, while, do], push to a new line.\n // if (a) if (b) if(c) d(); else e(); else f();\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token,\n reserved_array(current_token, ['do', 'for', 'if', 'while']));\n }\n return true;\n }\n return false;\n};\n\nBeautifier.prototype.handle_start_expr = function(current_token) {\n // The conditional starts the statement if appropriate.\n if (!this.start_of_statement(current_token)) {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_mode = MODE.Expression;\n if (current_token.text === '[') {\n\n if (this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === ')') {\n // this is array index specifier, break immediately\n // a[x], fn()[x]\n if (reserved_array(this._flags.last_token, line_starters)) {\n this._output.space_before_token = true;\n }\n this.set_mode(next_mode);\n this.print_token(current_token);\n this.indent();\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n return;\n }\n\n next_mode = MODE.ArrayLiteral;\n if (is_array(this._flags.mode)) {\n if (this._flags.last_token.text === '[' ||\n (this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) {\n // ], [ goes to new line\n // }, [ goes to new line\n if (!this._options.keep_array_indentation) {\n this.print_newline();\n }\n }\n }\n\n if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) {\n this._output.space_before_token = true;\n }\n } else {\n if (this._flags.last_token.type === TOKEN.RESERVED) {\n if (this._flags.last_token.text === 'for') {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.ForInitializer;\n } else if (in_array(this._flags.last_token.text, ['if', 'while'])) {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.Conditional;\n } else if (in_array(this._flags.last_word, ['await', 'async'])) {\n // Should be a space between await and an IIFE, or async and an arrow function\n this._output.space_before_token = true;\n } else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') {\n this._output.space_before_token = false;\n } else if (in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') {\n this._output.space_before_token = true;\n }\n } else if (this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {\n // Support of this kind of newline preservation.\n // a = (b &&\n // (c || d));\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._flags.last_token.type === TOKEN.WORD) {\n this._output.space_before_token = false;\n } else {\n // Support preserving wrapped arrow function expressions\n // a.b('c',\n // () => d.e\n // )\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // function() vs function ()\n // yield*() vs yield* ()\n // function*() vs function* ()\n if ((this._flags.last_token.type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) ||\n (this._flags.last_token.text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n\n this._output.space_before_token = this._options.space_after_anon_function;\n }\n\n }\n\n if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN.START_BLOCK) {\n this.print_newline();\n } else if (this._flags.last_token.type === TOKEN.END_EXPR || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.END_BLOCK || this._flags.last_token.text === '.' || this._flags.last_token.type === TOKEN.COMMA) {\n // do nothing on (( and )( and ][ and ]( and .(\n // TODO: Consider whether forcing this is required. Review failing tests when removed.\n this.allow_wrap_or_preserved_newline(current_token, current_token.newlines);\n }\n\n this.set_mode(next_mode);\n this.print_token(current_token);\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n // In all cases, if we newline while inside an expression it should be indented.\n this.indent();\n};\n\nBeautifier.prototype.handle_end_expr = function(current_token) {\n // statements inside expressions are not valid syntax, but...\n // statements must all be closed when their container closes\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n this.handle_whitespace_and_comments(current_token);\n\n if (this._flags.multiline_frame) {\n this.allow_wrap_or_preserved_newline(current_token,\n current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation);\n }\n\n if (this._options.space_in_paren) {\n if (this._flags.last_token.type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) {\n // () [] no inner space in empty parens like these, ever, ref #320\n this._output.trim();\n this._output.space_before_token = false;\n } else {\n this._output.space_before_token = true;\n }\n }\n if (current_token.text === ']' && this._options.keep_array_indentation) {\n this.print_token(current_token);\n this.restore_mode();\n } else {\n this.restore_mode();\n this.print_token(current_token);\n }\n remove_redundant_indentation(this._output, this._previous_flags);\n\n // do {} while () // no statement required after\n if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) {\n this._previous_flags.mode = MODE.Expression;\n this._flags.do_block = false;\n this._flags.do_while = false;\n\n }\n};\n\nBeautifier.prototype.handle_start_block = function(current_token) {\n this.handle_whitespace_and_comments(current_token);\n\n // Check if this is should be treated as a ObjectLiteral\n var next_token = this._tokens.peek();\n var second_token = this._tokens.peek(1);\n if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN.END_EXPR) {\n this.set_mode(MODE.BlockStatement);\n this._flags.in_case_statement = true;\n } else if (second_token && (\n (in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) ||\n (in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED]))\n )) {\n // We don't support TypeScript,but we didn't break it for a very long time.\n // We'll try to keep not breaking it.\n if (!in_array(this._last_last_text, ['class', 'interface'])) {\n this.set_mode(MODE.ObjectLiteral);\n } else {\n this.set_mode(MODE.BlockStatement);\n }\n } else if (this._flags.last_token.type === TOKEN.OPERATOR && this._flags.last_token.text === '=>') {\n // arrow function: (param1, paramN) => { statements }\n this.set_mode(MODE.BlockStatement);\n } else if (in_array(this._flags.last_token.type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) ||\n reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default'])\n ) {\n // Detecting shorthand function syntax is difficult by scanning forward,\n // so check the surrounding context.\n // If the block is being returned, imported, export default, passed as arg,\n // assigned with = or assigned in a nested object, treat as an ObjectLiteral.\n this.set_mode(MODE.ObjectLiteral);\n } else {\n this.set_mode(MODE.BlockStatement);\n }\n\n var empty_braces = !next_token.comments_before && next_token.text === '}';\n var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' &&\n this._flags.last_token.type === TOKEN.END_EXPR;\n\n if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so\n {\n // search forward for a newline wanted inside this block\n var index = 0;\n var check_token = null;\n this._flags.inline_frame = true;\n do {\n index += 1;\n check_token = this._tokens.peek(index - 1);\n if (check_token.newlines) {\n this._flags.inline_frame = false;\n break;\n }\n } while (check_token.type !== TOKEN.EOF &&\n !(check_token.type === TOKEN.END_BLOCK && check_token.opened === current_token));\n }\n\n if ((this._options.brace_style === \"expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n if (this._flags.last_token.type !== TOKEN.OPERATOR &&\n (empty_anonymous_function ||\n this._flags.last_token.type === TOKEN.EQUALS ||\n (reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) {\n this._output.space_before_token = true;\n } else {\n this.print_newline(false, true);\n }\n } else { // collapse || inline_frame\n if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.COMMA)) {\n if (this._flags.last_token.type === TOKEN.COMMA || this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n if (this._flags.last_token.type === TOKEN.COMMA || (this._flags.last_token.type === TOKEN.START_EXPR && this._flags.inline_frame)) {\n this.allow_wrap_or_preserved_newline(current_token);\n this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame;\n this._flags.multiline_frame = false;\n }\n }\n if (this._flags.last_token.type !== TOKEN.OPERATOR && this._flags.last_token.type !== TOKEN.START_EXPR) {\n if (this._flags.last_token.type === TOKEN.START_BLOCK && !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.space_before_token = true;\n }\n }\n }\n this.print_token(current_token);\n this.indent();\n};\n\nBeautifier.prototype.handle_end_block = function(current_token) {\n // statements must all be closed when their container closes\n this.handle_whitespace_and_comments(current_token);\n\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n var empty_braces = this._flags.last_token.type === TOKEN.START_BLOCK;\n\n if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first\n this._output.space_before_token = true;\n } else if (this._options.brace_style === \"expand\") {\n if (!empty_braces) {\n this.print_newline();\n }\n } else {\n // skip {}\n if (!empty_braces) {\n if (is_array(this._flags.mode) && this._options.keep_array_indentation) {\n // we REALLY need a newline here, but newliner would skip that\n this._options.keep_array_indentation = false;\n this.print_newline();\n this._options.keep_array_indentation = true;\n\n } else {\n this.print_newline();\n }\n }\n }\n this.restore_mode();\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_word = function(current_token) {\n if (current_token.type === TOKEN.RESERVED) {\n if (in_array(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) {\n current_token.type = TOKEN.WORD;\n } else if (in_array(current_token.text, ['as', 'from']) && !this._flags.import_block) {\n current_token.type = TOKEN.WORD;\n } else if (this._flags.mode === MODE.ObjectLiteral) {\n var next_token = this._tokens.peek();\n if (next_token.text === ':') {\n current_token.type = TOKEN.WORD;\n }\n }\n }\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) {\n this._flags.declaration_statement = true;\n }\n } else if (current_token.newlines && !is_expression(this._flags.mode) &&\n (this._flags.last_token.type !== TOKEN.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) &&\n this._flags.last_token.type !== TOKEN.EQUALS &&\n (this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) {\n this.handle_whitespace_and_comments(current_token);\n this.print_newline();\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.do_block && !this._flags.do_while) {\n if (reserved_word(current_token, 'while')) {\n // do {} ## while ()\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n this._flags.do_while = true;\n return;\n } else {\n // do {} should always have while as the next word.\n // if we don't see the expected while, recover\n this.print_newline();\n this._flags.do_block = false;\n }\n }\n\n // if may be followed by else, or not\n // Bare/inline ifs are tricky\n // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();\n if (this._flags.if_block) {\n if (!this._flags.else_block && reserved_word(current_token, 'else')) {\n this._flags.else_block = true;\n } else {\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this._flags.if_block = false;\n this._flags.else_block = false;\n }\n }\n\n if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) {\n this.print_newline();\n if (this._flags.case_body || this._options.jslint_happy) {\n // switch cases following one another\n this.deindent();\n this._flags.case_body = false;\n }\n this.print_token(current_token);\n this._flags.in_case = true;\n return;\n }\n\n if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n }\n\n if (reserved_word(current_token, 'function')) {\n if (in_array(this._flags.last_token.text, ['}', ';']) ||\n (this._output.just_added_newline() && !(in_array(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN.OPERATOR))) {\n // make sure there is a nice clean space of at least one blank line\n // before a new function definition\n if (!this._output.just_added_blankline() && !current_token.comments_before) {\n this.print_newline();\n this.print_newline(true);\n }\n }\n if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD) {\n if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) ||\n reserved_array(this._flags.last_token, newline_restricted_tokens)) {\n this._output.space_before_token = true;\n } else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n } else if (this._flags.last_token.type === TOKEN.OPERATOR || this._flags.last_token.text === '=') {\n // foo = function\n this._output.space_before_token = true;\n } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) {\n // (function\n } else {\n this.print_newline();\n }\n\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n return;\n }\n\n var prefix = 'NONE';\n\n if (this._flags.last_token.type === TOKEN.END_BLOCK) {\n\n if (this._previous_flags.inline_frame) {\n prefix = 'SPACE';\n } else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) {\n prefix = 'NEWLINE';\n } else {\n if (this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) {\n prefix = 'NEWLINE';\n } else {\n prefix = 'SPACE';\n this._output.space_before_token = true;\n }\n }\n } else if (this._flags.last_token.type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) {\n // TODO: Should this be for STATEMENT as well?\n prefix = 'NEWLINE';\n } else if (this._flags.last_token.type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) {\n prefix = 'SPACE';\n } else if (this._flags.last_token.type === TOKEN.STRING) {\n prefix = 'NEWLINE';\n } else if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD ||\n (this._flags.last_token.text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n prefix = 'SPACE';\n } else if (this._flags.last_token.type === TOKEN.START_BLOCK) {\n if (this._flags.inline_frame) {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n } else if (this._flags.last_token.type === TOKEN.END_EXPR) {\n this._output.space_before_token = true;\n prefix = 'NEWLINE';\n }\n\n if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {\n if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n\n }\n\n if (reserved_array(current_token, ['else', 'catch', 'finally'])) {\n if ((!(this._flags.last_token.type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) ||\n this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.trim(true);\n var line = this._output.current_line;\n // If we trimmed and there's something other than a close block before us\n // put a newline back in. Handles '} // comment' scenario.\n if (line.last() !== '}') {\n this.print_newline();\n }\n this._output.space_before_token = true;\n }\n } else if (prefix === 'NEWLINE') {\n if (reserved_array(this._flags.last_token, special_words)) {\n // no newline between 'return nnn'\n this._output.space_before_token = true;\n } else if (this._flags.last_token.type !== TOKEN.END_EXPR) {\n if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') {\n // no need to force newline on 'var': for (var x = 0...)\n if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) {\n // no newline for } else if {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n }\n } else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {\n this.print_newline();\n }\n } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') {\n this.print_newline(); // }, in lists get a newline treatment\n } else if (prefix === 'SPACE') {\n this._output.space_before_token = true;\n }\n if (current_token.previous && (current_token.previous.type === TOKEN.WORD || current_token.previous.type === TOKEN.RESERVED)) {\n this._output.space_before_token = true;\n }\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n\n if (current_token.type === TOKEN.RESERVED) {\n if (current_token.text === 'do') {\n this._flags.do_block = true;\n } else if (current_token.text === 'if') {\n this._flags.if_block = true;\n } else if (current_token.text === 'import') {\n this._flags.import_block = true;\n } else if (this._flags.import_block && reserved_word(current_token, 'from')) {\n this._flags.import_block = false;\n }\n }\n};\n\nBeautifier.prototype.handle_semicolon = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // Semicolon can be the start (and end) of a statement\n this._output.space_before_token = false;\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && reserved_word(next_token, 'else')) &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n\n // hacky but effective for the moment\n if (this._flags.import_block) {\n this._flags.import_block = false;\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_string = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // One difference - strings want at least a space before\n this._output.space_before_token = true;\n } else {\n this.handle_whitespace_and_comments(current_token);\n if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.inline_frame) {\n this._output.space_before_token = true;\n } else if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else {\n this.print_newline();\n }\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_equals = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.declaration_statement) {\n // just got an '=' in a var-line, different formatting/line-breaking, etc will now be done\n this._flags.declaration_assignment = true;\n }\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n};\n\nBeautifier.prototype.handle_comma = function(current_token) {\n this.handle_whitespace_and_comments(current_token, true);\n\n this.print_token(current_token);\n this._output.space_before_token = true;\n if (this._flags.declaration_statement) {\n if (is_expression(this._flags.parent.mode)) {\n // do not break on comma, for(var a = 1, b = 2)\n this._flags.declaration_assignment = false;\n }\n\n if (this._flags.declaration_assignment) {\n this._flags.declaration_assignment = false;\n this.print_newline(false, true);\n } else if (this._options.comma_first) {\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._flags.mode === MODE.ObjectLiteral ||\n (this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) {\n if (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n if (!this._flags.inline_frame) {\n this.print_newline();\n }\n } else if (this._options.comma_first) {\n // EXPR or DO_BLOCK\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n};\n\nBeautifier.prototype.handle_operator = function(current_token) {\n var isGeneratorAsterisk = current_token.text === '*' &&\n (reserved_array(this._flags.last_token, ['function', 'yield']) ||\n (in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON]))\n );\n var isUnary = in_array(current_token.text, ['-', '+']) && (\n in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) ||\n in_array(this._flags.last_token.text, line_starters) ||\n this._flags.last_token.text === ','\n );\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n var preserve_statement_flags = !isGeneratorAsterisk;\n this.handle_whitespace_and_comments(current_token, preserve_statement_flags);\n }\n\n if (reserved_array(this._flags.last_token, special_words)) {\n // \"return\" had a special handling in TK_WORD. Now we need to return the favor\n this._output.space_before_token = true;\n this.print_token(current_token);\n return;\n }\n\n // hack for actionscript's import .*;\n if (current_token.text === '*' && this._flags.last_token.type === TOKEN.DOT) {\n this.print_token(current_token);\n return;\n }\n\n if (current_token.text === '::') {\n // no spaces around exotic namespacing syntax operator\n this.print_token(current_token);\n return;\n }\n\n // Allow line wrapping between operators when operator_position is\n // set to before or preserve\n if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n if (current_token.text === ':' && this._flags.in_case) {\n this._flags.case_body = true;\n this.indent();\n this.print_token(current_token);\n this.print_newline();\n this._flags.in_case = false;\n return;\n }\n\n var space_before = true;\n var space_after = true;\n var in_ternary = false;\n if (current_token.text === ':') {\n if (this._flags.ternary_depth === 0) {\n // Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant.\n space_before = false;\n } else {\n this._flags.ternary_depth -= 1;\n in_ternary = true;\n }\n } else if (current_token.text === '?') {\n this._flags.ternary_depth += 1;\n }\n\n // let's handle the operator_position option prior to any conflicting logic\n if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array(current_token.text, positionable_operators)) {\n var isColon = current_token.text === ':';\n var isTernaryColon = (isColon && in_ternary);\n var isOtherColon = (isColon && !in_ternary);\n\n switch (this._options.operator_position) {\n case OPERATOR_POSITION.before_newline:\n // if the current token is : and it's not a ternary statement then we set space_before to false\n this._output.space_before_token = !isOtherColon;\n\n this.print_token(current_token);\n\n if (!isColon || isTernaryColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.after_newline:\n // if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement,\n // then print a newline.\n\n this._output.space_before_token = true;\n\n if (!isColon || isTernaryColon) {\n if (this._tokens.peek().newlines) {\n this.print_newline(false, true);\n } else {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else {\n this._output.space_before_token = false;\n }\n\n this.print_token(current_token);\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.preserve_newline:\n if (!isOtherColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // if we just added a newline, or the current token is : and it's not a ternary statement,\n // then we set space_before to false\n space_before = !(this._output.just_added_newline() || isOtherColon);\n\n this._output.space_before_token = space_before;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n }\n }\n\n if (isGeneratorAsterisk) {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = false;\n var next_token = this._tokens.peek();\n space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]);\n } else if (current_token.text === '...') {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = this._flags.last_token.type === TOKEN.START_BLOCK;\n space_after = false;\n } else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) {\n // unary operators (and binary +/- pretending to be unary) special cases\n if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n space_before = false;\n space_after = false;\n\n // http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1\n // if there is a newline between -- or ++ and anything else we should preserve it.\n if (current_token.newlines && (current_token.text === '--' || current_token.text === '++')) {\n this.print_newline(false, true);\n }\n\n if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) {\n // for (;; ++i)\n // ^^^\n space_before = true;\n }\n\n if (this._flags.last_token.type === TOKEN.RESERVED) {\n space_before = true;\n } else if (this._flags.last_token.type === TOKEN.END_EXPR) {\n space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++'));\n } else if (this._flags.last_token.type === TOKEN.OPERATOR) {\n // a++ + ++b;\n // a - -b\n space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_token.text, ['--', '-', '++', '+']);\n // + and - are not unary when preceeded by -- or ++ operator\n // a-- + b\n // a * +b\n // a - -b\n if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_token.text, ['--', '++'])) {\n space_after = true;\n }\n }\n\n\n if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) &&\n (this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) {\n // { foo; --i }\n // foo(); --bar;\n this.print_newline();\n }\n }\n\n this._output.space_before_token = this._output.space_before_token || space_before;\n this.print_token(current_token);\n this._output.space_before_token = space_after;\n};\n\nBeautifier.prototype.handle_block_comment = function(current_token, preserve_statement_flags) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n if (current_token.directives && current_token.directives.preserve === 'end') {\n // If we're testing the raw output behavior, do not allow a directive to turn it off.\n this._output.raw = this._options.test_output_raw;\n }\n return;\n }\n\n if (current_token.directives) {\n this.print_newline(false, preserve_statement_flags);\n this.print_token(current_token);\n if (current_token.directives.preserve === 'start') {\n this._output.raw = true;\n }\n this.print_newline(false, true);\n return;\n }\n\n // inline block\n if (!acorn.newline.test(current_token.text) && !current_token.newlines) {\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n }\n\n var lines = split_linebreaks(current_token.text);\n var j; // iterator for this case\n var javadoc = false;\n var starless = false;\n var lastIndent = current_token.whitespace_before;\n var lastIndentLength = lastIndent.length;\n\n // block comment starts with a new line\n this.print_newline(false, preserve_statement_flags);\n if (lines.length > 1) {\n javadoc = all_lines_start_with(lines.slice(1), '*');\n starless = each_line_matches_indent(lines.slice(1), lastIndent);\n }\n\n // first line always indented\n this.print_token(current_token, lines[0]);\n for (j = 1; j < lines.length; j++) {\n this.print_newline(false, true);\n if (javadoc) {\n // javadoc: reformat and re-indent\n this.print_token(current_token, ' ' + ltrim(lines[j]));\n } else if (starless && lines[j].length > lastIndentLength) {\n // starless: re-indent non-empty content, avoiding trim\n this.print_token(current_token, lines[j].substring(lastIndentLength));\n } else {\n // normal comments output raw\n this._output.add_token(lines[j]);\n }\n }\n\n // for comments of more than one line, make sure there's a new line after\n this.print_newline(false, preserve_statement_flags);\n};\n\nBeautifier.prototype.handle_comment = function(current_token, preserve_statement_flags) {\n if (current_token.newlines) {\n this.print_newline(false, preserve_statement_flags);\n } else {\n this._output.trim(true);\n }\n\n this._output.space_before_token = true;\n this.print_token(current_token);\n this.print_newline(false, preserve_statement_flags);\n};\n\nBeautifier.prototype.handle_dot = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token, true);\n }\n\n if (this._options.unindent_chained_methods) {\n this.deindent();\n }\n\n if (reserved_array(this._flags.last_token, special_words)) {\n this._output.space_before_token = false;\n } else {\n // allow preserved newlines before dots in general\n // force newlines on dots after close paren when break_chained - for bar().baz()\n this.allow_wrap_or_preserved_newline(current_token,\n this._flags.last_token.text === ')' && this._options.break_chained_methods);\n }\n\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_unknown = function(current_token, preserve_statement_flags) {\n this.print_token(current_token);\n\n if (current_token.text[current_token.text.length - 1] === '\\n') {\n this.print_newline(false, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_eof = function(current_token) {\n // Unwind any open statements\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this.handle_whitespace_and_comments(current_token);\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'js');\n\n // compatibility, re\n var raw_brace_style = this.raw_options.brace_style || null;\n if (raw_brace_style === \"expand-strict\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"expand\";\n } else if (raw_brace_style === \"collapse-preserve-inline\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"collapse,preserve-inline\";\n } else if (this.raw_options.braces_on_own_line !== undefined) { //graceful handling of deprecated option\n this.raw_options.brace_style = this.raw_options.braces_on_own_line ? \"expand\" : \"collapse\";\n // } else if (!raw_brace_style) { //Nothing exists to set it\n // raw_brace_style = \"collapse\";\n }\n\n //preserve-inline in delimited string will trigger brace_preserve_inline, everything\n //else is considered a brace_style and the last one only will have an effect\n\n var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);\n\n this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option\n this.brace_style = \"collapse\";\n\n for (var bs = 0; bs < brace_style_split.length; bs++) {\n if (brace_style_split[bs] === \"preserve-inline\") {\n this.brace_preserve_inline = true;\n } else {\n this.brace_style = brace_style_split[bs];\n }\n }\n\n this.unindent_chained_methods = this._get_boolean('unindent_chained_methods');\n this.break_chained_methods = this._get_boolean('break_chained_methods');\n this.space_in_paren = this._get_boolean('space_in_paren');\n this.space_in_empty_paren = this._get_boolean('space_in_empty_paren');\n this.jslint_happy = this._get_boolean('jslint_happy');\n this.space_after_anon_function = this._get_boolean('space_after_anon_function');\n this.keep_array_indentation = this._get_boolean('keep_array_indentation');\n this.space_before_conditional = this._get_boolean('space_before_conditional', true);\n this.unescape_strings = this._get_boolean('unescape_strings');\n this.e4x = this._get_boolean('e4x');\n this.comma_first = this._get_boolean('comma_first');\n this.operator_position = this._get_selection('operator_position', validPositionValues);\n\n // For testing of beautify preserve:start directive\n this.test_output_raw = this._get_boolean('test_output_raw');\n\n // force this._options.space_after_anon_function to true if this._options.jslint_happy\n if (this.jslint_happy) {\n this.space_after_anon_function = true;\n }\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction TokenStream(parent_token) {\n // private\n this.__tokens = [];\n this.__tokens_length = this.__tokens.length;\n this.__position = 0;\n this.__parent_token = parent_token;\n}\n\nTokenStream.prototype.restart = function() {\n this.__position = 0;\n};\n\nTokenStream.prototype.isEmpty = function() {\n return this.__tokens_length === 0;\n};\n\nTokenStream.prototype.hasNext = function() {\n return this.__position < this.__tokens_length;\n};\n\nTokenStream.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__tokens[this.__position];\n this.__position += 1;\n }\n return val;\n};\n\nTokenStream.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__tokens_length) {\n val = this.__tokens[index];\n }\n return val;\n};\n\nTokenStream.prototype.add = function(token) {\n if (this.__parent_token) {\n token.parent = this.__parent_token;\n }\n this.__tokens.push(token);\n this.__tokens_length += 1;\n};\n\nmodule.exports.TokenStream = TokenStream;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction css_beautify(source_text, options) {\n var beautifier = new Beautifier(source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = css_beautify;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('./options').Options;\nvar Output = require('../core/output').Output;\nvar InputScanner = require('../core/inputscanner').InputScanner;\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\n// tokenizer\nvar whitespaceChar = /\\s/;\nvar whitespacePattern = /(?:\\s|\\n)+/g;\nvar block_comment_pattern = /\\/\\*(?:[\\s\\S]*?)((?:\\*\\/)|$)/g;\nvar comment_pattern = /\\/\\/(?:[^\\n\\r\\u2028\\u2029]*)/g;\n\nfunction Beautifier(source_text, options) {\n this._source_text = source_text || '';\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n this._options = new Options(options);\n this._ch = null;\n this._input = null;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule\n this.NESTED_AT_RULE = {\n \"@page\": true,\n \"@font-face\": true,\n \"@keyframes\": true,\n // also in CONDITIONAL_GROUP_RULE below\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n this.CONDITIONAL_GROUP_RULE = {\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n\n}\n\nBeautifier.prototype.eatString = function(endChars) {\n var result = '';\n this._ch = this._input.next();\n while (this._ch) {\n result += this._ch;\n if (this._ch === \"\\\\\") {\n result += this._input.next();\n } else if (endChars.indexOf(this._ch) !== -1 || this._ch === \"\\n\") {\n break;\n }\n this._ch = this._input.next();\n }\n return result;\n};\n\n// Skips any white space in the source text from the current position.\n// When allowAtLeastOneNewLine is true, will output new lines for each\n// newline character found; if the user has preserve_newlines off, only\n// the first newline will be output\nBeautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {\n var result = whitespaceChar.test(this._input.peek());\n var isFirstNewLine = true;\n\n while (whitespaceChar.test(this._input.peek())) {\n this._ch = this._input.next();\n if (allowAtLeastOneNewLine && this._ch === '\\n') {\n if (this._options.preserve_newlines || isFirstNewLine) {\n isFirstNewLine = false;\n this._output.add_new_line(true);\n }\n }\n }\n return result;\n};\n\n// Nested pseudo-class if we are insideRule\n// and the next special character found opens\n// a new block\nBeautifier.prototype.foundNestedPseudoClass = function() {\n var openParen = 0;\n var i = 1;\n var ch = this._input.peek(i);\n while (ch) {\n if (ch === \"{\") {\n return true;\n } else if (ch === '(') {\n // pseudoclasses can contain ()\n openParen += 1;\n } else if (ch === ')') {\n if (openParen === 0) {\n return false;\n }\n openParen -= 1;\n } else if (ch === \";\" || ch === \"}\") {\n return false;\n }\n i++;\n ch = this._input.peek(i);\n }\n return false;\n};\n\nBeautifier.prototype.print_string = function(output_string) {\n if (this._output.just_added_newline()) {\n this._output.set_indent(this._indentLevel);\n }\n this._output.add_token(output_string);\n};\n\nBeautifier.prototype.preserveSingleSpace = function(isAfterSpace) {\n if (isAfterSpace) {\n this._output.space_before_token = true;\n }\n};\n\nBeautifier.prototype.indent = function() {\n this._indentLevel++;\n};\n\nBeautifier.prototype.outdent = function() {\n if (this._indentLevel > 0) {\n this._indentLevel--;\n }\n};\n\n/*_____________________--------------------_____________________*/\n\nBeautifier.prototype.beautify = function() {\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text || '')) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n\n // HACK: newline parsing inconsistent. This brute force normalizes the this._input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n\n // reset\n var baseIndentString = source_text.match(/^[\\t ]*/)[0];\n\n this._output = new Output(this._options, baseIndentString);\n this._input = new InputScanner(source_text);\n this._indentLevel = 0;\n this._nestedLevel = 0;\n\n this._ch = null;\n var parenLevel = 0;\n\n var insideRule = false;\n // This is the value side of a property value pair (blue in the following ex)\n // label { content: blue }\n var insidePropertyValue = false;\n var enteringConditionalGroup = false;\n var insideAtExtend = false;\n var insideAtImport = false;\n var topCharacter = this._ch;\n\n while (true) {\n var whitespace = this._input.read(whitespacePattern);\n var isAfterSpace = whitespace !== '';\n var previous_ch = topCharacter;\n this._ch = this._input.next();\n topCharacter = this._ch;\n\n if (!this._ch) {\n break;\n } else if (this._ch === '/' && this._input.peek() === '*') {\n // /* css comment */\n // Always start block comments on a new line.\n // This handles scenarios where a block comment immediately\n // follows a property definition on the same line or where\n // minified code is being beautified.\n this._output.add_new_line();\n this._input.back();\n this.print_string(this._input.read(block_comment_pattern));\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n\n // Block comments are followed by a new line so they don't\n // share a line with other properties\n this._output.add_new_line();\n } else if (this._ch === '/' && this._input.peek() === '/') {\n // // single line comment\n // Preserves the space before a comment\n // on the same line as a rule\n this._output.space_before_token = true;\n this._input.back();\n this.print_string(this._input.read(comment_pattern));\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n } else if (this._ch === '@') {\n this.preserveSingleSpace(isAfterSpace);\n\n // deal with less propery mixins @{...}\n if (this._input.peek() === '{') {\n this.print_string(this._ch + this.eatString('}'));\n } else {\n this.print_string(this._ch);\n\n // strip trailing space, if present, for hash property checks\n var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\\]\\/='\"]/g);\n\n if (variableOrRule.match(/[ :]$/)) {\n // we have a variable or pseudo-class, add it and insert one space before continuing\n variableOrRule = this.eatString(\": \").replace(/\\s$/, '');\n this.print_string(variableOrRule);\n this._output.space_before_token = true;\n }\n\n variableOrRule = variableOrRule.replace(/\\s$/, '');\n\n if (variableOrRule === 'extend') {\n insideAtExtend = true;\n } else if (variableOrRule === 'import') {\n insideAtImport = true;\n }\n\n // might be a nesting at-rule\n if (variableOrRule in this.NESTED_AT_RULE) {\n this._nestedLevel += 1;\n if (variableOrRule in this.CONDITIONAL_GROUP_RULE) {\n enteringConditionalGroup = true;\n }\n // might be less variable\n } else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) {\n insidePropertyValue = true;\n this.indent();\n }\n }\n } else if (this._ch === '#' && this._input.peek() === '{') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch + this.eatString('}'));\n } else if (this._ch === '{') {\n if (insidePropertyValue) {\n insidePropertyValue = false;\n this.outdent();\n }\n this.indent();\n this._output.space_before_token = true;\n this.print_string(this._ch);\n\n // when entering conditional groups, only rulesets are allowed\n if (enteringConditionalGroup) {\n enteringConditionalGroup = false;\n insideRule = (this._indentLevel > this._nestedLevel);\n } else {\n // otherwise, declarations are also allowed\n insideRule = (this._indentLevel >= this._nestedLevel);\n }\n if (this._options.newline_between_rules && insideRule) {\n if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') {\n this._output.ensure_empty_line_above('/', ',');\n }\n }\n this.eatWhitespace(true);\n this._output.add_new_line();\n } else if (this._ch === '}') {\n this.outdent();\n this._output.add_new_line();\n if (previous_ch === '{') {\n this._output.trim(true);\n }\n insideAtImport = false;\n insideAtExtend = false;\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n this.print_string(this._ch);\n insideRule = false;\n if (this._nestedLevel) {\n this._nestedLevel--;\n }\n\n this.eatWhitespace(true);\n this._output.add_new_line();\n\n if (this._options.newline_between_rules && !this._output.just_added_blankline()) {\n if (this._input.peek() !== '}') {\n this._output.add_new_line(true);\n }\n }\n } else if (this._ch === \":\") {\n if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack(\"&\") || this.foundNestedPseudoClass()) && !this._input.lookBack(\"(\") && !insideAtExtend) {\n // 'property: value' delimiter\n // which could be in a conditional group query\n this.print_string(':');\n if (!insidePropertyValue) {\n insidePropertyValue = true;\n this._output.space_before_token = true;\n this.eatWhitespace(true);\n this.indent();\n }\n } else {\n // sass/less parent reference don't use a space\n // sass nested pseudo-class don't use a space\n\n // preserve space before pseudoclasses/pseudoelements, as it means \"in any child\"\n if (this._input.lookBack(\" \")) {\n this._output.space_before_token = true;\n }\n if (this._input.peek() === \":\") {\n // pseudo-element\n this._ch = this._input.next();\n this.print_string(\"::\");\n } else {\n // pseudo-class\n this.print_string(':');\n }\n }\n } else if (this._ch === '\"' || this._ch === '\\'') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch + this.eatString(this._ch));\n this.eatWhitespace(true);\n } else if (this._ch === ';') {\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n insideAtExtend = false;\n insideAtImport = false;\n this.print_string(this._ch);\n this.eatWhitespace(true);\n\n // This maintains single line comments on the same\n // line. Block comments are also affected, but\n // a new line is always output before one inside\n // that section\n if (this._input.peek() !== '/') {\n this._output.add_new_line();\n }\n } else if (this._ch === '(') { // may be a url\n if (this._input.lookBack(\"url\")) {\n this.print_string(this._ch);\n this.eatWhitespace();\n this._ch = this._input.next();\n if (this._ch === ')' || this._ch === '\"' || this._ch !== '\\'') {\n this._input.back();\n parenLevel++;\n } else if (this._ch) {\n this.print_string(this._ch + this.eatString(')'));\n }\n } else {\n parenLevel++;\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n this.eatWhitespace();\n }\n } else if (this._ch === ')') {\n this.print_string(this._ch);\n parenLevel--;\n } else if (this._ch === ',') {\n this.print_string(this._ch);\n this.eatWhitespace(true);\n if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel < 1 && !insideAtImport) {\n this._output.add_new_line();\n } else {\n this._output.space_before_token = true;\n }\n } else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel < 1) {\n //handle combinator spacing\n if (this._options.space_around_combinator) {\n this._output.space_before_token = true;\n this.print_string(this._ch);\n this._output.space_before_token = true;\n } else {\n this.print_string(this._ch);\n this.eatWhitespace();\n // squash extra whitespace\n if (this._ch && whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n }\n } else if (this._ch === ']') {\n this.print_string(this._ch);\n } else if (this._ch === '[') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n } else if (this._ch === '=') { // no whitespace before or after\n this.eatWhitespace();\n this.print_string('=');\n if (whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n } else if (this._ch === '!') { // !important\n this.print_string(' ');\n this.print_string(this._ch);\n } else {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n }\n }\n\n var sweetCode = this._output.get_code(eol);\n\n return sweetCode;\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'css');\n\n this.selector_separator_newline = this._get_boolean('selector_separator_newline', true);\n this.newline_between_rules = this._get_boolean('newline_between_rules', true);\n var space_around_selector_separator = this._get_boolean('space_around_selector_separator');\n this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator;\n\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier;\n\nfunction style_html(html_source, options, js_beautify, css_beautify) {\n var beautifier = new Beautifier(html_source, options, js_beautify, css_beautify);\n return beautifier.beautify();\n}\n\nmodule.exports = style_html;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('../html/options').Options;\nvar Output = require('../core/output').Output;\nvar Tokenizer = require('../html/tokenizer').Tokenizer;\nvar TOKEN = require('../html/tokenizer').TOKEN;\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\nvar Printer = function(options, base_indent_string) { //handles input/output and some other printing functions\n\n this.indent_level = 0;\n this.alignment_size = 0;\n this.wrap_line_length = options.wrap_line_length;\n this.max_preserve_newlines = options.max_preserve_newlines;\n this.preserve_newlines = options.preserve_newlines;\n\n this._output = new Output(options, base_indent_string);\n\n};\n\nPrinter.prototype.current_line_has_match = function(pattern) {\n return this._output.current_line.has_match(pattern);\n};\n\nPrinter.prototype.set_space_before_token = function(value) {\n this._output.space_before_token = value;\n};\n\nPrinter.prototype.add_raw_token = function(token) {\n this._output.add_raw_token(token);\n};\n\nPrinter.prototype.traverse_whitespace = function(raw_token) {\n if (raw_token.whitespace_before || raw_token.newlines) {\n var newlines = 0;\n\n if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) {\n newlines = raw_token.newlines ? 1 : 0;\n }\n\n if (this.preserve_newlines) {\n newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1;\n }\n\n if (newlines) {\n for (var n = 0; n < newlines; n++) {\n this.print_newline(n > 0);\n }\n } else {\n this._output.space_before_token = true;\n this.print_space_or_wrap(raw_token.text);\n }\n return true;\n }\n return false;\n};\n\n// Append a space to the given content (string array) or, if we are\n// at the wrap_line_length, append a newline/indentation.\n// return true if a newline was added, false if a space was added\nPrinter.prototype.print_space_or_wrap = function(text) {\n if (this.wrap_line_length) {\n if (this._output.current_line.get_character_count() + text.length + 1 >= this.wrap_line_length) { //insert a line when the wrap_line_length is reached\n return this._output.add_new_line();\n }\n }\n return false;\n};\n\nPrinter.prototype.print_newline = function(force) {\n this._output.add_new_line(force);\n};\n\nPrinter.prototype.print_token = function(text) {\n if (text) {\n if (this._output.current_line.is_empty()) {\n this._output.set_indent(this.indent_level, this.alignment_size);\n }\n\n this._output.add_token(text);\n }\n};\n\nPrinter.prototype.print_raw_text = function(text) {\n this._output.current_line.push_raw(text);\n};\n\nPrinter.prototype.indent = function() {\n this.indent_level++;\n};\n\nPrinter.prototype.unindent = function() {\n if (this.indent_level > 0) {\n this.indent_level--;\n }\n};\n\nPrinter.prototype.get_full_indent = function(level) {\n level = this.indent_level + (level || 0);\n if (level < 1) {\n return '';\n }\n\n return this._output.get_indent_string(level);\n};\n\n\nvar uses_beautifier = function(tag_check, start_token) {\n var raw_token = start_token.next;\n if (!start_token.closed) {\n return false;\n }\n\n while (raw_token.type !== TOKEN.EOF && raw_token.closed !== start_token) {\n if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === 'type') {\n // For script and style tags that have a type attribute, only enable custom beautifiers for matching values\n var peekEquals = raw_token.next ? raw_token.next : raw_token;\n var peekValue = peekEquals.next ? peekEquals.next : peekEquals;\n if (peekEquals.type === TOKEN.EQUALS && peekValue.type === TOKEN.VALUE) {\n return (tag_check === 'style' && peekValue.text.search('text/css') > -1) ||\n (tag_check === 'script' && peekValue.text.search(/(text|application|dojo)\\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\\+)?json|method|aspect)/) > -1);\n }\n return false;\n }\n raw_token = raw_token.next;\n }\n\n return true;\n};\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction TagFrame(parent, parser_token, indent_level) {\n this.parent = parent || null;\n this.tag = parser_token ? parser_token.tag_name : '';\n this.indent_level = indent_level || 0;\n this.parser_token = parser_token || null;\n}\n\nfunction TagStack(printer) {\n this._printer = printer;\n this._current_frame = null;\n}\n\nTagStack.prototype.get_parser_token = function() {\n return this._current_frame ? this._current_frame.parser_token : null;\n};\n\nTagStack.prototype.record_tag = function(parser_token) { //function to record a tag and its parent in this.tags Object\n var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);\n this._current_frame = new_frame;\n};\n\nTagStack.prototype._try_pop_frame = function(frame) { //function to retrieve the opening tag to the corresponding closer\n var parser_token = null;\n\n if (frame) {\n parser_token = frame.parser_token;\n this._printer.indent_level = frame.indent_level;\n this._current_frame = frame.parent;\n }\n\n return parser_token;\n};\n\nTagStack.prototype._get_frame = function(tag_list, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._current_frame;\n\n while (frame) { //till we reach '' (the initial value);\n if (tag_list.indexOf(frame.tag) !== -1) { //if this is it use it\n break;\n } else if (stop_list && stop_list.indexOf(frame.tag) !== -1) {\n frame = null;\n break;\n }\n frame = frame.parent;\n }\n\n return frame;\n};\n\nTagStack.prototype.try_pop = function(tag, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._get_frame([tag], stop_list);\n return this._try_pop_frame(frame);\n};\n\nTagStack.prototype.indent_to_tag = function(tag_list) {\n var frame = this._get_frame(tag_list);\n if (frame) {\n this._printer.indent_level = frame.indent_level;\n }\n};\n\nfunction Beautifier(source_text, options, js_beautify, css_beautify) {\n //Wrapper function to invoke all the necessary constructors and deal with the output.\n this._source_text = source_text || '';\n options = options || {};\n this._js_beautify = js_beautify;\n this._css_beautify = css_beautify;\n this._tag_stack = null;\n\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n var optionHtml = new Options(options, 'html');\n\n this._options = optionHtml;\n\n this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 'force'.length) === 'force';\n this._is_wrap_attributes_force_expand_multiline = (this._options.wrap_attributes === 'force-expand-multiline');\n this._is_wrap_attributes_force_aligned = (this._options.wrap_attributes === 'force-aligned');\n this._is_wrap_attributes_aligned_multiple = (this._options.wrap_attributes === 'aligned-multiple');\n}\n\nBeautifier.prototype.beautify = function() {\n\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text)) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n // HACK: newline parsing inconsistent. This brute force normalizes the input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n var baseIndentString = '';\n\n // Including commented out text would change existing html beautifier behavior to autodetect base indent.\n // baseIndentString = source_text.match(/^[\\t ]*/)[0];\n\n var last_token = {\n text: '',\n type: ''\n };\n\n var last_tag_token = new TagOpenParserToken();\n\n var printer = new Printer(this._options, baseIndentString);\n var tokens = new Tokenizer(source_text, this._options).tokenize();\n\n this._tag_stack = new TagStack(printer);\n\n var parser_token = null;\n var raw_token = tokens.next();\n while (raw_token.type !== TOKEN.EOF) {\n\n if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) {\n parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token);\n last_tag_token = parser_token;\n } else if ((raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE) ||\n (raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete)) {\n parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, tokens);\n } else if (raw_token.type === TOKEN.TAG_CLOSE) {\n parser_token = this._handle_tag_close(printer, raw_token, last_tag_token);\n } else if (raw_token.type === TOKEN.TEXT) {\n parser_token = this._handle_text(printer, raw_token, last_tag_token);\n } else {\n // This should never happen, but if it does. Print the raw token\n printer.add_raw_token(raw_token);\n }\n\n last_token = parser_token;\n\n raw_token = tokens.next();\n }\n var sweet_code = printer._output.get_code(eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) {\n var parser_token = { text: raw_token.text, type: raw_token.type };\n printer.alignment_size = 0;\n last_tag_token.tag_complete = true;\n\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '');\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n if (last_tag_token.tag_start_char === '<') {\n printer.set_space_before_token(raw_token.text[0] === '/'); // space before />, no space before >\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) {\n printer.print_newline(false);\n }\n }\n printer.print_token(raw_token.text);\n }\n\n if (last_tag_token.indent_content &&\n !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {\n printer.indent();\n\n // only indent once per opened tag\n last_tag_token.indent_content = false;\n }\n return parser_token;\n};\n\nBeautifier.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, tokens) {\n var parser_token = { text: raw_token.text, type: raw_token.type };\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '');\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n if (last_tag_token.tag_start_char === '<') {\n if (raw_token.type === TOKEN.ATTRIBUTE) {\n printer.set_space_before_token(true);\n last_tag_token.attr_count += 1;\n } else if (raw_token.type === TOKEN.EQUALS) { //no space before =\n printer.set_space_before_token(false);\n } else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) { //no space before value\n printer.set_space_before_token(false);\n }\n }\n\n if (printer._output.space_before_token && last_tag_token.tag_start_char === '<') {\n var wrapped = printer.print_space_or_wrap(raw_token.text);\n if (raw_token.type === TOKEN.ATTRIBUTE) {\n var indentAttrs = wrapped && !this._is_wrap_attributes_force;\n\n if (this._is_wrap_attributes_force) {\n var force_first_attr_wrap = false;\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.attr_count === 1) {\n var is_only_attribute = true;\n var peek_index = 0;\n var peek_token;\n do {\n peek_token = tokens.peek(peek_index);\n if (peek_token.type === TOKEN.ATTRIBUTE) {\n is_only_attribute = false;\n break;\n }\n peek_index += 1;\n } while (peek_index < 4 && peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE);\n\n force_first_attr_wrap = !is_only_attribute;\n }\n\n if (last_tag_token.attr_count > 1 || force_first_attr_wrap) {\n printer.print_newline(false);\n indentAttrs = true;\n }\n }\n if (indentAttrs) {\n last_tag_token.has_wrapped_attrs = true;\n }\n }\n }\n printer.print_token(raw_token.text);\n }\n return parser_token;\n};\n\nBeautifier.prototype._handle_text = function(printer, raw_token, last_tag_token) {\n var parser_token = { text: raw_token.text, type: 'TK_CONTENT' };\n if (last_tag_token.custom_beautifier) { //check if we need to format javascript\n this._print_custom_beatifier_text(printer, raw_token, last_tag_token);\n } else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n printer.traverse_whitespace(raw_token);\n printer.print_token(raw_token.text);\n }\n return parser_token;\n};\n\nBeautifier.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) {\n if (raw_token.text !== '') {\n printer.print_newline(false);\n var text = raw_token.text,\n _beautifier,\n script_indent_level = 1;\n if (last_tag_token.tag_name === 'script') {\n _beautifier = typeof this._js_beautify === 'function' && this._js_beautify;\n } else if (last_tag_token.tag_name === 'style') {\n _beautifier = typeof this._css_beautify === 'function' && this._css_beautify;\n }\n\n if (this._options.indent_scripts === \"keep\") {\n script_indent_level = 0;\n } else if (this._options.indent_scripts === \"separate\") {\n script_indent_level = -printer.indent_level;\n }\n\n var indentation = printer.get_full_indent(script_indent_level);\n\n // if there is at least one empty line at the end of this text, strip it\n // we'll be adding one back after the text but before the containing tag.\n text = text.replace(/\\n[ \\t]*$/, '');\n\n if (_beautifier) {\n\n // call the Beautifier if avaliable\n var Child_options = function() {\n this.eol = '\\n';\n };\n Child_options.prototype = this._options.raw_options;\n var child_options = new Child_options();\n text = _beautifier(indentation + text, child_options);\n } else {\n // simply indent the string otherwise\n var white = text.match(/^\\s*/)[0];\n var _level = white.match(/[^\\n\\r]*$/)[0].split(this._options.indent_string).length - 1;\n var reindent = this._get_full_indent(script_indent_level - _level);\n text = (indentation + text.trim())\n .replace(/\\r\\n|\\r|\\n/g, '\\n' + reindent);\n }\n if (text) {\n printer.print_raw_text(text);\n printer.print_newline(true);\n }\n }\n};\n\nBeautifier.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token) {\n var parser_token = this._get_tag_open_token(raw_token);\n printer.traverse_whitespace(raw_token);\n\n this._set_tag_position(printer, raw_token, parser_token, last_tag_token, last_token);\n\n\n if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) &&\n raw_token.type === TOKEN.TAG_OPEN && raw_token.text.indexOf(']*)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n } else {\n tag_check_match = raw_token.text.match(/^{{\\#?([^\\s}]+)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n }\n this.tag_check = this.tag_check.toLowerCase();\n\n if (raw_token.type === TOKEN.COMMENT) {\n this.tag_complete = true;\n }\n\n this.is_start_tag = this.tag_check.charAt(0) !== '/';\n this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check;\n this.is_end_tag = !this.is_start_tag ||\n (raw_token.closed && raw_token.closed.text === '/>');\n\n // handlebars tags that don't start with # or ^ are single_tags, and so also start and end.\n this.is_end_tag = this.is_end_tag ||\n (this.tag_start_char === '{' && (this.text.length < 3 || (/[^#\\^]/.test(this.text.charAt(2)))));\n }\n};\n\nBeautifier.prototype._get_tag_open_token = function(raw_token) { //function to get a full tag and parse its type\n var parser_token = new TagOpenParserToken(this._tag_stack.get_parser_token(), raw_token);\n\n parser_token.alignment_size = this._options.wrap_attributes_indent_size;\n\n parser_token.is_end_tag = parser_token.is_end_tag ||\n in_array(parser_token.tag_check, this._options.void_elements);\n\n parser_token.is_empty_element = parser_token.tag_complete ||\n (parser_token.is_start_tag && parser_token.is_end_tag);\n\n parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted);\n parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted);\n parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_start_char === '{';\n\n return parser_token;\n};\n\nBeautifier.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) {\n\n if (!parser_token.is_empty_element) {\n if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name); //remove it and all ancestors\n } else { // it's a start-tag\n // check if this tag is starting an element that has optional end element\n // and do an ending needed\n this._do_optional_end_element(parser_token);\n\n this._tag_stack.record_tag(parser_token); //push it on the tag stack\n\n if ((parser_token.tag_name === 'script' || parser_token.tag_name === 'style') &&\n !(parser_token.is_unformatted || parser_token.is_content_unformatted)) {\n parser_token.custom_beautifier = uses_beautifier(parser_token.tag_check, raw_token);\n }\n }\n }\n\n if (in_array(parser_token.tag_check, this._options.extra_liners)) { //check if this double needs an extra line\n printer.print_newline(false);\n if (!printer._output.just_added_blankline()) {\n printer.print_newline(true);\n }\n }\n\n if (parser_token.is_empty_element) { //if this tag name is a single tag type (either in the list or has a closing /)\n\n // if you hit an else case, reset the indent level if you are inside an:\n // 'if', 'unless', or 'each' block.\n if (parser_token.tag_start_char === '{' && parser_token.tag_check === 'else') {\n this._tag_stack.indent_to_tag(['if', 'unless', 'each']);\n parser_token.indent_content = true;\n // Don't add a newline if opening {{#if}} tag is on the current line\n var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/);\n if (!foundIfOnCurrentLine) {\n printer.print_newline(false);\n }\n }\n\n // Don't add a newline before elements that should remain where they are.\n if (parser_token.tag_name === '!--' && last_token.type === TOKEN.TAG_CLOSE &&\n last_tag_token.is_end_tag && parser_token.text.indexOf('\\n') === -1) {\n //Do nothing. Leave comments on same line.\n } else if (!parser_token.is_inline_element && !parser_token.is_unformatted) {\n printer.print_newline(false);\n }\n } else if (parser_token.is_unformatted || parser_token.is_content_unformatted) {\n if (!parser_token.is_inline_element && !parser_token.is_unformatted) {\n printer.print_newline(false);\n }\n } else if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n if ((parser_token.start_tag_token && parser_token.start_tag_token.multiline_content) ||\n !(parser_token.is_inline_element ||\n (last_tag_token.is_inline_element) ||\n (last_token.type === TOKEN.TAG_CLOSE &&\n parser_token.start_tag_token === last_tag_token) ||\n (last_token.type === 'TK_CONTENT')\n )) {\n printer.print_newline(false);\n }\n } else { // it's a start-tag\n parser_token.indent_content = !parser_token.custom_beautifier;\n\n if (parser_token.tag_start_char === '<') {\n if (parser_token.tag_name === 'html') {\n parser_token.indent_content = this._options.indent_inner_html;\n } else if (parser_token.tag_name === 'head') {\n parser_token.indent_content = this._options.indent_head_inner_html;\n } else if (parser_token.tag_name === 'body') {\n parser_token.indent_content = this._options.indent_body_inner_html;\n }\n }\n\n if (!parser_token.is_inline_element && last_token.type !== 'TK_CONTENT') {\n if (parser_token.parent) {\n parser_token.parent.multiline_content = true;\n }\n printer.print_newline(false);\n }\n }\n};\n\n//To be used for

tag special case:\n//var p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'];\n\nBeautifier.prototype._do_optional_end_element = function(parser_token) {\n // NOTE: cases of \"if there is no more content in the parent element\"\n // are handled automatically by the beautifier.\n // It assumes parent or ancestor close tag closes all children.\n // https://www.w3.org/TR/html5/syntax.html#optional-tags\n if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) {\n return;\n\n } else if (parser_token.tag_name === 'body') {\n // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment.\n this._tag_stack.try_pop('head');\n\n //} else if (parser_token.tag_name === 'body') {\n // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment.\n\n } else if (parser_token.tag_name === 'li') {\n // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.\n this._tag_stack.try_pop('li', ['ol', 'ul']);\n\n } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') {\n // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element.\n // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element.\n this._tag_stack.try_pop('dt', ['dl']);\n this._tag_stack.try_pop('dd', ['dl']);\n\n //} else if (p_closers.indexOf(parser_token.tag_name) !== -1) {\n //TODO: THIS IS A BUG FARM. We are not putting this into 1.8.0 as it is likely to blow up.\n //A p element’s end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, details, div, dl, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hr, main, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is an HTML element that is not an a, audio, del, ins, map, noscript, or video element, or an autonomous custom element.\n //this._tag_stack.try_pop('p', ['body']);\n\n } else if (parser_token.tag_name === 'rp' || parser_token.tag_name === 'rt') {\n // An rt element’s end tag may be omitted if the rt element is immediately followed by an rt or rp element, or if there is no more content in the parent element.\n // An rp element’s end tag may be omitted if the rp element is immediately followed by an rt or rp element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('rt', ['ruby', 'rtc']);\n this._tag_stack.try_pop('rp', ['ruby', 'rtc']);\n\n } else if (parser_token.tag_name === 'optgroup') {\n // An optgroup element’s end tag may be omitted if the optgroup element is immediately followed by another optgroup element, or if there is no more content in the parent element.\n // An option element’s end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('optgroup', ['select']);\n //this._tag_stack.try_pop('option', ['select']);\n\n } else if (parser_token.tag_name === 'option') {\n // An option element’s end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('option', ['select', 'datalist', 'optgroup']);\n\n } else if (parser_token.tag_name === 'colgroup') {\n // DONE: A colgroup element’s end tag may be omitted if the colgroup element is not immediately followed by a space character or a comment.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n\n } else if (parser_token.tag_name === 'thead') {\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n\n //} else if (parser_token.tag_name === 'caption') {\n // DONE: A caption element’s end tag may be omitted if the caption element is not immediately followed by a space character or a comment.\n\n } else if (parser_token.tag_name === 'tbody' || parser_token.tag_name === 'tfoot') {\n // A thead element’s end tag may be omitted if the thead element is immediately followed by a tbody or tfoot element.\n // A tbody element’s end tag may be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element.\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n this._tag_stack.try_pop('thead', ['table']);\n this._tag_stack.try_pop('tbody', ['table']);\n\n //} else if (parser_token.tag_name === 'tfoot') {\n // DONE: A tfoot element’s end tag may be omitted if there is no more content in the parent element.\n\n } else if (parser_token.tag_name === 'tr') {\n // A tr element’s end tag may be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element.\n // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.\n // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.\n this._tag_stack.try_pop('caption', ['table']);\n this._tag_stack.try_pop('colgroup', ['table']);\n this._tag_stack.try_pop('tr', ['table', 'thead', 'tbody', 'tfoot']);\n\n } else if (parser_token.tag_name === 'th' || parser_token.tag_name === 'td') {\n // A td element’s end tag may be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element.\n // A th element’s end tag may be omitted if the th element is immediately followed by a td or th element, or if there is no more content in the parent element.\n this._tag_stack.try_pop('td', ['tr']);\n this._tag_stack.try_pop('th', ['tr']);\n }\n\n // Start element omission not handled currently\n // A head element’s start tag may be omitted if the element is empty, or if the first thing inside the head element is an element.\n // A tbody element’s start tag may be omitted if the first thing inside the tbody element is a tr element, and if the element is not immediately preceded by a tbody, thead, or tfoot element whose end tag has been omitted. (It can’t be omitted if the element is empty.)\n // A colgroup element’s start tag may be omitted if the first thing inside the colgroup element is a col element, and if the element is not immediately preceded by another colgroup element whose end tag has been omitted. (It can’t be omitted if the element is empty.)\n\n // Fix up the parent of the parser token\n parser_token.parent = this._tag_stack.get_parser_token();\n\n};\n\nmodule.exports.Beautifier = Beautifier;","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'html');\n\n this.indent_inner_html = this._get_boolean('indent_inner_html');\n this.indent_body_inner_html = this._get_boolean('indent_body_inner_html', true);\n this.indent_head_inner_html = this._get_boolean('indent_head_inner_html', true);\n\n this.indent_handlebars = this._get_boolean('indent_handlebars', true);\n this.wrap_attributes = this._get_selection('wrap_attributes',\n ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple']);\n this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size);\n this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']);\n\n this.inline = this._get_array('inline', [\n // https://www.w3.org/TR/html5/dom.html#phrasing-content\n 'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite',\n 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img',\n 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript',\n 'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small',\n 'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var',\n 'video', 'wbr', 'text',\n // prexisting - not sure of full effect of removing, leaving in\n 'acronym', 'address', 'big', 'dt', 'ins', 'strike', 'tt'\n ]);\n this.void_elements = this._get_array('void_elements', [\n // HTLM void elements - aka self-closing tags - aka singletons\n // https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',\n 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr',\n // NOTE: Optional tags are too complex for a simple list\n // they are hard coded in _do_optional_end_element\n\n // Doctype and xml elements\n '!doctype', '?xml',\n // ?php and ?= tags\n '?php', '?=',\n // other tags that were in this list, keeping just in case\n 'basefont', 'isindex'\n ]);\n this.unformatted = this._get_array('unformatted', []);\n this.content_unformatted = this._get_array('content_unformatted', [\n 'pre', 'textarea'\n ]);\n this.indent_scripts = this._get_selection('indent_scripts', ['normal', 'keep', 'separate']);\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;"],"sourceRoot":""} \ No newline at end of file diff --git a/js/lib/beautify-css.js b/js/lib/beautify-css.js index b092bdf23..2c931010a 100644 --- a/js/lib/beautify-css.js +++ b/js/lib/beautify-css.js @@ -305,13 +305,24 @@ IndentCache.prototype.get_level_string = function(level) { }; -function Output(indent_string, baseIndentString) { +function Output(options, baseIndentString) { + var indent_string = options.indent_char; + if (options.indent_size > 1) { + indent_string = new Array(options.indent_size + 1).join(options.indent_char); + } + + // Set to null to continue support for auto detection of base indent level. baseIndentString = baseIndentString || ''; + if (options.indent_level > 0) { + baseIndentString = new Array(options.indent_level + 1).join(indent_string); + } + this.__indent_cache = new IndentCache(baseIndentString, indent_string); this.__alignment_cache = new IndentCache('', ' '); this.baseIndentLength = baseIndentString.length; this.indent_length = indent_string.length; this.raw = false; + this._end_with_newline = options.end_with_newline; this.__lines = []; this.previous_line = null; @@ -359,10 +370,10 @@ Output.prototype.add_new_line = function(force_newline) { return true; }; -Output.prototype.get_code = function(end_with_newline, eol) { +Output.prototype.get_code = function(eol) { var sweet_code = this.__lines.join('\n').replace(/[\r\n\t ]+$/, ''); - if (end_with_newline) { + if (this._end_with_newline) { sweet_code += '\n'; } @@ -461,7 +472,8 @@ module.exports.Output = Output; /***/ }), /* 3 */, /* 4 */, -/* 5 */ +/* 5 */, +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -509,7 +521,7 @@ function Options(options, merge_child_field) { this.indent_level = this._get_number('indent_level'); this.preserve_newlines = this._get_boolean('preserve_newlines', true); - this.max_preserve_newlines = this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); + this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); if (!this.preserve_newlines) { this.max_preserve_newlines = 0; } @@ -520,16 +532,6 @@ function Options(options, merge_child_field) { this.indent_size = 1; } - this.indent_string = this.indent_char; - if (this.indent_size > 1) { - this.indent_string = new Array(this.indent_size + 1).join(this.indent_char); - } - // Set to null to continue support for auto detection of base indent level. - this.base_indent_string = null; - if (this.indent_level > 0) { - this.base_indent_string = new Array(this.indent_level + 1).join(this.indent_string); - } - // Backwards compat with 1.3.x this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char')); @@ -577,6 +579,22 @@ Options.prototype._get_number = function(name, default_value) { }; Options.prototype._get_selection = function(name, selection_list, default_value) { + var result = this._get_selection_list(name, selection_list, default_value); + if (result.length !== 1) { + throw new Error( + "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); + } + + return result[0]; +}; + + +Options.prototype._get_selection_list = function(name, selection_list, default_value) { + if (!selection_list || selection_list.length === 0) { + throw new Error("Selection list cannot be empty."); + } + default_value = default_value || [selection_list[0]]; if (!this._is_valid_selection(default_value, selection_list)) { throw new Error("Invalid Default Value!"); @@ -585,7 +603,8 @@ Options.prototype._get_selection = function(name, selection_list, default_value) var result = this._get_array(name, default_value); if (!this._is_valid_selection(result, selection_list)) { throw new Error( - "Invalid Option Value: The option '" + name + "' must be one of the following values\n" + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); + "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); } return result; @@ -638,8 +657,8 @@ module.exports.normalizeOpts = _normalizeOpts; module.exports.mergeOpts = _mergeOpts; /***/ }), -/* 6 */, -/* 7 */ +/* 7 */, +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -793,7 +812,6 @@ InputScanner.prototype.lookBack = function(testVal) { module.exports.InputScanner = InputScanner; /***/ }), -/* 8 */, /* 9 */, /* 10 */, /* 11 */, @@ -877,7 +895,7 @@ module.exports = css_beautify; var Options = __webpack_require__(14).Options; var Output = __webpack_require__(2).Output; -var InputScanner = __webpack_require__(7).InputScanner; +var InputScanner = __webpack_require__(8).InputScanner; var lineBreak = /\r\n|[\r\n]/; var allLineBreaks = /\r\n|[\r\n]/g; @@ -1020,15 +1038,9 @@ Beautifier.prototype.beautify = function() { source_text = source_text.replace(allLineBreaks, '\n'); // reset - var baseIndentString = ''; - if (this._options.base_indent_string) { - baseIndentString = this._options.base_indent_string; - } else { - var match = source_text.match(/^[\t ]*/); - baseIndentString = match[0]; - } + var baseIndentString = source_text.match(/^[\t ]*/)[0]; - this._output = new Output(this._options.indent_string, baseIndentString); + this._output = new Output(this._options, baseIndentString); this._input = new InputScanner(source_text); this._indentLevel = 0; this._nestedLevel = 0; @@ -1283,7 +1295,7 @@ Beautifier.prototype.beautify = function() { } } - var sweetCode = this._output.get_code(this._options.end_with_newline, eol); + var sweetCode = this._output.get_code(eol); return sweetCode; }; @@ -1325,7 +1337,7 @@ module.exports.Beautifier = Beautifier; -var BaseOptions = __webpack_require__(5).Options; +var BaseOptions = __webpack_require__(6).Options; function Options(options) { BaseOptions.call(this, options, 'css'); diff --git a/js/lib/beautify-html.js b/js/lib/beautify-html.js index 1d70794a6..a012973bc 100644 --- a/js/lib/beautify-html.js +++ b/js/lib/beautify-html.js @@ -315,13 +315,24 @@ IndentCache.prototype.get_level_string = function(level) { }; -function Output(indent_string, baseIndentString) { +function Output(options, baseIndentString) { + var indent_string = options.indent_char; + if (options.indent_size > 1) { + indent_string = new Array(options.indent_size + 1).join(options.indent_char); + } + + // Set to null to continue support for auto detection of base indent level. baseIndentString = baseIndentString || ''; + if (options.indent_level > 0) { + baseIndentString = new Array(options.indent_level + 1).join(indent_string); + } + this.__indent_cache = new IndentCache(baseIndentString, indent_string); this.__alignment_cache = new IndentCache('', ' '); this.baseIndentLength = baseIndentString.length; this.indent_length = indent_string.length; this.raw = false; + this._end_with_newline = options.end_with_newline; this.__lines = []; this.previous_line = null; @@ -369,10 +380,10 @@ Output.prototype.add_new_line = function(force_newline) { return true; }; -Output.prototype.get_code = function(end_with_newline, eol) { +Output.prototype.get_code = function(eol) { var sweet_code = this.__lines.join('\n').replace(/[\r\n\t ]+$/, ''); - if (end_with_newline) { + if (this._end_with_newline) { sweet_code += '\n'; } @@ -469,9 +480,69 @@ Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) { module.exports.Output = Output; /***/ }), -/* 3 */, +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*jshint node:true */ +/* + + The MIT License (MIT) + + Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + + + +function Token(type, text, newlines, whitespace_before) { + this.type = type; + this.text = text; + + // comments_before are + // comments that have a new line before them + // and may or may not have a newline after + // this is a set of comments before + this.comments_before = null; /* inline comment*/ + + + // this.comments_after = new TokenStream(); // no new line before and newline after + this.newlines = newlines || 0; + this.whitespace_before = whitespace_before || ''; + this.parent = null; + this.next = null; + this.previous = null; + this.opened = null; + this.closed = null; + this.directives = null; +} + + +module.exports.Token = Token; + +/***/ }), /* 4 */, -/* 5 */ +/* 5 */, +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -519,7 +590,7 @@ function Options(options, merge_child_field) { this.indent_level = this._get_number('indent_level'); this.preserve_newlines = this._get_boolean('preserve_newlines', true); - this.max_preserve_newlines = this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); + this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); if (!this.preserve_newlines) { this.max_preserve_newlines = 0; } @@ -530,16 +601,6 @@ function Options(options, merge_child_field) { this.indent_size = 1; } - this.indent_string = this.indent_char; - if (this.indent_size > 1) { - this.indent_string = new Array(this.indent_size + 1).join(this.indent_char); - } - // Set to null to continue support for auto detection of base indent level. - this.base_indent_string = null; - if (this.indent_level > 0) { - this.base_indent_string = new Array(this.indent_level + 1).join(this.indent_string); - } - // Backwards compat with 1.3.x this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char')); @@ -587,6 +648,22 @@ Options.prototype._get_number = function(name, default_value) { }; Options.prototype._get_selection = function(name, selection_list, default_value) { + var result = this._get_selection_list(name, selection_list, default_value); + if (result.length !== 1) { + throw new Error( + "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); + } + + return result[0]; +}; + + +Options.prototype._get_selection_list = function(name, selection_list, default_value) { + if (!selection_list || selection_list.length === 0) { + throw new Error("Selection list cannot be empty."); + } + default_value = default_value || [selection_list[0]]; if (!this._is_valid_selection(default_value, selection_list)) { throw new Error("Invalid Default Value!"); @@ -595,7 +672,8 @@ Options.prototype._get_selection = function(name, selection_list, default_value) var result = this._get_array(name, default_value); if (!this._is_valid_selection(result, selection_list)) { throw new Error( - "Invalid Option Value: The option '" + name + "' must be one of the following values\n" + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); + "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); } return result; @@ -648,8 +726,8 @@ module.exports.normalizeOpts = _normalizeOpts; module.exports.mergeOpts = _mergeOpts; /***/ }), -/* 6 */, -/* 7 */ +/* 7 */, +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -803,7 +881,7 @@ InputScanner.prototype.lookBack = function(testVal) { module.exports.InputScanner = InputScanner; /***/ }), -/* 8 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -837,8 +915,8 @@ module.exports.InputScanner = InputScanner; -var InputScanner = __webpack_require__(7).InputScanner; -var Token = __webpack_require__(9).Token; +var InputScanner = __webpack_require__(8).InputScanner; +var Token = __webpack_require__(3).Token; var TokenStream = __webpack_require__(10).TokenStream; var TOKEN = { @@ -960,66 +1038,6 @@ Tokenizer.prototype._readWhitespace = function() { module.exports.Tokenizer = Tokenizer; module.exports.TOKEN = TOKEN; -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function Token(type, text, newlines, whitespace_before) { - this.type = type; - this.text = text; - - // comments_before are - // comments that have a new line before them - // and may or may not have a newline after - // this is a set of comments before - this.comments_before = null; /* inline comment*/ - - - // this.comments_after = new TokenStream(); // no new line before and newline after - this.newlines = newlines || 0; - this.whitespace_before = whitespace_before || ''; - this.parent = null; - this.next = null; - this.previous = null; - this.opened = null; - this.closed = null; - this.directives = null; -} - - -module.exports.Token = Token; - /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { @@ -1262,15 +1280,15 @@ var TOKEN = __webpack_require__(18).TOKEN; var lineBreak = /\r\n|[\r\n]/; var allLineBreaks = /\r\n|[\r\n]/g; -var Printer = function(indent_string, base_indent_string, wrap_line_length, max_preserve_newlines, preserve_newlines) { //handles input/output and some other printing functions +var Printer = function(options, base_indent_string) { //handles input/output and some other printing functions this.indent_level = 0; this.alignment_size = 0; - this.wrap_line_length = wrap_line_length; - this.max_preserve_newlines = max_preserve_newlines; - this.preserve_newlines = preserve_newlines; + this.wrap_line_length = options.wrap_line_length; + this.max_preserve_newlines = options.max_preserve_newlines; + this.preserve_newlines = options.preserve_newlines; - this._output = new Output(indent_string, base_indent_string); + this._output = new Output(options, base_indent_string); }; @@ -1489,13 +1507,8 @@ Beautifier.prototype.beautify = function() { source_text = source_text.replace(allLineBreaks, '\n'); var baseIndentString = ''; - if (this._options.base_indent_string) { - baseIndentString = this._options.base_indent_string; - } else { - // Including commented out text would change existing beautifier behavior for v1.8.1 to autodetect base indent. - // var match = source_text.match(/^[\t ]*/); - // baseIndentString = match[0]; - } + // Including commented out text would change existing html beautifier behavior to autodetect base indent. + // baseIndentString = source_text.match(/^[\t ]*/)[0]; var last_token = { text: '', @@ -1504,8 +1517,7 @@ Beautifier.prototype.beautify = function() { var last_tag_token = new TagOpenParserToken(); - var printer = new Printer(this._options.indent_string, baseIndentString, - this._options.wrap_line_length, this._options.max_preserve_newlines, this._options.preserve_newlines); + var printer = new Printer(this._options, baseIndentString); var tokens = new Tokenizer(source_text, this._options).tokenize(); this._tag_stack = new TagStack(printer); @@ -1533,7 +1545,7 @@ Beautifier.prototype.beautify = function() { raw_token = tokens.next(); } - var sweet_code = printer._output.get_code(this._options.end_with_newline, eol); + var sweet_code = printer._output.get_code(eol); return sweet_code; }; @@ -2002,7 +2014,7 @@ module.exports.Beautifier = Beautifier; -var BaseOptions = __webpack_require__(5).Options; +var BaseOptions = __webpack_require__(6).Options; function Options(options) { BaseOptions.call(this, options, 'html'); @@ -2013,7 +2025,7 @@ function Options(options) { this.indent_handlebars = this._get_boolean('indent_handlebars', true); this.wrap_attributes = this._get_selection('wrap_attributes', - ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple'])[0]; + ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple']); this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size); this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']); @@ -2090,8 +2102,8 @@ module.exports.Options = Options; -var BaseTokenizer = __webpack_require__(8).Tokenizer; -var BASETOKEN = __webpack_require__(8).TOKEN; +var BaseTokenizer = __webpack_require__(9).Tokenizer; +var BASETOKEN = __webpack_require__(9).TOKEN; var Directives = __webpack_require__(11).Directives; var TOKEN = { diff --git a/js/lib/beautify.js b/js/lib/beautify.js index 65453ba0f..05a19aa3a 100644 --- a/js/lib/beautify.js +++ b/js/lib/beautify.js @@ -255,12 +255,13 @@ module.exports = js_beautify; var Output = __webpack_require__(2).Output; -var acorn = __webpack_require__(3); -var Options = __webpack_require__(4).Options; -var Tokenizer = __webpack_require__(6).Tokenizer; -var line_starters = __webpack_require__(6).line_starters; -var positionable_operators = __webpack_require__(6).positionable_operators; -var TOKEN = __webpack_require__(6).TOKEN; +var Token = __webpack_require__(3).Token; +var acorn = __webpack_require__(4); +var Options = __webpack_require__(5).Options; +var Tokenizer = __webpack_require__(7).Tokenizer; +var line_starters = __webpack_require__(7).line_starters; +var positionable_operators = __webpack_require__(7).positionable_operators; +var TOKEN = __webpack_require__(7).TOKEN; function remove_redundant_indentation(output, frame) { // This implementation is effective but has some issues: @@ -295,6 +296,16 @@ function generateMapFromStrings(list) { return result; } +function reserved_word(token, word) { + return token && token.type === TOKEN.RESERVED && token.text === word; +} + +function reserved_array(token, words) { + return token && token.type === TOKEN.RESERVED && in_array(token.text, words); +} +// Unsure of what they mean, but they work. Worth cleaning up in future. +var special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async']; + var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline']; // Generate map from array @@ -363,9 +374,6 @@ function each_line_matches_indent(lines, indent) { return true; } -function is_special_word(word) { - return in_array(word, ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async']); -} function Beautifier(source_text, options) { options = options || {}; @@ -373,7 +381,6 @@ function Beautifier(source_text, options) { this._output = null; this._tokens = null; - this._last_type = null; this._last_last_text = null; this._flags = null; this._previous_flags = null; @@ -395,7 +402,7 @@ Beautifier.prototype.create_flags = function(flags_base, mode) { var next_flags = { mode: mode, parent: flags_base, - last_text: flags_base ? flags_base.last_text : '', // last token text + last_token: flags_base ? flags_base.last_token : new Token(TOKEN.START_BLOCK, ''), // last token text last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed declaration_statement: false, declaration_assignment: false, @@ -418,19 +425,10 @@ Beautifier.prototype.create_flags = function(flags_base, mode) { }; Beautifier.prototype._reset = function(source_text) { - var baseIndentString = ''; + var baseIndentString = source_text.match(/^[\t ]*/)[0]; - if (this._options.base_indent_string) { - baseIndentString = this._options.base_indent_string; - } else { - var match = source_text.match(/^[\t ]*/); - baseIndentString = match[0]; - } - - - this._last_type = TOKEN.START_BLOCK; // last token type this._last_last_text = ''; // pre-last token text - this._output = new Output(this._options.indent_string, baseIndentString); + this._output = new Output(this._options, baseIndentString); // If testing the ignore directive, start with output disable set to true this._output.raw = this._options.test_output_raw; @@ -474,14 +472,13 @@ Beautifier.prototype.beautify = function() { while (current_token) { this.handle_token(current_token); - this._last_last_text = this._flags.last_text; - this._last_type = current_token.type; - this._flags.last_text = current_token.text; + this._last_last_text = this._flags.last_token.text; + this._flags.last_token = current_token; current_token = this._tokens.next(); } - sweet_code = this._output.get_code(this._options.end_with_newline, eol); + sweet_code = this._output.get_code(eol); return sweet_code; }; @@ -572,12 +569,12 @@ Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, f } var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap; - var operatorLogicApplies = in_array(this._flags.last_text, positionable_operators) || + var operatorLogicApplies = in_array(this._flags.last_token.text, positionable_operators) || in_array(current_token.text, positionable_operators); if (operatorLogicApplies) { var shouldPrintOperatorNewline = ( - in_array(this._flags.last_text, positionable_operators) && + in_array(this._flags.last_token.text, positionable_operators) && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE) ) || in_array(current_token.text, positionable_operators); @@ -587,7 +584,7 @@ Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, f if (shouldPreserveOrForce) { this.print_newline(false, true); } else if (this._options.wrap_line_length) { - if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, newline_restricted_tokens)) { + if (reserved_array(this._flags.last_token, newline_restricted_tokens)) { // These tokens should never have a newline inserted // between them and the following expression. return; @@ -602,10 +599,10 @@ Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, f Beautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) { if (!preserve_statement_flags) { - if (this._flags.last_text !== ';' && this._flags.last_text !== ',' && this._flags.last_text !== '=' && (this._last_type !== TOKEN.OPERATOR || this._flags.last_text === '--' || this._flags.last_text === '++')) { + if (this._flags.last_token.text !== ';' && this._flags.last_token.text !== ',' && this._flags.last_token.text !== '=' && (this._flags.last_token.type !== TOKEN.OPERATOR || this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) { var next_token = this._tokens.peek(); while (this._flags.mode === MODE.Statement && - !(this._flags.if_block && next_token && next_token.type === TOKEN.RESERVED && next_token.text === 'else') && + !(this._flags.if_block && reserved_word(next_token, 'else')) && !this._flags.do_block) { this.restore_mode(); } @@ -634,7 +631,7 @@ Beautifier.prototype.print_token = function(current_token, printable_token) { return; } - if (this._options.comma_first && this._last_type === TOKEN.COMMA && + if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN.COMMA && this._output.just_added_newline()) { if (this._output.previous_line.last() === ',') { var popped = this._output.previous_line.pop(); @@ -695,24 +692,24 @@ Beautifier.prototype.restore_mode = function() { Beautifier.prototype.start_of_object_property = function() { return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && ( - (this._flags.last_text === ':' && this._flags.ternary_depth === 0) || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['get', 'set']))); + (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set']))); }; Beautifier.prototype.start_of_statement = function(current_token) { var start = false; - start = start || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD); - start = start || (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'do'); - start = start || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, newline_restricted_tokens) && !current_token.newlines); - start = start || (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'else' && - !(current_token.type === TOKEN.RESERVED && current_token.text === 'if' && !current_token.comments_before)); - start = start || (this._last_type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional)); - start = start || (this._last_type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement && + start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD; + start = start || reserved_word(this._flags.last_token, 'do'); + start = start || (reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines); + start = start || reserved_word(this._flags.last_token, 'else') && + !(reserved_word(current_token, 'if') && !current_token.comments_before); + start = start || (this._flags.last_token.type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional)); + start = start || (this._flags.last_token.type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement && !this._flags.in_case && !(current_token.text === '--' || current_token.text === '++') && this._last_last_text !== 'function' && current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED); start = start || (this._flags.mode === MODE.ObjectLiteral && ( - (this._flags.last_text === ':' && this._flags.ternary_depth === 0) || (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['get', 'set'])))); + (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set']))); if (start) { this.set_mode(MODE.Statement); @@ -725,9 +722,8 @@ Beautifier.prototype.start_of_statement = function(current_token) { // if (a) if (b) if(c) d(); else e(); else f(); if (!this.start_of_object_property()) { this.allow_wrap_or_preserved_newline(current_token, - current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['do', 'for', 'if', 'while'])); + reserved_array(current_token, ['do', 'for', 'if', 'while'])); } - return true; } return false; @@ -742,10 +738,10 @@ Beautifier.prototype.handle_start_expr = function(current_token) { var next_mode = MODE.Expression; if (current_token.text === '[') { - if (this._last_type === TOKEN.WORD || this._flags.last_text === ')') { + if (this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === ')') { // this is array index specifier, break immediately // a[x], fn()[x] - if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, line_starters)) { + if (reserved_array(this._flags.last_token, line_starters)) { this._output.space_before_token = true; } this.set_mode(next_mode); @@ -759,8 +755,8 @@ Beautifier.prototype.handle_start_expr = function(current_token) { next_mode = MODE.ArrayLiteral; if (is_array(this._flags.mode)) { - if (this._flags.last_text === '[' || - (this._flags.last_text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) { + if (this._flags.last_token.text === '[' || + (this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) { // ], [ goes to new line // }, [ goes to new line if (!this._options.keep_array_indentation) { @@ -769,33 +765,33 @@ Beautifier.prototype.handle_start_expr = function(current_token) { } } - if (!in_array(this._last_type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) { + if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) { this._output.space_before_token = true; } } else { - if (this._last_type === TOKEN.RESERVED) { - if (this._flags.last_text === 'for') { + if (this._flags.last_token.type === TOKEN.RESERVED) { + if (this._flags.last_token.text === 'for') { this._output.space_before_token = this._options.space_before_conditional; next_mode = MODE.ForInitializer; - } else if (in_array(this._flags.last_text, ['if', 'while'])) { + } else if (in_array(this._flags.last_token.text, ['if', 'while'])) { this._output.space_before_token = this._options.space_before_conditional; next_mode = MODE.Conditional; } else if (in_array(this._flags.last_word, ['await', 'async'])) { // Should be a space between await and an IIFE, or async and an arrow function this._output.space_before_token = true; - } else if (this._flags.last_text === 'import' && current_token.whitespace_before === '') { + } else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') { this._output.space_before_token = false; - } else if (in_array(this._flags.last_text, line_starters) || this._flags.last_text === 'catch') { + } else if (in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') { this._output.space_before_token = true; } - } else if (this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) { + } else if (this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) { // Support of this kind of newline preservation. // a = (b && // (c || d)); if (!this.start_of_object_property()) { this.allow_wrap_or_preserved_newline(current_token); } - } else if (this._last_type === TOKEN.WORD) { + } else if (this._flags.last_token.type === TOKEN.WORD) { this._output.space_before_token = false; } else { // Support preserving wrapped arrow function expressions @@ -808,8 +804,8 @@ Beautifier.prototype.handle_start_expr = function(current_token) { // function() vs function () // yield*() vs yield* () // function*() vs function* () - if ((this._last_type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) || - (this._flags.last_text === '*' && + if ((this._flags.last_token.type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) || + (this._flags.last_token.text === '*' && (in_array(this._last_last_text, ['function', 'yield']) || (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) { @@ -818,9 +814,9 @@ Beautifier.prototype.handle_start_expr = function(current_token) { } - if (this._flags.last_text === ';' || this._last_type === TOKEN.START_BLOCK) { + if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN.START_BLOCK) { this.print_newline(); - } else if (this._last_type === TOKEN.END_EXPR || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.END_BLOCK || this._flags.last_text === '.' || this._last_type === TOKEN.COMMA) { + } else if (this._flags.last_token.type === TOKEN.END_EXPR || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.END_BLOCK || this._flags.last_token.text === '.' || this._flags.last_token.type === TOKEN.COMMA) { // do nothing on (( and )( and ][ and ]( and .( // TODO: Consider whether forcing this is required. Review failing tests when removed. this.allow_wrap_or_preserved_newline(current_token, current_token.newlines); @@ -851,7 +847,7 @@ Beautifier.prototype.handle_end_expr = function(current_token) { } if (this._options.space_in_paren) { - if (this._last_type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) { + if (this._flags.last_token.type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) { // () [] no inner space in empty parens like these, ever, ref #320 this._output.trim(); this._output.space_before_token = false; @@ -883,7 +879,10 @@ Beautifier.prototype.handle_start_block = function(current_token) { // Check if this is should be treated as a ObjectLiteral var next_token = this._tokens.peek(); var second_token = this._tokens.peek(1); - if (second_token && ( + if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN.END_EXPR) { + this.set_mode(MODE.BlockStatement); + this._flags.in_case_statement = true; + } else if (second_token && ( (in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) || (in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED])) )) { @@ -894,11 +893,11 @@ Beautifier.prototype.handle_start_block = function(current_token) { } else { this.set_mode(MODE.BlockStatement); } - } else if (this._last_type === TOKEN.OPERATOR && this._flags.last_text === '=>') { + } else if (this._flags.last_token.type === TOKEN.OPERATOR && this._flags.last_token.text === '=>') { // arrow function: (param1, paramN) => { statements } this.set_mode(MODE.BlockStatement); - } else if (in_array(this._last_type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) || - (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['return', 'throw', 'import', 'default'])) + } else if (in_array(this._flags.last_token.type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) || + reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default']) ) { // Detecting shorthand function syntax is difficult by scanning forward, // so check the surrounding context. @@ -911,7 +910,7 @@ Beautifier.prototype.handle_start_block = function(current_token) { var empty_braces = !next_token.comments_before && next_token.text === '}'; var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' && - this._last_type === TOKEN.END_EXPR; + this._flags.last_token.type === TOKEN.END_EXPR; if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so { @@ -933,28 +932,28 @@ Beautifier.prototype.handle_start_block = function(current_token) { if ((this._options.brace_style === "expand" || (this._options.brace_style === "none" && current_token.newlines)) && !this._flags.inline_frame) { - if (this._last_type !== TOKEN.OPERATOR && + if (this._flags.last_token.type !== TOKEN.OPERATOR && (empty_anonymous_function || - this._last_type === TOKEN.EQUALS || - (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text) && this._flags.last_text !== 'else'))) { + this._flags.last_token.type === TOKEN.EQUALS || + (reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) { this._output.space_before_token = true; } else { this.print_newline(false, true); } } else { // collapse || inline_frame - if (is_array(this._previous_flags.mode) && (this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.COMMA)) { - if (this._last_type === TOKEN.COMMA || this._options.space_in_paren) { + if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.COMMA)) { + if (this._flags.last_token.type === TOKEN.COMMA || this._options.space_in_paren) { this._output.space_before_token = true; } - if (this._last_type === TOKEN.COMMA || (this._last_type === TOKEN.START_EXPR && this._flags.inline_frame)) { + if (this._flags.last_token.type === TOKEN.COMMA || (this._flags.last_token.type === TOKEN.START_EXPR && this._flags.inline_frame)) { this.allow_wrap_or_preserved_newline(current_token); this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame; this._flags.multiline_frame = false; } } - if (this._last_type !== TOKEN.OPERATOR && this._last_type !== TOKEN.START_EXPR) { - if (this._last_type === TOKEN.START_BLOCK && !this._flags.inline_frame) { + if (this._flags.last_token.type !== TOKEN.OPERATOR && this._flags.last_token.type !== TOKEN.START_EXPR) { + if (this._flags.last_token.type === TOKEN.START_BLOCK && !this._flags.inline_frame) { this.print_newline(); } else { this._output.space_before_token = true; @@ -973,7 +972,7 @@ Beautifier.prototype.handle_end_block = function(current_token) { this.restore_mode(); } - var empty_braces = this._last_type === TOKEN.START_BLOCK; + var empty_braces = this._flags.last_token.type === TOKEN.START_BLOCK; if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first this._output.space_before_token = true; @@ -1015,13 +1014,13 @@ Beautifier.prototype.handle_word = function(current_token) { if (this.start_of_statement(current_token)) { // The conditional starts the statement if appropriate. - if (this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) { + if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) { this._flags.declaration_statement = true; } } else if (current_token.newlines && !is_expression(this._flags.mode) && - (this._last_type !== TOKEN.OPERATOR || (this._flags.last_text === '--' || this._flags.last_text === '++')) && - this._last_type !== TOKEN.EQUALS && - (this._options.preserve_newlines || !(this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['var', 'let', 'const', 'set', 'get'])))) { + (this._flags.last_token.type !== TOKEN.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) && + this._flags.last_token.type !== TOKEN.EQUALS && + (this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) { this.handle_whitespace_and_comments(current_token); this.print_newline(); } else { @@ -1029,7 +1028,7 @@ Beautifier.prototype.handle_word = function(current_token) { } if (this._flags.do_block && !this._flags.do_while) { - if (current_token.type === TOKEN.RESERVED && current_token.text === 'while') { + if (reserved_word(current_token, 'while')) { // do {} ## while () this._output.space_before_token = true; this.print_token(current_token); @@ -1048,7 +1047,7 @@ Beautifier.prototype.handle_word = function(current_token) { // Bare/inline ifs are tricky // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e(); if (this._flags.if_block) { - if (!this._flags.else_block && (current_token.type === TOKEN.RESERVED && current_token.text === 'else')) { + if (!this._flags.else_block && reserved_word(current_token, 'else')) { this._flags.else_block = true; } else { while (this._flags.mode === MODE.Statement) { @@ -1059,7 +1058,7 @@ Beautifier.prototype.handle_word = function(current_token) { } } - if (current_token.type === TOKEN.RESERVED && (current_token.text === 'case' || (current_token.text === 'default' && this._flags.in_case_statement))) { + if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) { this.print_newline(); if (this._flags.case_body || this._options.jslint_happy) { // switch cases following one another @@ -1068,19 +1067,18 @@ Beautifier.prototype.handle_word = function(current_token) { } this.print_token(current_token); this._flags.in_case = true; - this._flags.in_case_statement = true; return; } - if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) { + if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) { if (!this.start_of_object_property()) { this.allow_wrap_or_preserved_newline(current_token); } } - if (current_token.type === TOKEN.RESERVED && current_token.text === 'function') { - if (in_array(this._flags.last_text, ['}', ';']) || - (this._output.just_added_newline() && !(in_array(this._flags.last_text, ['(', '[', '{', ':', '=', ',']) || this._last_type === TOKEN.OPERATOR))) { + if (reserved_word(current_token, 'function')) { + if (in_array(this._flags.last_token.text, ['}', ';']) || + (this._output.just_added_newline() && !(in_array(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN.OPERATOR))) { // make sure there is a nice clean space of at least one blank line // before a new function definition if (!this._output.just_added_blankline() && !current_token.comments_before) { @@ -1088,17 +1086,16 @@ Beautifier.prototype.handle_word = function(current_token) { this.print_newline(true); } } - if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD) { - if (this._last_type === TOKEN.RESERVED && ( - in_array(this._flags.last_text, ['get', 'set', 'new', 'export']) || - in_array(this._flags.last_text, newline_restricted_tokens))) { + if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD) { + if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) || + reserved_array(this._flags.last_token, newline_restricted_tokens)) { this._output.space_before_token = true; - } else if (this._last_type === TOKEN.RESERVED && this._flags.last_text === 'default' && this._last_last_text === 'export') { + } else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') { this._output.space_before_token = true; } else { this.print_newline(); } - } else if (this._last_type === TOKEN.OPERATOR || this._flags.last_text === '=') { + } else if (this._flags.last_token.type === TOKEN.OPERATOR || this._flags.last_token.text === '=') { // foo = function this._output.space_before_token = true; } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) { @@ -1114,11 +1111,11 @@ Beautifier.prototype.handle_word = function(current_token) { var prefix = 'NONE'; - if (this._last_type === TOKEN.END_BLOCK) { + if (this._flags.last_token.type === TOKEN.END_BLOCK) { if (this._previous_flags.inline_frame) { prefix = 'SPACE'; - } else if (!(current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['else', 'catch', 'finally', 'from']))) { + } else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) { prefix = 'NEWLINE'; } else { if (this._options.brace_style === "expand" || @@ -1130,31 +1127,31 @@ Beautifier.prototype.handle_word = function(current_token) { this._output.space_before_token = true; } } - } else if (this._last_type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) { + } else if (this._flags.last_token.type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) { // TODO: Should this be for STATEMENT as well? prefix = 'NEWLINE'; - } else if (this._last_type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) { + } else if (this._flags.last_token.type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) { prefix = 'SPACE'; - } else if (this._last_type === TOKEN.STRING) { + } else if (this._flags.last_token.type === TOKEN.STRING) { prefix = 'NEWLINE'; - } else if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD || - (this._flags.last_text === '*' && + } else if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || + (this._flags.last_token.text === '*' && (in_array(this._last_last_text, ['function', 'yield']) || (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) { prefix = 'SPACE'; - } else if (this._last_type === TOKEN.START_BLOCK) { + } else if (this._flags.last_token.type === TOKEN.START_BLOCK) { if (this._flags.inline_frame) { prefix = 'SPACE'; } else { prefix = 'NEWLINE'; } - } else if (this._last_type === TOKEN.END_EXPR) { + } else if (this._flags.last_token.type === TOKEN.END_EXPR) { this._output.space_before_token = true; prefix = 'NEWLINE'; } - if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, line_starters) && this._flags.last_text !== ')') { - if (this._flags.inline_frame || this._flags.last_text === 'else' || this._flags.last_text === 'export') { + if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') { + if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') { prefix = 'SPACE'; } else { prefix = 'NEWLINE'; @@ -1162,8 +1159,8 @@ Beautifier.prototype.handle_word = function(current_token) { } - if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['else', 'catch', 'finally'])) { - if ((!(this._last_type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) || + if (reserved_array(current_token, ['else', 'catch', 'finally'])) { + if ((!(this._flags.last_token.type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) || this._options.brace_style === "expand" || this._options.brace_style === "end-expand" || (this._options.brace_style === "none" && current_token.newlines)) && @@ -1180,28 +1177,28 @@ Beautifier.prototype.handle_word = function(current_token) { this._output.space_before_token = true; } } else if (prefix === 'NEWLINE') { - if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) { + if (reserved_array(this._flags.last_token, special_words)) { // no newline between 'return nnn' this._output.space_before_token = true; - } else if (this._last_type !== TOKEN.END_EXPR) { - if ((this._last_type !== TOKEN.START_EXPR || !(current_token.type === TOKEN.RESERVED && in_array(current_token.text, ['var', 'let', 'const']))) && this._flags.last_text !== ':') { + } else if (this._flags.last_token.type !== TOKEN.END_EXPR) { + if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') { // no need to force newline on 'var': for (var x = 0...) - if (current_token.type === TOKEN.RESERVED && current_token.text === 'if' && this._flags.last_text === 'else') { + if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) { // no newline for } else if { this._output.space_before_token = true; } else { this.print_newline(); } } - } else if (current_token.type === TOKEN.RESERVED && in_array(current_token.text, line_starters) && this._flags.last_text !== ')') { + } else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') { this.print_newline(); } - } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_text === ',' && this._last_last_text === '}') { + } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') { this.print_newline(); // }, in lists get a newline treatment } else if (prefix === 'SPACE') { this._output.space_before_token = true; } - if (this._last_type === TOKEN.WORD || this._last_type === TOKEN.RESERVED) { + if (current_token.previous && (current_token.previous.type === TOKEN.WORD || current_token.previous.type === TOKEN.RESERVED)) { this._output.space_before_token = true; } this.print_token(current_token); @@ -1214,7 +1211,7 @@ Beautifier.prototype.handle_word = function(current_token) { this._flags.if_block = true; } else if (current_token.text === 'import') { this._flags.import_block = true; - } else if (this._flags.import_block && current_token.type === TOKEN.RESERVED && current_token.text === 'from') { + } else if (this._flags.import_block && reserved_word(current_token, 'from')) { this._flags.import_block = false; } } @@ -1231,7 +1228,7 @@ Beautifier.prototype.handle_semicolon = function(current_token) { var next_token = this._tokens.peek(); while (this._flags.mode === MODE.Statement && - !(this._flags.if_block && next_token && next_token.type === TOKEN.RESERVED && next_token.text === 'else') && + !(this._flags.if_block && reserved_word(next_token, 'else')) && !this._flags.do_block) { this.restore_mode(); } @@ -1250,9 +1247,9 @@ Beautifier.prototype.handle_string = function(current_token) { this._output.space_before_token = true; } else { this.handle_whitespace_and_comments(current_token); - if (this._last_type === TOKEN.RESERVED || this._last_type === TOKEN.WORD || this._flags.inline_frame) { + if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.inline_frame) { this._output.space_before_token = true; - } else if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR || this._last_type === TOKEN.EQUALS || this._last_type === TOKEN.OPERATOR) { + } else if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) { if (!this.start_of_object_property()) { this.allow_wrap_or_preserved_newline(current_token); } @@ -1317,13 +1314,13 @@ Beautifier.prototype.handle_comma = function(current_token) { Beautifier.prototype.handle_operator = function(current_token) { var isGeneratorAsterisk = current_token.text === '*' && - ((this._last_type === TOKEN.RESERVED && in_array(this._flags.last_text, ['function', 'yield'])) || - (in_array(this._last_type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON])) + (reserved_array(this._flags.last_token, ['function', 'yield']) || + (in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON])) ); var isUnary = in_array(current_token.text, ['-', '+']) && ( - in_array(this._last_type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) || - in_array(this._flags.last_text, line_starters) || - this._flags.last_text === ',' + in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) || + in_array(this._flags.last_token.text, line_starters) || + this._flags.last_token.text === ',' ); if (this.start_of_statement(current_token)) { @@ -1333,7 +1330,7 @@ Beautifier.prototype.handle_operator = function(current_token) { this.handle_whitespace_and_comments(current_token, preserve_statement_flags); } - if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) { + if (reserved_array(this._flags.last_token, special_words)) { // "return" had a special handling in TK_WORD. Now we need to return the favor this._output.space_before_token = true; this.print_token(current_token); @@ -1341,7 +1338,7 @@ Beautifier.prototype.handle_operator = function(current_token) { } // hack for actionscript's import .*; - if (current_token.text === '*' && this._last_type === TOKEN.DOT) { + if (current_token.text === '*' && this._flags.last_token.type === TOKEN.DOT) { this.print_token(current_token); return; } @@ -1354,7 +1351,7 @@ Beautifier.prototype.handle_operator = function(current_token) { // Allow line wrapping between operators when operator_position is // set to before or preserve - if (this._last_type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) { + if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) { this.allow_wrap_or_preserved_newline(current_token); } @@ -1446,11 +1443,11 @@ Beautifier.prototype.handle_operator = function(current_token) { space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]); } else if (current_token.text === '...') { this.allow_wrap_or_preserved_newline(current_token); - space_before = this._last_type === TOKEN.START_BLOCK; + space_before = this._flags.last_token.type === TOKEN.START_BLOCK; space_after = false; } else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) { // unary operators (and binary +/- pretending to be unary) special cases - if (this._last_type === TOKEN.COMMA || this._last_type === TOKEN.START_EXPR) { + if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR) { this.allow_wrap_or_preserved_newline(current_token); } @@ -1463,32 +1460,32 @@ Beautifier.prototype.handle_operator = function(current_token) { this.print_newline(false, true); } - if (this._flags.last_text === ';' && is_expression(this._flags.mode)) { + if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) { // for (;; ++i) // ^^^ space_before = true; } - if (this._last_type === TOKEN.RESERVED) { + if (this._flags.last_token.type === TOKEN.RESERVED) { space_before = true; - } else if (this._last_type === TOKEN.END_EXPR) { - space_before = !(this._flags.last_text === ']' && (current_token.text === '--' || current_token.text === '++')); - } else if (this._last_type === TOKEN.OPERATOR) { + } else if (this._flags.last_token.type === TOKEN.END_EXPR) { + space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++')); + } else if (this._flags.last_token.type === TOKEN.OPERATOR) { // a++ + ++b; // a - -b - space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_text, ['--', '-', '++', '+']); + space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_token.text, ['--', '-', '++', '+']); // + and - are not unary when preceeded by -- or ++ operator // a-- + b // a * +b // a - -b - if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_text, ['--', '++'])) { + if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_token.text, ['--', '++'])) { space_after = true; } } if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) && - (this._flags.last_text === '{' || this._flags.last_text === ';')) { + (this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) { // { foo; --i } // foo(); --bar; this.print_newline(); @@ -1585,13 +1582,13 @@ Beautifier.prototype.handle_dot = function(current_token) { this.deindent(); } - if (this._last_type === TOKEN.RESERVED && is_special_word(this._flags.last_text)) { + if (reserved_array(this._flags.last_token, special_words)) { this._output.space_before_token = false; } else { // allow preserved newlines before dots in general // force newlines on dots after close paren when break_chained - for bar().baz() this.allow_wrap_or_preserved_newline(current_token, - this._flags.last_text === ')' && this._options.break_chained_methods); + this._flags.last_token.text === ')' && this._options.break_chained_methods); } this.print_token(current_token); @@ -1766,13 +1763,24 @@ IndentCache.prototype.get_level_string = function(level) { }; -function Output(indent_string, baseIndentString) { +function Output(options, baseIndentString) { + var indent_string = options.indent_char; + if (options.indent_size > 1) { + indent_string = new Array(options.indent_size + 1).join(options.indent_char); + } + + // Set to null to continue support for auto detection of base indent level. baseIndentString = baseIndentString || ''; + if (options.indent_level > 0) { + baseIndentString = new Array(options.indent_level + 1).join(indent_string); + } + this.__indent_cache = new IndentCache(baseIndentString, indent_string); this.__alignment_cache = new IndentCache('', ' '); this.baseIndentLength = baseIndentString.length; this.indent_length = indent_string.length; this.raw = false; + this._end_with_newline = options.end_with_newline; this.__lines = []; this.previous_line = null; @@ -1820,10 +1828,10 @@ Output.prototype.add_new_line = function(force_newline) { return true; }; -Output.prototype.get_code = function(end_with_newline, eol) { +Output.prototype.get_code = function(eol) { var sweet_code = this.__lines.join('\n').replace(/[\r\n\t ]+$/, ''); - if (end_with_newline) { + if (this._end_with_newline) { sweet_code += '\n'; } @@ -1923,6 +1931,66 @@ module.exports.Output = Output; /* 3 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; +/*jshint node:true */ +/* + + The MIT License (MIT) + + Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + + + +function Token(type, text, newlines, whitespace_before) { + this.type = type; + this.text = text; + + // comments_before are + // comments that have a new line before them + // and may or may not have a newline after + // this is a set of comments before + this.comments_before = null; /* inline comment*/ + + + // this.comments_after = new TokenStream(); // no new line before and newline after + this.newlines = newlines || 0; + this.whitespace_before = whitespace_before || ''; + this.parent = null; + this.next = null; + this.previous = null; + this.opened = null; + this.closed = null; + this.directives = null; +} + + +module.exports.Token = Token; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* jshint node: true, curly: false */ // Parts of this section of code is taken from acorn. @@ -1982,7 +2050,7 @@ exports.lineBreak = new RegExp('\r\n|' + exports.newline.source); exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); /***/ }), -/* 4 */ +/* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2016,7 +2084,7 @@ exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); -var BaseOptions = __webpack_require__(5).Options; +var BaseOptions = __webpack_require__(6).Options; var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline']; @@ -2038,7 +2106,7 @@ function Options(options) { //preserve-inline in delimited string will trigger brace_preserve_inline, everything //else is considered a brace_style and the last one only will have an effect - var brace_style_split = this._get_selection('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']); + var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']); this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option this.brace_style = "collapse"; @@ -2062,7 +2130,7 @@ function Options(options) { this.unescape_strings = this._get_boolean('unescape_strings'); this.e4x = this._get_boolean('e4x'); this.comma_first = this._get_boolean('comma_first'); - this.operator_position = this._get_selection('operator_position', validPositionValues)[0]; + this.operator_position = this._get_selection('operator_position', validPositionValues); // For testing of beautify preserve:start directive this.test_output_raw = this._get_boolean('test_output_raw'); @@ -2079,7 +2147,7 @@ Options.prototype = new BaseOptions(); module.exports.Options = Options; /***/ }), -/* 5 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2127,7 +2195,7 @@ function Options(options, merge_child_field) { this.indent_level = this._get_number('indent_level'); this.preserve_newlines = this._get_boolean('preserve_newlines', true); - this.max_preserve_newlines = this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); + this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); if (!this.preserve_newlines) { this.max_preserve_newlines = 0; } @@ -2138,16 +2206,6 @@ function Options(options, merge_child_field) { this.indent_size = 1; } - this.indent_string = this.indent_char; - if (this.indent_size > 1) { - this.indent_string = new Array(this.indent_size + 1).join(this.indent_char); - } - // Set to null to continue support for auto detection of base indent level. - this.base_indent_string = null; - if (this.indent_level > 0) { - this.base_indent_string = new Array(this.indent_level + 1).join(this.indent_string); - } - // Backwards compat with 1.3.x this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char')); @@ -2195,6 +2253,22 @@ Options.prototype._get_number = function(name, default_value) { }; Options.prototype._get_selection = function(name, selection_list, default_value) { + var result = this._get_selection_list(name, selection_list, default_value); + if (result.length !== 1) { + throw new Error( + "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); + } + + return result[0]; +}; + + +Options.prototype._get_selection_list = function(name, selection_list, default_value) { + if (!selection_list || selection_list.length === 0) { + throw new Error("Selection list cannot be empty."); + } + default_value = default_value || [selection_list[0]]; if (!this._is_valid_selection(default_value, selection_list)) { throw new Error("Invalid Default Value!"); @@ -2203,7 +2277,8 @@ Options.prototype._get_selection = function(name, selection_list, default_value) var result = this._get_array(name, default_value); if (!this._is_valid_selection(result, selection_list)) { throw new Error( - "Invalid Option Value: The option '" + name + "' must be one of the following values\n" + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); + "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); } return result; @@ -2256,7 +2331,7 @@ module.exports.normalizeOpts = _normalizeOpts; module.exports.mergeOpts = _mergeOpts; /***/ }), -/* 6 */ +/* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2290,11 +2365,11 @@ module.exports.mergeOpts = _mergeOpts; -var InputScanner = __webpack_require__(7).InputScanner; -var BaseTokenizer = __webpack_require__(8).Tokenizer; -var BASETOKEN = __webpack_require__(8).TOKEN; +var InputScanner = __webpack_require__(8).InputScanner; +var BaseTokenizer = __webpack_require__(9).Tokenizer; +var BASETOKEN = __webpack_require__(9).TOKEN; var Directives = __webpack_require__(11).Directives; -var acorn = __webpack_require__(3); +var acorn = __webpack_require__(4); function in_array(what, arr) { return arr.indexOf(what) !== -1; @@ -2796,7 +2871,7 @@ module.exports.positionable_operators = positionable_operators.slice(); module.exports.line_starters = line_starters.slice(); /***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2950,7 +3025,7 @@ InputScanner.prototype.lookBack = function(testVal) { module.exports.InputScanner = InputScanner; /***/ }), -/* 8 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2984,8 +3059,8 @@ module.exports.InputScanner = InputScanner; -var InputScanner = __webpack_require__(7).InputScanner; -var Token = __webpack_require__(9).Token; +var InputScanner = __webpack_require__(8).InputScanner; +var Token = __webpack_require__(3).Token; var TokenStream = __webpack_require__(10).TokenStream; var TOKEN = { @@ -3107,66 +3182,6 @@ Tokenizer.prototype._readWhitespace = function() { module.exports.Tokenizer = Tokenizer; module.exports.TOKEN = TOKEN; -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function Token(type, text, newlines, whitespace_before) { - this.type = type; - this.text = text; - - // comments_before are - // comments that have a new line before them - // and may or may not have a newline after - // this is a set of comments before - this.comments_before = null; /* inline comment*/ - - - // this.comments_after = new TokenStream(); // no new line before and newline after - this.newlines = newlines || 0; - this.whitespace_before = whitespace_before || ''; - this.parent = null; - this.next = null; - this.previous = null; - this.opened = null; - this.closed = null; - this.directives = null; -} - - -module.exports.Token = Token; - /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) {