UNPKG

js-beautify

Version:
1 lines 64.6 kB
!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 n(i){if(e[i])return e[i].exports;var _=e[i]={i:i,l:!1,exports:{}};return t[i].call(_.exports,_,_.exports,n),_.l=!0,_.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var _ in t)n.d(i,_,function(e){return t[e]}.bind(null,_));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){"use strict";t.exports.mergeOpts=function(t,e){var n,i={};for(n in t)n!==e&&(i[n]=t[n]);if(e in t)for(n in t[e])i[n]=t[e][n];return i},t.exports.normalizeOpts=function(t){var e,n={};for(e in t)n[e.replace(/-/g,"_")]=t[e];return n}},function(t,e,n){"use strict";var i="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",_="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_",r=new RegExp("[$@A-Z_a-z"+i+"]"),s=new RegExp("[$0-9A-Z_a-z"+i+_+"]");e.identifier=new RegExp("[$@A-Z_a-z"+i+"][$0-9A-Z_a-z"+i+_+"]*","g"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(t){return r.test(String.fromCharCode(t))},e.isIdentifierChar=function(t){return s.test(String.fromCharCode(t))}},function(t,e,n){"use strict";var i=n(4).InputScanner,_=n(11).Token,r=n(12).TokenStream,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,e){this._input=new i(t),this._options=e||{},this.__tokens=null,this.__newline_count=0,this.__whitespace_before_token="",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};o.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new r,this._reset();for(var e=new _(s.START,""),n=null,i=[],o=new r;e.type!==s.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)o.add(t),t=this._get_next_token(e,n);o.isEmpty()||(t.comments_before=o,o=new r),t.parent=n,this._is_opening(t)?(i.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=i.pop(),t.parent=n),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 n=this._input.read(/.+/g);return n?this._create_token(s.RAW,n):this._create_token(s.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 n=new _(t,e,this.__newline_count,this.__whitespace_before_token);return this.__newline_count=0,this.__whitespace_before_token="",n},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=s},function(t,e,n){"use strict";function i(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 r(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()}i.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},i.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},i.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},i.prototype.get_character_count=function(){return this.__character_count},i.prototype.is_empty=function(){return 0===this.__items.length},i.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},i.prototype.push=function(t){this.__items.push(t),this.__character_count+=t.length},i.prototype.push_raw=function(t){this.push(t);var e=t.lastIndexOf("\n");-1!==e&&(this.__character_count=t.length-e)},i.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},i.prototype.remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_length)},i.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},i.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]},r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=new i(this),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(t){return this.__indent_cache.get_level_string(t)},r.prototype.get_alignment_string=function(t){return this.__alignment_cache.get_level_string(t)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(t,e){var n=this.__lines.join("\n").replace(/[\r\n\t ]+$/,"");return t&&(n+="\n"),"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},r.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)},r.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.push(t.whitespace_before),this.current_line.push_raw(t.text),this.space_before_token=!1},r.prototype.add_token=function(t){this.add_space_before_token(),this.current_line.push(t)},r.prototype.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},r.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t].remove_indent(),t++},r.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim(this.indent_string,this.baseIndentString);t&&this.__lines.length>1&&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},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(t,e){for(var n=this.__lines.length-2;n>=0;){var _=this.__lines[n];if(_.is_empty())break;if(0!==_.item(0).indexOf(t)&&_.item(-1)!==e){this.__lines.splice(n+1,0,new i(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},t.exports.Output=r},function(t,e,n){"use strict";function i(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}i.prototype.restart=function(){this.__position=0},i.prototype.back=function(){this.__position>0&&(this.__position-=1)},i.prototype.hasNext=function(){return this.__position<this.__input_length},i.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},i.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},i.prototype.test=function(t,e){if(e=e||0,e+=this.__position,t.lastIndex=e,e>=0&&e<this.__input_length){var n=t.exec(this.__input);return n&&n.index===e}return!1},i.prototype.testChar=function(t,e){var n=this.peek(e);return null!==n&&t.test(n)},i.prototype.match=function(t){t.lastIndex=this.__position;var e=t.exec(this.__input);return e&&e.index===this.__position?this.__position+=e[0].length:e=null,e},i.prototype.read=function(t){var e="",n=this.match(t);return n&&(e=n[0]),e},i.prototype.readUntil=function(t,e){var n,i=this.__position;t.lastIndex=this.__position;var _=t.exec(this.__input);return i=_?e?_.index+_[0].length:_.index:this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},i.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},i.prototype.peekUntilAfter=function(t){var e=this.__position,n=this.readUntilAfter(t);return this.__position=e,n},i.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=i},function(t,e,n){"use strict";var i=n(4).InputScanner,_=n(2).Tokenizer,r=n(2).TOKEN,s=n(1),o=n(6).Directives;function a(t,e){return-1!==e.indexOf(t)}var p={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:r.START,RAW:r.RAW,EOF:r.EOF},l=new o(/\/\*/,/\*\//),c=/0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/g,u=/[0-9]/,h=/[^\d\.]/,d=">>> === !== << && >= ** != == <= >> || < / - + > : & % ? ^ | *".split(" "),f=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ++ %= &= *= |= = ! ? > < : / ^ - + * & % ~ |";f=(f=f.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")).replace(/ /g,"|");var m,g=new RegExp(f,"g"),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),E=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),k=new RegExp("^(?:"+E.join("|")+")$"),y=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,b=/\/\/(?:[^\n\r\u2028\u2029]*)/g,v=/(?:(?:<\?php|<\?=)[\s\S]*?\?>)|(?:<%[\s\S]*?%>)/g,w=function(t,e){_.call(this,t,e),this.positionable_operators=d,this.line_starters=x};(w.prototype=new _)._is_comment=function(t){return t.type===p.COMMENT||t.type===p.BLOCK_COMMENT||t.type===p.UNKNOWN},w.prototype._is_opening=function(t){return t.type===p.START_BLOCK||t.type===p.START_EXPR},w.prototype._is_closing=function(t,e){return(t.type===p.END_BLOCK||t.type===p.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},w.prototype._reset=function(){m=!1},w.prototype._get_next_token=function(t,e){this._readWhitespace();var n=null,i=this._input.peek();return n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_singles(i))||this._read_word(t))||this._read_comment(i))||this._read_string(i))||this._read_regexp(i,t))||this._read_xml(i,t))||this._read_non_javascript(i))||this._read_punctuation())||this._create_token(p.UNKNOWN,this._input.next())},w.prototype._read_word=function(t){var e;return""!==(e=this._input.read(s.identifier))?t.type!==p.DOT&&(t.type!==p.RESERVED||"set"!==t.text&&"get"!==t.text)&&k.test(e)?"in"===e||"of"===e?this._create_token(p.OPERATOR,e):this._create_token(p.RESERVED,e):this._create_token(p.WORD,e):""!==(e=this._input.read(c))?this._create_token(p.WORD,e):void 0},w.prototype._read_singles=function(t){var e=null;return null===t?e=this._create_token(p.EOF,""):"("===t||"["===t?e=this._create_token(p.START_EXPR,t):")"===t||"]"===t?e=this._create_token(p.END_EXPR,t):"{"===t?e=this._create_token(p.START_BLOCK,t):"}"===t?e=this._create_token(p.END_BLOCK,t):";"===t?e=this._create_token(p.SEMICOLON,t):"."===t&&h.test(this._input.peek(1))?e=this._create_token(p.DOT,t):","===t&&(e=this._create_token(p.COMMA,t)),e&&this._input.next(),e},w.prototype._read_punctuation=function(){var t=this._input.read(g);if(""!==t)return"="===t?this._create_token(p.EQUALS,t):this._create_token(p.OPERATOR,t)},w.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(p.UNKNOWN,e.trim()+"\n")}var n="#";if(this._input.hasNext()&&this._input.testChar(u)){do{n+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(p.WORD,n)}this._input.back()}else if("<"===t){if("?"===this._input.peek(1)||"%"===this._input.peek(1)){if(e=this._input.read(v))return e=e.replace(s.allLineBreaks,"\n"),this._create_token(p.STRING,e)}else if(this._input.match(/<\!--/g)){for(t="\x3c!--";this._input.hasNext()&&!this._input.testChar(s.newline);)t+=this._input.next();return m=!0,this._create_token(p.COMMENT,t)}}else if("-"===t&&m&&this._input.match(/-->/g))return m=!1,this._create_token(p.COMMENT,"--\x3e");return null},w.prototype._read_comment=function(t){var e=null;if("/"===t){var n="";if("*"===this._input.peek(1)){n=this._input.read(y);var i=l.get_directives(n);i&&"start"===i.ignore&&(n+=l.readIgnored(this._input)),n=n.replace(s.allLineBreaks,"\n"),(e=this._create_token(p.BLOCK_COMMENT,n)).directives=i}else"/"===this._input.peek(1)&&(n=this._input.read(b),e=this._create_token(p.COMMENT,n))}return e},w.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="",n=0,_=new i(t),r=null;for(;_.hasNext();)if((r=_.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=r[0]),"\\"===_.peek()){if(_.next(),"x"===_.peek())r=_.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==_.peek()){e+="\\",_.hasNext()&&(e+=_.next());continue}r=_.match(/u([0-9A-Fa-f]{4})/g)}if(!r)return t;if((n=parseInt(r[1],16))>126&&n<=255&&0===r[0].indexOf("x"))return t;if(n>=0&&n<32){e+="\\"+r[0];continue}e+=34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),this._create_token(p.STRING,e)}return null},w.prototype._allow_regexp_or_xml=function(t){return t.type===p.RESERVED&&a(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===p.END_EXPR&&")"===t.text&&t.opened.previous.type===p.RESERVED&&a(t.opened.previous.text,["if","while","for"])||a(t.type,[p.COMMENT,p.START_EXPR,p.START_BLOCK,p.START,p.END_BLOCK,p.OPERATOR,p.EQUALS,p.EOF,p.SEMICOLON,p.COMMA])},w.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var n=this._input.next(),i=!1,_=!1;this._input.hasNext()&&(i||_||this._input.peek()!==t)&&!this._input.testChar(s.newline);)n+=this._input.peek(),i?i=!1:(i="\\"===this._input.peek(),"["===this._input.peek()?_=!0:"]"===this._input.peek()&&(_=!1)),this._input.next();return this._input.peek()===t&&(n+=this._input.next(),n+=this._input.read(s.identifier)),this._create_token(p.STRING,n)}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;w.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._input.test(R)&&this._allow_regexp_or_xml(e)){var n="",i=this._input.match(R);if(i){for(var _=i[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),r=0===_.indexOf("{"),o=0;i;){var a=!!i[1],l=i[2];if(!(!!i[i.length-1]||"![CDATA["===l.slice(0,8))&&(l===_||r&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--o:++o),n+=i[0],o<=0)break;i=this._input.match(O)}return i||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(s.allLineBreaks,"\n"),this._create_token(p.STRING,n)}}return null},w.prototype._read_string_recursive=function(t,e,n){for(var i,_="",r=!1;this._input.hasNext()&&(i=this._input.peek(),r||i!==t&&(e||!s.newline.test(i)));)(r||e)&&s.newline.test(i)?("\r"===i&&"\n"===this._input.peek(1)&&(this._input.next(),i=this._input.peek()),_+="\n"):_+=i,r?("x"!==i&&"u"!==i||(this.has_char_escapes=!0),r=!1):r="\\"===i,this._input.next(),n&&-1!==_.indexOf(n,_.length-n.length)&&(_+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(_+=this._input.next()));return _},t.exports.Tokenizer=w,t.exports.TOKEN=p},function(t,e,n){"use strict";function i(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")}i.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},i.prototype.readIgnored=function(t){return t.read(this.__directives_end_ignore_pattern)},t.exports.Directives=i},function(t,e,n){"use strict";var i=n(2).Tokenizer,_=n(2).TOKEN,r=n(6).Directives,s=n(1),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:_.START,RAW:_.RAW,EOF:_.EOF},a=new r(/<\!--/,/-->/),p=function(t,e){i.call(this,t,e),this._current_tag_name="",this._whitespace_pattern=/[\n\r\t ]+/g,this._newline_pattern=/([^\n\r]*)(\r\n|[\n\r])?/g,this._word_pattern=this._options.indent_handlebars?/[\n\r\t <]|{{/g:/[\n\r\t <]/g};(p.prototype=new i)._is_comment=function(t){return!1},p.prototype._is_opening=function(t){return t.type===o.TAG_OPEN},p.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])},p.prototype._reset=function(){this._current_tag_name=""},p.prototype._get_next_token=function(t,e){this._readWhitespace();var n=null,i=this._input.peek();return null===i?this._create_token(o.EOF,""):n=(n=(n=(n=(n=(n=(n=n||this._read_attribute(i,t,e))||this._read_raw_content(t,e))||this._read_comment(i))||this._read_open(i,e))||this._read_close(i,e))||this._read_content_word())||this._create_token(o.UNKNOWN,this._input.next())},p.prototype._read_comment=function(t){var e=null;if("<"===t||"{"===t){var n=this._input.peek(1),i=this._input.peek(2);if("<"===t&&("!"===n||"?"===n||"%"===n)||this._options.indent_handlebars&&"{"===t&&"{"===n&&"!"===i){for(var _="",r=">",p=!1,l=this._input.next();l&&((_+=l).charAt(_.length-1)!==r.charAt(r.length-1)||-1===_.indexOf(r));)p||(p=_.length>10,0===_.indexOf("<![if")?(r="<![endif]>",p=!0):0===_.indexOf("<![cdata[")?(r="]]>",p=!0):0===_.indexOf("<![")?(r="]>",p=!0):0===_.indexOf("\x3c!--")?(r="--\x3e",p=!0):0===_.indexOf("{{!--")?(r="--}}",p=!0):0===_.indexOf("{{!")?5===_.length&&-1===_.indexOf("{{!--")&&(r="}}",p=!0):0===_.indexOf("<?")?(r="?>",p=!0):0===_.indexOf("<%")&&(r="%>",p=!0)),l=this._input.next();var c=a.get_directives(_);c&&"start"===c.ignore&&(_+=a.readIgnored(this._input)),_=_.replace(s.allLineBreaks,"\n"),(e=this._create_token(o.COMMENT,_)).directives=c}}return e},p.prototype._read_open=function(t,e){var n=null,i=null;return e||("<"===t?(n=this._input.read(/<(?:[^\n\r\t >{][^\n\r\t >{/]*)?/g),i=this._create_token(o.TAG_OPEN,n)):this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&(n=this._input.readUntil(/[\n\r\t }]/g),i=this._create_token(o.TAG_OPEN,n))),i},p.prototype._read_close=function(t,e){var n=null,i=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(n=this._input.next(),"/"===t&&(n+=this._input.next()),i=this._create_token(o.TAG_CLOSE,n)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),i=this._create_token(o.TAG_CLOSE,"}}"))),i},p.prototype._read_attribute=function(t,e,n){var i=null,_="";if(n&&"<"===n.text[0])if("="===t)i=this._create_token(o.EQUALS,this._input.next());else if('"'===t||"'"===t){for(var r=this._input.next(),s="",a=new RegExp(t+"|{{","g");this._input.hasNext()&&(r+=s=this._input.readUntilAfter(a),'"'!==s[s.length-1]&&"'"!==s[s.length-1]);)this._input.hasNext()&&(r+=this._input.readUntilAfter(/}}/g));i=this._create_token(o.VALUE,r)}else(_="{"===t&&"{"===this._input.peek(1)?this._input.readUntilAfter(/}}/g):this._input.readUntil(/[\n\r\t =\/>]/g))&&(i=e.type===o.EQUALS?this._create_token(o.VALUE,_):this._create_token(o.ATTRIBUTE,_));return i},p.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))},p.prototype._read_raw_content=function(t,e){var n="";if(e&&"{"===e.text[0])n=this._input.readUntil(/}}/g);else if(t.type===o.TAG_CLOSE&&"<"===t.opened.text[0]){var i=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(i)&&(n=this._input.readUntil(new RegExp("</"+i+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(o.TEXT,n):null},p.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=p,t.exports.TOKEN=o},function(t,e,n){"use strict";var i=n(9),_=n(13),r=n(15);t.exports.js=i,t.exports.css=_,t.exports.html=function(t,e,n,s){return r(t,e,n=n||i,s=s||_)}},function(t,e,n){"use strict";var i=n(10).Beautifier;t.exports=function(t,e){return new i(t,e).beautify()}},function(t,e,n){"use strict";var i=n(0).mergeOpts,_=n(0).normalizeOpts,r=n(1),s=n(3).Output,o=n(5).Tokenizer,a=n(5).TOKEN;function p(t,e){e.multiline_frame||e.mode===f.ForInitializer||e.mode===f.Conditional||t.remove_indent(e.start_line_index)}function l(t,e){return-1!==e.indexOf(t)}function c(t){return t.replace(/^\s+/g,"")}var u=["before-newline","after-newline","preserve-newline"],h=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].replace(/-/g,"_")]=t[n];return e}(u),d=[h.before_newline,h.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};t.exports.Beautifier=function(t,e){var n,m,g,x,E,k,y,b,v,w,R;function O(t,e){var i=0;return t&&(i=t.indentation_level,!n.just_added_newline()&&t.line_indent_level>i&&(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:n.get_line_number(),ternary_depth:0}}e=e||{},this._source_text=t||"",(w={})[a.START_EXPR]=function(){z()||A(x);var t=f.Expression;if("["===x.text){if(E===a.WORD||")"===y.last_text)return E===a.RESERVED&&l(y.last_text,g.line_starters)&&(n.space_before_token=!0),K(t),M(),B(),void(R.space_in_paren&&(n.space_before_token=!0));t=f.ArrayLiteral,P(y.mode)&&("["!==y.last_text&&(","!==y.last_text||"]"!==k&&"}"!==k)||R.keep_array_indentation||L()),l(E,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR])||(n.space_before_token=!0)}else E===a.RESERVED?"for"===y.last_text?(n.space_before_token=R.space_before_conditional,t=f.ForInitializer):l(y.last_text,["if","while"])?(n.space_before_token=R.space_before_conditional,t=f.Conditional):l(y.last_word,["await","async"])?n.space_before_token=!0:"import"===y.last_text&&""===x.whitespace_before?n.space_before_token=!1:(l(y.last_text,g.line_starters)||"catch"===y.last_text)&&(n.space_before_token=!0):E===a.EQUALS||E===a.OPERATOR?V()||C():E===a.WORD?n.space_before_token=!1:C(),(E===a.RESERVED&&("function"===y.last_word||"typeof"===y.last_word)||"*"===y.last_text&&(l(k,["function","yield"])||y.mode===f.ObjectLiteral&&l(k,["{",","])))&&(n.space_before_token=R.space_after_anon_function);";"===y.last_text||E===a.START_BLOCK?L():E!==a.END_EXPR&&E!==a.START_EXPR&&E!==a.END_BLOCK&&"."!==y.last_text&&E!==a.COMMA||C(x.newlines),K(t),M(),R.space_in_paren&&(n.space_before_token=!0),B()},w[a.END_EXPR]=function(){for(;y.mode===f.Statement;)j();A(x),y.multiline_frame&&C("]"===x.text&&P(y.mode)&&!R.keep_array_indentation),R.space_in_paren&&(E!==a.START_EXPR||R.space_in_empty_paren?n.space_before_token=!0:(n.trim(),n.space_before_token=!1)),"]"===x.text&&R.keep_array_indentation?(M(),j()):(j(),M()),p(n,b),y.do_while&&b.mode===f.Conditional&&(b.mode=f.Expression,y.do_block=!1,y.do_while=!1)},w[a.START_BLOCK]=function(){A(x);var t=m.peek(),e=m.peek(1);e&&(l(e.text,[":",","])&&l(t.type,[a.STRING,a.WORD,a.RESERVED])||l(t.text,["get","set","..."])&&l(e.type,[a.WORD,a.RESERVED]))?l(k,["class","interface"])?K(f.BlockStatement):K(f.ObjectLiteral):E===a.OPERATOR&&"=>"===y.last_text?K(f.BlockStatement):l(E,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||E===a.RESERVED&&l(y.last_text,["return","throw","import","default"])?K(f.ObjectLiteral):K(f.BlockStatement);var i=!t.comments_before&&"}"===t.text&&"function"===y.last_word&&E===a.END_EXPR;if(R.brace_preserve_inline){var _=0,r=null;y.inline_frame=!0;do{if(_+=1,(r=m.peek(_-1)).newlines){y.inline_frame=!1;break}}while(r.type!==a.EOF&&(r.type!==a.END_BLOCK||r.opened!==x))}("expand"===R.brace_style||"none"===R.brace_style&&x.newlines)&&!y.inline_frame?E!==a.OPERATOR&&(i||E===a.EQUALS||E===a.RESERVED&&W(y.last_text)&&"else"!==y.last_text)?n.space_before_token=!0:L(!1,!0):(!P(b.mode)||E!==a.START_EXPR&&E!==a.COMMA||((E===a.COMMA||R.space_in_paren)&&(n.space_before_token=!0),(E===a.COMMA||E===a.START_EXPR&&y.inline_frame)&&(C(),b.multiline_frame=b.multiline_frame||y.multiline_frame,y.multiline_frame=!1)),E!==a.OPERATOR&&E!==a.START_EXPR&&(E!==a.START_BLOCK||y.inline_frame?n.space_before_token=!0:L())),M(),B()},w[a.END_BLOCK]=function(){for(A(x);y.mode===f.Statement;)j();var t=E===a.START_BLOCK;y.inline_frame&&!t?n.space_before_token=!0:"expand"===R.brace_style?t||L():t||(P(y.mode)&&R.keep_array_indentation?(R.keep_array_indentation=!1,L(),R.keep_array_indentation=!0):L()),j(),M()},w[a.WORD]=X,w[a.RESERVED]=X,w[a.SEMICOLON]=function(){z()?n.space_before_token=!1:A(x);for(var t=m.peek();!(y.mode!==f.Statement||y.if_block&&t&&t.type===a.RESERVED&&"else"===t.text||y.do_block);)j();y.import_block&&(y.import_block=!1),M()},w[a.STRING]=function(){z()?n.space_before_token=!0:(A(x),E===a.RESERVED||E===a.WORD||y.inline_frame?n.space_before_token=!0:E===a.COMMA||E===a.START_EXPR||E===a.EQUALS||E===a.OPERATOR?V()||C():L()),M()},w[a.EQUALS]=function(){z()||A(x),y.declaration_statement&&(y.declaration_assignment=!0),n.space_before_token=!0,M(),n.space_before_token=!0},w[a.OPERATOR]=function(){var t="*"===x.text&&(E===a.RESERVED&&l(y.last_text,["function","yield"])||l(E,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),e=l(x.text,["-","+"])&&(l(E,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||l(y.last_text,g.line_starters)||","===y.last_text);if(z());else{var i=!t;A(x,i)}if(E===a.RESERVED&&W(y.last_text))return n.space_before_token=!0,void M();if("*"!==x.text||E!==a.DOT)if("::"!==x.text){if(E===a.OPERATOR&&l(R.operator_position,d)&&C(),":"===x.text&&y.in_case)return y.case_body=!0,B(),M(),L(),void(y.in_case=!1);var _=!0,r=!0,s=!1;if(":"===x.text?0===y.ternary_depth?_=!1:(y.ternary_depth-=1,s=!0):"?"===x.text&&(y.ternary_depth+=1),!e&&!t&&R.preserve_newlines&&l(x.text,g.positionable_operators)){var o=":"===x.text,p=o&&s,c=o&&!s;switch(R.operator_position){case h.before_newline:return n.space_before_token=!c,M(),o&&!p||C(),void(n.space_before_token=!0);case h.after_newline:return n.space_before_token=!0,!o||p?m.peek().newlines?L(!1,!0):C():n.space_before_token=!1,M(),void(n.space_before_token=!0);case h.preserve_newline:return c||C(),_=!(n.just_added_newline()||c),n.space_before_token=_,M(),void(n.space_before_token=!0)}}if(t){C(),_=!1;var u=m.peek();r=u&&l(u.type,[a.WORD,a.RESERVED])}else"..."===x.text?(C(),_=E===a.START_BLOCK,r=!1):(l(x.text,["--","++","!","~"])||e)&&(E!==a.COMMA&&E!==a.START_EXPR||C(),_=!1,r=!1,!x.newlines||"--"!==x.text&&"++"!==x.text||L(!1,!0),";"===y.last_text&&U(y.mode)&&(_=!0),E===a.RESERVED?_=!0:E===a.END_EXPR?_=!("]"===y.last_text&&("--"===x.text||"++"===x.text)):E===a.OPERATOR&&(_=l(x.text,["--","-","++","+"])&&l(y.last_text,["--","-","++","+"]),l(x.text,["+","-"])&&l(y.last_text,["--","++"])&&(r=!0)),(y.mode!==f.BlockStatement||y.inline_frame)&&y.mode!==f.Statement||"{"!==y.last_text&&";"!==y.last_text||L());n.space_before_token=n.space_before_token||_,M(),n.space_before_token=r}else M();else M()},w[a.COMMA]=function(){A(x,!0),M(),n.space_before_token=!0,y.declaration_statement?(U(y.parent.mode)&&(y.declaration_assignment=!1),y.declaration_assignment?(y.declaration_assignment=!1,L(!1,!0)):R.comma_first&&C()):y.mode===f.ObjectLiteral||y.mode===f.Statement&&y.parent.mode===f.ObjectLiteral?(y.mode===f.Statement&&j(),y.inline_frame||L()):R.comma_first&&C()},w[a.BLOCK_COMMENT]=function(t){if(n.raw)return n.add_raw_token(x),void(x.directives&&"end"===x.directives.preserve&&(n.raw=R.test_output_raw));if(x.directives)return L(!1,t),M(),"start"===x.directives.preserve&&(n.raw=!0),void L(!1,!0);if(!r.newline.test(x.text)&&!x.newlines)return n.space_before_token=!0,M(),void(n.space_before_token=!0);var e,i=function(t){for(var e=[],n=(t=t.replace(r.allLineBreaks,"\n")).indexOf("\n");-1!==n;)e.push(t.substring(0,n)),t=t.substring(n+1),n=t.indexOf("\n");return t.length&&e.push(t),e}(x.text),_=!1,s=!1,o=x.whitespace_before,a=o.length;for(L(!1,t),i.length>1&&(_=function(t,e){for(var n=0;n<t.length;n++){var i=t[n].trim();if(i.charAt(0)!==e)return!1}return!0}(i.slice(1),"*"),s=function(t,e){for(var n,i=0,_=t.length;i<_;i++)if((n=t[i])&&0!==n.indexOf(e))return!1;return!0}(i.slice(1),o)),M(i[0]),e=1;e<i.length;e++)L(!1,!0),_?M(" "+c(i[e])):s&&i[e].length>a?M(i[e].substring(a)):n.add_token(i[e]);L(!1,t)},w[a.COMMENT]=function(t){x.newlines?L(!1,t):n.trim(!0),n.space_before_token=!0,M(),L(!1,t)},w[a.DOT]=function(){z()||A(x,!0),R.unindent_chained_methods&&I(),E===a.RESERVED&&W(y.last_text)?n.space_before_token=!1:C(")"===y.last_text&&R.break_chained_methods),M()},w[a.UNKNOWN]=function(t){M(),"\n"===x.text[x.text.length-1]&&L(!1,t)},w[a.EOF]=function(){for(;y.mode===f.Statement;)j();A(x)},e=i(e,"js"),e=_(e),R={},"expand-strict"===e.brace_style?e.brace_style="expand":"collapse-preserve-inline"===e.brace_style?e.brace_style="collapse,preserve-inline":void 0!==e.braces_on_own_line?e.brace_style=e.braces_on_own_line?"expand":"collapse":e.brace_style||(e.brace_style="collapse");var T=e.brace_style.split(/[^a-zA-Z0-9_\-]+/);R.brace_preserve_inline=!1,R.brace_style="collapse";for(var S=0;S<T.length;S++)"preserve-inline"===T[S]?R.brace_preserve_inline=!0:R.brace_style=T[S];function A(t,e){var n=t.newlines,i=R.keep_array_indentation&&P(y.mode);if(t.comments_before){var _=x;for(x=t.comments_before.next();x;)A(x,e),w[x.type](e),x=t.comments_before.next();x=_}if(i)for(var r=0;r<n;r+=1)L(r>0,e);else if(R.max_preserve_newlines&&n>R.max_preserve_newlines&&(n=R.max_preserve_newlines),R.preserve_newlines&&t.newlines>1){L(!1,e);for(var s=1;s<n;s+=1)L(!0,e)}}R.indent_size=e.indent_size?parseInt(e.indent_size,10):4,R.indent_char=e.indent_char?e.indent_char:" ",R.eol=e.eol?e.eol:"auto",R.preserve_newlines=void 0===e.preserve_newlines||e.preserve_newlines,R.unindent_chained_methods=void 0!==e.unindent_chained_methods&&e.unindent_chained_methods,R.break_chained_methods=void 0!==e.break_chained_methods&&e.break_chained_methods,R.max_preserve_newlines=void 0===e.max_preserve_newlines?0:parseInt(e.max_preserve_newlines,10),R.space_in_paren=void 0!==e.space_in_paren&&e.space_in_paren,R.space_in_empty_paren=void 0!==e.space_in_empty_paren&&e.space_in_empty_paren,R.jslint_happy=void 0!==e.jslint_happy&&e.jslint_happy,R.space_after_anon_function=void 0!==e.space_after_anon_function&&e.space_after_anon_function,R.keep_array_indentation=void 0!==e.keep_array_indentation&&e.keep_array_indentation,R.space_before_conditional=void 0===e.space_before_conditional||e.space_before_conditional,R.unescape_strings=void 0!==e.unescape_strings&&e.unescape_strings,R.wrap_line_length=void 0===e.wrap_line_length?0:parseInt(e.wrap_line_length,10),R.e4x=void 0!==e.e4x&&e.e4x,R.end_with_newline=void 0!==e.end_with_newline&&e.end_with_newline,R.comma_first=void 0!==e.comma_first&&e.comma_first,R.operator_position=function(t){if(!l(t=t||h.before_newline,u))throw new Error("Invalid Option Value: The option 'operator_position' must be one of the following values\n"+u+"\nYou passed in: '"+t+"'");return t}(e.operator_position),R.disabled=void 0!==e.disabled&&e.disabled,R.test_output_raw=void 0!==e.test_output_raw&&e.test_output_raw,R.jslint_happy&&(R.space_after_anon_function=!0),e.indent_with_tabs&&(R.indent_char="\t",R.indent_size=1),R.eol=R.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),this._reset=function(t){var e="",i=new Array(R.indent_size+1).join(R.indent_char),_=0;if(t&&t.length){for(;" "===t.charAt(_)||"\t"===t.charAt(_);)_+=1;e=t.substring(0,_),t=t.substring(_)}return E=a.START_BLOCK,k="",(n=new s(i,e)).raw=R.test_output_raw,v=[],K(f.BlockStatement),g=new o(t,R,i),m=g.tokenize(),t},this.beautify=function(){if(R.disabled)return this._source_text;var t=this._reset(this._source_text),e=R.eol;for("auto"===R.eol&&(e="\n",t&&r.lineBreak.test(t||"")&&(e=t.match(r.lineBreak)[0])),x=m.next();x;)w[x.type](),k=y.last_text,E=x.type,y.last_text=x.text,x=m.next();return n.get_code(R.end_with_newline,e)};var N=["async","await","break","continue","return","throw","yield"];function C(t){if(t=void 0!==t&&t,!n.just_added_newline()){var e=R.preserve_newlines&&x.newlines||t;if(l(y.last_text,g.positionable_operators)||l(x.text,g.positionable_operators)){var i=l(y.last_text,g.positionable_operators)&&l(R.operator_position,d)||l(x.text,g.positionable_operators);e=e&&i}if(e)L(!1,!0);else if(R.wrap_line_length){if(E===a.RESERVED&&l(y.last_text,N))return;n.current_line.get_character_count()+x.text.length+(n.space_before_token?1:0)>=R.wrap_line_length&&L(!1,!0)}}}function L(t,e){if(!e&&";"!==y.last_text&&","!==y.last_text&&"="!==y.last_text&&(E!==a.OPERATOR||"--"===y.last_text||"++"===y.last_text))for(var i=m.peek();!(y.mode!==f.Statement||y.if_block&&i&&i.type===a.RESERVED&&"else"===i.text||y.do_block);)j();n.add_new_line(t)&&(y.multiline_frame=!0)}function D(){n.just_added_newline()&&(R.keep_array_indentation&&P(y.mode)&&x.newlines?(n.current_line.push(x.whitespace_before),n.space_before_token=!1):n.set_indent(y.indentation_level)&&(y.line_indent_level=y.indentation_level))}function M(t){if(n.raw)n.add_raw_token(x);else{if(R.comma_first&&E===a.COMMA&&n.just_added_newline()&&","===n.previous_line.last()){var e=n.previous_line.pop();n.previous_line.is_empty()&&(n.previous_line.push(e),n.trim(!0),n.current_line.pop(),n.trim()),D(),n.add_token(","),n.space_before_token=!0}t=t||x.text,D(),n.add_token(t)}}function B(){y.indentation_level+=1}function I(){y.indentation_level>0&&(!y.parent||y.indentation_level>y.parent.indentation_level)&&(y.indentation_level-=1)}function K(t){y?(v.push(y),b=y):b=O(null,t),y=O(b,t)}function P(t){return t===f.ArrayLiteral}function U(t){return l(t,[f.Expression,f.ForInitializer,f.Conditional])}function j(){v.length>0&&(b=y,y=v.pop(),b.mode===f.Statement&&p(n,b))}function V(){return y.parent.mode===f.ObjectLiteral&&y.mode===f.Statement&&(":"===y.last_text&&0===y.ternary_depth||E===a.RESERVED&&l(y.last_text,["get","set"]))}function z(){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||E===a.RESERVED&&l(y.last_text,["var","let","const"])&&x.type===a.WORD)||E===a.RESERVED&&"do"===y.last_text)||E===a.RESERVED&&l(y.last_text,N)&&!x.newlines)||E===a.RESERVED&&"else"===y.last_text&&!(x.type===a.RESERVED&&"if"===x.text&&!x.comments_before))||E===a.END_EXPR&&(b.mode===f.ForInitializer||b.mode===f.Conditional))||E===a.WORD&&y.mode===f.BlockStatement&&!y.in_case&&!("--"===x.text||"++"===x.text)&&"function"!==k&&x.type!==a.WORD&&x.type!==a.RESERVED)||y.mode===f.ObjectLiteral&&(":"===y.last_text&&0===y.ternary_depth||E===a.RESERVED&&l(y.last_text,["get","set"])))&&(K(f.Statement),B(),A(x,!0),V()||C(x.type===a.RESERVED&&l(x.text,["do","for","if","while"])),!0)}function W(t){return l(t,["case","return","do","if","throw","else","await","break","continue","async"])}function X(){if(x.type===a.RESERVED&&(l(x.text,["set","get"])&&y.mode!==f.ObjectLiteral?x.type=a.WORD:l(x.text,["as","from"])&&!y.import_block?x.type=a.WORD:y.mode===f.ObjectLiteral&&":"===m.peek().text&&(x.type=a.WORD)),z()?E===a.RESERVED&&l(y.last_text,["var","let","const"])&&x.type===a.WORD&&(y.declaration_statement=!0):!x.newlines||U(y.mode)||E===a.OPERATOR&&"--"!==y.last_text&&"++"!==y.last_text||E===a.EQUALS||!R.preserve_newlines&&E===a.RESERVED&&l(y.last_text,["var","let","const","set","get"])?A(x):(A(x),L()),y.do_block&&!y.do_while){if(x.type===a.RESERVED&&"while"===x.text)return n.space_before_token=!0,M(),n.space_before_token=!0,void(y.do_while=!0);L(),y.do_block=!1}if(y.if_block)if(y.else_block||x.type!==a.RESERVED||"else"!==x.text){for(;y.mode===f.Statement;)j();y.if_block=!1,y.else_block=!1}else y.else_block=!0;if(x.type===a.RESERVED&&("case"===x.text||"default"===x.text&&y.in_case_statement))return L(),(y.case_body||R.jslint_happy)&&(I(),y.case_body=!1),M(),y.in_case=!0,void(y.in_case_statement=!0);if(E!==a.COMMA&&E!==a.START_EXPR&&E!==a.EQUALS&&E!==a.OPERATOR||V()||C(),x.type===a.RESERVED&&"function"===x.text)return(l(y.last_text,["}",";"])||n.just_added_newline()&&!l(y.last_text,["(","[","{",":","=",","])&&E!==a.OPERATOR)&&(n.just_added_blankline()||x.comments_before||(L(),L(!0))),E===a.RESERVED||E===a.WORD?E===a.RESERVED&&(l(y.last_text,["get","set","new","export"])||l(y.last_text,N))?n.space_before_token=!0:E===a.RESERVED&&"default"===y.last_text&&"export"===k?n.space_before_token=!0:L():E===a.OPERATOR||"="===y.last_text?n.space_before_token=!0:(y.multiline_frame||!U(y.mode)&&!P(y.mode))&&L(),M(),void(y.last_word=x.text);var t="NONE";E===a.END_BLOCK?b.inline_frame?t="SPACE":x.type===a.RESERVED&&l(x.text,["else","catch","finally","from"])?"expand"===R.brace_style||"end-expand"===R.brace_style||"none"===R.brace_style&&x.newlines?t="NEWLINE":(t="SPACE",n.space_before_token=!0):t="NEWLINE":E===a.SEMICOLON&&y.mode===f.BlockStatement?t="NEWLINE":E===a.SEMICOLON&&U(y.mode)?t="SPACE":E===a.STRING?t="NEWLINE":E===a.RESERVED||E===a.WORD||"*"===y.last_text&&(l(k,["function","yield"])||y.mode===f.ObjectLiteral&&l(k,["{",","]))?t="SPACE":E===a.START_BLOCK?t=y.inline_frame?"SPACE":"NEWLINE":E===a.END_EXPR&&(n.space_before_token=!0,t="NEWLINE"),x.type===a.RESERVED&&l(x.text,g.line_starters)&&")"!==y.last_text&&(t=y.inline_frame||"else"===y.last_text||"export"===y.last_text?"SPACE":"NEWLINE"),x.type===a.RESERVED&&l(x.text,["else","catch","finally"])?(E!==a.END_BLOCK||b.mode!==f.BlockStatement||"expand"===R.brace_style||"end-expand"===R.brace_style||"none"===R.brace_style&&x.newlines)&&!y.inline_frame?L():(n.trim(!0),"}"!==n.current_line.last()&&L(),n.space_before_token=!0):"NEWLINE"===t?E===a.RESERVED&&W(y.last_text)?n.space_before_token=!0:E!==a.END_EXPR?E===a.START_EXPR&&x.type===a.RESERVED&&l(x.text,["var","let","const"])||":"===y.last_text||(x.type===a.RESERVED&&"if"===x.text&&"else"===y.last_text?n.space_before_token=!0:L()):x.type===a.RESERVED&&l(x.text,g.line_starters)&&")"!==y.last_text&&L():y.multiline_frame&&P(y.mode)&&","===y.last_text&&"}"===k?L():"SPACE"===t&&(n.space_before_token=!0),E!==a.WORD&&E!==a.RESERVED||(n.space_before_token=!0),M(),y.last_word=x.text,x.type===a.RESERVED&&("do"===x.text?y.do_block=!0:"if"===x.text?y.if_block=!0:"import"===x.text?y.import_block=!0:y.import_block&&x.type===a.RESERVED&&"from"===x.text&&(y.import_block=!1))}}},function(t,e,n){"use strict";t.exports.Token=function(t,e,n,i){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},function(t,e,n){"use strict";function i(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}i.prototype.restart=function(){this.__position=0},i.prototype.isEmpty=function(){return 0===this.__tokens_length},i.prototype.hasNext=function(){return this.__position<this.__tokens_length},i.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},i.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},i.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},t.exports.TokenStream=i},function(t,e,n){"use strict";var i=n(14).Beautifier;t.exports=function(t,e){return new i(t,e).beautify()}},function(t,e,n){"use strict";var i=n(0).mergeOpts,_=n(0).normalizeOpts,r=n(1),s=n(3).Output,o=n(4).InputScanner,a=r.lineBreak,p=r.allLineBreaks;t.exports.Beautifier=function(t,e){this._source_text=t||"",e=i(e=e||{},"css"),e=_(e),this._options={};var n=e.indent_size?parseInt(e.indent_size,10):4,r=e.indent_char||" ",l=void 0!==e.preserve_newlines&&e.preserve_newlines,c=void 0===e.selector_separator_newline||e.selector_separator_newline,u=void 0!==e.end_with_newline&&e.end_with_newline,h=void 0===e.newline_between_rules||e.newline_between_rules,d=void 0!==e.space_around_combinator&&e.space_around_combinator;d=d||void 0!==e.space_around_selector_separator&&e.space_around_selector_separator;var f=e.eol?e.eol:"auto";this._options.disabled=void 0!==e.disabled&&e.disabled,e.indent_with_tabs&&(r="\t",n=1),f=f.replace(/\\r/,"\r").replace(/\\n/,"\n");var m,g,x,E,k,y=/\s/,b=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g,R=0;function O(t){var e="";for(m=g.next();m;){if(e+=m,"\\"===m)e+=g.next();else if(-1!==t.indexOf(m)||"\n"===m)break;m=g.next()}return e}function T(t){for(var e=y.test(g.peek()),n=!0;y.test(g.peek());)m=g.next(),t&&"\n"===m&&(l||n)&&(n=!1,k.add_new_line(!0));return e}function S(){for(var t=0,e=1,n=g.peek(e);n;){if("{"===n)return!0;if("("===n)t+=1;else if(")"===n){if(0===t)return!1;t-=1}else if(";"===n||"}"===n)return!1;e++,n=g.peek(e)}return!1}function A(t){k.just_added_newline()&&k.set_indent(x),k.add_token(t)}function N(t){t&&(k.space_before_token=!0)}function C(){x++}function L(){x>0&&x--}this.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text;"auto"===f&&(f="\n",t&&a.test(t||"")&&(f=t.match(a)[0])),t=t.replace(p,"\n");var e=new Array(n+1).join(r),i="",_=0;if(t&&t.length){for(;" "===t.charAt(_)||"\t"===t.charAt(_);)_+=1;i=t.substring(0,_),t=t.substring(_)}k=new s(e,i),g=new o(t),x=0,E=0,R=0;for(var l=!1,D=!1,M=!1,B=!1,I=!1,K=m=null;;){var P=""!==g.read(b),U=K;if(K=m=g.next(),!m)break;if("/"===m&&"*"===g.peek())k.add_new_line(),g.back(),A(g.read(v)),T(!0),k.add_new_line();else if("/"===m&&"/"===g.peek())k.space_before_token=!0,g.back(),A(g.read(w)),T(!0);else if("@"===m)if(N(P),"{"===g.peek())A(m+O("}"));else{A(m);var j=g.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);j.match(/[ :]$/)&&(A(j=O(": ").replace(/\s$/,"")),k.space_before_token=!0),"extend"===(j=j.replace(/\s$/,""))?B=!0:"import"===j&&(I=!0),j in this.NESTED_AT_RULE?(E+=1,j in this.CONDITIONAL_GROUP_RULE&&(M=!0)):l||0!==R||-1===j.indexOf(":")||(D=!0,C())}else"#"===m&&"{"===g.peek()?(N(P),A(m+O("}"))):"{"===m?(D&&(D=!1,L()),C(),k.space_before_token=!0,A(m),M?(M=!1,l=x>E):l=x>=E,h&&l&&k.previous_line&&"{"!==k.previous_line.item(-1)&&k.ensure_empty_line_above("/",","),T(!0),k.add_new_line()):"}"===m?(L(),k.add_new_line(),"{"===U&&k.trim(!0),I=!1,B=!1,D&&(L(),D=!1),A(m),l=!1,E&&E--,T(!0),k.add_new_line(),h&&!k.just_added_blankline()&&"}"!==g.peek()&&k.add_new_line(!0)):":"===m?!l&&!M||g.lookBack("&")||S()||g.lookBack("(")||B?(g.lookBack(" ")&&(k.space_before_token=!0),":"===g.peek()?(m=g.next(),A("::")):A(":")):(A(":"),D||(D=!0,k.space_before_token=!0,T(!0),C())):'"'===m||"'"===m?(N(P),A(m+O(m)),T(!0)):";"===m?(D&&(L(),D=!1),B=!1,I=!1,A(m),T(!0),"/"!==g.peek()&&k.add_new_line()):"("===m?g.lookBack("url")?(A(m),T(),")"===(m=g.next())||'"'===m||"'"!==m?(g.back(),R++):m&&A(m+O(")"))):(R++,N(P),A(m),T()):")"===m?(A(m),R--):","===m?(A(m),T(!0),c&&!D&&R<1&&!I?k.add_new_line():k.space_before_token=!0):(">"===m||"+"===m||"~"===m)&&!D&&R<1?d?(k.space_before_token=!0,A(m),k.space_before_token=!0):(A(m),T(),m&&y.test(m)&&(m="")):"]"===m?A(m):"["===m?(N(P),A(m)):"="===m?(T(),A("="),y.test(m)&&(m="")):"!"===m?(A(" "),A(m)):(N(P),A(m))}return k.get_code(u,f)},this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}},function(t,e,n){"use strict";var i=n(16).Beautifier;t.exports=function(t,e,n,_){return new i(t,e,n,_).beautify()}},function(t,e,n){"use strict";var i=n(0).mergeOpts,_=n(0).normalizeOpts,r=n(1),s=n(3).Output,o=n(7).Tokenizer,a=n(7).TOKEN,p=r.lineBreak,l=r.allLineBreaks,c=function(t,e,n,i,_){this.indent_character=t,this.indent_string=t,this.indent_size=e,this.indent_level=0,this.alignment_size=0,this.wrap_line_length=n,this.max_preserve_newlines=i,this.preserve_newlines=_,this.indent_size>1&&(this.indent_string=new Array(this.indent_size+1).join(this.indent_character)),this._output=new s(this.indent_string,"")};c.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},c.prototype.set_space_before_token=function(t){this._output.space_before_token=t},c.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},c.prototype.traverse_whitespace=function(t){if(t.whitespace_before||t.newlines){var e=0;if(t.type!==a.TEXT&&t.previous.type!==a.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1),e)for(var n=0;n<e;n++)this.print_newline(n>0);else this._output.space_before_token=!0,this.print_space_or_wrap(t.text);return!0}return!1},c.prototype.print_space_or_wrap=function(t){return!!(this._output.current_line.get_character_count()+t.length+1>=this.wrap_line_length&&this._output.add_new_line())},c.prototype.print_newline=function(t){this._output.add_new_line(t)},c.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))},c.prototype.print_raw_text=function(t){this._output.current_line.push_raw(t)},c.prototype.indent=function(){this.indent_level++},c.prototype.unindent=function(){this.indent_level>0&&this.indent_level--},c.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};function u(t,e){return-1!==e.indexOf(t)}function h(t){this._printer=t,this._current_frame=null}function d(t,e){var n=e||[];return"object"==typeof t?null!==t&&"function"==typeof t.concat&&(n=t.concat()):"stri