54 lines
31 KiB
JavaScript
54 lines
31 KiB
JavaScript
(function(){function p(h,c){return(new E(h,c)).beautify()}function E(h,c){var da,H,a,p,I,z,w,N,S,Z,$,y,O,P,x,t,A,o,F,f,J;function ia(b,e){var d=0;return b&&(d=b.indentation_level,!T()&&b.line_indent_level>d&&(d=b.line_indent_level)),{mode:e,parent:b,last_text:b?b.last_text:"",last_word:b?b.last_word:"",declaration_statement:!1,declaration_assignment:!1,in_html_comment:!1,multiline_frame:!1,if_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:d,line_indent_level:b?
|
||
b.line_indent_level:d,start_line_index:m.length,had_comment:!1,ternary_depth:0}}function B(b){if(b=void 0===b?!1:b,m.length)for(ja(m[m.length-1],b);b&&1<m.length&&0===m[m.length-1].text.length;)m.pop(),ja(m[m.length-1],b)}function ja(b){for(;b.text.length&&(" "===b.text[b.text.length-1]||b.text[b.text.length-1]===K||b.text[b.text.length-1]===U);)b.text.pop()}function ga(b){return b.replace(/^\s+|\s+$/g,"")}function T(){return 0===m[m.length-1].text.length}function Q(n){if(n=void 0===n?!1:n,da&&!n){var e=
|
||
m[m.length-1],d=0;0<e.text.length&&(d=e.text.join("").length+k.length+(j?1:0),d>=da&&(n=!0))}(H&&L||n)&&!T()&&(i(!1,!0),b.mode===x||aa(b.mode)||b.mode===t||(R=!0))}function i(d,e){if(R=!1,j=!1,!e&&";"!==b.last_text&&","!==b.last_text&&"="!==b.last_text&&"TK_OPERATOR"!==g)for(;b.mode===t&&!b.if_block&&!b.do_block;)M();1===m.length&&T()||(d||!T())&&(b.multiline_frame=!0,m.push({text:[]}))}function q(d){var d=d||k,e,o;if(T())if(e=m[m.length-1],a&&b.mode===x&&L){e.text.push("");for(o=0;o<V.length;o+=
|
||
1)e.text.push(V[o])}else{U&&e.text.push(U);e=b.indentation_level+(R?1:0);var F;if(1<m.length){o=m[m.length-1];b.line_indent_level=e;for(F=0;F<e;F+=1)o.text.push(K)}}R=!1;e=m[m.length-1];var f;j&&e.text.length&&(f=e.text[e.text.length-1]," "!==f&&f!==K&&e.text.push(" "));j=!1;m[m.length-1].text.push(d)}function ka(b){if(!b.multiline_frame)for(var b=b.start_line_index,e=0,d;b<m.length;)(d=m[b],b++,0!==d.text.length)&&(e=U&&d.text[0]===U?1:0,d.text[e]===K&&d.text.splice(e,1))}function u(d){b?(ea.push(b),
|
||
C=b):C=ia(null,d);b=ia(C,d)}function aa(b){return r(b,[A,o,F])}function M(){0<ea.length&&(C=b,b=ea.pop(),C.mode===t&&ka(C))}function E(){return b.mode===f&&":"===b.last_text&&0===b.ternary_depth}function fa(){var d;"TK_RESERVED"===g&&r(b.last_text,["var","let","const"])&&"TK_WORD"===s||"TK_RESERVED"===g&&"do"===b.last_text||"TK_RESERVED"===g&&"return"===b.last_text&&!L||"TK_RESERVED"===g&&"else"===b.last_text&&!("TK_RESERVED"===s&&"if"===k)||"TK_END_EXPR"===g&&(C.mode===o||C.mode===F)?(u(t),b.indentation_level+=
|
||
1,d=("TK_RESERVED"===g&&r(b.last_text,["var","let","const"])&&"TK_WORD"===s&&(b.declaration_statement=!0),Q("TK_RESERVED"===s&&r(k,["do","for","if","while"])),R=!1,!0)):d=!1;return d}function ba(b){return r(b,"case return do if throw else".split(" "))}function r(b,d){for(var o=0;o<d.length;o+=1)if(d[o]===b)return!0;return!1}function la(){var n,e,f,a,c;if(G=0,d>=v)return["","TK_EOF"];L=!1;V=[];e=l.charAt(d);for(d+=1;r(e,ha);){if("\n"===e?(G+=1,V=[]):G&&(e===K?V.push(K):"\r"!==e&&V.push(" ")),d>=v)return["",
|
||
"TK_EOF"];e=l.charAt(d);d+=1}if(ca.isIdentifierChar(l.charCodeAt(d-1))){if(d<v)for(;ca.isIdentifierChar(l.charCodeAt(d))&&!(e+=l.charAt(d),d+=1,d===v););return d!==v&&e.match(/^[0-9]+[Ee]$/)&&("-"===l.charAt(d)||"+"===l.charAt(d))?(f=l.charAt(d),d+=1,a=la(),e+=f+a[0],[e,"TK_WORD"]):!("TK_DOT"===g||"TK_RESERVED"===g&&r(b.last_text,["set","get"]))&&r(e,ma)?"in"===e?[e,"TK_OPERATOR"]:[e,"TK_RESERVED"]:[e,"TK_WORD"]}if("("===e||"["===e)return[e,"TK_START_EXPR"];if(")"===e||"]"===e)return[e,"TK_END_EXPR"];
|
||
if("{"===e)return[e,"TK_START_BLOCK"];if("}"===e)return[e,"TK_END_BLOCK"];if(";"===e)return[e,"TK_SEMICOLON"];if("/"===e){if(f="",a=!0,"*"===l.charAt(d)){if(d+=1,d<v)for(;d<v&&!("*"===l.charAt(d)&&l.charAt(d+1)&&"/"===l.charAt(d+1))&&!(e=l.charAt(d),f+=e,("\n"===e||"\r"===e)&&(a=!1),d+=1,d>=v););return d+=2,a&&0===G?["/*"+f+"*/","TK_INLINE_COMMENT"]:["/*"+f+"*/","TK_BLOCK_COMMENT"]}if("/"===l.charAt(d)){for(f=e;"\r"!==l.charAt(d)&&"\n"!==l.charAt(d)&&!(f+=l.charAt(d),d+=1,d>=v););return[f,"TK_COMMENT"]}}if("`"===
|
||
e||"'"===e||'"'===e||("/"===e||p&&"<"===e&&l.slice(d-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])\s*([-a-zA-Z:0-9_.]+=('[^']*'|"[^"]*"|{[^{}]*})\s*)*\/?\s*>/))&&("TK_RESERVED"===g&&ba(b.last_text)||"TK_END_EXPR"===g&&r(C.mode,[F,o])||r(g,"TK_COMMENT TK_START_EXPR TK_START_BLOCK TK_END_BLOCK TK_OPERATOR TK_EQUALS TK_EOF TK_SEMICOLON TK_COMMA".split(" ")))){f=e;var i=a=!1;if(n=e,d<v)if("/"===f)for(c=!1;a||c||l.charAt(d)!==f;){if(n+=l.charAt(d),a?a=!1:(a="\\"===l.charAt(d),"["===l.charAt(d)?
|
||
c=!0:"]"===l.charAt(d)&&(c=!1)),d+=1,d>=v)return[n,"TK_STRING"]}else if(p&&"<"===f){e=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])\s*([-a-zA-Z:0-9_.]+=('[^']*'|"[^"]*"|{[^{}]*})\s*)*(\/?)\s*>/g;a=l.slice(d-1);var j=e.exec(a);if(j&&0===j.index){f=j[2];for(n=0;j;){var i=!!j[1],k=j[2],J=!!j[j.length-1]||"![CDATA["===k.slice(0,8);if(k!==f||J||(i?--n:++n),0>=n)break;j=e.exec(a)}return c=j?j.index+j[0].length:a.length,d+=c-1,[a.slice(0,c),"TK_STRING"]}}else for(;a||l.charAt(d)!==f;)if(n+=l.charAt(d),
|
||
a?(("x"===l.charAt(d)||"u"===l.charAt(d))&&(i=!0),a=!1):a="\\"===l.charAt(d),d+=1,d>=v)return[n,"TK_STRING"];d+=1;n+=f;if(i&&I){a:{c=n;e=!1;a="";j=0;n="";for(i=0;e||j<c.length;)if(k=c.charAt(j),j++,e){if(e=!1,"x"===k)n=c.substr(j,2),j+=2;else if("u"===k)n=c.substr(j,4),j+=4;else{a+="\\"+k;continue}if(!n.match(/^[0123456789abcdefABCDEF]+$/))break a;if(i=parseInt(n,16),0<=i&&32>i)a+="x"===k?"\\x"+n:"\\u"+n;else if(34===i||39===i||92===i)a+="\\"+String.fromCharCode(i);else{if("x"===k&&126<i&&255>=i)break a;
|
||
a+=String.fromCharCode(i)}}else"\\"===k?e=!0:a+=k;c=a}n=c}if("/"===f)for(;d<v&&r(l.charAt(d),na);)n+=l.charAt(d),d+=1;return[n,"TK_STRING"]}if("#"===e){if(1===m.length&&0===m[0].text.length&&"!"===l.charAt(d)){for(n=e;d<v&&"\n"!==e;)e=l.charAt(d),n+=e,d+=1;return[ga(n)+"\n","TK_UNKNOWN"]}if(c="#",d<v&&r(l.charAt(d),oa)){do e=l.charAt(d),c+=e,d+=1;while(d<v&&"#"!==e&&"="!==e);return"#"===e||("["===l.charAt(d)&&"]"===l.charAt(d+1)?(c+="[]",d+=2):"{"===l.charAt(d)&&"}"===l.charAt(d+1)&&(c+="{}",d+=2)),
|
||
[c,"TK_WORD"]}}if("<"===e&&"<\!--"===l.substring(d-1,d+3)){d+=3;for(e="<\!--";"\n"!==l.charAt(d)&&d<v;)e+=l.charAt(d),d++;return b.in_html_comment=!0,[e,"TK_COMMENT"]}if("-"===e&&b.in_html_comment&&"--\>"===l.substring(d-1,d+2))return b.in_html_comment=!1,d+=2,["--\>","TK_COMMENT"];if("."===e)return[e,"TK_DOT"];if(r(e,W)){for(;d<v&&r(e+l.charAt(d),W)&&!(e+=l.charAt(d),d+=1,d>=v););return","===e?[e,"TK_COMMA"]:"="===e?[e,"TK_EQUALS"]:[e,"TK_OPERATOR"]}return[e,"TK_UNKNOWN"]}function pa(){if(fa()||
|
||
!L||aa(b.mode)||"TK_OPERATOR"===g&&"--"!==b.last_text&&"++"!==b.last_text||"TK_EQUALS"===g||!H&&"TK_RESERVED"===g&&r(b.last_text,["var","let","const","set","get"])||i(),b.do_block&&!b.do_while){if("TK_RESERVED"===s&&"while"===k){j=!0;q();j=!0;b.do_while=!0;return}i();b.do_block=!1}if(b.if_block&&!("TK_RESERVED"===s&&"else"===k)){for(;b.mode===t;)M();b.if_block=!1}if("TK_RESERVED"===s&&("case"===k||"default"===k&&b.in_case_statement)){i();if(b.case_body||z)0<b.indentation_level&&(!b.parent||b.indentation_level>
|
||
b.parent.indentation_level)&&(b.indentation_level-=1),b.case_body=!1;q();b.in_case=!0;b.in_case_statement=!0}else if("TK_RESERVED"===s&&"function"===k&&((r(b.last_text,["}",";"])||T()&&!r(b.last_text,["{",":","=",","]))&&((T()?1===m.length?!0:0===m[m.length-2].text.length:!1)||b.had_comment||(i(),i(!0))),"TK_RESERVED"===g||"TK_WORD"===g?"TK_RESERVED"===g&&r(b.last_text,["get","set","new","return"])?j=!0:i():"TK_OPERATOR"===g||"="===b.last_text?j=!0:aa(b.mode)||i()),("TK_COMMA"===g||"TK_START_EXPR"===
|
||
g||"TK_EQUALS"===g||"TK_OPERATOR"===g)&&(E()||Q()),"TK_RESERVED"===s&&"function"===k)q(),b.last_word=k;else{if(D="NONE","TK_END_BLOCK"===g?"TK_RESERVED"===s&&r(k,["else","catch","finally"])?"expand"===w||"end-expand"===w?D="NEWLINE":(D="SPACE",j=!0):D="NEWLINE":"TK_SEMICOLON"===g&&b.mode===J?D="NEWLINE":"TK_SEMICOLON"===g&&aa(b.mode)?D="SPACE":"TK_STRING"===g?D="NEWLINE":"TK_RESERVED"===g||"TK_WORD"===g?D="SPACE":"TK_START_BLOCK"===g?D="NEWLINE":"TK_END_EXPR"===g&&(j=!0,D="NEWLINE"),"TK_RESERVED"===
|
||
s&&r(k,X)&&")"!==b.last_text&&(D="else"===b.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===s&&r(k,["else","catch","finally"]))if("TK_END_BLOCK"!==g||"expand"===w||"end-expand"===w)i();else{B(!0);var d=m[m.length-1];"}"!==d.text[d.text.length-1]&&i();j=!0}else"NEWLINE"===D?"TK_RESERVED"===g&&ba(b.last_text)?j=!0:"TK_END_EXPR"!==g?"TK_START_EXPR"===g&&"TK_RESERVED"===s&&r(k,["var","let","const"])||":"===b.last_text||("TK_RESERVED"===s&&"if"===k&&"else"===b.last_word&&"{"!==b.last_text?j=!0:i()):"TK_RESERVED"===
|
||
s&&r(k,X)&&")"!==b.last_text&&i():b.mode===x&&","===b.last_text&&"}"===Y?i():"SPACE"===D&&(j=!0);q();b.last_word=k;"TK_RESERVED"===s&&"do"===k&&(b.do_block=!0);"TK_RESERVED"===s&&"if"===k&&(b.if_block=!0)}}var l,m,k,s,g,Y,K,b,C,ea,ha,na,W,d,X,ma,oa,D,L,R,j,v,G,V,qa,U="";ha=["\n","\r","\t"," "];na="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$".split("");oa="0123456789".split("");W="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! , : ? ^ ^= |= :: =>";
|
||
W+=" <%= <% %> <?= <? ?>";W=W.split(" ");X="continue try throw return var let const if switch case default for while break function".split(" ");ma=X.concat("do in else get set new catch finally typeof".split(" "));J="BlockStatement";t="Statement";f="ObjectLiteral";x="ArrayLiteral";o="ForInitializer";F="Conditional";A="Expression";qa={TK_START_EXPR:function(){fa();var d=A;if("["===k){if("TK_WORD"===g||")"===b.last_text){"TK_RESERVED"===g&&r(b.last_text,X)&&(j=!0);u(d);q();b.indentation_level+=1;N&&
|
||
(j=!0);return}d=x;b.mode===x&&("["===b.last_text||","===b.last_text&&("]"===Y||"}"===Y))&&(a||i())}else"TK_RESERVED"===g&&"for"===b.last_text?d=o:"TK_RESERVED"===g&&r(b.last_text,["if","while"])&&(d=F);";"===b.last_text||"TK_START_BLOCK"===g?i():"TK_END_EXPR"===g||"TK_START_EXPR"===g||"TK_END_BLOCK"===g||"."===b.last_text?(Q(L),R=!1):"TK_RESERVED"===g&&"("===k||"TK_WORD"===g||"TK_OPERATOR"===g?"TK_RESERVED"===g&&("function"===b.last_word||"typeof"===b.last_word)?z&&(j=!0):"TK_RESERVED"===g&&(r(b.last_text,
|
||
X)||"catch"===b.last_text)&&S&&(j=!0):j=!0;"("===k&&("TK_EQUALS"===g||"TK_OPERATOR"===g)&&(E()||Q());u(d);q();N&&(j=!0);b.indentation_level+=1},TK_END_EXPR:function(){for(;b.mode===t;)M();b.multiline_frame&&(Q("]"===k&&b.mode===x&&!a),R=!1);N&&("TK_START_EXPR"!==g||Z?j=!0:(B(),j=!1));"]"===k&&a?(q(),M()):(M(),q());ka(C);b.do_while&&C.mode===F&&(C.mode=A,b.do_block=!1,b.do_while=!1)},TK_START_BLOCK:function(){u(J);var a;a:{a=d;for(var e=l.charAt(a);r(e,ha)&&"}"!==e;){if(a++,a>=v){a=!1;break a}e=l.charAt(a)}a=
|
||
"}"===e}a=a&&"function"===b.last_word&&"TK_END_EXPR"===g;"expand"===w?"TK_OPERATOR"!==g&&(a||"TK_EQUALS"===g||"TK_RESERVED"===g&&ba(b.last_text)&&"else"!==b.last_text)?j=!0:i(!1,!0):"TK_OPERATOR"!==g&&"TK_START_EXPR"!==g?"TK_START_BLOCK"===g?i():j=!0:C.mode===x&&","===b.last_text&&("}"===Y?j=!0:i());q();b.indentation_level+=1},TK_END_BLOCK:function(){for(;b.mode===t;)M();var d="TK_START_BLOCK"===g;"expand"===w?d||i():d||(b.mode===x&&a?(a=!1,i(),a=!0):i());M();q()},TK_WORD:pa,TK_RESERVED:pa,TK_SEMICOLON:function(){for(fa()&&
|
||
(j=!1);b.mode===t&&!b.if_block&&!b.do_block;)M();q();b.mode===f&&(b.mode=J)},TK_STRING:function(){fa()?j=!0:"TK_RESERVED"===g||"TK_WORD"===g?j=!0:"TK_COMMA"===g||"TK_START_EXPR"===g||"TK_EQUALS"===g||"TK_OPERATOR"===g?E()||Q():i();q()},TK_EQUALS:function(){b.declaration_statement&&(b.declaration_assignment=!0);j=!0;q();j=!0},TK_OPERATOR:function(){var d=!0,e=!0;"TK_RESERVED"===g&&ba(b.last_text)?(j=!0,q()):"*"===k&&"TK_DOT"===g&&!Y.match(/^\d+$/)?q():":"===k&&b.in_case?(b.case_body=!0,b.indentation_level+=
|
||
1,q(),i(),b.in_case=!1):"::"===k?q():(L&&("--"===k||"++"===k)&&i(),"TK_OPERATOR"===g&&Q(),r(k,["--","++","!"])||r(k,["-","+"])&&(r(g,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||r(b.last_text,X)||","===b.last_text)?(d=!1,e=!1,";"===b.last_text&&aa(b.mode)&&(d=!0),"TK_RESERVED"===g&&(d=!0),(b.mode===J||b.mode===t)&&("{"===b.last_text||";"===b.last_text)&&i()):":"===k?0===b.ternary_depth?(b.mode===J&&(b.mode=f),d=!1):b.ternary_depth-=1:"?"===k&&(b.ternary_depth+=1),j=j||d,q(),j=e)},
|
||
TK_COMMA:function(){b.declaration_statement?(aa(b.parent.mode)&&(b.declaration_assignment=!1),q(),b.declaration_assignment?(b.declaration_assignment=!1,i(!1,!0)):j=!0):"TK_END_BLOCK"===g&&b.mode!==A?(q(),b.mode===f&&"}"===b.last_text?i():j=!0):b.mode===f?(q(),i()):(q(),j=!0)},TK_BLOCK_COMMENT:function(){var b;b=k;b=b.replace(/\x0d/g,"");for(var d=[],a=b.indexOf("\n");-1!==a;)d.push(b.substring(0,a)),b=b.substring(a+1),a=b.indexOf("\n");b=(b.length&&d.push(b),d);var o,d=!1;i(!1,!0);if(1<b.length){a:{for(var a=
|
||
b.slice(1),f=0;f<a.length;f++)if(o=ga(a[f]),"*"!==o.charAt(0)){o=!1;break a}o=!0}o&&(d=!0)}q(b[0]);for(o=1;o<b.length;o++)i(!1,!0),d?q(" "+ga(b[o])):m[m.length-1].text.push(b[o]);i(!1,!0)},TK_INLINE_COMMENT:function(){j=!0;q();j=!0},TK_COMMENT:function(){L?i(!1,!0):B(!0);j=!0;q();i(!1,!0)},TK_DOT:function(){"TK_RESERVED"===g&&ba(b.last_text)?j=!0:Q(")"===b.last_text&&$);q()},TK_UNKNOWN:function(){q();"\n"===k[k.length-1]&&i()}};c=c?c:{};P=O=y=$=Z=S=N=w=z=I=p=a=H=da=void 0;void 0!==c.space_after_anon_function&&
|
||
void 0===c.jslint_happy&&(c.jslint_happy=c.space_after_anon_function);void 0!==c.braces_on_own_line&&(w=c.braces_on_own_line?"expand":"collapse");w=c.brace_style?c.brace_style:w?w:"collapse";"expand-strict"===w&&(w="expand");y=c.indent_size?parseInt(c.indent_size,10):4;O=c.indent_char?c.indent_char:" ";H=void 0===c.preserve_newlines?!0:c.preserve_newlines;$=void 0===c.break_chained_methods?!1:c.break_chained_methods;P=void 0===c.max_preserve_newlines?0:parseInt(c.max_preserve_newlines,10);N=void 0===
|
||
c.space_in_paren?!1:c.space_in_paren;Z=void 0===c.space_in_empty_paren?!1:c.space_in_empty_paren;z=void 0===c.jslint_happy?!1:c.jslint_happy;a=void 0===c.keep_array_indentation?!1:c.keep_array_indentation;S=void 0===c.space_before_conditional?!0:c.space_before_conditional;I=void 0===c.unescape_strings?!1:c.unescape_strings;da=void 0===c.wrap_line_length?0:parseInt(c.wrap_line_length,10);p=void 0===c.e4x?!1:c.e4x;c.indent_with_tabs&&(O="\t",y=1);for(K="";0<y;)K+=O,y-=1;for(;h&&(" "===h.charAt(0)||
|
||
"\t"===h.charAt(0));)U+=h.charAt(0),h=h.substring(1);l=h;v=h.length;g="TK_START_BLOCK";Y="";m=[{text:[]}];j=R=!1;V=[];ea=[];u(J);d=0;this.beautify=function(){for(var d,e,o;;){if(d=la(),k=d[0],s=d[1],"TK_EOF"===s){for(;b.mode===t;)M();break}if(o=a&&b.mode===x,L=0<G,o)for(e=0;e<G;e+=1)i(0<e);else if(P&&G>P&&(G=P),H&&1<G){i();for(e=1;e<G;e+=1)i(!0)}qa[s]();"TK_INLINE_COMMENT"!==s&&"TK_COMMENT"!==s&&"TK_BLOCK_COMMENT"!==s&&"TK_UNKNOWN"!==s&&(Y=b.last_text,g=s,b.last_text=k);b.had_comment="TK_INLINE_COMMENT"===
|
||
s||"TK_COMMENT"===s||"TK_BLOCK_COMMENT"===s}d=m[0].text.join("");for(e=1;e<m.length;e++)d+="\n"+m[e].text.join("");return d.replace(/[\r\n ]+$/,"")}}var ca={};(function(h){var c=RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),
|
||
p=RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]");
|
||
h.isIdentifierStart=function(h){return 65>h?36===h:91>h?!0:97>h?95===h:123>h?!0:170<=h&&c.test(String.fromCharCode(h))};h.isIdentifierChar=function(c){return 48>c?36===c:58>c?!0:65>c?!1:91>c?!0:97>c?95===c:123>c?!0:170<=c&&p.test(String.fromCharCode(c))}})(ca);"function"==typeof define&&define.amd?define([],function(){return p}):"undefined"!=typeof exports?exports.js_beautify=p:"undefined"!=typeof window?window.js_beautify=p:"undefined"!=typeof global&&(global.js_beautify=p)})();
|
||
(function(){function p(h,c,p,H){var a,E,I,z,w,N,S,Z,$,y,O,P,x,t,A,c=c||{};(void 0===c.wrap_line_length||0===parseInt(c.wrap_line_length,10))&&void 0!==c.max_char&&0!==parseInt(c.max_char,10)&&(c.wrap_line_length=c.max_char);E=c.indent_inner_html||!1;I=parseInt(c.indent_size||4,10);z=c.indent_char||" ";N=c.brace_style||"collapse";w=0===parseInt(c.wrap_line_length,10)?32786:parseInt(c.wrap_line_length||250,10);S=c.unformatted||"a span bdo em strong dfn code samp kbd var cite abbr acronym q sub sup tt i b big small u s strike font ins del pre address dt h1 h2 h3 h4 h5 h6".split(" ");
|
||
$=(Z=c.preserve_newlines||!0,parseInt(c.max_preserve_newlines||32786,10));y=c.indent_handlebars||!1;a=new function(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=E,this.Utils={whitespace:["\n","\r","\t"," "],single_token:"br input link meta !doctype basefont base area hr wbr param img isindex ?xml embed ?php ? ?=".split(" "),
|
||
extra_liners:["head","body","/html"],in_array:function(a,c){for(var f=0;f<c.length;f++)if(a===c[f])return!0;return!1}},this.traverse_whitespace=function(){var a="";if(a=this.input.charAt(this.pos),this.Utils.in_array(a,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(a,this.Utils.whitespace);)Z&&"\n"===a&&this.newlines<=$&&(this.newlines+=1),this.pos++,a=this.input.charAt(this.pos);return!0}return!1},this.get_content=function(){for(var a="",c=[],f=!1,h;"<"!==this.input.charAt(this.pos);){if(this.pos>=
|
||
this.input.length)return c.length?c.join(""):["","TK_EOF"];if(this.traverse_whitespace())c.length&&(f=!0);else{if(y)if(h=this.input.substr(this.pos,3),"{{#"===h||"{{/"===h)break;else if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break;a=this.input.charAt(this.pos);this.pos++;f&&(this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,c),this.print_indentation(c)):(this.line_char_count++,c.push(" ")),f=!1);this.line_char_count++;c.push(a)}}return c.length?c.join(""):
|
||
""},this.get_contents_to=function(a){var c,f;if(this.pos===this.input.length)return["","TK_EOF"];a=RegExp("</"+a+"\\s*>","igm");return a.lastIndex=this.pos,c=a.exec(this.input),f=c?c.index:this.input.length,this.pos<f&&(this.input.substring(this.pos,f),this.pos=f),""},this.record_tag=function(a){this.tags[a+"count"]?(this.tags[a+"count"]++,this.tags[a+this.tags[a+"count"]]=this.indent_level):(this.tags[a+"count"]=1,this.tags[a+this.tags[a+"count"]]=this.indent_level);this.tags[a+this.tags[a+"count"]+
|
||
"parent"]=this.tags.parent;this.tags.parent=a+this.tags[a+"count"]},this.retrieve_tag=function(a){if(this.tags[a+"count"]){for(var c=this.tags.parent;c&&a+this.tags[a+"count"]!==c;)c=this.tags[c+"parent"];c&&(this.indent_level=this.tags[a+this.tags[a+"count"]],this.tags.parent=this.tags[c+"parent"]);delete this.tags[a+this.tags[a+"count"]+"parent"];delete this.tags[a+this.tags[a+"count"]];1===this.tags[a+"count"]?delete this.tags[a+"count"]:this.tags[a+"count"]--}},this.indent_to_tag=function(a){if(this.tags[a+
|
||
"count"]){for(var c=this.tags.parent;c&&a+this.tags[a+"count"]!==c;)c=this.tags[c+"parent"];c&&(this.indent_level=this.tags[a+this.tags[a+"count"]])}},this.get_tag=function(a){var c="",f=[],h="",p=!1,B,w,t,x=this.pos,z=this.line_char_count,i,q,A,u,a=void 0!==a?a:!1;do{if(this.pos>=this.input.length)return a&&(this.pos=x,this.line_char_count=z),f.length?f.join(""):["","TK_EOF"];if(c=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(c,this.Utils.whitespace))p=!0;else{if(("'"===c||'"'===c)&&
|
||
(c+=this.get_unformatted(c),p=!0),"="===c&&(p=!1),f.length&&"="!==f[f.length-1]&&">"!==c&&p&&(this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,f),this.print_indentation(f)):(f.push(" "),this.line_char_count++),p=!1),y&&"<"===t&&"{{"===c+this.input.charAt(this.pos)&&(c+=this.get_unformatted("}}"),f.length&&" "!==f[f.length-1]&&"<"!==f[f.length-1]&&(c=" "+c),p=!0),"<"!==c||t||(B=this.pos-1,t="<"),y&&!t&&2<=f.length&&"{"===f[f.length-1]&&"{"==f[f.length-2]&&(B="#"===c||"/"===c?this.pos-
|
||
3:this.pos-2,t="{"),this.line_char_count++,f.push(c),f[1]&&"!"===f[1]){f=[this.get_comment(B)];break}if(y&&"{"===t&&2<f.length&&"}"===f[f.length-2]&&"}"===f[f.length-1])break}}while(">"!==c);return i=f.join(""),q=-1!==i.indexOf(" ")?i.indexOf(" "):"{"===i[0]?i.indexOf("}"):i.indexOf(">"),A="<"!==i[0]&&y?"#"===i[2]?3:2:1,u=i.substring(A,q).toLowerCase(),"/"===i.charAt(i.length-2)||this.Utils.in_array(u,this.Utils.single_token)?a||(this.tag_type="SINGLE"):y&&"{"===i[0]&&"else"===u?a||(this.indent_to_tag("if"),
|
||
this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):"script"===u?a||(this.record_tag(u),this.tag_type="SCRIPT"):"style"===u?a||(this.record_tag(u),this.tag_type="STYLE"):this.is_unformatted(u,S)?(h=this.get_unformatted("</"+u+">",i),f.push(h),0<B&&this.Utils.in_array(this.input.charAt(B-1),this.Utils.whitespace)&&f.splice(0,0,this.input.charAt(B-1)),w=this.pos-1,this.Utils.in_array(this.input.charAt(w+1),this.Utils.whitespace)&&f.push(this.input.charAt(w+1)),this.tag_type=
|
||
"SINGLE"):"!"===u.charAt(0)?a||(this.tag_type="SINGLE",this.traverse_whitespace()):a||("/"===u.charAt(0)?(this.retrieve_tag(u.substring(1)),this.tag_type="END",this.traverse_whitespace()):(this.record_tag(u),"html"!==u.toLowerCase()&&(this.indent_content=!0),this.tag_type="START",this.traverse_whitespace()),this.Utils.in_array(u,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!==this.output[this.output.length-2]&&this.print_newline(!0,this.output))),a&&(this.pos=
|
||
x,this.line_char_count=z),f.join("")},this.get_comment=function(a){var c="",f=">",h=!1;this.pos=a;input_char=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&!(c+=input_char,c[c.length-1]===f[f.length-1]&&-1!==c.indexOf(f));)!h&&10>c.length&&(0===c.indexOf("<![if")?(f="<![endif]>",h=!0):0===c.indexOf("<![cdata[")?(f="]]\>",h=!0):0===c.indexOf("<![")?(f="]>",h=!0):0===c.indexOf("<\!--")&&(f="--\>",h=!0)),input_char=this.input.charAt(this.pos),this.pos++;return c},this.get_unformatted=
|
||
function(a,c){if(c&&-1!==c.toLowerCase().indexOf(a))return"";var f="",h="",p=0,B=!0;do{if(this.pos>=this.input.length)break;if(f=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(f,this.Utils.whitespace)){if(!B){this.line_char_count--;continue}if("\n"===f||"\r"===f){h+="\n";this.line_char_count=0;continue}}h+=f;this.line_char_count++;B=!0;y&&"{"===f&&h.length&&"{"===h[h.length-2]&&(h+=this.get_unformatted("}}"),p=h.length)}while(-1===h.toLowerCase().indexOf(a,p));return h},this.get_token=
|
||
function(){var a,c,f;return"TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token?(c=this.last_token.substr(7),a=this.get_contents_to(c),"string"!=typeof a)?a:[a,"TK_"+c]:"CONTENT"===this.current_mode?(a=this.get_content(),"string"!=typeof a?a:[a,"TK_CONTENT"]):"TAG"===this.current_mode?(a=this.get_tag(),"string"!=typeof a?a:(f="TK_TAG_"+this.tag_type,[a,f])):void 0},this.get_full_indent=function(a){return(a=this.indent_level+a||0,1>a)?"":Array(a+1).join(this.indent_string)},this.is_unformatted=
|
||
function(a,c){if(!this.Utils.in_array(a,c))return!1;if("a"!==a.toLowerCase()||!this.Utils.in_array("a",c))return!0;var f=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!f||this.Utils.in_array(f,c)?!0:!1},this.printer=function(a,c,f,h,p){this.input=a||"";this.output=[];this.indent_character=c;this.indent_string="";this.indent_size=f;this.brace_style=p;this.indent_level=0;this.wrap_line_length=h;for(a=this.line_char_count=0;a<this.indent_size;a++)this.indent_string+=this.indent_character;
|
||
this.print_newline=function(a,c){(this.line_char_count=0,c&&c.length)&&(a||"\n"!==c[c.length-1])&&c.push("\n")};this.print_indentation=function(a){for(var c=0;c<this.indent_level;c++)a.push(this.indent_string),this.line_char_count+=this.indent_string.length};this.print_token=function(a){(a||""!==a)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),a=a.replace(/^\s+/g,""));this.print_token_raw(a)};this.print_token_raw=function(a){a&&""!==a&&(1<a.length&&
|
||
"\n"===a[a.length-1]?(this.output.push(a.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(a));for(a=0;a<this.newlines;a++)this.print_newline(0<a,this.output);this.newlines=0};this.indent=function(){this.indent_level++};this.unindent=function(){0<this.indent_level&&this.indent_level--}},this};for(a.printer(h,z,I,w,N);!(O=a.get_token(),a.token_text=O[0],a.token_type=O[1],"TK_EOF"===a.token_type);){switch(a.token_type){case "TK_TAG_START":a.print_newline(!1,a.output);a.print_token(a.token_text);
|
||
a.indent_content&&(a.indent(),a.indent_content=!1);a.current_mode="CONTENT";break;case "TK_TAG_STYLE":case "TK_TAG_SCRIPT":a.print_newline(!1,a.output);a.print_token(a.token_text);a.current_mode="CONTENT";break;case "TK_TAG_END":"TK_CONTENT"===a.last_token&&""===a.last_text&&(P=a.token_text.match(/\w+/)[0],x=null,a.output.length&&(x=a.output[a.output.length-1].match(/(?:<|{{#)\s*(\w+)/)),(null===x||x[1]!==P)&&a.print_newline(!1,a.output));a.print_token(a.token_text);a.current_mode="CONTENT";break;
|
||
case "TK_TAG_SINGLE":(h=a.token_text.match(/^\s*<([a-z]+)/i))&&a.Utils.in_array(h[1],S)||a.print_newline(!1,a.output);a.print_token(a.token_text);a.current_mode="CONTENT";break;case "TK_TAG_HANDLEBARS_ELSE":a.print_token(a.token_text);a.indent_content&&(a.indent(),a.indent_content=!1);a.current_mode="CONTENT";break;case "TK_CONTENT":a.print_token(a.token_text);a.current_mode="TAG";break;case "TK_STYLE":case "TK_SCRIPT":""!==a.token_text&&((a.print_newline(!1,a.output),h=a.token_text,A=1,"TK_SCRIPT"===
|
||
a.token_type?t="function"==typeof p&&p:"TK_STYLE"===a.token_type&&(t="function"==typeof H&&H),"keep"===c.indent_scripts?A=0:"separate"===c.indent_scripts&&(A=-a.indent_level),I=a.get_full_indent(A),t)?h=t(h.replace(/^\s*/,I),c):(z=h.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(a.indent_string).length-1,z=a.get_full_indent(A-z),h=h.replace(/^\s*/,I).replace(/\r\n|\r|\n/g,"\n"+z).replace(/\s+$/,"")),h&&(a.print_token_raw(I+h.replace(/^\s+|\s+$/g,"")),a.print_newline(!1,a.output))),a.current_mode="TAG"}a.last_token=
|
||
a.token_type;a.last_text=a.token_text}return a.output.join("")}if("function"==typeof define&&define.amd)define(["./beautify","./beautify-css"],function(h,c){return{html_beautify:function(E,H){return p(E,H,h,c)}}});else if("undefined"!=typeof exports){var E=require("./beautify.js").js_beautify,ca=require("./beautify-css.js").css_beautify;exports.html_beautify=function(h,c){return p(h,c,E,ca)}}else"undefined"!=typeof window?window.html_beautify=function(h,c){return p(h,c,window.js_beautify,window.css_beautify)}:
|
||
"undefined"!=typeof global&&(global.html_beautify=function(h,c){return p(h,c,global.js_beautify,global.css_beautify)})})(); |