From 77806a86c5f506cec9546c28dcea6e758e2395ce Mon Sep 17 00:00:00 2001 From: austincheney Date: Fri, 9 Mar 2012 22:55:18 -0700 Subject: [PATCH] fixed up the charcomp subcomponent to be more stable along side other latest revisions --- diffview.js | 91 ++++++++++++++++++++++++--------------------------- prettydiff.js | 2 +- 2 files changed, 43 insertions(+), 50 deletions(-) diff --git a/diffview.js b/diffview.js index f2e067a1..97daca95 100644 --- a/diffview.js +++ b/diffview.js @@ -555,7 +555,8 @@ var diffview = function (args) { i = 0, j = 0, o = 0, - p = []; + p = [], + q = false; //build out static indexes for undefined areas //and find where the differences start @@ -564,51 +565,40 @@ var diffview = function (args) { r = i; } else { if (!n && ax[i] !== bx[i] && !em.test(ax[i]) && !em.test(bx[i]) && !em.test(ax[i - 1]) && !em.test(bx[i - 1])) { - if (typeof ax[i - 2] === "string" && /(<\/em>)$/.test(ax[i - 2]) && ax[i - 1] === " ") { - ax[i - 2] = ax[i - 2].replace(/(<\/em>)$/, ""); - bx[i - 2] = bx[i - 2].replace(/(<\/em>)$/, ""); - } else { - if (ax[i] !== undefined && bx[i] !== undefined) { - ax[i] = "" + ax[i]; - bx[i] = "" + bx[i]; - errorout += 1; - } else if (ax[i] === undefined && bx[i] !== undefined) { - ax[i] = ""; - bx[i] = "" + bx[i]; - errorout += 1; - } else if (ax[i] !== undefined && bx[i] === undefined) { - ax[i] = "" + ax[i]; - bx[i] = ""; - errorout += 1; - } + + if (typeof ax[i - 1] === "string" && typeof bx[i - 1] === "string") { + ax[i - 1] = ax[i - 1] + ""; + bx[i - 1] = bx[i - 1] + ""; + errorout += 1; + n = true; + break; + } else if (typeof ax[i - 1] !== "string" && typeof bx[i - 1] === "string") { + ax[i - 1] = ""; + bx[i - 1] = bx[i] + ""; + errorout += 1; + n = true; + break; + } else if (typeof ax[i - 1] === "string" && typeof bx[i - 1] !== "string") { + ax[i - 1] = ax[i] + ""; + bx[i - 1] = ""; + errorout += 1; + n = true; + break; } - n = true; } else if (ax[i] === undefined && (bx[i] === "" || bx[i] === " ")) { ax[i] = ""; } else if (bx[i] === undefined && (ax[i] === "" || ax[i] === " ")) { bx[i] = ""; } - break; } } //this is voodoo magic. for (j = i + 1; j < zx; j += 1) { - if (typeof ax[j] !== "undefined" && typeof bx[j] === "undefined") { + if (typeof ax[j] === "string" && typeof bx[j] !== "string") { bx[j] = ""; - } else if (typeof ax[j] === "undefined" && typeof bx[j] !== "undefined") { + } else if (typeof ax[j] !== "string" && typeof bx[j] === "string") { ax[j] = ""; - } else if (n && (ax[j] === bx[j] || ax[j + 1] === bx[j + 1])) { - if (ax[j] === bx[j]) { - ax[j - 1] = ax[j - 1] + ""; - bx[j - 1] = bx[j - 1] + ""; - } else { - ax[j] = ax[j] + ""; - bx[j] = bx[j] + ""; - } - n = false; - k = j + 1; - break; } else if (n) { for (o = j; o < zx; o += 1) { if (ax[j - 1] === "" + bx[o] && em.test(bx[j - 1]) && (j - 2 < 0 || ax[j - 2] !== bx[o + 1])) { @@ -639,7 +629,7 @@ var diffview = function (args) { } n = false; break; - } else if (bx[j] === ax[o]) { + } else if (bx[j] === ax[o] && ((ax[o - 1] !== ")" && ax[o - 1] !== "}" && ax[o - 1] !== "]" && ax[o - 1] !== ">" && bx[j - 1] !== ")" && bx[j - 1] !== "}" && bx[j - 1] !== "]" && bx[j - 1] !== ">") || (o === zx - 1 || bx[j + 1] === ax[o + 1]))) { if (bx[j - 1] === "" + ax[o - 1]) { bx[j - 1] = bx[j - 1].replace(//, ""); ax[o - 1] = ax[o - 1] + ""; @@ -651,9 +641,12 @@ var diffview = function (args) { ax[o - 2] = ax[o - 2] + ""; bx[j - 2] = bx[j - 2] + ""; bx[j - 1] = bx[j - 1].replace(//, ""); - } else { + } else if (ax[o - 1] !== bx[j - 1] && !em.test(ax[o - 1])) { ax[o - 1] = ax[o - 1] + ""; bx[j - 1] = bx[j - 1] + ""; + } else { + ax[o - 1] = "" + ax[o - 1]; + bx[j - 1] = "" + bx[j - 1]; } k = o; if (o - j > 0) { @@ -665,7 +658,7 @@ var diffview = function (args) { } n = false; break; - } else if (ax[j] === bx[o]) { + } else if (ax[j] === bx[o] && ((bx[o - 1] !== ")" && bx[o - 1] !== "}" && bx[o - 1] !== "]" && bx[o - 1] !== ">" && ax[j - 1] !== ")" && ax[j - 1] !== "}" && ax[j - 1] !== "]" && ax[j - 1] !== ">") || (o === zx - 1 || ax[j + 1] === bx[o + 1]))) { if (ax[j - 1] === "" + bx[o - 1]) { ax[j - 1] = ax[j - 1].replace(//, ""); bx[o - 1] = bx[o - 1] + ""; @@ -677,9 +670,12 @@ var diffview = function (args) { bx[o - 2] = bx[o - 2] + ""; ax[j - 2] = ax[j - 2] + ""; ax[j - 1] = ax[j - 1].replace(//, ""); - } else { + } else if (bx[o - 1] !== ax[j - 1] && !em.test(bx[o - 1])) { bx[o - 1] = bx[o - 1] + ""; ax[j - 1] = ax[j - 1] + ""; + } else { + bx[o - 1] = "" + bx[o - 1]; + ax[j - 1] = "" + ax[j - 1]; } k = o; if (o - j > 0) { @@ -700,26 +696,23 @@ var diffview = function (args) { //need this. if (n) { for (o = j + 1; o < zx - 1; o += 1) { - if (typeof ax[o - 1] !== "string" && ax[j + 1] === bx[o]) { - ax[j] += ""; - bx[o - 1] += ""; - k = o + 1; - n = false; - break; - } else if (typeof bx[o - 1] !== "string" && bx[j + 1] === ax[o]) { - bx[j] += ""; - ax[o - 1] += ""; - k = o + 1; - n = false; - break; + if (typeof ax[o] !== "string") { + ax.push(""); + } else if (typeof bx[o] !== "string") { + bx.push(""); } else if (ax[o] === bx[o] && typeof ax[o - 1] === "string" && typeof bx[o - 1] === "string") { ax[o - 1] = ax[o - 1] + ""; bx[o - 1] = bx[o - 1] + ""; k = o; n = false; + q = true; break; } } + if (q) { + q = false; + break; + } } } zx = Math.max(ax.length, bx.length); diff --git a/prettydiff.js b/prettydiff.js index ef244e35..160c029e 100644 --- a/prettydiff.js +++ b/prettydiff.js @@ -142,4 +142,4 @@ if (typeof exports !== "string") { }; } ***/ -var prettydiff=function(api){"use strict";var startTime=(function(){var d=new Date(),t=d.getTime();return t;}()),summary,charDecoder=function(input){var b=0,d=0,a=0,f=0,g=0,c=input,e=[],x=[],y=[],uni=(/u\+[0-9a-f]{4,5}\+/),unit=(/u\![0-9a-f]{4,5}\+/),htmln=(/\&\#[0-9]{1,6}\;/),htmlt=(/\&\![0-9]{1,6}\;/);if((!o.rh&&!o.rh.innerHTML)||(c.search(unit)===-1&&c.search(uni)===-1&&c.search(htmlt)===-1&&c.search(htmln)===-1)){return input;}f=input.length;for(b=0;bsource.length){return source;}else if(source===error){if(a!==source.length-1){return source+a+", '"+err+"'.";}else{return source+a+".";}}source=source.replace(/\n/g,"\n\n{-}\n\n");if(source.charAt(source.length-ch.length)===ch){source=source.slice(0,source.length+1-ch.length)+"{|}";}do{source=source.replace(ch,"\n");}while(source.indexOf(ch)!==-1);b=c.length;for(a=0;a2){e=c.length-1;for(d=1;d3){level=2;}if(type==="javascript"){input=input.replace(/\/\/(\s)*-->/g,"//-->");}else if(type!=="css"){input="Error: The type argument is not provided a value of either 'css' or 'javascript'.";}}}()),ret,atchar=input.match(/\@charset\s+("|')[\w\-]+("|');?/gi),error="",a="",b="",geti,getl,EOF=-1,LETTERS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",DIGITS="0123456789",OTHERS,ALNUM,fcom=[],alterj=false,asiflag=true,theLookahead=EOF,isAlphanum=function(c){return c!==EOF&&(ALNUM.indexOf(c)>-1||c.charCodeAt(0)>126);},jsasiq=function(x){if(x.indexOf("\n")===-1){return x;}else{x=x.split("");x[0]=x[0]+";";return x.join("");}},asiFix=function(y){var a=0,x=y.split(""),b=x.length,c=0,d=0,e="",f="",g="",h="";for(a=0;a-1;c-=1){if((c>1&&x[c-1]==="\\"&&x[c-2]!=="\\")||(c===1&&x[c-1]==="\\")){c-=1;}else{if(x[c].charAt(0)===g&&e===""){d-=1;}else if(x[c]===h&&e===""){d+=1;}else if(x[c]==="\""&&e===""){e="\"";}else if(x[c]==="'"&&e===""){e="'";}else if(x[c]==="pd"&&e===""){e="/";}else if(x[c]==="\""&&e==="\""){e="";}else if(x[c]==="'"&&e==="'"){e="";}else if(x[c]==="pd"&&e==="/"){e="";}}if(d===0&&(c!==a-1||(c===a-1&&typeof x[c-1]==="string"&&x[c-1]!==x[a]))){if(x[c-1]===")"&&g==="}"){c-=2;d=-1;e="";for(c;c>-1;c-=1){if((c>1&&x[c-1]==="\\"&&x[c-2]!=="\\")||(c===1&&x[c-1]==="\\")){c-=1;}else{if(x[c]===")"&&e===""){d-=1;}else if(x[c]==="("&&e===""){d+=1;}else if(x[c]==="\""&&e===""){e="\"";}else if(x[c]==="'"&&e===""){e="'";}else if(x[c]==="pd"&&e===""){e="/";}else if(x[c]==="\""&&e==="\""){e="";}else if(x[c]==="'"&&e==="'"){e="";}else if(x[c]==="pd"&&e==="/"){e="";}}if(d===0){c-=1;if(typeof x[c-9]==="string"&&x[c-8]==="="&&x[c-7]==="f"&&x[c-6]==="u"&&x[c-5]==="n"&&x[c-4]==="c"&&x[c-3]==="t"&&x[c-2]==="i"&&x[c-1]==="o"&&x[c]==="n"&&(isAlphanum(x[c-9])||x[c-9]==="]"||x[c-9]===")")){x[a]+=";";}break;}}break;}else if(typeof x[c-2]==="string"&&x[c-1]==="="&&(x[a-1].length===1||x[a-1]==="pd")&&(isAlphanum(x[c-2]||x[c-2]==="]"||x[c-2]===")"))){if(typeof x[a+1]!=="string"||x[a+1]!=="/"){x[a]+=";";}break;}else{break;}}}}}}for(a=0;a-1){h=d[a].split("");f=h.length;for(e=3;e=" "||c==="\n"){return c;}if(c==="\r"){return"\n";}return" ";},peek=function(){theLookahead=get();return theLookahead;},next=function(){var c=get();if(c==="/"&&(type==="javascript"||(type==="css"&&peek()!=="/"))){switch(peek()){case"/":for(;;){c=get();if(c<="\n"){return c;}}break;case"*":get();for(;;){switch(get()){case"'":c=get().replace(/'/,"");break;case"\"":c=get().replace(/"/,"");break;case"*":if(peek()==="/"){get();return" ";}break;case EOF:error="Error: Unterminated block comment.";return error;}}break;default:return c;}}return c;},action=function(d){var r=[];if(d===1){r.push(a);}if(d<3){a=b;if(a==="'"||a==="\""){if(d===1&&(r[0]===")"||r[0]==="]")&&alterj){a=";";return r[0];}for(;;){r.push(a);a=get();if(a===b){break;}if(a<="\n"){if(type==="css"){error="Error: This does not appear to be CSS.";}else{error="Error: This does not appear to be JavaScript.";}return error;}if(a==="\\"){r.push(a);a=get();}}}}b=next();if(b==="/"&&"(,=:[!&|".indexOf(a)>-1){r.push(a);r.push(b);for(;;){a=get();if(a==="/"){break;}else if(a==="\\"){r.push(a);a=get();}else if(a<="\n"){error="Error: unterminated JavaScript Regular Expression literal";return error;}r.push(a);}b=next();}return r.join("");},m=function(){var firstComment=(function(){var a=0,b=input.length,c="";if(fcomment!==true||(/^\s*\/\*/.test(input)!==true&&/^\s*\/\//.test(input)!==true)){return;}for(a=0;a/g,"//-->");ret=asiFix(ret);}else{ret=ret.replace(/^\s+/,"").replace(/x{2}-->/g,"//-->");}if(error!==""){return error;}else{return fcom.join("")+ret;}},cleanCSS=function(x,size,character,comment,alter){var q=x.length,a=0,b=0,c=[],atchar=x.match(/\@charset\s+("|')[\w\-]+("|');?/gi),tab="",nsize=Number(size),fixURI=function(y){var a=0,b=[],c="",x=y.replace(/\\\)/g,"~PDpar~").split("url("),d=x.length,e="\"";for(a=1;a3&&y[i-3]==="u"&&y[i-2]==="r"&&y[i-1]==="l"&&y[i]==="("){for(j=i;j=b){out=[out.join("").replace(/^(\s*)/,"").replace(/(\s*)$/,"")];x=out.join("");tabs=[];}},reduction=function(x){var a=0,e=0,f=0,g=-1,m=0,p=0,q="",b=x.length,c=[],d=[],h=[],i=[],test=false,colorLow=function(y){y=y.toLowerCase();if(y.length===7&&y.charAt(1)===y.charAt(2)&&y.charAt(3)===y.charAt(4)&&y.charAt(5)===y.charAt(6)){y="#"+y.charAt(1)+y.charAt(3)+y.charAt(5);}return y;},ccex=(/[\w\s:#\-\=\!\(\)"'\[\]\.%-\_\?\/\\]\/\*/),cceg=function(a){return a.replace(/\s*\/\*/,";/*");};for(a=0;a0;b-=1){if(x.charAt(b)==="/"&&x.charAt(b-1)&&x.charAt(b-1)==="*"){for(e=b-1;e>0;e-=1){if(x.charAt(e)==="/"&&x.charAt(e+1)==="*"){b=e;break;}}}else if(!/[\}\s]/.test(x.charAt(b))){break;}}for(a=d.length-1;a>0;a-=1){if(d[a]==="}"){b+=1;}else{break;}}if(b===x.length||x.substring(b+1,x.length-1)===d[d.length-1]){d.push("}");}else{d.push(x.substring(b+1,x.length));}b=d.length;for(a=0;a/g," > ");}else{if(d[a].indexOf("url(")>-1){h=d[a].split("");f=h.length;for(e=3;e])\s?/g,"$1").replace(/\{(\.*):(\.*)\}/g,"{$1: $2}").replace(/\b\*/g," *").replace(/\*\/\s?/g,"*/\n").replace(/\d%\d/g,fixpercent);if(alter===true){x=reduction(x);}cleanAsync();if(alter===true){c=x.split("*/");b=c.length;for(a=0;a"+e[a]+"";}b[a]="
  • "+e[a]+" - "+b[a]+"
  • ";}}if(d!==0){i="

    List of HTTP requests:

      "+b.join("")+"
    ";}j=f.length;for(a=2;aTotal input size: "+k+" characters

    Total output size: "+l+" characters

    Number of HTTP requests: "+h+"

    "+i;}());return x;},js_beautify=function(args){(function(){if(!args.source||typeof args.source!=="string"){args.source="";}else{args.source=args.source.replace(/var /g,"var prettydiffvar,");}if(args.insize===undefined||isNaN(args.insize)){args.insize=4;}if(!args.inchar||args.inchar.length<1||typeof args.inchar!=="string"){args.inchar=" ";}if(!args.inlevel||isNaN(args.inlevel)){args.inlevel=0;}if(typeof args.preserve!=="boolean"){args.preserve=true;}if(!args.preserve_max||isNaN(args.preserve_max)){args.preserve_max=0;}if(!args.space||args.space!==true){args.space=false;}if(!args.braces||typeof args.braces!=="boolean"){if(args.braces==="allman"){args.braces=true;}else{args.braces=false;}}if(!args.inarray||args.inarray!==true){args.inarray=false;}if(!args.content||args.content!==true){args.content=false;}if(!args.comments||typeof args.comments!=="boolean"){if(args.comments==="noindent"){args.comments=true;}else{args.comments=false;}}}());var j=[0,0],k=[0,0],l=[0,0,0],m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=[0,0,0,0,0],o=[0,0],w=[0,0,0,0],i=0,insize=args.insize,input=args.source,input_length=args.source.length+1,t=[],output=[],token_text="",last_type="TK_START_EXPR",var_last_type="",var_last_last_type="",var_end_count=-1,last_text="",last_last_text="",last_word="",last_last_word="",flags={previous_mode:(flags)?flags.mode:"BLOCK",mode:"BLOCK",var_line:false,var_line_reindented:false,in_html_comment:false,if_line:false,in_case:false,eat_next_space:false,indentation_baseline:-1,indentation_level:((flags)?flags.indentation_level+((flags.var_line&&flags.var_line_reindented)?1:0):args.inlevel)},functestval=0,var_var_test=false,commafix=false,comma_test=false,forblock=false,forcount=0,flag_store=[flags],indent_string="",wordchar=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9","_","$"],punct=["+","-","*","/","%","&","++","--","=","+=","-=","*=","/=","%=","==","===","!=","!==",">","<",">=","<=",">>","<<",">>>",">>>=",">>=","<<=","&&","&=","|","||","!","!!",",",":","?","^","^=","|=","::"],parser_pos=0,prefix="",token_type="",do_block_just_closed=false,wanted_newline=false,just_added_newline=false,rvalue="",space_before=true,space_after=true,pseudo_block=false,block_comment=function(x){var lines=x.split(/\x0a|\x0d\x0a/),j=lines.length,i=0;print_newline();output.push(lines[0]);for(i=1;i0){flags=flag_store.pop();}},in_array=function(what,arr){var i=0;for(i=0;i=0;i-=1){if(output[i]===":"&&level===0){colon_count+=1;}else if(output[i]==="?"&&level===0){if(colon_count===0){return true;}else{colon_count-=1;}}else if(output[i]==="{"||output[i]==="("||output[i]==="["){if(output[i]==="{"&&level===0){return false;}level-=1;}else if(output[i]===")"||output[i]==="}"||output[i]==="]"){level+=1;}}},fix_object_own_line=function(){var b=0;for(b=output.length-2;b>0;b-=1){if(/^(\s+)$/.test(output[b])){output[b]="";}else if(in_array(output[b],punct)){output[b+1]=" ";break;}}},funcfix=function(y){var a=(y.indexOf("}")-1),b="",c="";if(y.charAt(0)==="\n"){b="\n";c=y.substr(1,a);}else{c=y.substr(0,a);}return b+c+"}\n"+c+"(function";},get_next_token=function(){var c="",i=0,comment="",inline_comment=false,keep_whitespace=false,sep="",esc=false,resulting_string="",in_char_class=false,whitespace_count=0;if(parser_pos>=input_length){return["","TK_EOF"];}wanted_newline=false;c=input.charAt(parser_pos);parser_pos+=1;keep_whitespace=args.inarray&&is_array(flags.mode);if(keep_whitespace){whitespace_count=0;while(c==="\n"||c==="\r"||c==="\t"||c===" "){if(c==="\n"){trim_output();output.push("\n");just_added_newline=true;whitespace_count=0;}else{if(c==="\t"){whitespace_count+=4;}else if(c!=="\r"){whitespace_count+=1;}}if(parser_pos>=input_length){return["","TK_EOF"];}c=input.charAt(parser_pos);parser_pos+=1;}if(flags.indentation_baseline===-1){flags.indentation_baseline=whitespace_count;}if(just_added_newline){for(i=0;i=input_length){return["","TK_EOF"];}c=input.charAt(parser_pos);parser_pos+=1;}if(args.preserve){if(n_newlines>1){for(i=0;i0;}());if(parser_pos>=input_length){return["","TK_EOF"];}}if(in_array(c,wordchar)){if(parser_pos=input_length){break;}}}parser_pos+=2;if(inline_comment){return["/*"+comment+"*/","TK_INLINE_COMMENT"];}else{return["/*"+comment+"*/","TK_BLOCK_COMMENT"];}}if(input.charAt(parser_pos)==="/"){comment=c;while(input.charAt(parser_pos)!=="\r"&&input.charAt(parser_pos)!=="\n"){comment+=input.charAt(parser_pos);parser_pos+=1;if(parser_pos>=input_length){break;}}parser_pos+=1;if(wanted_newline){print_newline();}return[comment,"TK_COMMENT"];}}if(c==="'"||c==="\""||(c==="/"&&((last_type==="TK_WORD"&&(last_text==="return"||last_text==="do"))||(last_type==="TK_COMMENT"||last_type==="TK_START_EXPR"||last_type==="TK_START_BLOCK"||last_type==="TK_END_BLOCK"||last_type==="TK_OPERATOR"||last_type==="TK_EQUALS"||last_type==="TK_EOF"||last_type==="TK_SEMICOLON")))){sep=c;esc=false;resulting_string=c;if(parser_pos=input_length){return[resulting_string,"TK_STRING"];}}}else{while(esc||input.charAt(parser_pos)!==sep){resulting_string+=input.charAt(parser_pos);if(!esc){esc=input.charAt(parser_pos)==="\\";}else{esc=false;}parser_pos+=1;if(parser_pos>=input_length){return[resulting_string,"TK_STRING"];}}}}parser_pos+=1;resulting_string+=sep;if(sep==="/"){while(parser_pos"){flags.in_html_comment=false;parser_pos+=2;if(wanted_newline){print_newline();}return["-->","TK_COMMENT"];}if(in_array(c,punct)){while(parser_pos=input_length){break;}}if(c==="="){return[c,"TK_EQUALS"];}else{return[c,"TK_OPERATOR"];}}return[c,"TK_UNKNOWN"];};if(args.source===""){return"Error: no source code supplied to js_beautify.js";}while(insize>0){indent_string+=args.inchar;insize-=1;}parser_pos=0;while(true){t=get_next_token(parser_pos);token_text=t[0];token_type=t[1];if(token_type==="TK_EOF"){break;}else if(token_type==="TK_START_EXPR"){n[4]+=1;pseudo_block=false;if(token_text==="["){if(last_type==="TK_WORD"||last_text===")"){if(last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function"){print_single_space();}set_mode("(EXPRESSION)");print_token();}else if(flags.mode==="[EXPRESSION]"||flags.mode==="[INDENTED-EXPRESSION]"){if(last_last_text==="]"&&last_text===","){if(flags.mode==="[EXPRESSION]"){flags.mode="[INDENTED-EXPRESSION]";if(!args.inarray){flags.indentation_level+=1;}}set_mode("[EXPRESSION]");if(!args.inarray){print_newline();}}else if(last_text==="["){if(flags.mode==="[EXPRESSION]"){flags.mode="[INDENTED-EXPRESSION]";if(!args.inarray){flags.indentation_level+=1;}}set_mode("[EXPRESSION]");if(!args.inarray){print_newline();}}else{set_mode("[EXPRESSION]");}}else{set_mode("[EXPRESSION]");}}else{set_mode("(EXPRESSION)");}if(token_text!=="["||(token_text==="["&&(last_type!=="TK_WORD"&&last_text!==")"))){if(last_text===";"||last_type==="TK_START_BLOCK"){print_newline();}else if(last_type!=="TK_END_EXPR"&&last_type!=="TK_START_EXPR"&&last_type!=="TK_END_BLOCK"&&last_text!=="."){if((last_type!=="TK_WORD"&&last_type!=="TK_OPERATOR")||(last_word==="function"&&args.space)){print_single_space();}else if(last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function"||last_text==="catch"){print_single_space();}}print_token();}if(forblock&&token_text==="("){forcount+=1;}}else if(token_type==="TK_END_EXPR"){n[4]+=1;if(last_last_text==="}"){pseudo_block=true;}if(token_text==="]"&&args.inarray&&last_text==="}"){if(output.length&&output[output.length-1]===indent_string){output.pop();}print_token();restore_mode();}else if(token_text==="]"&&flags.mode==="[INDENTED-EXPRESSION]"&&last_text==="]"){restore_mode();print_newline();print_token();}else{restore_mode();print_token();}if(forblock&&token_text===")"){forcount-=1;if(forcount===0){forblock=false;}}}else if(token_type==="TK_START_BLOCK"){n[4]+=1;pseudo_block=false;if(last_word==="do"){set_mode("DO_BLOCK");}else{set_mode("BLOCK");}if(var_last_last_type==="TK_START_BLOCK"&&!isNaN(var_end_count)){var_end_count+=1;}if(args.braces){if(last_type!=="TK_OPERATOR"){if(last_text==="return"){print_single_space();}else{print_newline();}}}else{if(functestval>1){flags.indentation_level+=1;var_var_test=true;comma_test=true;}if(last_type!=="TK_OPERATOR"&&last_type!=="TK_START_EXPR"){if(last_type==="TK_START_BLOCK"){print_newline();}else{print_single_space();}}else{if(is_array(flags.previous_mode)&&last_text===","){print_newline();}}}flags.indentation_level+=1;print_token();forblock=false;forcount=0;}else if(token_type==="TK_END_BLOCK"){n[4]+=1;restore_mode();functestval=0;if(var_var_test){pseudo_block=true;}else{pseudo_block=false;}if(var_end_count===0){var_end_count="x";}else if(var_end_count===-1&&var_var_test&&comma_test){flags.var_line_reindented=true;}else if(var_last_last_type==="TK_START_BLOCK"&&!isNaN(var_end_count)){var_end_count-=1;}else if(var_end_count==="a"){if(flags.var_line&&!flags.var_line_reindented){flags.var_line_reindented=true;var_end_count=-1;}}if(args.braces){if(last_text==="{"&&in_array(last_last_text,punct)){fix_object_own_line();}else{if(var_end_count==="y"){var_last_last_type="";var_end_count="a";}print_newline();if(var_end_count==="x"){if(flags.var_line&&!comma_test&&!var_var_test){flags.var_line_reindented=true;}var_end_count="y";}}print_token();}else{if(last_type==="TK_START_BLOCK"){if(just_added_newline){if(output.length&&output[output.length-1]===indent_string){output.pop();}}else{trim_output();}}else if(is_array(flags.mode)&&args.inarray){args.inarray=false;print_newline();args.inarray=true;}else{if(var_end_count==="y"){var_last_last_type="";var_end_count="a";}print_newline();if(var_end_count==="x"){if(flags.var_line&&!comma_test&&!var_var_test){flags.var_line_reindented=true;}var_end_count="y";}}if(!comma_test&&var_var_test&&!flags.var_line_reindented){if((flags.mode==="(EXPRESSION)"&&!flags.var_line)||(flags.mode==="BLOCK"&&flags.var_line)){if(last_text!=="}"&&var_end_count===-1&&flags.mode==="(EXPRESSION)"){output.push(indent_string);}var_var_test=false;}}print_token();}}else if(token_type==="TK_WORD"){if(token_text==="alert"){m[0]+=1;}else if(token_text==="break"){m[2]+=1;}else if(token_text==="case"){m[4]+=1;}else if(token_text==="catch"){m[48]+=1;}else if(token_text==="continue"){m[6]+=1;}else if(token_text==="default"){m[8]+=1;}else if(token_text==="delete"){m[10]+=1;}else if(token_text==="do"){m[12]+=1;}else if(token_text==="document"){m[44]+=1;}else if(token_text==="else"){m[14]+=1;}else if(token_text==="eval"){m[16]+=1;}else if(token_text==="for"){m[18]+=1;}else if(token_text==="function"){m[20]+=1;}else if(token_text==="if"){m[22]+=1;}else if(token_text==="in"){m[24]+=1;}else if(token_text==="label"){m[26]+=1;}else if(token_text==="new"){m[28]+=1;}else if(token_text==="return"){m[30]+=1;}else if(token_text==="switch"){m[32]+=1;}else if(token_text==="this"){m[34]+=1;}else if(token_text==="throw"){m[50]+=1;}else if(token_text==="try"){m[52]+=1;}else if(token_text==="typeof"){m[36]+=1;}else if(token_text==="var"){m[38]+=1;}else if(token_text==="while"){m[40]+=1;}else if(token_text==="with"){m[42]+=1;}else if(token_text==="window"){m[46]+=1;}else{o[0]+=1;o[1]+=token_text.length;}if(token_text!=="var"&&last_text===";"){comma_test=false;}if(last_text===";"&&last_last_text==="}"&&var_end_count==="y"){flags.indentation_level-=1;}if(last_text==="{"&&((last_last_text===":"&&comma_test)||(last_last_text===")"&&var_last_type==="TK_START_BLOCK"&&!comma_test))){output.push(indent_string);flags.indentation_level+=1;if(token_text!=="var"&&!isNaN(var_end_count)){var_end_count+=1;}}if(do_block_just_closed){print_single_space();print_token();print_single_space();do_block_just_closed=false;}else{if(token_text==="do"){print_newline();print_token();}else if(token_text==="case"||token_text==="default"){if(last_text===":"){if(output.length&&output[output.length-1]===indent_string){output.pop();}}else{flags.indentation_level-=1;print_newline();flags.indentation_level+=1;}print_token();flags.in_case=true;}else{if(token_text==="function"){if(comma_test&&(flags.var_line||(!flags.var_line&&last_last_word==="var"))){functestval+=1;}else if(!comma_test){functestval-=1;}if(comma_test&&flags.var_line&&last_last_word==="var"&&!var_var_test&&functestval===0){flags.var_line_reindented=true;}}prefix="NONE";if(last_type==="TK_END_BLOCK"){if(args.braces||(token_text!=="else"&&token_text!=="catch"&&token_text!=="finally")){prefix="NEWLINE";}else{prefix="SPACE";print_single_space();}}else if(last_type==="TK_STRING"||last_type==="TK_START_BLOCK"||(last_type==="TK_SEMICOLON"&&(flags.mode==="BLOCK"||flags.mode==="DO_BLOCK"))){prefix="NEWLINE";}else if(last_type==="TK_WORD"||(last_type==="TK_SEMICOLON"&&is_expression(flags.mode))){prefix="SPACE";}else if(last_type==="TK_END_EXPR"){print_single_space();prefix="NEWLINE";}if(flags.if_line&&last_type==="TK_END_EXPR"){flags.if_line=false;}if(token_text==="else"||token_text==="catch"||token_text==="finally"){if(last_type!=="TK_END_BLOCK"||args.braces){print_newline();}else{trim_output(true);print_single_space();}}else if(last_type!=="TK_START_EXPR"&&last_text!=="="&&last_text!==","&&(token_text==="continue"||token_text==="try"||token_text==="throw"||token_text==="return"||token_text==="var"||token_text==="if"||token_text==="switch"||token_text==="case"||token_text==="default"||token_text==="for"||token_text==="while"||token_text==="break"||token_text==="function"||prefix==="NEWLINE")){if(last_text==="return"||last_text==="throw"||(last_type!=="TK_END_EXPR"&&last_text!==":"&&(last_type!=="TK_START_EXPR"||token_text!=="var"))){if((token_text==="if"&&last_word==="else"&&last_text!=="{")||(token_text==="function"&&last_type==="TK_OPERATOR")){print_single_space();}else{print_newline();}}else if(last_text!==")"&&last_text!==":"&&(token_text==="continue"||token_text==="try"||token_text==="throw"||token_text==="return"||token_text==="var"||token_text==="if"||token_text==="switch"||token_text==="case"||token_text==="default"||token_text==="for"||token_text==="while"||token_text==="break"||token_text==="function")){print_newline();}}else if(prefix==="SPACE"||(forblock&&last_text===";")){print_single_space();}else if(last_text===";"||(is_array(flags.mode)&&last_text===","&&last_last_text==="}")){print_newline();}if(token_text==="var"){if(!var_var_test&&last_type==="TK_START_BLOCK"&&comma_test){if(functestval>=0){var_var_test=true;}}else if(last_type==="TK_START_BLOCK"){if(var_last_type==="TK_START_BLOCK"){if(last_type==="TK_START_BLOCK"){var_last_type="";var_last_last_type="TK_START_BLOCK";var_end_count=0;}}else{var_last_type="TK_START_BLOCK";}}else if(last_type==="TK_START_BLOCK"&&var_last_type===""){var_last_type="TK_START_BLOCK";}flags.var_line=true;flags.var_line_reindented=false;comma_test=true;}print_token();if(token_text==="typeof"){print_single_space();}if(token_text==="if"){flags.if_line=true;}if(token_text==="else"){flags.if_line=false;}if(token_text==="for"){forblock=true;}}last_last_word=last_word;last_word=token_text;}}else if(token_type==="TK_SEMICOLON"){n[3]+=1;if(last_text==="}"){comma_test=true;}print_token();flags.var_line=false;flags.var_line_reindented=false;if(functestval<2){var_var_test=false;}var_last_type="";}else if(token_type==="TK_STRING"){l[0]+=1;if((token_text.charAt(0)==="\""&&token_text.charAt(token_text.length-1)==="\"")||(token_text.charAt(0)==="'"&&token_text.charAt(token_text.length-1)==="'")){l[1]+=token_text.length-2;l[2]+=2;}else{l[1]+=token_text.length;}white_count(token_text);if(last_type==="TK_START_BLOCK"||last_type==="TK_END_BLOCK"||last_type==="TK_SEMICOLON"){print_newline();}else if(last_type==="TK_WORD"){print_single_space();}if(args.content){output.push(token_text.charAt(0)+"text"+token_text.charAt(0));}else{print_token();}}else if(token_type==="TK_EQUALS"){n[0]+=1;n[1]+=1;print_single_space();print_token();print_single_space();}else if(token_type==="TK_OPERATOR"){if(token_text!==","){n[0]+=1;n[1]+=token_text.length;}var_last_type="";if(token_text===","){if(var_end_count==="y"&&last_type!=="TK_END_BLOCK"){flags.indentation_level-=1;}if(commafix){commafix=false;if(last_text==="}"){flags.var_line_reindented=true;}}if(last_text==="}"&&last_last_text==="{"&&last_last_word==="var"&&flags.var_line){commafix=true;flags.var_line_reindented=true;}n[2]+=1;if(flags.mode!=="(EXPRESSION)"&&last_last_text!==":"){comma_test=false;}if(flags.var_line&&flags.mode!=="(EXPRESSION)"){flags.var_line_reindented=true;print_token();if(last_word!=="prettydiffvar"){print_newline();}}else if(last_type==="TK_END_BLOCK"&&flags.mode!=="(EXPRESSION)"){print_token();if(last_text==="}"){print_newline();}else{print_single_space();}}else if(flags.mode!=="(EXPRESSION)"&&(flags.mode==="BLOCK"||flags.mode==="OBJECT"||is_ternary_op())){print_token();print_newline();}else{print_token();print_single_space();}}else if(last_text==="return"||last_text==="throw"){print_single_space();print_token();}else if(token_text==="::"){print_token();}else if(token_text==="--"||token_text==="++"||token_text==="!"||((token_text==="-"||token_text==="+")&&(last_type==="TK_START_BLOCK"||last_type==="TK_START_EXPR"||last_type==="TK_EQUALS"||last_type==="TK_OPERATOR"||last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function"))){space_before=false;space_after=false;if(last_text===";"&&is_expression(flags.mode)){space_before=true;}if(last_type==="TK_WORD"&&(last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function")){space_before=true;}if(flags.mode==="BLOCK"&&(last_text==="{"||last_text===";")){print_newline();}}else if(token_text==="."){space_before=false;}if(token_text!==","&&token_text!==":"&&(token_text!=="-"||(token_text==="-"&&last_text!=="continue"&&last_text!=="try"&&last_text!=="throw"&&last_text!=="return"&&last_text!=="var"&&last_text!=="if"&&last_text!=="switch"&&last_text!=="case"&&last_text!=="default"&&last_text!=="for"&&last_text!=="while"&&last_text!=="break"&&last_text!=="function"))){if(space_before){print_single_space();}print_token();if(space_after){print_single_space();}}else if(token_text===":"){if(flags.in_case){print_token();print_newline();flags.in_case=false;}else if(is_ternary_op()){print_single_space();print_token();print_single_space();flags.mode="OBJECT";}else if(flags.in_case){print_single_space();print_token();print_single_space();}else if(last_last_text!=="case"&&last_last_text!=="default"&&last_text!=="case"&&last_text!=="default"){print_token();print_single_space();}}space_before=true;space_after=true;}else if(token_type==="TK_BLOCK_COMMENT"){j[0]+=1;j[1]+=token_text.length;white_count(token_text);if(args.comments){for(i=output.length-1;i>0;i-=1){if(output[i]===indent_string||output[i]===" "){output[i]="";}else{break;}}output.push("\n");print_token();output.push("\n");}else{block_comment(token_text);}}else if(token_type==="TK_INLINE_COMMENT"){j[0]+=1;j[1]+=token_text.length;white_count(token_text);print_token();if(is_expression(flags.mode)){print_single_space();}else if(args.comments){output.push("\n");}else{print_newline();}}else if(token_type==="TK_COMMENT"){k[0]+=1;k[1]+=token_text.length;white_count(token_text);if(args.comments){for(i=output.length-1;i>0;i-=1){if(output[i]===indent_string){output[i]="";}else{break;}}}else if(wanted_newline){print_newline();}else{print_single_space();}print_token();print_newline();}else if(token_type==="TK_UNKNOWN"){n[0]+=1;n[1]+=token_text.length;white_count(token_text);if(last_text==="return"||last_text==="throw"){print_single_space();}print_token();}last_last_text=last_text;last_type=token_type;last_text=token_text;}rvalue=output.join("").replace(/var prettydiffvar\,\s*/g,"var ").replace(/^(\s+)/,"").replace(/(\s+)$/,"").replace(/\s*\}\(function/g,funcfix).replace(/\n( |\t)+\n/g,"\n\n").replace(/ \n/g,"\n");(function(){var a=0,b=0,e=1,f=1,g=0,h=0,i=0,p=0,q=[],z=[],output,zero=function(x,y){if(y===0){return"0.00%";}else{return((x/y)*100).toFixed(2)+"%";}},drawRow=function(w,x,y,z,Z){var a=["Keyword '"];a.push(w);a.push("'");a.push(y);a.push("");a.push(zero(y,m[54]));a.push("");a.push(zero(y,Z[0]));a.push("");a.push(z);a.push("");a.push(zero(z,m[55]));a.push("");a.push(zero(z,Z[1]));a.push("");return a.join("");};if(rvalue.length<=input_length){b=input_length;}else{b=rvalue.length;}for(a=0;a0){q[0]=" class='bad'";}else{q[0]="";}if(m[6]>0){q[1]=" class='bad'";}else{q[1]="";}if(m[16]>0){q[2]=" class='bad'";}else{q[2]="";}if(m[42]>0){q[3]=" class='bad'";}else{q[3]="";}g=g-w[1];h=h-w[2];p=p-w[3];i=((e-1-w[0])+g+h+p);n.push(l[2]+n[0]+n[2]+n[3]+n[4]);n.push(l[2]+n[1]+n[2]+n[3]+n[4]);j.push(j[0]+k[0]);j.push(j[1]+k[1]);m[1]=m[0]*5;m[3]=m[2]*5;m[5]=m[4]*4;m[7]=m[6]*8;m[9]=m[8]*7;m[11]=m[10]*6;m[13]=m[12]*2;m[15]=m[14]*4;m[17]=m[16]*4;m[19]=m[18]*3;m[21]=m[20]*8;m[23]=m[22]*2;m[25]=m[24]*2;m[27]=m[26]*5;m[29]=m[28]*3;m[31]=m[30]*6;m[33]=m[32]*6;m[35]=m[34]*4;m[37]=m[36]*6;m[39]=m[38]*3;m[41]=m[40]*5;m[43]=m[42]*4;m[45]=m[44]*8;m[47]=m[46]*6;m[49]=m[48]*5;m[51]=m[50]*5;m[53]=m[52]*3;m[54]=m[0]+m[2]+m[4]+m[6]+m[8]+m[10]+m[12]+m[14]+m[16]+m[18]+m[20]+m[22]+m[24]+m[26]+m[28]+m[30]+m[32]+m[34]+m[36]+m[38]+m[40]+m[42]+m[44]+m[46]+m[48]+m[50]+m[52];m[55]=m[1]+m[3]+m[5]+m[7]+m[9]+m[11]+m[13]+m[15]+m[17]+m[19]+m[21]+m[23]+m[25]+m[27]+m[29]+m[31]+m[33]+m[35]+m[37]+m[39]+m[41]+m[43]+m[45]+m[47]+m[49]+m[51]+m[53];z.push(j[2]+l[0]+n[5]+m[54]+o[0]+i);z.push(j[3]+l[1]+n[6]+m[55]+o[1]+i);output=["
    "];output.push("");output.push("
    JavaScript data report
    Data LabelInputOutputLiteral IncreasePercentage Increase
    Total Character Size");output.push(input_length);output.push("");output.push(rvalue.length);output.push("");output.push(rvalue.length-input_length);output.push("");output.push((((rvalue.length-input_length)/rvalue.length)*100).toFixed(2));output.push("%
    Total Lines of Code");output.push(e);output.push("");output.push(f);output.push("");output.push(f-e);output.push("");output.push((((f-e)/e)*100).toFixed(2));output.push("%
    ");output.push("");output.push("");output.push("");output.push("");output.push(drawRow("alert",q[0],m[0],m[1],z));output.push(drawRow("break","",m[2],m[3],z));output.push(drawRow("case","",m[4],m[5],z));output.push(drawRow("catch","",m[48],m[49],z));output.push(drawRow("continue",q[1],m[6],m[7],z));output.push(drawRow("default","",m[8],m[9],z));output.push(drawRow("delete","",m[10],m[11],z));output.push(drawRow("do","",m[12],m[13],z));output.push(drawRow("document","",m[44],m[45],z));output.push(drawRow("else","",m[14],m[15],z));output.push(drawRow("eval",q[2],m[16],m[17],z));output.push(drawRow("for","",m[18],m[19],z));output.push(drawRow("function","",m[20],m[21],z));output.push(drawRow("if","",m[22],m[23],z));output.push(drawRow("in","",m[24],m[25],z));output.push(drawRow("label","",m[26],m[27],z));output.push(drawRow("new","",m[28],m[29],z));output.push(drawRow("return","",m[30],m[31],z));output.push(drawRow("switch","",m[32],m[33],z));output.push(drawRow("this","",m[34],m[35],z));output.push(drawRow("throw","",m[50],m[51],z));output.push(drawRow("typeof","",m[36],m[37],z));output.push(drawRow("var","",m[38],m[39],z));output.push(drawRow("while","",m[40],m[41],z));output.push(drawRow("with",q[3],m[42],m[43],z));output.push(drawRow("window","",m[46],m[47],z));output.push(drawRow("try","",m[52],m[53],z));output.push("");output.push("
    JavaScript component analysis
    JavaScript ComponentComponent QuantityPercentage Quantity from SectionPercentage Qauntity from TotalCharacter LengthPercentage Length from SectionPercentage Length from Total
    Total Accounted");output.push(z[0]);output.push("100.00%100.00%");output.push(z[1]);output.push("100.00%100.00%
    Comments
    Block Comments");output.push(j[0]);output.push("");output.push(zero(j[0],j[2]));output.push("");output.push(zero(j[0],z[0]));output.push("");output.push(j[1]);output.push("");output.push(zero(j[1],j[3]));output.push("");output.push(zero(j[1],z[1]));output.push("
    Inline Comments");output.push(k[0]);output.push("");output.push(zero(k[0],j[2]));output.push("");output.push(zero(k[0],z[0]));output.push("");output.push(k[1]);output.push("");output.push(zero(k[1],j[3]));output.push("");output.push(zero(k[1],z[1]));output.push("
    Comment Total");output.push(j[2]);output.push("100.00%");output.push(zero(j[2],z[0]));output.push("");output.push(j[3]);output.push("100.00%");output.push(zero(j[3],z[1]));output.push("
    Whitespace Outside of Strings and Comments
    New Lines");output.push(e-1-w[0]);output.push("");output.push(zero(e-1-w[0],i));output.push("");output.push(zero(e-1-w[0],z[0]));output.push("");output.push(e-1-w[0]);output.push("");output.push(zero(e-1-w[0],i));output.push("");output.push(zero(e-1-w[0],z[1]));output.push("
    Spaces");output.push(g);output.push("");output.push(zero(g,i));output.push("");output.push(zero(g,z[0]));output.push("");output.push(g);output.push("");output.push(zero(g,i));output.push("");output.push(zero(g,z[1]));output.push("
    Tabs");output.push(h);output.push("");output.push(zero(h,i));output.push("");output.push(zero(h,z[0]));output.push("");output.push(h);output.push("");output.push(zero(h,i));output.push("");output.push(zero(h,z[1]));output.push("
    Other Whitespace");output.push(p);output.push("");output.push(zero(p,i));output.push("");output.push(zero(p,z[0]));output.push("");output.push(p);output.push("");output.push(zero(p,i));output.push("");output.push(zero(p,z[1]));output.push("
    Total Whitespace");output.push(i);output.push("100.00%");output.push(zero(i,z[0]));output.push("");output.push(i);output.push("100.00%");output.push(zero(i,z[1]));output.push("
    Strings
    Strings");output.push(l[0]);output.push("100.00%");output.push(zero(l[0],z[0]));output.push("");output.push(l[1]);output.push("100.00%");output.push(zero(l[1],z[1]));output.push("
    Syntax Characters
    Quote Characters");output.push(l[2]);output.push("");output.push(zero(l[2],n[5]));output.push("");output.push(zero(l[2],z[0]));output.push("");output.push(l[2]);output.push("");output.push(zero(l[2],n[6]));output.push("");output.push(zero(l[2],z[1]));output.push("
    Commas");output.push(n[2]);output.push("");output.push(zero(n[2],n[5]));output.push("");output.push(zero(n[2],z[0]));output.push("");output.push(n[2]);output.push("");output.push(zero(n[2],n[6]));output.push("");output.push(zero(n[2],z[1]));output.push("
    Containment Characters");output.push(n[4]);output.push("");output.push(zero(n[4],n[5]));output.push("");output.push(zero(n[4],z[0]));output.push("");output.push(n[4]);output.push("");output.push(zero(n[4],n[6]));output.push("");output.push(zero(n[4],z[1]));output.push("
    Semicolons");output.push(n[3]);output.push("");output.push(zero(n[3],n[5]));output.push("");output.push(zero(n[3],z[0]));output.push("");output.push(n[3]);output.push("");output.push(zero(n[3],n[6]));output.push("");output.push(zero(n[3],z[1]));output.push("
    Operators");output.push(n[0]);output.push("");output.push(zero(n[0],n[5]));output.push("");output.push(zero(n[0],z[0]));output.push("");output.push(n[1]);output.push("");output.push(zero(n[1],n[6]));output.push("");output.push(zero(n[1],z[1]));output.push("
    Total Syntax Characters");output.push(n[5]);output.push("100.00%");output.push(zero(n[5],z[0]));output.push("");output.push(n[6]);output.push("100.00%");output.push(zero(n[6],z[1]));output.push("
    Keywords
    Total Keywords");output.push(m[54]);output.push("100.00%");output.push(zero(m[55],z[0]));output.push("");output.push(m[55]);output.push("100.00%");output.push(zero(m[55],z[1]));output.push("
    Variables and Other Keywords
    Variable Instances");output.push(o[0]);output.push("100.00%");output.push(zero(o[0],z[0]));output.push("");output.push(o[1]);output.push("100.00%");output.push(zero(o[1],z[1]));output.push("
    ");summary=output.join("");}());return rvalue;},markupmin=function(y,comments,presume_html,top_comments){var i=0,x=y.split(""),markupspace=function(){var a=0,c=[],Y=x.length;for(a=i;a"){break;}else{c.push(x[a]);x[a]="";}}i=a;x[i]=c.join("").replace(/\s+/g," ").replace(/\s*,\s+/g,", ").replace(/\s*\/\s*/g,"/").replace(/\s*=\s*/g,"=").replace(/\s*:\s*/g,":").replace(/ \="/g,"=\"").replace(/ \='/g,"='")+">";},markupcomment=function(){var Y=x.length,b=0,c=[];for(b=i;b"){x[b]="";x[b+1]="";x[b+2]="";i=b+2;break;}else{if(comments==="beautify"||comments==="comments"){c.push(x[b]);}x[b]="";}}if(comments==="comments"||comments==="beautify"){x[i]=" "+c.join("")+"-->";}},markupscript=function(z){var c=0,e=[],f=0,g="",h="",j="\s*)$/),scriptStart=(/^(\s*<\!\-\-)/),scriptEnd=(/(\/+\-\->\s*)$/),cs="",ce="";if(typeof jsmin==="undefined"){return;}for(c=i;c"){e.push(x[c]);x[c]="";}else{break;}}m=e[0];e.splice(0,1);if((/\s/).test(e[0])){e.splice(0,1);}for(f;f"){h=h+x[f];x[f]="";}else{break;}}h=h+">";i=f;if(e.join("")===""){x[i]=m+h;return;}g=e.join("");if(comments!=="beautify"){if(cdataStart.test(g)){cs=g.match(cdataStart)[0];g=g.replace(cdataStart,"");}else if(scriptStart.test(g)){cs=g.match(scriptStart)[0];g=g.replace(scriptStart,"");}if(cdataEnd.test(g)){ce=g.match(cdataEnd)[0];g=g.replace(cdataEnd,"");}else if(scriptEnd.test(g)){ce=g.match(scriptEnd)[0];g=g.replace(scriptEnd,"");}if(z==="style"){g=cs+jsmin(g,3,"css",true,top_comments)+ce;}else{g=cs+jsmin(g,3,"javascript",false,top_comments)+ce;}}Y=g.length;for(c=0;c"){break;}a.push(y.charAt(b));}d=a.join("").toLowerCase().replace(/'/g,"\"");if(comments!=="beautify"&&comments!=="diff"){markupspace();}if(d.indexOf("type=\"")===-1||d.indexOf("type=\"text/javascript\"")!==-1||d.indexOf("type=\"application/javascript\"")!==-1||d.indexOf("type=\"application/x-javascript\"")!==-1||d.indexOf("type=\"text/ecmascript\"")!==-1||d.indexOf("type=\"application/ecmascript\"")!==-1){markupscript("script");}}else if((y.slice(i,i+6)).toLowerCase()===""){break;}a.push(y.charAt(b));}d=a.join("").toLowerCase().replace(/'/g,"\"");if(comments!=="beautify"&&comments!=="diff"){markupspace();}if(d.indexOf("type=\"")===-1||d.indexOf("type=\"text/css\"")!==-1){markupscript("style");}}else if(y.slice(i,i+4)==="\s+/g,"--> ").replace(/\s+<\?php/g," \s+/g,"> ").replace(/\s+<\s*/g," <").replace(/\s+\/>/g,"/>").replace(/\s+>/g,">");if((/\s/).test(g.charAt(0))){g=g.slice(1,g.length);}return g;}());},markup_beauty=function(args){var tab="",token=[],build=[],cinfo=[],level=[],inner=[],sum=[],x=args.source,start=(function(){if(!args.source||typeof args.source!=="string"){args.source="";}if(args.insize===undefined||isNaN(args.insize)){args.insize=4;}if(typeof args.inchar!=="string"||args.inchar.length<1){args.inchar=" ";}if(!args.mode||args.mode!=="diff"){args.mode="beautify";}if(!args.comments||args.comments!=="indent"){args.comments="noindent";}if(!args.style||args.style!=="indent"){args.style="noindent";}if(typeof args.html!=="boolean"){args.html=false;}if(typeof args.content!=="boolean"){args.content=false;}if(typeof args.force_indent!=="boolean"){args.force_indent=false;}}()),cdatafix=(function(){var a=function(y){y=y.replace(//g,"\nprettydiffcdatae");return y;};x=x.replace(/\/+/g,b);}()),innerset=(function(){var d=(function(){var a=0,b=0,c=args.source.length,d=[],e=0,h=-1,i=0,j=0,k=-1,l=0,m=0,n=false,o=false,p=0,q=[">"],r=false;for(a=0;a"){if(/>"){if(/>"){a=b;h+=1;break;}}}else if(x.charAt(a)==="<"&&x.charAt(a+1)==="%"){for(b=a+2;b"){a=b;h+=1;break;}}}else if(x.charAt(a)==="<"&&x.charAt(a+1)==="!"&&/[A-Z]|\[/.test(x.charAt(a+2))){for(b=a+3;b"&&q[q.length-1]===">"&&q.length===1){h+=1;if(r){d.push([a,b,h,a]);}r=false;a=b;q=[">"];break;}else if(x.charAt(b)==="<"){q.push(">");r=true;}else if(x.charAt(b)===">"&&q.length>1){q.pop();r=true;}else if(x.charAt(b)==="["){q.push("]");}else if(x.charAt(b)==="]"){q.pop();}else if(x.charAt(b)==="\""){if(q[q.length-1]==="\""){q.pop();}else{q.push("\"");}}else if(x.charAt(b)==="'"){if(q[q.length-1]==="'"){q.pop();}else{q.push("'");}}}}else if(x.charAt(a)===x.charAt(a+1)&&(x.charAt(a)==="\""||x.charAt(a)==="'")){a+=1;}else if(x.charAt(a-1)==="="&&(x.charAt(a)==="\""||x.charAt(a)==="'")){o=false;for(m=a-1;m>0;m-=1){if((x.charAt(m)==="\""&&x.charAt(a)==="\"")||(x.charAt(m)==="'"&&x.charAt(a)==="'")||x.charAt(m)==="<"){break;}else if(x.charAt(m)===">"){o=true;break;}}if(!o){n=false;for(b=a+1;b"){b=p+8;break;}}}else if(x.substr(b,6).toLowerCase()===""){b=p+7;break;}}}else if(x.substr(b,5)===""){b=p;break;}}}else if(x.charAt(b)==="<"&&x.charAt(b+1)==="%"){for(p=b+5;p"){b=p;break;}}}else if(x.charAt(b)===">"||x.charAt(b)==="<"){n=true;}else if((x.charAt(b-1)!=="\\"&&((x.charAt(a)==="\""&&x.charAt(b)==="\"")||(x.charAt(a)==="'"&&x.charAt(b)==="'")))||b===c-1){if(k!==h&&l===1){l=0;h-=1;k-=1;}else if(k===h){for(e=i+1;e>a;e+=1){if(!/\s/.test(x.charAt(e))){break;}}j=e;if(i"){break;}}h+=1;a=b+2;}else{h+=1;j=a;}}else if(x.charAt(a+1)==="<"&&x.charAt(a)!==">"){for(b=a;b>0;b-=1){if(!/\s/.test(x.charAt(b))&&x.charAt(b)!==">"){h+=1;k+=1;j=a;break;}else if(x.charAt(b)===">"){if(h!==k){k+=1;i=a;}break;}}}else if(x.charAt(a)===">"){k+=1;i=a;}}return d;}());(function(){var a=0,b=0,c=d.length,e=0,f=0,g=0,h=0,i=0,j=0,k=0,y=x.split("");for(a=0;aj;b-=1){h+=1;if(/\s/.test(y[b])){for(k=b-1;k>j;k-=1){if(!/\s/.test(y[k])){if(y[k]!=="="){h+=1;}else if(/\s/.test(y[k-1])){h-=1;}b=k;break;}}}}if(/\s/.test(y[i])){h-=1;}inner.push(["<",h,g]);}else if(y[e]===">"){y[e]="]";for(b=e;b>j;b-=1){h+=1;if(/\s/.test(y[b])){for(k=b-1;k>j;k-=1){if(!/\s/.test(y[k])){if(y[k]!=="="){h+=1;}else if(/\s/.test(y[k-1])){h-=1;}b=k;break;}}}}if(/\s/.test(y[i])){h-=1;}inner.push([">",h,g]);}}}x=y.join("");}());}()),elements=(function(){var i=0,y=markupmin(x,args.mode,args.html).split(""),a="",b=function(end){var a=[],b=end.length,c=end.split("").reverse(),d=0,e="",loop=y.length;if(i>0&&y[i-1]===" "){e=" ";}for(i;i0;e-=1){if(!/\s/.test(y[e])){break;}}if(y[e]===")"||y[e]==="]"||y[e]==="}"||/\w/.test(y[e])){q="";}else{q="/";}}else{q=y[c];}}}else if(y[c-1]!=="\\"&&((q==="'"&&y[c]==="'")||(q==="\""&&y[c]==="\"")||(q==="/"&&y[c]==="/")||(q==="//"&&(y[c]==="\n"||(y[c-4]&&y[c-4]==="/"&&y[c-3]==="/"&&y[c-2]==="-"&&y[c-1]==="-"&&y[c]===">")))||(q==="/*"&&y[c-1]==="*"&&y[c]==="/"))){q="";}if(((z==="script"&&q==="")||z==="style")&&y[c]==="<"&&y[c+1]==="/"&&y[c+2].toLowerCase()==="s"){if(z==="script"&&(y[c+3].toLowerCase()==="c"&&y[c+4].toLowerCase()==="r"&&y[c+5].toLowerCase()==="i"&&y[c+6].toLowerCase()==="p"&&y[c+7].toLowerCase()==="t")){break;}else if(z==="style"&&(y[c+3].toLowerCase()==="t"&&y[c+4].toLowerCase()==="y"&&y[c+5].toLowerCase()==="l"&&y[c+6].toLowerCase()==="e")){break;}}else if(z==="other"&&y[c]==="<"){break;}else{d=d+y[c];}}i=c-1;if(args.content){if(d.charAt(0)===" "&&d.charAt(d.length-1)===" "){d=" text ";}else if(d.charAt(0)===" "){d=" text";}else if(d.charAt(d.length-1)===" "){d="text ";}else{d="text";}}return d;},loop=y.length;for(i=0;i"));token.push("T_comment");}else if(y[i]==="<"&&y[i+1]==="!"&&y[i+2]==="-"&&y[i+3]==="-"&&y[i+4]==="#"){build.push(b("-->"));token.push("T_ssi");}else if(y[i]==="<"&&y[i+1]==="!"&&y[i+2]!=="-"&&token[token.length-1]!=="T_script"){build.push(b(">"));token.push("T_sgml");}else if(y[i]==="<"&&y[i+1]==="?"&&y[i+2].toLowerCase()==="x"&&y[i+3].toLowerCase()==="m"&&y[i+4].toLowerCase()==="l"){build.push(b("?>"));token.push("T_xml");}else if(y[i]==="<"&&y[i+1]==="?"&&y[i+2].toLowerCase()==="p"&&y[i+3].toLowerCase()==="h"&&y[i+4].toLowerCase()==="p"){build.push(b("?>"));token.push("T_php");}else if(y[i]==="<"&&y[i+1].toLowerCase()==="s"&&y[i+2].toLowerCase()==="c"&&y[i+3].toLowerCase()==="r"&&y[i+4].toLowerCase()==="i"&&y[i+5].toLowerCase()==="p"&&y[i+6].toLowerCase()==="t"){build.push(b(">"));a=build[build.length-1].toLowerCase().replace(/'/g,"\"");if(a.charAt(a.length-2)==="/"){token.push("T_singleton");}else if(a.indexOf(" type=\"")===-1||a.indexOf(" type=\"text/javascript\"")!==-1||a.indexOf(" type=\"application/javascript\"")!==-1||a.indexOf(" type=\"application/x-javascript\"")!==-1||a.indexOf(" type=\"text/ecmascript\"")!==-1||a.indexOf(" type=\"application/ecmascript\"")!==-1){token.push("T_script");}else{token.push("T_tag_start");}}else if(y[i]==="<"&&y[i+1].toLowerCase()==="s"&&y[i+2].toLowerCase()==="t"&&y[i+3].toLowerCase()==="y"&&y[i+4].toLowerCase()==="l"&&y[i+5].toLowerCase()==="e"){build.push(b(">"));a=build[build.length-1].toLowerCase().replace(/'/g,"\"");if(a.indexOf(" type=\"")===-1||a.indexOf(" type=\"text/css\"")!==-1){token.push("T_style");}else{token.push("T_tag_start");}}else if(y[i]==="<"&&y[i+1]==="%"){build.push(b("%>"));token.push("T_asp");}else if(y[i]==="<"&&y[i+1]==="/"){build.push(b(">"));token.push("T_tag_end");}else if(y[i]==="<"&&token[token.length-1]!=="T_script"&&token[token.length-1]!=="T_style"&&(y[i+1]!=="!"||y[i+1]!=="?"||y[i+1]!=="/"||y[i+1]!=="%")){for(c=i;c"){build.push(b("/>"));token.push("T_singleton");break;}else if(y[c+1]===">"){build.push(b(">"));token.push("T_tag_start");break;}}}}else if(y[i-1]===">"&&(y[i]!=="<"||(y[i]!==" "&&y[i+1]!=="<"))){if(token[token.length-1]==="T_script"){build.push(cgather("script"));token.push("T_content");}else if(token[token.length-1]==="T_style"){build.push(cgather("style"));token.push("T_content");}else if(y[i-1]+y[i]+y[i+1]!=="> <"){build.push(cgather("other"));token.push("T_content");}}}}()),code_type=(function(){var i=0,Z=token.length;for(i=0;i");if(token[i]==="T_sgml"||token[i]==="T_xml"){cinfo.push("parse");}else if(token[i]==="T_asp"||token[i]==="T_php"||token[i]==="T_ssi"){cinfo.push("singleton");}else if(token[i]==="T_comment"){cinfo.push("comment");}else if((token[i]==="T_content"&&build[i]!==" ")&&token[i-1]==="T_script"){cinfo.push("external");}else if(token[i]==="T_content"&&token[i-1]==="T_style"){cinfo.push("external");}else if(token[i]==="T_content"&&build[i].charAt(0)===" "&&build[i].charAt(build[i].length-1)===" "){cinfo.push("mixed_both");}else if(token[i]==="T_content"&&build[i].charAt(0)===" "&&build[i].charAt(build[i].length-1)!==" "){cinfo.push("mixed_start");}else if(token[i]==="T_content"&&build[i].charAt(0)!==" "&&build[i].charAt(build[i].length-1)===" "){cinfo.push("mixed_end");}else if(token[i]==="T_content"){cinfo.push("content");}else if(token[i]==="T_tag_start"){cinfo.push("start");}else if(token[i]==="T_style"){build[i]=build[i].replace(/\s+/g," ");cinfo.push("start");}else if(token[i]==="T_script"){build[i]=build[i].replace(/\s+/g," ");cinfo.push("start");}else if(token[i]==="T_singleton"){cinfo.push("singleton");}else if(token[i]==="T_tag_end"){cinfo.push("end");}}sum=[].concat(build);}()),tab_check=(function(){var a=0,b=args.insize,c=args.inchar,d=[];for(a=0;a-1;k-=1){if(cinfo[k]==="start"&&level[k]==="x"){m+=1;}else if(cinfo[k]==="end"){m-=1;}else if(cinfo[k]==="start"&&level[k]!=="x"){return level.push(level[k]+m);}else if(k===0){if(cinfo[k]!=="start"){return level.push(0);}else if(cinfo[i]==="mixed_start"||cinfo[i]==="content"||(cinfo[i]==="singleton"&&build[i].charAt(0)!==" ")){return level.push("x");}else{return level.push(1);}}}},e=function(){var z=function(y){for(y;y>0;y-=1){if(level[y]!=="x"){return level.push(level[y]+1);}}},w=function(){var k=0,q=false,u=function(){var y=0,t=function(){var k=0,s=0,l=0;for(s=i-1;s>0;s-=1){if((cinfo[s]==="start"&&cinfo[s+1]==="start"&&level[s]===level[s+1]-1)||(cinfo[s]==="start"&&cinfo[s-1]!=="start"&&level[s]===level[s-1])){break;}}for(k=s+1;k0;y-=1){if(cinfo[y]!=="mixed_end"||(cinfo[y]==="start"&&level[y]!=="x")){if(cinfo[y-1]==="end"){q=true;if(cinfo[i-1]==="mixed_both"&&level[i-1]===level[y]-t()){return level.push(level[y]-(t()+1));}else if(cinfo[i-2]==="start"&&(cinfo[i-1]==="mixed_end"||cinfo[i-1]==="mixed_both")){return level.push(level[y]);}else if(level[y]!=="x"){if(cinfo[y]==="mixed_both"&&y!==i-t()){if(y===i-1){return level.push(level[y]-1);}else{return level.push(level[y]+t());}}else if(cinfo[i-1]==="mixed_end"&&t()===0){return level.push(level[y]-1);}else{if(level[i-1]==="x"&&(cinfo[i-2]!=="end"||(cinfo[i-2]==="end"&&level[i-2]!=="x"))){return level.push(level[y]+t());}else{return level.push(level[y]-t());}}}}else{q=false;return;}}}},r=function(){var l=0,k=0;for(k=i;k>0;k-=1){if(cinfo[k]==="end"){l+=1;}else if(cinfo[k]==="start"){l-=1;}if(l===0){return k;}}};if(cinfo[i-1]==="end"&&level[i-1]!=="x"){if(cinfo[i-2]==="start"&&level[i-2]==="x"){for(k=i-2;k>0;k-=1){if(level[k]!=="x"){break;}}if(cinfo[k]==="start"){return c("end");}else{return level.push(level[k]-1);}}else if(cinfo[i-2]==="start"&&level[i-2]!=="x"){return level.push(level[i-2]-1);}else{return level.push(level[i-1]-1);}}else{u();if(q){return;}else{return(function(){var y=0,q=0;for(q=r();q>0;q-=1){if(cinfo[q]==="start"){y+=1;}else if(cinfo[q]==="end"){y-=1;}if(level[q]!=="x"){if(cinfo[q]==="end"&&cinfo[q-1]==="start"&&level[q-1]!=="x"){return level.push(level[q]);}else if(level[i-1]==="x"&&build[i].charAt(0)!==" "&&cinfo[i-1]!=="mixed_end"&&(cinfo[i-2]!=="end"||level[i-2]!=="x")&&(cinfo[i-3]!=="end"||level[i-3]!=="x")){return level.push("x");}else{return level.push(level[q]+(y-1));}}}y=0;for(q=i;q>-1;q-=1){if(cinfo[q]==="start"){y+=1;}else if(cinfo[q]==="end"){y-=1;}}return level.push(y);}());}}};if(cinfo[i-1]==="end"||cinfo[i-1]==="mixed_both"||cinfo[i-1]==="mixed_end"){return w();}else if(cinfo[i-1]==="mixed_start"||cinfo[i-1]==="content"){return level.push("x");}else if(cinfo[i-1]==="external"){return(function(){var a=0,yy=-1;for(a=i-2;a>0;a-=1){if(cinfo[a]==="start"){yy+=1;}else if(cinfo[a]==="end"){yy-=1;}if(level[a]!=="x"){break;}}if(cinfo[a]==="end"){yy+=1;}return level.push(level[a]+yy);}());}else if(build[i].charAt(0)!==" "){if((cinfo[i-1]==="singleton"||cinfo[i-1]==="content")&&level[i-1]==="x"){return level.push("x");}return(function(){var a=0,yy=0;for(a=i-1;a>0;a-=1){if(cinfo[a]==="singleton"&&level[a]==="x"&&((cinfo[a-1]==="singleton"&&level[a-1]!=="x")||cinfo[a-1]!=="singleton")){yy+=1;}if(level[a]!==0&&level[a]!=="x"&&cinfo[i-1]!=="start"){if(cinfo[a]==="mixed_both"||cinfo[a]==="mixed_start"){return level.push(level[a]-yy);}else if(level[a]===yy||(cinfo[a]==="singleton"&&(cinfo[a-1]==="content"||cinfo[a-1]==="mixed_start"))){return level.push(level[a]);}else{return level.push(level[a]-1);}}else if(cinfo[a]==="start"&&level[a]==="x"){return z(a);}else if(cinfo[i-1]==="start"){return level.push(level[a]);}}return level.push(0);}());}else{return c("end");}},f=function(z){var k=0,l=0,m=0,n=(function(){var j=0;if(z===1){k=0;l=0;m=0;}else{for(j=z-1;j>0;j-=1){if(cinfo[j]!=="comment"){k=j;break;}}if(k===1){l=0;m=0;}else{for(j=k-1;j>0;j-=1){if(cinfo[j]!=="comment"){l=j;break;}}if(l===1){m=0;}else{for(j=l-1;j>0;j-=1){if(cinfo[j]!=="comment"){m=j;break;}}}}}}()),p=function(){var j=0,v=1,u=-1;for(j=k;j>0;j-=1){if(cinfo[j]==="start"){u-=1;if(level[j]==="x"){v+=1;}}else if(cinfo[j]==="end"){u+=1;v-=1;}if(level[j]===0){k=0;for(l=i-1;l>j;l-=1){if(cinfo[l]==="start"){k+=1;}else if(cinfo[l]==="end"){k-=1;}}if(k>0){if(level[j+1]==="x"){return level.push(((u)*-1)-1);}else if(cinfo[j]!=="external"&&(args.comments!=="noindent"||(args.comments==="noindent"&&cinfo[j]!=="comment"))){return level.push((u+1)*-1);}}else{for(k=i-1;k>0;k-=1){if(level[k]!=="x"){return level.push(level[k]);}}}}if(level[j]!=="x"&&level[i-1]!=="x"){if(cinfo[j]==="start"||cinfo[j]==="end"){return level.push(level[j]+v);}else{return level.push(level[j]+v-1);}}else if(u===-1&&level[j]==="x"){break;}else if(u===1&&level[j]!=="x"&&cinfo[j]!=="mixed_start"&&cinfo[j]!=="content"){if(cinfo[j-1]==="mixed_end"||(level[i-1]==="x"&&cinfo[i-1]==="end"&&cinfo[j]!=="end")){return level.push(level[j]-u-1);}else{return level.push(level[j]-u);}}else if(u===0&&level[j]!=="x"){return c("start");}}return c("start");};if(i-1===0&&cinfo[0]==="start"){return level.push(1);}else if(cinfo[k]==="mixed_start"||cinfo[k]==="content"||cinfo[i-1]==="mixed_start"||cinfo[i-1]==="content"||(cinfo[i]==="singleton"&&(cinfo[i-1]==="start"||cinfo[i-1]==="singleton")&&build[i].charAt(0)!==" ")){return level.push("x");}else if((cinfo[i-1]==="comment"&&level[i-1]===0)||((cinfo[m]==="mixed_start"||cinfo[m]==="content")&&cinfo[l]==="end"&&(cinfo[k]==="mixed_end"||cinfo[k]==="mixed_both"))){return c("start");}else if(cinfo[i-1]==="comment"&&level[i-1]!=="x"){return level.push(level[i-1]);}else if((cinfo[k]==="start"&&level[k]==="x")||(cinfo[k]!=="mixed_end"&&cinfo[k]!=="mixed_both"&&level[k]==="x")){if(level[i-1]==="x"&&build[i].charAt(0)!==" "&&cinfo[i-1]!=="start"&&build[i-1].charAt(build[i-1].length-1)!==" "){if((cinfo[i-1]==="end"&&cinfo[i-2]==="end")||(cinfo[i-1]==="end"&&cinfo[i]!=="end"&&cinfo[i+1]!=="mixed_start"&&cinfo[i+1]!=="content")){return c("start");}else{return level.push("x");}}else{return p();}}else if(cinfo[k]==="end"&&level[k]!=="x"&&(cinfo[k-1]!=="start"||(cinfo[k-1]==="start"&&level[k-1]!=="x"))){if(level[k]<0){return c("start");}else{return level.push(level[k]);}}else if(cinfo[m]!=="mixed_start"&&cinfo[m]!=="content"&&(cinfo[k]==="mixed_end"||cinfo[k]==="mixed_both")){return(function(){var a=0,l=0,p=0,m=0;for(a=k;a>0;a-=1){if(cinfo[a]==="end"){l+=1;}if(cinfo[a]==="start"){p+=1;}if(level[a]===0&&a!==0){m=a;}if(cinfo[k]==="mixed_both"&&level[a]!=="x"){return level.push(level[a]);}else if(cinfo[a]!=="comment"&&cinfo[a]!=="content"&&cinfo[a]!=="external"&&cinfo[a]!=="mixed_end"&&level[a]!=="x"){if(cinfo[a]==="start"&&level[a]!=="x"){if(cinfo[i-1]!=="end"){return level.push(level[a]+(p-l));}else if((level[a]===level[a-1]&&cinfo[a-1]!=="end"&&level[a+1]!=="x")||(cinfo[i-2]==="start"&&level[i-2]!=="x"&&level[i-1]==="x")){return level.push(level[a]+1);}else if(p<=1){return level.push(level[a]);}}else if(l>0){if(p>1){if(m!==0){return c("start");}else{return level.push(level[a]+1);}}else{return level.push(level[a]-l+1);}}else{return level.push(level[a]+p);}}}return c("start");}());}else if(cinfo[k]==="start"&&level[k]!=="x"){return(function(){var a=0;for(a=i-1;a>-1;a-=1){if(cinfo[a]!=="comment"&&cinfo[a]!=="content"&&cinfo[a]!=="external"&&cinfo[a]!=="mixed_end"){if(cinfo[i+1]&&build[i].charAt(0)!==" "&&(cinfo[i+1]==="content"||cinfo[i+1]==="mixed_end")){return level.push("x");}else{return level.push(level[a]+1);}}}return level.push(0);}());}else if(build[i].charAt(0)!==" "&&(cinfo[i-1]==="singleton"||cinfo[i-1]==="content"||cinfo[i-1]==="mixed_start")){return level.push("x");}else{return c("start");}},h=function(){var z;if(cinfo[i]!=="start"&&level[i-1]==="x"&&cinfo[i-1]!=="content"&&build[i].charAt(0)!==" "&&cinfo[i-1]!=="mixed_start"&&cinfo[i-1]!=="mixed_end"){return level.push("x");}else if(cinfo[i]!=="start"&&build[i]===" "){build[i]="";return level.push("x");}else{if(cinfo[i-1]!=="comment"){f(i);}else{for(z=i-1;z>0;z-=1){if(cinfo[z]!=="comment"){break;}}f(z+1);}}},innerfix=(function(){var a=0,b="",c=0,d=0,e=inner.length,f=[];for(a=0;a"&&f[c]==="]"){f[c]=">";}build[d]=f.join("");}}}()),algorithm=(function(){var test=false,test1=false,cdata=[],cdata1=[],cdataStart=(/^(\s*\/*<\!\[+[A-Z]+\[+)/),cdataEnd=(/(\/*\]+>\s*)$/),scriptStart=(/^(\s*<\!\-\-)/),scriptEnd=(/(\-\->\s*)$/),ops={},loop=cinfo.length;for(i=0;i\s*)/.test(build[i])){if(build[i].charAt(0)===" "){build[i]=build[i].substr(1);}if(build[i].charAt(build[i].length-1)===" "){build[i]=build[i].substr(0,build[i].length-1);}cinfo[i]="comment";token[i]="T_comment";if(args.comments!=="noindent"){h();}else{level.push(0);}}else if(token[i-1]==="T_script"){level.push(0);if(scriptStart.test(build[i])){test=true;build[i]=build[i].replace(scriptStart,"");}else if(cdataStart.test(build[i])){cdata=cdataStart.exec(build[i]);build[i]=build[i].replace(cdataStart,"");}if(scriptEnd.test(build[i])&&!/(\/\/\-\->\s*)$/.test(build[i])){test1=true;build[i]=build[i].replace(scriptEnd,"");}else if(cdataEnd.test(build[i])){cdata1=cdataEnd.exec(build[i]);build[i]=build[i].replace(cdataEnd,"");}ops.source=build[i];ops.insize=args.insize;ops.inchar=args.inchar;ops.preserve=true;ops.preserve_max=1;ops.inlevel=0;ops.space=true;ops.braces=args.indent;ops.inarray=false;ops.comments=args.comments;build[i]=js_beautify(ops);if(test){build[i]="";}else if(cdata1[0]!==""){build[i]=build[i]+"\n"+cdata1[0];}build[i]=build[i].replace(/(\/\/(\s)+\-\->(\s)*)$/,"//-->").replace(/^(\s*)/,"").replace(/\s*$/,"");}else if(token[i-1]==="T_style"){level.push(0);if(scriptStart.test(build[i])){test=true;build[i]=build[i].replace(scriptStart,"");}else if(cdataStart.test(build[i])){cdata=cdataStart.exec(build[i]);build[i]=build[i].replace(cdataStart,"");}if(scriptEnd.test(build[i])&&!/(\/\/\-\->\s*)$/.test(build[i])){test1=true;build[i].replace(scriptEnd,"");}else if(cdataEnd.test(build[i])){cdata1=cdataEnd.exec(build[i]);build[i]=build[i].replace(cdataEnd,"");}build[i]=cleanCSS(build[i],args.insize,args.inchar,args.comments,true);if(test){build[i]="";}else if(cdata1[0]!==""){build[i]=build[i]+"\n"+cdata1[0];}build[i]=build[i].replace(/^(\s*)/,"").replace(/\s*$/,"");}}else{if(cinfo[i]==="comment"&&args.comments!=="noindent"){h();}else if(cinfo[i]==="comment"&&args.comments==="noindent"){level.push(0);}else if(cinfo[i]==="content"){level.push("x");}else if(cinfo[i]==="parse"){h();}else if(cinfo[i]==="mixed_both"){h();}else if(cinfo[i]==="mixed_start"){h();}else if(cinfo[i]==="mixed_end"){build[i]=build[i].slice(0,build[i].length-1);level.push("x");}else if(cinfo[i]==="start"){h();}else if(cinfo[i]==="end"){e();}else if(cinfo[i]==="singleton"){h();}}}}());}()),write_tabs=(function(){var i=0,loop=build.length,tab_math=function(x){var a=0,b=(typeof level[i]==="number")?level[i]:0,indent=[];for(a=0;a0;b-=1){if(level[b]!=="x"){break;}}for(a=0;a0;b-=1){if(cinfo[b]==="start"){a+=1;}else if(cinfo[b]==="end"){a-=1;}if(level[b]!=="x"){break;}}if(cinfo[b]==="end"){a+=1;}for(c=0;c0.4){z="bad";}else{z="good";}break;case 1:if((b[2][x]/g)<0.25){y="bad";}else{y="good";}if((b[3][x]/f)<0.6){z="bad";}else{z="good";}break;case 2:if((b[2][x]/g)>0.05){y="bad";}else{y="good";}if((b[3][x]/f)>0.05){z="bad";}else{z="good";}break;}w=[""];w.push(b[2][x]);w.push("");w.push(v(x));w.push("");w.push(((b[2][x]/g)*100).toFixed(2));w.push("%");w.push(b[3][x]);w.push("");w.push(u(x));w.push("");w.push(((b[3][x]/f)*100).toFixed(2));w.push("%");return w.join("");},o=(function(){var a=0,c="",d=[],e=[],h=(function(){var a=0,c=["*** Start Tags","End Tags","Singleton Tags","Comments","Flat String","String with Space at Start","String with Space at End","String with Space at Start and End","SGML","XML","Total Parsing Declarations","SSI","ASP","PHP","Total Server Side Tags","*** Script Tags","*** Style Tags","JavaScript/CSS Code"],d=[],h="",l="",z=b[0].length;for(a=0;a"+c[a]];d.push("");d.push(b[0][a]);d.push("");d.push(h);d.push("");d.push(((b[0][a]/g)*100).toFixed(2));d.push("%");d.push(b[1][a]);d.push("");d.push(l);d.push("");d.push(((b[1][a]/f)*100).toFixed(2));d.push("%");if(a===3){d.push("Total Common Tags");d.push(p(0));d.push("Content");}else if(a===7){d.push("Total Content");d.push(p(1));d.push("Parsing Declarations");}else if(a===10){d.push("Server Side Tags");}else if(a===14){d.push("Style and Script Code/Tags");}else if(a===17){d.push("Total Script and Style Tags/Code");d.push(p(2));}c[a]=d.join("");}return c.join("");}()),i=["
    "],z=m.length;i.push(function(){var a=0,b=0,z=g,h=[],i=[],j=0,k=0,l=[],m=[],w=[],x="",punctuation=function(y){return y.replace(/(\,|\.|\?|\!|\:) /," ");};for(a=0;ah[k][0]&&h[b][1]!==""){k=b;}}m.push(h[k]);if(h[k]!==h[a]){h[k]=h[a];}else{h[k]=[0,""];}if(m.length===11){break;}}if(m.length<2){return"";}else if(m.length>10){b=10;}else{b=m.length;}for(a=0;a"+m[a][1].replace(/&/g,"&")+""+m[a][0]+""+h[a]+""+((m[a][0]/j)*100).toFixed(2)+"%";}if(m[10]){m[10]="";}if(b>10){m[m.length-1]="";}i.push("");i.push("");i.push(m.join(""));i.push("
    This table demonstrates Zipf's Law by listing the 10 most occuring words in the content and the number of times they occurred.
    Word RankMost Occurring Word by RankNumber of InstancesRatio Increased Over Next Most Frequence OccurancePercentage from ");i.push(insertComma(j));if(j>1){i.push(" Total");}i.push(" Word");if(j>1){i.push("s");}i.push("
    ");return i.join("");}());i.push("");i.push(h);d=[];for(a=0;a"];e.push(m[a].replace(/\&/g,"&").replace(//g,">").replace(/"/g,"""));e.push("");d[a]=e.join("");}}if(d.length>0){c="

    HTML elements making HTTP requests:

      "+d.join("")+"
    ";}else{c="";}i.push("
    Analysis of markup pieces.
    TypeQuantity of Tags/ContentPercentage Quantity in SectionPercentage Quantity of Total** Character SizePercentage Size in SectionPercentage Size of Total
    Total Pieces");i.push(g);i.push("100.00%100.00%");i.push(f);i.push("100.00%100.00%
    Common Tags

    * The number of requests is determined from the input submitted only and does not count the additional HTTP requests supplied from dynamically executed code, frames, iframes, css, or other external entities.

    **");i.push("Character size is measured from the individual pieces of tags and content specifically between minification and beautification.

    *** The number of starting <script> and <style> tags is subtracted from the total number of start tags.");i.push("The combination of those three values from the table above should equal the number of end tags or the code is in error.

    ");i.push(c);return i.join("");}()),r=function(x,y){return(((b[3][0]+x)/f)/((b[3][1]*y)/f));},n=(function(){var a="",c=f/7500,d=build.join("").length,e=args.source.length,h=0,i=["

    If the input is content it receives an efficiency score of "],k="",l="",t="",u="";a=c.toFixed(0);if(c>0){c=(m.length-a)*4;}else{c=0;}if(b[3][1]===0){b[2][1]=0.00000001;b[3][1]=0.00000001;}h=(((b[2][0]+b[2][2]-c)/g)/(b[2][1]/g));k=(h/r(b[3][2],1)).toPrecision(2);l=(h/r(b[1][15],1)).toPrecision(2);t=(h/r(b[3][2],4)).toPrecision(2);u=(h/r(b[1][15],4)).toPrecision(2);if(k===l){l="";u="";}else{l=", or "+l+" if inline script code and style tags are removed";u=", or "+u+" if inline script code and style tags are removed";}i.push(k);i.push("");i.push(l);i.push(". The efficiency score if this input is a large form or application is ");i.push(t);i.push("");i.push(u);i.push(". Efficient markup achieves scores higher than 2.00 and excellent markup achieves scores higher than 4.00. The score reflects the highest number of tags to pieces of content where the weight of those tags is as small as possible compared to the weight of the content.");i.push("The score is a performance metric only and is not associated with validity or well-formedness, but semantic code typically achieves the highest scores. All values are rounded to the nearest hundreth.

    Total input size: ");i.push(insertComma(e));i.push(" characters

    Total output size: ");i.push(insertComma(d));i.push(" characters

    * Total number of HTTP requests in supplied HTML: ");i.push(m.length);i.push("

    ");return i.join("");}()),s=(function(){var a=0,c=["

    "],q="";if(b[0][0]+b[0][15]+b[0][16]!==b[0][1]){q="s";a=(b[0][0]+b[0][15]+b[0][16])-b[0][1];if(a>0){if(a===1){q="";}c.push(a);c.push(" more start tag");c.push(q);c.push(" than end tag");c.push(q);c.push("!");}else{if(a===-1){q="";}c.push(a*-1);c.push(" more end tag");c.push(q);c.push(" than start tag");c.push(q);c.push("!");}c.push(" The combined total number of start tags, script tags, and style tags should equal the number of end tags. For HTML this problem may be solved by selecting the 'Presume SGML type HTML' option.

    ");}else{return"";}return c.join("");}());summary=s+n+o;}());return build.join("").replace(/\n(\s)+\n/g,"\n\n");},diffview=function(args){(function(){if(typeof args.baseTextLines!=="string"){args.baseTextLines="Error: Cannot build diff view; baseTextLines is not defined.";}if(typeof args.newTextLines!=="string"){args.newTextLines="Error: Cannot build diff view; newTextLines is not defined.";}if(args.inline!==true){args.inline=false;}if(isNaN(Number(args.contextSize))){args.contextSize="";}if(typeof args.baseTextName!=="string"){args.baseTextName="Base Source";}if(typeof args.newTextName!=="string"){args.newTextName="New Source";}if(typeof args.tchar!=="string"){args.tchar="";}if(isNaN(Number(args.tsize))){if(args.tchar===""){args.tsize=0;}else{args.tsize=1;}}}());var node=[""],errorout=0,diffline=0,tab=(function(){var a=Number(args.tsize),b=0,c=[];if(args.tchar===""){return"";}for(b=0;b-1&&crpos>-1)||crpos<0)?"\n":"\r",lines=str.replace(/\&/g,"&").replace(/\$#lt;/g,"%#lt;").replace(/\$#gt;/g,"%#gt;").replace(//g,"$#gt;");if(linebreak==="\n"){str=str.replace(/\r/g,"");}else{str=str.replace(/\n/g,"");}return lines.split(linebreak);},bta=stringAsLines(args.baseTextLines),nta=stringAsLines(args.newTextLines),baseTextName=args.baseTextName,newTextName=args.newTextName,opcodes=(function(){var junkdict={},isbjunk=function(key){if(junkdict.hasOwnProperty(key)){return junkdict[key];}},a=bta,b=nta,matching_blocks=[],bxj=[],opcodes=[],answer=[],get_matching_blocks=function(){var c=0,d=0,alo=0,ahi=0,blo=0,bhi=0,qi=[],i=0,j=0,k=0,x=[],i1=0,i2=0,j1=0,j2=0,k1=0,k2=0,la=a.length,lb=b.length,queue=[[0,la,0,lb]],non_adjacent=[],ntuplecomp=function(a,b){var i=0,mlen=Math.max(a.length,b.length);for(i=0;ib[i]){return 1;}}return(a.length===b.length)?0:((a.length=blo){if(j>=bhi){break;}if(l[0]===j-1){k=l[1]+1;}else{k=1;}if(k>bestsize){besti=i-k+1;bestj=j-k+1;bestsize=k;}}l=[j,k];}}while(besti>alo&&bestj>blo&&!isbjunk(b[bestj-1])&&a[besti-1]===b[bestj-1]){besti-=1;bestj-=1;bestsize+=1;}while(besti+bestsizealo&&bestj>blo&&isbjunk(b[bestj-1])&&a[besti-1]===b[bestj-1]){besti-=1;bestj-=1;bestsize+=1;}while(besti+bestsize0){matching_blocks.push(x);if(alo-1;c-=1){if(bxj[c][1]===elt){break;}}if(c>-1){if(n>=200&&100>n){bxj.splice(c,1);}}else{bxj.push([i,elt]);}}}()),result=(function(){var ai=0,bj=0,size=0,tag="",c=0,i=0,j=0,blocks=get_matching_blocks(),d=blocks.length;for(c=0;c0){answer.push(["equal",ai,i,bj,j]);}}}());}());return answer;}());if(inline){node.push("");}else{node.push("");}(function(){var idx=0,b=0,be=0,n=0,ne=0,rowcnt=0,i=0,jump=0,tb=(tab==="")?"":new RegExp("^(("+tab.replace(/\\/g,"\\")+")+)"),noTab=function(str){var a=0,b=str.length,c=[];for(a=0;ak){r=j-k;zx=i-r;ax[zx]=""+ax[zx];ax[zx+r]=""+ax[zx+r];bx[p]=""+bx[p];}else{r=k-j;zx=p-r;ax[i]=""+ax[i];bx[zx]=""+bx[zx];bx[zx+r]=""+bx[zx+r];}c=ax.join("").replace(/\$#34;/g,"\"").replace(/\$#39;/g,"'");d=bx.join("").replace(/\$#34;/g,"\"").replace(/\$#39;/g,"'");return[c,d];}());}errorout-=1;ax=a.split("");bx=b.split("");zx=Math.max(ax.length,bx.length);entity=function(z){var a=z.length,b=[];for(n=0;n/g,i=0,j=0,o=0,p=[];for(i=k;i)$/.test(ax[i-2])&&ax[i-1]===" "){ax[i-2]=ax[i-2].replace(/(<\/em>)$/,"");bx[i-2]=bx[i-2].replace(/(<\/em>)$/,"");}else{if(ax[i]!==undefined&&bx[i]!==undefined){ax[i]=""+ax[i];bx[i]=""+bx[i];errorout+=1;}else if(ax[i]===undefined&&bx[i]!==undefined){ax[i]="";bx[i]=""+bx[i];errorout+=1;}else if(ax[i]!==undefined&&bx[i]===undefined){ax[i]=""+ax[i];bx[i]="";errorout+=1;}}n=true;}else if(ax[i]===undefined&&(bx[i]===""||bx[i]===" ")){ax[i]="";}else if(bx[i]===undefined&&(ax[i]===""||ax[i]===" ")){bx[i]="";}break;}}for(j=i+1;j";bx[j-1]=bx[j-1]+"";}else{ax[j]=ax[j]+"";bx[j]=bx[j]+"";}n=false;k=j+1;break;}else if(n){for(o=j;o"+bx[o]&&em.test(bx[j-1])&&(j-2<0||ax[j-2]!==bx[o+1])){ax[j-1]=ax[j-1].replace(em,"");ax.splice(j-1,0,"");bx[o-1]=bx[o-1]+"";k=o;if(o-j>0){p=[];for(o;o>j;o-=1){p.push("");}ax=p.concat(ax);}n=false;break;}else if(bx[j-1]===""+ax[o]&&em.test(ax[j-1])&&(j-2<0||bx[j-2]!==ax[o+1])){bx[j-1]=bx[j-1].replace(em,"");bx.splice(j-1,0,"");ax[o-1]=ax[o-1]+"";k=o;if(o-j>0){p=[];for(o;o>j;o-=1){p.push("");}bx=p.concat(bx);}n=false;break;}else if(bx[j]===ax[o]){if(bx[j-1]===""+ax[o-1]){bx[j-1]=bx[j-1].replace(//,"");ax[o-1]=ax[o-1]+"";k=j;n=false;break;}if(ax.length>bx.length&&ax[o-1].substr(4)===bx[j-1]){ax[o-2]=ax[o-2]+"";bx[j-2]=bx[j-2]+"";bx[j-1]=bx[j-1].replace(//,"");}else{ax[o-1]=ax[o-1]+"";bx[j-1]=bx[j-1]+"";}k=o;if(o-j>0){p=[];for(o;o>j;o-=1){p.push("");}bx=p.concat(bx);}n=false;break;}else if(ax[j]===bx[o]){if(ax[j-1]===""+bx[o-1]){ax[j-1]=ax[j-1].replace(//,"");bx[o-1]=bx[o-1]+"";k=j;n=false;break;}if(bx.length>ax.length&&bx[o-1].substr(4)===ax[j-1]){bx[o-2]=bx[o-2]+"";ax[j-2]=ax[j-2]+"";ax[j-1]=ax[j-1].replace(//,"");}else{bx[o-1]=bx[o-1]+"";ax[j-1]=ax[j-1]+"";}k=o;if(o-j>0){p=[];for(o;o>j;o-=1){p.push("");}ax=p.concat(ax);}n=false;break;}}if(n){for(o=j+1;o";bx[o-1]+="";k=o+1;n=false;break;}else if(typeof bx[o-1]!=="string"&&bx[j+1]===ax[o]){bx[j]+="";ax[o-1]+="";k=o+1;n=false;break;}else if(ax[o]===bx[o]&&typeof ax[o-1]==="string"&&typeof bx[o-1]==="string"){ax[o-1]=ax[o-1]+"";bx[o-1]=bx[o-1]+"";k=o;n=false;break;}}}}zx=Math.max(ax.length,bx.length);}};for(p=0;p").length>c.split("").length){c+="";}if(d.split("").length>d.split("").length){d+="";}}return[c,d];};for(idx=0;idx-1&&opcodes.length>1&&((idx>0&&i===context)||(idx===0&&i===0))&&change==="equal"){jump=rowcnt-((idx===0?1:2)*context);if(jump>1){node.push("");if(inline){node.push("");}node.push("");b+=jump;n+=jump;i+=jump-1;if(idx+1===opcodes.length){break;}}}if(change!=="equal"){diffline+=1;}node.push("");if(tab!==""){if(!btest&&typeof bta[b+1]==="string"&&typeof nta[n]==="string"&&btab[b+1]===ntab[n]&&btab[b]!==ntab[n]&&(typeof nta[n-1]!=="string"||(btab[b]!==ntab[n-1]))){btest=true;}else if(!ntest&&typeof nta[n+1]==="string"&&typeof bta[b]==="string"&&ntab[n+1]===btab[b]&&ntab[n]!==btab[b]&&(typeof bta[b-1]!=="string"||(ntab[n]!==btab[b-1]))){ntest=true;}}if(inline){if(ntest||change==="insert"){node.push("");}else if(btest||change==="delete"){node.push("");}else if(change==="replace"){if(b");node.push(b+1);node.push("");}if(b");}if(n");}}else if(b");node.push(b+1);node.push("");}if(btest){b+=1;btest=false;}else if(ntest){n+=1;ntest=false;}else{b+=1;n+=1;}}else{if(!btest&&!ntest&&typeof bta[b]==="string"&&typeof nta[n]==="string"){if(change==="replace"&&b");node.push(b+1);node.push("");}else{node.push("");}if(n");node.push(n+1);node.push("");}else{node.push("");}if(b");node.push(b+1);node.push("");node.push("");btest=false;b+=1;}else if(ntest||(typeof bta[b]!=="string"&&typeof nta[n]==="string")){node.push("");node.push("");ntest=false;n+=1;}node.push("");}}}}());node.push("
    ");node.push(baseTextName);node.push(" vs. ");node.push(newTextName);node.push("
    ");node.push(baseTextName);node.push("");node.push(newTextName);node.push("
    ......
    ");node.push(n+1);node.push("");node.push(nta[n]);node.push("
    ");node.push(b+1);node.push("");node.push(bta[b]);node.push("
    ");node.push(z[0]);node.push("
    ");node.push(n+1);node.push("");node.push(z[1]);node.push("
    ");node.push(n+1);node.push("");node.push(bta[b]);node.push("
    ");if(z.length===2){node.push(z[0]);}else{node.push(bta[b]);}node.push("");if(z.length===2){node.push(z[1]);}else{node.push(nta[n]);}node.push("");node.push(bta[b]);node.push("");node.push(n+1);node.push("");node.push(nta[n]);node.push("
    Original diff view created by jsdifflib. Diff view rewritten by Austin Cheney.
    ");return[node.join("").replace(/\$#gt;/g,">").replace(/\$#lt;/g,"<").replace(/\%#lt;/g,"$#lt;").replace(/\%#gt;/g,"$#gt;"),errorout,diffline];},core=function(api){var start=(function(){if(!api.source||api.source===""){api.source="Source sample is missing.";}if(!api.mode||api.mode===""||(api.mode!=="minify"&&api.mode!=="diff")){api.mode="beautify";}if(api.mode==="diff"&&(!api.diff||api.diff==="")){api.diff="Diff sample is missing.";}if(!api.lang||api.lang===""||(api.lang!=="css"&&api.lang!=="markup"&&api.lang!=="csv"&&api.lang!=="text")){api.lang="auto";}if(typeof api.topcoms!=="boolean"){api.topcoms=false;}if(!api.csvchar||typeof api.csvchar!=="string"||api.csvchar===""){api.csvchar=",";}if(!api.comments||api.comments!=="noindent"){api.comments="indent";}if(typeof api.content!=="boolean"){api.content=false;}if(typeof api.force_indent!=="boolean"){api.force_indent=false;}if(!api.context||isNaN(api.context)){api.context="";}if(!api.diffview||api.diffview!=="inline"){api.diffview="sidebyside";}if(!api.html||typeof api.html!=="boolean"){if(api.html==="html-yes"){api.html=true;}else{api.html=false;}}if(api.insize===undefined||isNaN(api.insize)){api.insize=4;}if(typeof api.inchar!=="string"){api.inchar=" ";}if(!api.indent||api.indent!=="allman"){api.indent="";}if(typeof api.quote!=="boolean"){api.quote=false;}if(typeof api.semicolon!=="boolean"){api.semicolon=false;}if(!api.style||api.style!=="noindent"){api.style="indent";}if(typeof api.content!=="boolean"){api.content=false;}if(typeof api.sourcelabel!=="string"||api.sourcelabel.length<1){api.sourcelabel="base";}if(typeof api.difflabel!=="string"||api.difflabel.length<1){api.difflabel="base";}}()),auto="",autotest=false,spacetest=(/^\s+$/g),apioutput="",apidiffout="",args={},proctime=function(){var d="",e="",f=0,h=0,g=new Date(),b=((g.getTime()-startTime)/1000),c=b.toFixed(3),plural=function(x,y){var a="";if(x>1){a=x+y+"s ";}else{a=x+y+" ";}return a;},minute=function(){d=(b/60).toFixed(1);f=Number(d.toString().split(".")[0]);c=(b-(f*60)).toFixed(3);d=plural(d," minute");};if(b>=60&&b<3600){minute();}else if(b>=3600){e=(b/3600).toFixed(1);h=Number(e.toString().split(".")[0]);b=b-(h*3600);e=plural(e," hour");minute();}return"

    Execution time: "+e+d+c+" seconds

    ";},pdcomment=function(){var a="",b=api.source.length,c=api.source.indexOf("/*prettydiff.com")+16,d=true,e=[],f=-1,g=0,h=[],i="";if(api.source.indexOf("/*prettydiff.com")===-1&&api.diff.indexOf("/*prettydiff.com")===-1){return;}if(c===15&&typeof api.diff!=="undefined"){c=api.diff.indexOf("/*prettydiff.com")+16;d=false;}else if(c===15){return;}for(c;c\s*)$/.test(a)){for(d=1;d([a-z0-9\s])*<\/?[a-z]+>/i.test(a)&&/^(\s*<)/.test(a)&&/(>\s*)$/.test(a))||(/^(\s*\s*)$/i.test(a))){api.lang="markup";if(api.html===true){auto="HTML";}else{auto="markup";}}else if(api.mode==="diff"){api.lang="text";auto="unknown";}else{api.lang="javascript";auto="JavaScript";}if(auto==="unknown"){if(api.mode==="diff"){auto="Plain Text";}else{auto="JavaScript";}auto="

    Language set to auto, but language could not be determined. Language defaulted to "+auto+".

    ";}else{auto="

    Language set to auto. Presumed language is "+auto+".

    ";}}());}pdcomment();if(api.mode==="minify"){if(api.lang==="css"){apioutput=jsmin(api.source,3,"css",true,api.topcoms);}else if(api.lang==="csv"){apioutput=csvmin(api.source,api.csvchar);}else if(api.lang==="markup"){apioutput=markupmin(api.source,"",api.html,api.topcoms);}else if(api.lang==="text"){apioutput=api.source;}else{apioutput=jsmin(api.source,2,"javascript",true,api.topcoms);}return(function(){var sizediff=function(){var a=0,b=0,c=api.source,d=c.length,f=0,g=apioutput.length,h=d-g,i=0,j=0,k=((h/d)*100).toFixed(2)+"%",l="";for(a=0;a
    Minification efficiency report
    Output SizeNumber of Lines From Input
    "+g+""+(b+1)+"
    Operating SystemInput SizeSize DifferencePercentage of Decrease
    Unix/Linux"+d+""+h+""+k+"
    Windows"+f+""+i+""+l+"
    ";};if(autotest===true){return[apioutput,proctime()+auto+sizediff()];}else{return[apioutput,proctime()+sizediff()];}}());}else if(api.mode==="beautify"){if(api.lang==="css"){apioutput=cleanCSS(api.source,api.insize,api.inchar,api.comments,true);apidiffout=summary;}else if(api.lang==="csv"){apioutput=csvbeauty(api.source,api.csvchar);apidiffout="";}else if(api.lang==="markup"){args={};args.source=api.source;args.insize=api.insize;args.inchar=api.inchar;args.mode="beautify";args.comments=api.comments;args.style=api.style;args.html=api.html;args.force_indent=api.force_indent;apioutput=markup_beauty(args);apidiffout=summary;if(api.inchar!=="\t"){apioutput=apioutput.replace(/\n[\t]* \/>/g,"");}}else if(api.lang==="text"){apioutput=api.source;apidiffout="";}else{args={};args.source=api.source;args.insize=api.insize;args.inchar=api.inchar;args.preserve=true;args.preserve_max=1;args.inlevel=0;args.space=true;args.braces=api.indent;args.inarray=false;args.comments=api.comments;apioutput=js_beautify(args);apidiffout=summary;}if(!apidiffout){apidiffout="";}if(autotest===true&&api.lang!=="csv"&&api.lang!=="text"){return[apioutput,proctime()+auto+apidiffout];}else{return[apioutput,proctime()+apidiffout];}}else if(api.mode==="diff"){if(api.lang==="css"){apioutput=jsmin(api.source,3,"css",false);apioutput=cleanCSS(apioutput,api.insize,api.inchar,api.comments,false);apidiffout=jsmin(api.diff,3,"css",false);apidiffout=cleanCSS(apidiffout,api.insize,api.inchar,api.comments,false);}else if(api.lang==="csv"){apioutput=csvbeauty(api.source,api.csvchar);apidiffout=csvbeauty(api.diff,api.csvchar);}else if(api.lang==="markup"){args={};args.source=api.source;args.insize=api.insize;args.inchar=api.inchar;args.mode="diff";args.comments=api.comments;args.style=api.style;args.html=api.html;args.content=api.content;args.force_indent=api.force_indent;apioutput=markup_beauty(args).replace(/\n[\t]* \/>/g,"");args.source=api.diff;apidiffout=markup_beauty(args).replace(/\n[\t]* \/>/g,"");}else if(api.lang==="text"){apioutput=api.source;apidiffout=api.diff;}else{args={};args.insize=api.insize;args.inchar=api.inchar;args.preserve=true;args.preserve_max=1;args.inlevel=0;args.space=true;args.braces=api.indent;args.inarray=false;args.comments=api.comments;args.content=api.content;apioutput=jsmin(api.source,3,"javascript",false);args.source=apioutput;apioutput=js_beautify(args);apidiffout=jsmin(api.diff,3,"javascript",false);args.source=apidiffout;apidiffout=js_beautify(args);}if(api.quote===true){apioutput=apioutput.replace(/'/g,"\"");apidiffout=apidiffout.replace(/'/g,"\"");}if(api.semicolon===true){apioutput=apioutput.replace(/;\n/g,"\n");apidiffout=apidiffout.replace(/;\n/g,"\n");}if(api.sourcelabel===""||spacetest.test(api.sourcelabel)){api.sourcelabel="Base Text";}if(api.difflabel===""||spacetest.test(api.difflabel)){api.difflabel="New Text";}if(api.diffview==="inline"){api.diffview=true;}return(function(){var a=[],s="s",t="s";if(apioutput==="Error: This does not appear to be JavaScript."||apidiffout==="Error: This does not appear to be JavaScript."){a[1]=["

    Error: Please try using the option labeled Plain Text (diff only). The input does not appear to be markup, CSS, or JavaScript.

    ",0,0];}else{args={};args.baseTextLines=apioutput;args.newTextLines=apidiffout;args.baseTextName=api.sourcelabel;args.newTextName=api.difflabel;args.contextSize=api.context;args.inline=api.diffview;if(args.lang==="text"){args.tchar="";}else{args.tchar=api.inchar;}args.tsize=api.insize;a[1]=diffview(args);if(a[1][2]===1){t="";if(a[1][1]===0){s="";}}}a[0]="

    Number of differences: "+(a[1][1]+a[1][2])+" difference"+s+" from "+a[1][2]+" line"+t+" of code.

    ";if(autotest===true){return[a[1][0],proctime()+auto+a[0]];}else{return[a[1][0],proctime()+a[0]];}}());}};return core(api);}; \ No newline at end of file +var prettydiff=function(api){"use strict";var startTime=(function(){var d=new Date(),t=d.getTime();return t;}()),summary,charDecoder=function(input){var b=0,d=0,a=0,f=0,g=0,c=input,e=[],x=[],y=[],uni=(/u\+[0-9a-f]{4,5}\+/),unit=(/u\![0-9a-f]{4,5}\+/),htmln=(/\&\#[0-9]{1,6}\;/),htmlt=(/\&\![0-9]{1,6}\;/);if((!o.rh&&!o.rh.innerHTML)||(c.search(unit)===-1&&c.search(uni)===-1&&c.search(htmlt)===-1&&c.search(htmln)===-1)){return input;}f=input.length;for(b=0;bsource.length){return source;}else if(source===error){if(a!==source.length-1){return source+a+", '"+err+"'.";}else{return source+a+".";}}source=source.replace(/\n/g,"\n\n{-}\n\n");if(source.charAt(source.length-ch.length)===ch){source=source.slice(0,source.length+1-ch.length)+"{|}";}do{source=source.replace(ch,"\n");}while(source.indexOf(ch)!==-1);b=c.length;for(a=0;a2){e=c.length-1;for(d=1;d3){level=2;}if(type==="javascript"){input=input.replace(/\/\/(\s)*-->/g,"//-->");}else if(type!=="css"){input="Error: The type argument is not provided a value of either 'css' or 'javascript'.";}}}()),ret,atchar=input.match(/\@charset\s+("|')[\w\-]+("|');?/gi),error="",a="",b="",geti,getl,EOF=-1,LETTERS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",DIGITS="0123456789",OTHERS,ALNUM,fcom=[],alterj=false,asiflag=true,theLookahead=EOF,isAlphanum=function(c){return c!==EOF&&(ALNUM.indexOf(c)>-1||c.charCodeAt(0)>126);},jsasiq=function(x){if(x.indexOf("\n")===-1){return x;}else{x=x.split("");x[0]=x[0]+";";return x.join("");}},asiFix=function(y){var a=0,x=y.split(""),b=x.length,c=0,d=0,e="",f="",g="",h="";for(a=0;a-1;c-=1){if((c>1&&x[c-1]==="\\"&&x[c-2]!=="\\")||(c===1&&x[c-1]==="\\")){c-=1;}else{if(x[c].charAt(0)===g&&e===""){d-=1;}else if(x[c]===h&&e===""){d+=1;}else if(x[c]==="\""&&e===""){e="\"";}else if(x[c]==="'"&&e===""){e="'";}else if(x[c]==="pd"&&e===""){e="/";}else if(x[c]==="\""&&e==="\""){e="";}else if(x[c]==="'"&&e==="'"){e="";}else if(x[c]==="pd"&&e==="/"){e="";}}if(d===0&&(c!==a-1||(c===a-1&&typeof x[c-1]==="string"&&x[c-1]!==x[a]))){if(x[c-1]===")"&&g==="}"){c-=2;d=-1;e="";for(c;c>-1;c-=1){if((c>1&&x[c-1]==="\\"&&x[c-2]!=="\\")||(c===1&&x[c-1]==="\\")){c-=1;}else{if(x[c]===")"&&e===""){d-=1;}else if(x[c]==="("&&e===""){d+=1;}else if(x[c]==="\""&&e===""){e="\"";}else if(x[c]==="'"&&e===""){e="'";}else if(x[c]==="pd"&&e===""){e="/";}else if(x[c]==="\""&&e==="\""){e="";}else if(x[c]==="'"&&e==="'"){e="";}else if(x[c]==="pd"&&e==="/"){e="";}}if(d===0){c-=1;if(typeof x[c-9]==="string"&&x[c-8]==="="&&x[c-7]==="f"&&x[c-6]==="u"&&x[c-5]==="n"&&x[c-4]==="c"&&x[c-3]==="t"&&x[c-2]==="i"&&x[c-1]==="o"&&x[c]==="n"&&(isAlphanum(x[c-9])||x[c-9]==="]"||x[c-9]===")")){x[a]+=";";}break;}}break;}else if(typeof x[c-2]==="string"&&x[c-1]==="="&&(x[a-1].length===1||x[a-1]==="pd")&&(isAlphanum(x[c-2]||x[c-2]==="]"||x[c-2]===")"))){if(typeof x[a+1]!=="string"||x[a+1]!=="/"){x[a]+=";";}break;}else{break;}}}}}}for(a=0;a-1){h=d[a].split("");f=h.length;for(e=3;e=" "||c==="\n"){return c;}if(c==="\r"){return"\n";}return" ";},peek=function(){theLookahead=get();return theLookahead;},next=function(){var c=get();if(c==="/"&&(type==="javascript"||(type==="css"&&peek()!=="/"))){switch(peek()){case"/":for(;;){c=get();if(c<="\n"){return c;}}break;case"*":get();for(;;){switch(get()){case"'":c=get().replace(/'/,"");break;case"\"":c=get().replace(/"/,"");break;case"*":if(peek()==="/"){get();return" ";}break;case EOF:error="Error: Unterminated block comment.";return error;}}break;default:return c;}}return c;},action=function(d){var r=[];if(d===1){r.push(a);}if(d<3){a=b;if(a==="'"||a==="\""){if(d===1&&(r[0]===")"||r[0]==="]")&&alterj){a=";";return r[0];}for(;;){r.push(a);a=get();if(a===b){break;}if(a<="\n"){if(type==="css"){error="Error: This does not appear to be CSS.";}else{error="Error: This does not appear to be JavaScript.";}return error;}if(a==="\\"){r.push(a);a=get();}}}}b=next();if(b==="/"&&"(,=:[!&|".indexOf(a)>-1){r.push(a);r.push(b);for(;;){a=get();if(a==="/"){break;}else if(a==="\\"){r.push(a);a=get();}else if(a<="\n"){error="Error: unterminated JavaScript Regular Expression literal";return error;}r.push(a);}b=next();}return r.join("");},m=function(){var firstComment=(function(){var a=0,b=input.length,c="";if(fcomment!==true||(/^\s*\/\*/.test(input)!==true&&/^\s*\/\//.test(input)!==true)){return;}for(a=0;a/g,"//-->");ret=asiFix(ret);}else{ret=ret.replace(/^\s+/,"").replace(/x{2}-->/g,"//-->");}if(error!==""){return error;}else{return fcom.join("")+ret;}},cleanCSS=function(x,size,character,comment,alter){var q=x.length,a=0,b=0,c=[],atchar=x.match(/\@charset\s+("|')[\w\-]+("|');?/gi),tab="",nsize=Number(size),fixURI=function(y){var a=0,b=[],c="",x=y.replace(/\\\)/g,"~PDpar~").split("url("),d=x.length,e="\"";for(a=1;a3&&y[i-3]==="u"&&y[i-2]==="r"&&y[i-1]==="l"&&y[i]==="("){for(j=i;j=b){out=[out.join("").replace(/^(\s*)/,"").replace(/(\s*)$/,"")];x=out.join("");tabs=[];}},reduction=function(x){var a=0,e=0,f=0,g=-1,m=0,p=0,q="",b=x.length,c=[],d=[],h=[],i=[],test=false,colorLow=function(y){y=y.toLowerCase();if(y.length===7&&y.charAt(1)===y.charAt(2)&&y.charAt(3)===y.charAt(4)&&y.charAt(5)===y.charAt(6)){y="#"+y.charAt(1)+y.charAt(3)+y.charAt(5);}return y;},ccex=(/[\w\s:#\-\=\!\(\)"'\[\]\.%-\_\?\/\\]\/\*/),cceg=function(a){return a.replace(/\s*\/\*/,";/*");};for(a=0;a0;b-=1){if(x.charAt(b)==="/"&&x.charAt(b-1)&&x.charAt(b-1)==="*"){for(e=b-1;e>0;e-=1){if(x.charAt(e)==="/"&&x.charAt(e+1)==="*"){b=e;break;}}}else if(!/[\}\s]/.test(x.charAt(b))){break;}}for(a=d.length-1;a>0;a-=1){if(d[a]==="}"){b+=1;}else{break;}}if(b===x.length||x.substring(b+1,x.length-1)===d[d.length-1]){d.push("}");}else{d.push(x.substring(b+1,x.length));}b=d.length;for(a=0;a/g," > ");}else{if(d[a].indexOf("url(")>-1){h=d[a].split("");f=h.length;for(e=3;e])\s?/g,"$1").replace(/\{(\.*):(\.*)\}/g,"{$1: $2}").replace(/\b\*/g," *").replace(/\*\/\s?/g,"*/\n").replace(/\d%\d/g,fixpercent);if(alter===true){x=reduction(x);}cleanAsync();if(alter===true){c=x.split("*/");b=c.length;for(a=0;a"+e[a]+"";}b[a]="
  • "+e[a]+" - "+b[a]+"
  • ";}}if(d!==0){i="

    List of HTTP requests:

      "+b.join("")+"
    ";}j=f.length;for(a=2;aTotal input size: "+k+" characters

    Total output size: "+l+" characters

    Number of HTTP requests: "+h+"

    "+i;}());return x;},js_beautify=function(args){(function(){if(!args.source||typeof args.source!=="string"){args.source="";}else{args.source=args.source.replace(/var /g,"var prettydiffvar,");}if(args.insize===undefined||isNaN(args.insize)){args.insize=4;}if(!args.inchar||args.inchar.length<1||typeof args.inchar!=="string"){args.inchar=" ";}if(!args.inlevel||isNaN(args.inlevel)){args.inlevel=0;}if(typeof args.preserve!=="boolean"){args.preserve=true;}if(!args.preserve_max||isNaN(args.preserve_max)){args.preserve_max=0;}if(!args.space||args.space!==true){args.space=false;}if(!args.braces||typeof args.braces!=="boolean"){if(args.braces==="allman"){args.braces=true;}else{args.braces=false;}}if(!args.inarray||args.inarray!==true){args.inarray=false;}if(!args.content||args.content!==true){args.content=false;}if(!args.comments||typeof args.comments!=="boolean"){if(args.comments==="noindent"){args.comments=true;}else{args.comments=false;}}}());var j=[0,0],k=[0,0],l=[0,0,0],m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=[0,0,0,0,0],o=[0,0],w=[0,0,0,0],i=0,insize=args.insize,input=args.source,input_length=args.source.length+1,t=[],output=[],token_text="",last_type="TK_START_EXPR",var_last_type="",var_last_last_type="",var_end_count=-1,last_text="",last_last_text="",last_word="",last_last_word="",flags={previous_mode:(flags)?flags.mode:"BLOCK",mode:"BLOCK",var_line:false,var_line_reindented:false,in_html_comment:false,if_line:false,in_case:false,eat_next_space:false,indentation_baseline:-1,indentation_level:((flags)?flags.indentation_level+((flags.var_line&&flags.var_line_reindented)?1:0):args.inlevel)},functestval=0,var_var_test=false,commafix=false,comma_test=false,forblock=false,forcount=0,flag_store=[flags],indent_string="",wordchar=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9","_","$"],punct=["+","-","*","/","%","&","++","--","=","+=","-=","*=","/=","%=","==","===","!=","!==",">","<",">=","<=",">>","<<",">>>",">>>=",">>=","<<=","&&","&=","|","||","!","!!",",",":","?","^","^=","|=","::"],parser_pos=0,prefix="",token_type="",do_block_just_closed=false,wanted_newline=false,just_added_newline=false,rvalue="",space_before=true,space_after=true,pseudo_block=false,block_comment=function(x){var lines=x.split(/\x0a|\x0d\x0a/),j=lines.length,i=0;print_newline();output.push(lines[0]);for(i=1;i0){flags=flag_store.pop();}},in_array=function(what,arr){var i=0;for(i=0;i=0;i-=1){if(output[i]===":"&&level===0){colon_count+=1;}else if(output[i]==="?"&&level===0){if(colon_count===0){return true;}else{colon_count-=1;}}else if(output[i]==="{"||output[i]==="("||output[i]==="["){if(output[i]==="{"&&level===0){return false;}level-=1;}else if(output[i]===")"||output[i]==="}"||output[i]==="]"){level+=1;}}},fix_object_own_line=function(){var b=0;for(b=output.length-2;b>0;b-=1){if(/^(\s+)$/.test(output[b])){output[b]="";}else if(in_array(output[b],punct)){output[b+1]=" ";break;}}},funcfix=function(y){var a=(y.indexOf("}")-1),b="",c="";if(y.charAt(0)==="\n"){b="\n";c=y.substr(1,a);}else{c=y.substr(0,a);}return b+c+"}\n"+c+"(function";},get_next_token=function(){var c="",i=0,comment="",inline_comment=false,keep_whitespace=false,sep="",esc=false,resulting_string="",in_char_class=false,whitespace_count=0;if(parser_pos>=input_length){return["","TK_EOF"];}wanted_newline=false;c=input.charAt(parser_pos);parser_pos+=1;keep_whitespace=args.inarray&&is_array(flags.mode);if(keep_whitespace){whitespace_count=0;while(c==="\n"||c==="\r"||c==="\t"||c===" "){if(c==="\n"){trim_output();output.push("\n");just_added_newline=true;whitespace_count=0;}else{if(c==="\t"){whitespace_count+=4;}else if(c!=="\r"){whitespace_count+=1;}}if(parser_pos>=input_length){return["","TK_EOF"];}c=input.charAt(parser_pos);parser_pos+=1;}if(flags.indentation_baseline===-1){flags.indentation_baseline=whitespace_count;}if(just_added_newline){for(i=0;i=input_length){return["","TK_EOF"];}c=input.charAt(parser_pos);parser_pos+=1;}if(args.preserve){if(n_newlines>1){for(i=0;i0;}());if(parser_pos>=input_length){return["","TK_EOF"];}}if(in_array(c,wordchar)){if(parser_pos=input_length){break;}}}parser_pos+=2;if(inline_comment){return["/*"+comment+"*/","TK_INLINE_COMMENT"];}else{return["/*"+comment+"*/","TK_BLOCK_COMMENT"];}}if(input.charAt(parser_pos)==="/"){comment=c;while(input.charAt(parser_pos)!=="\r"&&input.charAt(parser_pos)!=="\n"){comment+=input.charAt(parser_pos);parser_pos+=1;if(parser_pos>=input_length){break;}}parser_pos+=1;if(wanted_newline){print_newline();}return[comment,"TK_COMMENT"];}}if(c==="'"||c==="\""||(c==="/"&&((last_type==="TK_WORD"&&(last_text==="return"||last_text==="do"))||(last_type==="TK_COMMENT"||last_type==="TK_START_EXPR"||last_type==="TK_START_BLOCK"||last_type==="TK_END_BLOCK"||last_type==="TK_OPERATOR"||last_type==="TK_EQUALS"||last_type==="TK_EOF"||last_type==="TK_SEMICOLON")))){sep=c;esc=false;resulting_string=c;if(parser_pos=input_length){return[resulting_string,"TK_STRING"];}}}else{while(esc||input.charAt(parser_pos)!==sep){resulting_string+=input.charAt(parser_pos);if(!esc){esc=input.charAt(parser_pos)==="\\";}else{esc=false;}parser_pos+=1;if(parser_pos>=input_length){return[resulting_string,"TK_STRING"];}}}}parser_pos+=1;resulting_string+=sep;if(sep==="/"){while(parser_pos"){flags.in_html_comment=false;parser_pos+=2;if(wanted_newline){print_newline();}return["-->","TK_COMMENT"];}if(in_array(c,punct)){while(parser_pos=input_length){break;}}if(c==="="){return[c,"TK_EQUALS"];}else{return[c,"TK_OPERATOR"];}}return[c,"TK_UNKNOWN"];};if(args.source===""){return"Error: no source code supplied to js_beautify.js";}while(insize>0){indent_string+=args.inchar;insize-=1;}parser_pos=0;while(true){t=get_next_token(parser_pos);token_text=t[0];token_type=t[1];if(token_type==="TK_EOF"){break;}else if(token_type==="TK_START_EXPR"){n[4]+=1;pseudo_block=false;if(token_text==="["){if(last_type==="TK_WORD"||last_text===")"){if(last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function"){print_single_space();}set_mode("(EXPRESSION)");print_token();}else if(flags.mode==="[EXPRESSION]"||flags.mode==="[INDENTED-EXPRESSION]"){if(last_last_text==="]"&&last_text===","){if(flags.mode==="[EXPRESSION]"){flags.mode="[INDENTED-EXPRESSION]";if(!args.inarray){flags.indentation_level+=1;}}set_mode("[EXPRESSION]");if(!args.inarray){print_newline();}}else if(last_text==="["){if(flags.mode==="[EXPRESSION]"){flags.mode="[INDENTED-EXPRESSION]";if(!args.inarray){flags.indentation_level+=1;}}set_mode("[EXPRESSION]");if(!args.inarray){print_newline();}}else{set_mode("[EXPRESSION]");}}else{set_mode("[EXPRESSION]");}}else{set_mode("(EXPRESSION)");}if(token_text!=="["||(token_text==="["&&(last_type!=="TK_WORD"&&last_text!==")"))){if(last_text===";"||last_type==="TK_START_BLOCK"){print_newline();}else if(last_type!=="TK_END_EXPR"&&last_type!=="TK_START_EXPR"&&last_type!=="TK_END_BLOCK"&&last_text!=="."){if((last_type!=="TK_WORD"&&last_type!=="TK_OPERATOR")||(last_word==="function"&&args.space)){print_single_space();}else if(last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function"||last_text==="catch"){print_single_space();}}print_token();}if(forblock&&token_text==="("){forcount+=1;}}else if(token_type==="TK_END_EXPR"){n[4]+=1;if(last_last_text==="}"){pseudo_block=true;}if(token_text==="]"&&args.inarray&&last_text==="}"){if(output.length&&output[output.length-1]===indent_string){output.pop();}print_token();restore_mode();}else if(token_text==="]"&&flags.mode==="[INDENTED-EXPRESSION]"&&last_text==="]"){restore_mode();print_newline();print_token();}else{restore_mode();print_token();}if(forblock&&token_text===")"){forcount-=1;if(forcount===0){forblock=false;}}}else if(token_type==="TK_START_BLOCK"){n[4]+=1;pseudo_block=false;if(last_word==="do"){set_mode("DO_BLOCK");}else{set_mode("BLOCK");}if(var_last_last_type==="TK_START_BLOCK"&&!isNaN(var_end_count)){var_end_count+=1;}if(args.braces){if(last_type!=="TK_OPERATOR"){if(last_text==="return"){print_single_space();}else{print_newline();}}}else{if(functestval>1){flags.indentation_level+=1;var_var_test=true;comma_test=true;}if(last_type!=="TK_OPERATOR"&&last_type!=="TK_START_EXPR"){if(last_type==="TK_START_BLOCK"){print_newline();}else{print_single_space();}}else{if(is_array(flags.previous_mode)&&last_text===","){print_newline();}}}flags.indentation_level+=1;print_token();forblock=false;forcount=0;}else if(token_type==="TK_END_BLOCK"){n[4]+=1;restore_mode();functestval=0;if(var_var_test){pseudo_block=true;}else{pseudo_block=false;}if(var_end_count===0){var_end_count="x";}else if(var_end_count===-1&&var_var_test&&comma_test){flags.var_line_reindented=true;}else if(var_last_last_type==="TK_START_BLOCK"&&!isNaN(var_end_count)){var_end_count-=1;}else if(var_end_count==="a"){if(flags.var_line&&!flags.var_line_reindented){flags.var_line_reindented=true;var_end_count=-1;}}if(args.braces){if(last_text==="{"&&in_array(last_last_text,punct)){fix_object_own_line();}else{if(var_end_count==="y"){var_last_last_type="";var_end_count="a";}print_newline();if(var_end_count==="x"){if(flags.var_line&&!comma_test&&!var_var_test){flags.var_line_reindented=true;}var_end_count="y";}}print_token();}else{if(last_type==="TK_START_BLOCK"){if(just_added_newline){if(output.length&&output[output.length-1]===indent_string){output.pop();}}else{trim_output();}}else if(is_array(flags.mode)&&args.inarray){args.inarray=false;print_newline();args.inarray=true;}else{if(var_end_count==="y"){var_last_last_type="";var_end_count="a";}print_newline();if(var_end_count==="x"){if(flags.var_line&&!comma_test&&!var_var_test){flags.var_line_reindented=true;}var_end_count="y";}}if(!comma_test&&var_var_test&&!flags.var_line_reindented){if((flags.mode==="(EXPRESSION)"&&!flags.var_line)||(flags.mode==="BLOCK"&&flags.var_line)){if(last_text!=="}"&&var_end_count===-1&&flags.mode==="(EXPRESSION)"){output.push(indent_string);}var_var_test=false;}}print_token();}}else if(token_type==="TK_WORD"){if(token_text==="alert"){m[0]+=1;}else if(token_text==="break"){m[2]+=1;}else if(token_text==="case"){m[4]+=1;}else if(token_text==="catch"){m[48]+=1;}else if(token_text==="continue"){m[6]+=1;}else if(token_text==="default"){m[8]+=1;}else if(token_text==="delete"){m[10]+=1;}else if(token_text==="do"){m[12]+=1;}else if(token_text==="document"){m[44]+=1;}else if(token_text==="else"){m[14]+=1;}else if(token_text==="eval"){m[16]+=1;}else if(token_text==="for"){m[18]+=1;}else if(token_text==="function"){m[20]+=1;}else if(token_text==="if"){m[22]+=1;}else if(token_text==="in"){m[24]+=1;}else if(token_text==="label"){m[26]+=1;}else if(token_text==="new"){m[28]+=1;}else if(token_text==="return"){m[30]+=1;}else if(token_text==="switch"){m[32]+=1;}else if(token_text==="this"){m[34]+=1;}else if(token_text==="throw"){m[50]+=1;}else if(token_text==="try"){m[52]+=1;}else if(token_text==="typeof"){m[36]+=1;}else if(token_text==="var"){m[38]+=1;}else if(token_text==="while"){m[40]+=1;}else if(token_text==="with"){m[42]+=1;}else if(token_text==="window"){m[46]+=1;}else{o[0]+=1;o[1]+=token_text.length;}if(token_text!=="var"&&last_text===";"){comma_test=false;}if(last_text===";"&&last_last_text==="}"&&var_end_count==="y"){flags.indentation_level-=1;}if(last_text==="{"&&((last_last_text===":"&&comma_test)||(last_last_text===")"&&var_last_type==="TK_START_BLOCK"&&!comma_test))){output.push(indent_string);flags.indentation_level+=1;if(token_text!=="var"&&!isNaN(var_end_count)){var_end_count+=1;}}if(do_block_just_closed){print_single_space();print_token();print_single_space();do_block_just_closed=false;}else{if(token_text==="do"){print_newline();print_token();}else if(token_text==="case"||token_text==="default"){if(last_text===":"){if(output.length&&output[output.length-1]===indent_string){output.pop();}}else{flags.indentation_level-=1;print_newline();flags.indentation_level+=1;}print_token();flags.in_case=true;}else{if(token_text==="function"){if(comma_test&&(flags.var_line||(!flags.var_line&&last_last_word==="var"))){functestval+=1;}else if(!comma_test){functestval-=1;}if(comma_test&&flags.var_line&&last_last_word==="var"&&!var_var_test&&functestval===0){flags.var_line_reindented=true;}}prefix="NONE";if(last_type==="TK_END_BLOCK"){if(args.braces||(token_text!=="else"&&token_text!=="catch"&&token_text!=="finally")){prefix="NEWLINE";}else{prefix="SPACE";print_single_space();}}else if(last_type==="TK_STRING"||last_type==="TK_START_BLOCK"||(last_type==="TK_SEMICOLON"&&(flags.mode==="BLOCK"||flags.mode==="DO_BLOCK"))){prefix="NEWLINE";}else if(last_type==="TK_WORD"||(last_type==="TK_SEMICOLON"&&is_expression(flags.mode))){prefix="SPACE";}else if(last_type==="TK_END_EXPR"){print_single_space();prefix="NEWLINE";}if(flags.if_line&&last_type==="TK_END_EXPR"){flags.if_line=false;}if(token_text==="else"||token_text==="catch"||token_text==="finally"){if(last_type!=="TK_END_BLOCK"||args.braces){print_newline();}else{trim_output(true);print_single_space();}}else if(last_type!=="TK_START_EXPR"&&last_text!=="="&&last_text!==","&&(token_text==="continue"||token_text==="try"||token_text==="throw"||token_text==="return"||token_text==="var"||token_text==="if"||token_text==="switch"||token_text==="case"||token_text==="default"||token_text==="for"||token_text==="while"||token_text==="break"||token_text==="function"||prefix==="NEWLINE")){if(last_text==="return"||last_text==="throw"||(last_type!=="TK_END_EXPR"&&last_text!==":"&&(last_type!=="TK_START_EXPR"||token_text!=="var"))){if((token_text==="if"&&last_word==="else"&&last_text!=="{")||(token_text==="function"&&last_type==="TK_OPERATOR")){print_single_space();}else{print_newline();}}else if(last_text!==")"&&last_text!==":"&&(token_text==="continue"||token_text==="try"||token_text==="throw"||token_text==="return"||token_text==="var"||token_text==="if"||token_text==="switch"||token_text==="case"||token_text==="default"||token_text==="for"||token_text==="while"||token_text==="break"||token_text==="function")){print_newline();}}else if(prefix==="SPACE"||(forblock&&last_text===";")){print_single_space();}else if(last_text===";"||(is_array(flags.mode)&&last_text===","&&last_last_text==="}")){print_newline();}if(token_text==="var"){if(!var_var_test&&last_type==="TK_START_BLOCK"&&comma_test){if(functestval>=0){var_var_test=true;}}else if(last_type==="TK_START_BLOCK"){if(var_last_type==="TK_START_BLOCK"){if(last_type==="TK_START_BLOCK"){var_last_type="";var_last_last_type="TK_START_BLOCK";var_end_count=0;}}else{var_last_type="TK_START_BLOCK";}}else if(last_type==="TK_START_BLOCK"&&var_last_type===""){var_last_type="TK_START_BLOCK";}flags.var_line=true;flags.var_line_reindented=false;comma_test=true;}print_token();if(token_text==="typeof"){print_single_space();}if(token_text==="if"){flags.if_line=true;}if(token_text==="else"){flags.if_line=false;}if(token_text==="for"){forblock=true;}}last_last_word=last_word;last_word=token_text;}}else if(token_type==="TK_SEMICOLON"){n[3]+=1;if(last_text==="}"){comma_test=true;}print_token();flags.var_line=false;flags.var_line_reindented=false;if(functestval<2){var_var_test=false;}var_last_type="";}else if(token_type==="TK_STRING"){l[0]+=1;if((token_text.charAt(0)==="\""&&token_text.charAt(token_text.length-1)==="\"")||(token_text.charAt(0)==="'"&&token_text.charAt(token_text.length-1)==="'")){l[1]+=token_text.length-2;l[2]+=2;}else{l[1]+=token_text.length;}white_count(token_text);if(last_type==="TK_START_BLOCK"||last_type==="TK_END_BLOCK"||last_type==="TK_SEMICOLON"){print_newline();}else if(last_type==="TK_WORD"){print_single_space();}if(args.content){output.push(token_text.charAt(0)+"text"+token_text.charAt(0));}else{print_token();}}else if(token_type==="TK_EQUALS"){n[0]+=1;n[1]+=1;print_single_space();print_token();print_single_space();}else if(token_type==="TK_OPERATOR"){if(token_text!==","){n[0]+=1;n[1]+=token_text.length;}var_last_type="";if(token_text===","){if(var_end_count==="y"&&last_type!=="TK_END_BLOCK"){flags.indentation_level-=1;}if(commafix){commafix=false;if(last_text==="}"){flags.var_line_reindented=true;}}if(last_text==="}"&&last_last_text==="{"&&last_last_word==="var"&&flags.var_line){commafix=true;flags.var_line_reindented=true;}n[2]+=1;if(flags.mode!=="(EXPRESSION)"&&last_last_text!==":"){comma_test=false;}if(flags.var_line&&flags.mode!=="(EXPRESSION)"){flags.var_line_reindented=true;print_token();if(last_word!=="prettydiffvar"){print_newline();}}else if(last_type==="TK_END_BLOCK"&&flags.mode!=="(EXPRESSION)"){print_token();if(last_text==="}"){print_newline();}else{print_single_space();}}else if(flags.mode!=="(EXPRESSION)"&&(flags.mode==="BLOCK"||flags.mode==="OBJECT"||is_ternary_op())){print_token();print_newline();}else{print_token();print_single_space();}}else if(last_text==="return"||last_text==="throw"){print_single_space();print_token();}else if(token_text==="::"){print_token();}else if(token_text==="--"||token_text==="++"||token_text==="!"||((token_text==="-"||token_text==="+")&&(last_type==="TK_START_BLOCK"||last_type==="TK_START_EXPR"||last_type==="TK_EQUALS"||last_type==="TK_OPERATOR"||last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function"))){space_before=false;space_after=false;if(last_text===";"&&is_expression(flags.mode)){space_before=true;}if(last_type==="TK_WORD"&&(last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function")){space_before=true;}if(flags.mode==="BLOCK"&&(last_text==="{"||last_text===";")){print_newline();}}else if(token_text==="."){space_before=false;}if(token_text!==","&&token_text!==":"&&(token_text!=="-"||(token_text==="-"&&last_text!=="continue"&&last_text!=="try"&&last_text!=="throw"&&last_text!=="return"&&last_text!=="var"&&last_text!=="if"&&last_text!=="switch"&&last_text!=="case"&&last_text!=="default"&&last_text!=="for"&&last_text!=="while"&&last_text!=="break"&&last_text!=="function"))){if(space_before){print_single_space();}print_token();if(space_after){print_single_space();}}else if(token_text===":"){if(flags.in_case){print_token();print_newline();flags.in_case=false;}else if(is_ternary_op()){print_single_space();print_token();print_single_space();flags.mode="OBJECT";}else if(flags.in_case){print_single_space();print_token();print_single_space();}else if(last_last_text!=="case"&&last_last_text!=="default"&&last_text!=="case"&&last_text!=="default"){print_token();print_single_space();}}space_before=true;space_after=true;}else if(token_type==="TK_BLOCK_COMMENT"){j[0]+=1;j[1]+=token_text.length;white_count(token_text);if(args.comments){for(i=output.length-1;i>0;i-=1){if(output[i]===indent_string||output[i]===" "){output[i]="";}else{break;}}output.push("\n");print_token();output.push("\n");}else{block_comment(token_text);}}else if(token_type==="TK_INLINE_COMMENT"){j[0]+=1;j[1]+=token_text.length;white_count(token_text);print_token();if(is_expression(flags.mode)){print_single_space();}else if(args.comments){output.push("\n");}else{print_newline();}}else if(token_type==="TK_COMMENT"){k[0]+=1;k[1]+=token_text.length;white_count(token_text);if(args.comments){for(i=output.length-1;i>0;i-=1){if(output[i]===indent_string){output[i]="";}else{break;}}}else if(wanted_newline){print_newline();}else{print_single_space();}print_token();print_newline();}else if(token_type==="TK_UNKNOWN"){n[0]+=1;n[1]+=token_text.length;white_count(token_text);if(last_text==="return"||last_text==="throw"){print_single_space();}print_token();}last_last_text=last_text;last_type=token_type;last_text=token_text;}rvalue=output.join("").replace(/var prettydiffvar\,\s*/g,"var ").replace(/^(\s+)/,"").replace(/(\s+)$/,"").replace(/\s*\}\(function/g,funcfix).replace(/\n( |\t)+\n/g,"\n\n").replace(/ \n/g,"\n");(function(){var a=0,b=0,e=1,f=1,g=0,h=0,i=0,p=0,q=[],z=[],output,zero=function(x,y){if(y===0){return"0.00%";}else{return((x/y)*100).toFixed(2)+"%";}},drawRow=function(w,x,y,z,Z){var a=["Keyword '"];a.push(w);a.push("'");a.push(y);a.push("");a.push(zero(y,m[54]));a.push("");a.push(zero(y,Z[0]));a.push("");a.push(z);a.push("");a.push(zero(z,m[55]));a.push("");a.push(zero(z,Z[1]));a.push("");return a.join("");};if(rvalue.length<=input_length){b=input_length;}else{b=rvalue.length;}for(a=0;a0){q[0]=" class='bad'";}else{q[0]="";}if(m[6]>0){q[1]=" class='bad'";}else{q[1]="";}if(m[16]>0){q[2]=" class='bad'";}else{q[2]="";}if(m[42]>0){q[3]=" class='bad'";}else{q[3]="";}g=g-w[1];h=h-w[2];p=p-w[3];i=((e-1-w[0])+g+h+p);n.push(l[2]+n[0]+n[2]+n[3]+n[4]);n.push(l[2]+n[1]+n[2]+n[3]+n[4]);j.push(j[0]+k[0]);j.push(j[1]+k[1]);m[1]=m[0]*5;m[3]=m[2]*5;m[5]=m[4]*4;m[7]=m[6]*8;m[9]=m[8]*7;m[11]=m[10]*6;m[13]=m[12]*2;m[15]=m[14]*4;m[17]=m[16]*4;m[19]=m[18]*3;m[21]=m[20]*8;m[23]=m[22]*2;m[25]=m[24]*2;m[27]=m[26]*5;m[29]=m[28]*3;m[31]=m[30]*6;m[33]=m[32]*6;m[35]=m[34]*4;m[37]=m[36]*6;m[39]=m[38]*3;m[41]=m[40]*5;m[43]=m[42]*4;m[45]=m[44]*8;m[47]=m[46]*6;m[49]=m[48]*5;m[51]=m[50]*5;m[53]=m[52]*3;m[54]=m[0]+m[2]+m[4]+m[6]+m[8]+m[10]+m[12]+m[14]+m[16]+m[18]+m[20]+m[22]+m[24]+m[26]+m[28]+m[30]+m[32]+m[34]+m[36]+m[38]+m[40]+m[42]+m[44]+m[46]+m[48]+m[50]+m[52];m[55]=m[1]+m[3]+m[5]+m[7]+m[9]+m[11]+m[13]+m[15]+m[17]+m[19]+m[21]+m[23]+m[25]+m[27]+m[29]+m[31]+m[33]+m[35]+m[37]+m[39]+m[41]+m[43]+m[45]+m[47]+m[49]+m[51]+m[53];z.push(j[2]+l[0]+n[5]+m[54]+o[0]+i);z.push(j[3]+l[1]+n[6]+m[55]+o[1]+i);output=["
    "];output.push("");output.push("
    JavaScript data report
    Data LabelInputOutputLiteral IncreasePercentage Increase
    Total Character Size");output.push(input_length);output.push("");output.push(rvalue.length);output.push("");output.push(rvalue.length-input_length);output.push("");output.push((((rvalue.length-input_length)/rvalue.length)*100).toFixed(2));output.push("%
    Total Lines of Code");output.push(e);output.push("");output.push(f);output.push("");output.push(f-e);output.push("");output.push((((f-e)/e)*100).toFixed(2));output.push("%
    ");output.push("");output.push("");output.push("");output.push("");output.push(drawRow("alert",q[0],m[0],m[1],z));output.push(drawRow("break","",m[2],m[3],z));output.push(drawRow("case","",m[4],m[5],z));output.push(drawRow("catch","",m[48],m[49],z));output.push(drawRow("continue",q[1],m[6],m[7],z));output.push(drawRow("default","",m[8],m[9],z));output.push(drawRow("delete","",m[10],m[11],z));output.push(drawRow("do","",m[12],m[13],z));output.push(drawRow("document","",m[44],m[45],z));output.push(drawRow("else","",m[14],m[15],z));output.push(drawRow("eval",q[2],m[16],m[17],z));output.push(drawRow("for","",m[18],m[19],z));output.push(drawRow("function","",m[20],m[21],z));output.push(drawRow("if","",m[22],m[23],z));output.push(drawRow("in","",m[24],m[25],z));output.push(drawRow("label","",m[26],m[27],z));output.push(drawRow("new","",m[28],m[29],z));output.push(drawRow("return","",m[30],m[31],z));output.push(drawRow("switch","",m[32],m[33],z));output.push(drawRow("this","",m[34],m[35],z));output.push(drawRow("throw","",m[50],m[51],z));output.push(drawRow("typeof","",m[36],m[37],z));output.push(drawRow("var","",m[38],m[39],z));output.push(drawRow("while","",m[40],m[41],z));output.push(drawRow("with",q[3],m[42],m[43],z));output.push(drawRow("window","",m[46],m[47],z));output.push(drawRow("try","",m[52],m[53],z));output.push("");output.push("
    JavaScript component analysis
    JavaScript ComponentComponent QuantityPercentage Quantity from SectionPercentage Qauntity from TotalCharacter LengthPercentage Length from SectionPercentage Length from Total
    Total Accounted");output.push(z[0]);output.push("100.00%100.00%");output.push(z[1]);output.push("100.00%100.00%
    Comments
    Block Comments");output.push(j[0]);output.push("");output.push(zero(j[0],j[2]));output.push("");output.push(zero(j[0],z[0]));output.push("");output.push(j[1]);output.push("");output.push(zero(j[1],j[3]));output.push("");output.push(zero(j[1],z[1]));output.push("
    Inline Comments");output.push(k[0]);output.push("");output.push(zero(k[0],j[2]));output.push("");output.push(zero(k[0],z[0]));output.push("");output.push(k[1]);output.push("");output.push(zero(k[1],j[3]));output.push("");output.push(zero(k[1],z[1]));output.push("
    Comment Total");output.push(j[2]);output.push("100.00%");output.push(zero(j[2],z[0]));output.push("");output.push(j[3]);output.push("100.00%");output.push(zero(j[3],z[1]));output.push("
    Whitespace Outside of Strings and Comments
    New Lines");output.push(e-1-w[0]);output.push("");output.push(zero(e-1-w[0],i));output.push("");output.push(zero(e-1-w[0],z[0]));output.push("");output.push(e-1-w[0]);output.push("");output.push(zero(e-1-w[0],i));output.push("");output.push(zero(e-1-w[0],z[1]));output.push("
    Spaces");output.push(g);output.push("");output.push(zero(g,i));output.push("");output.push(zero(g,z[0]));output.push("");output.push(g);output.push("");output.push(zero(g,i));output.push("");output.push(zero(g,z[1]));output.push("
    Tabs");output.push(h);output.push("");output.push(zero(h,i));output.push("");output.push(zero(h,z[0]));output.push("");output.push(h);output.push("");output.push(zero(h,i));output.push("");output.push(zero(h,z[1]));output.push("
    Other Whitespace");output.push(p);output.push("");output.push(zero(p,i));output.push("");output.push(zero(p,z[0]));output.push("");output.push(p);output.push("");output.push(zero(p,i));output.push("");output.push(zero(p,z[1]));output.push("
    Total Whitespace");output.push(i);output.push("100.00%");output.push(zero(i,z[0]));output.push("");output.push(i);output.push("100.00%");output.push(zero(i,z[1]));output.push("
    Strings
    Strings");output.push(l[0]);output.push("100.00%");output.push(zero(l[0],z[0]));output.push("");output.push(l[1]);output.push("100.00%");output.push(zero(l[1],z[1]));output.push("
    Syntax Characters
    Quote Characters");output.push(l[2]);output.push("");output.push(zero(l[2],n[5]));output.push("");output.push(zero(l[2],z[0]));output.push("");output.push(l[2]);output.push("");output.push(zero(l[2],n[6]));output.push("");output.push(zero(l[2],z[1]));output.push("
    Commas");output.push(n[2]);output.push("");output.push(zero(n[2],n[5]));output.push("");output.push(zero(n[2],z[0]));output.push("");output.push(n[2]);output.push("");output.push(zero(n[2],n[6]));output.push("");output.push(zero(n[2],z[1]));output.push("
    Containment Characters");output.push(n[4]);output.push("");output.push(zero(n[4],n[5]));output.push("");output.push(zero(n[4],z[0]));output.push("");output.push(n[4]);output.push("");output.push(zero(n[4],n[6]));output.push("");output.push(zero(n[4],z[1]));output.push("
    Semicolons");output.push(n[3]);output.push("");output.push(zero(n[3],n[5]));output.push("");output.push(zero(n[3],z[0]));output.push("");output.push(n[3]);output.push("");output.push(zero(n[3],n[6]));output.push("");output.push(zero(n[3],z[1]));output.push("
    Operators");output.push(n[0]);output.push("");output.push(zero(n[0],n[5]));output.push("");output.push(zero(n[0],z[0]));output.push("");output.push(n[1]);output.push("");output.push(zero(n[1],n[6]));output.push("");output.push(zero(n[1],z[1]));output.push("
    Total Syntax Characters");output.push(n[5]);output.push("100.00%");output.push(zero(n[5],z[0]));output.push("");output.push(n[6]);output.push("100.00%");output.push(zero(n[6],z[1]));output.push("
    Keywords
    Total Keywords");output.push(m[54]);output.push("100.00%");output.push(zero(m[55],z[0]));output.push("");output.push(m[55]);output.push("100.00%");output.push(zero(m[55],z[1]));output.push("
    Variables and Other Keywords
    Variable Instances");output.push(o[0]);output.push("100.00%");output.push(zero(o[0],z[0]));output.push("");output.push(o[1]);output.push("100.00%");output.push(zero(o[1],z[1]));output.push("
    ");summary=output.join("");}());return rvalue;},markupmin=function(y,comments,presume_html,top_comments){var i=0,x=y.split(""),markupspace=function(){var a=0,c=[],Y=x.length;for(a=i;a"){break;}else{c.push(x[a]);x[a]="";}}i=a;x[i]=c.join("").replace(/\s+/g," ").replace(/\s*,\s+/g,", ").replace(/\s*\/\s*/g,"/").replace(/\s*=\s*/g,"=").replace(/\s*:\s*/g,":").replace(/ \="/g,"=\"").replace(/ \='/g,"='")+">";},markupcomment=function(){var Y=x.length,b=0,c=[];for(b=i;b"){x[b]="";x[b+1]="";x[b+2]="";i=b+2;break;}else{if(comments==="beautify"||comments==="comments"){c.push(x[b]);}x[b]="";}}if(comments==="comments"||comments==="beautify"){x[i]=" "+c.join("")+"-->";}},markupscript=function(z){var c=0,e=[],f=0,g="",h="",j="\s*)$/),scriptStart=(/^(\s*<\!\-\-)/),scriptEnd=(/(\/+\-\->\s*)$/),cs="",ce="";if(typeof jsmin==="undefined"){return;}for(c=i;c"){e.push(x[c]);x[c]="";}else{break;}}m=e[0];e.splice(0,1);if((/\s/).test(e[0])){e.splice(0,1);}for(f;f"){h=h+x[f];x[f]="";}else{break;}}h=h+">";i=f;if(e.join("")===""){x[i]=m+h;return;}g=e.join("");if(comments!=="beautify"){if(cdataStart.test(g)){cs=g.match(cdataStart)[0];g=g.replace(cdataStart,"");}else if(scriptStart.test(g)){cs=g.match(scriptStart)[0];g=g.replace(scriptStart,"");}if(cdataEnd.test(g)){ce=g.match(cdataEnd)[0];g=g.replace(cdataEnd,"");}else if(scriptEnd.test(g)){ce=g.match(scriptEnd)[0];g=g.replace(scriptEnd,"");}if(z==="style"){g=cs+jsmin(g,3,"css",true,top_comments)+ce;}else{g=cs+jsmin(g,3,"javascript",false,top_comments)+ce;}}Y=g.length;for(c=0;c"){break;}a.push(y.charAt(b));}d=a.join("").toLowerCase().replace(/'/g,"\"");if(comments!=="beautify"&&comments!=="diff"){markupspace();}if(d.indexOf("type=\"")===-1||d.indexOf("type=\"text/javascript\"")!==-1||d.indexOf("type=\"application/javascript\"")!==-1||d.indexOf("type=\"application/x-javascript\"")!==-1||d.indexOf("type=\"text/ecmascript\"")!==-1||d.indexOf("type=\"application/ecmascript\"")!==-1){markupscript("script");}}else if((y.slice(i,i+6)).toLowerCase()===""){break;}a.push(y.charAt(b));}d=a.join("").toLowerCase().replace(/'/g,"\"");if(comments!=="beautify"&&comments!=="diff"){markupspace();}if(d.indexOf("type=\"")===-1||d.indexOf("type=\"text/css\"")!==-1){markupscript("style");}}else if(y.slice(i,i+4)==="\s+/g,"--> ").replace(/\s+<\?php/g," \s+/g,"> ").replace(/\s+<\s*/g," <").replace(/\s+\/>/g,"/>").replace(/\s+>/g,">");if((/\s/).test(g.charAt(0))){g=g.slice(1,g.length);}return g;}());},markup_beauty=function(args){var tab="",token=[],build=[],cinfo=[],level=[],inner=[],sum=[],x=args.source,start=(function(){if(!args.source||typeof args.source!=="string"){args.source="";}if(args.insize===undefined||isNaN(args.insize)){args.insize=4;}if(typeof args.inchar!=="string"||args.inchar.length<1){args.inchar=" ";}if(!args.mode||args.mode!=="diff"){args.mode="beautify";}if(!args.comments||args.comments!=="indent"){args.comments="noindent";}if(!args.style||args.style!=="indent"){args.style="noindent";}if(typeof args.html!=="boolean"){args.html=false;}if(typeof args.content!=="boolean"){args.content=false;}if(typeof args.force_indent!=="boolean"){args.force_indent=false;}}()),cdatafix=(function(){var a=function(y){y=y.replace(//g,"\nprettydiffcdatae");return y;};x=x.replace(/\/+/g,b);}()),innerset=(function(){var d=(function(){var a=0,b=0,c=args.source.length,d=[],e=0,h=-1,i=0,j=0,k=-1,l=0,m=0,n=false,o=false,p=0,q=[">"],r=false;for(a=0;a"){if(/>"){if(/>"){a=b;h+=1;break;}}}else if(x.charAt(a)==="<"&&x.charAt(a+1)==="%"){for(b=a+2;b"){a=b;h+=1;break;}}}else if(x.charAt(a)==="<"&&x.charAt(a+1)==="!"&&/[A-Z]|\[/.test(x.charAt(a+2))){for(b=a+3;b"&&q[q.length-1]===">"&&q.length===1){h+=1;if(r){d.push([a,b,h,a]);}r=false;a=b;q=[">"];break;}else if(x.charAt(b)==="<"){q.push(">");r=true;}else if(x.charAt(b)===">"&&q.length>1){q.pop();r=true;}else if(x.charAt(b)==="["){q.push("]");}else if(x.charAt(b)==="]"){q.pop();}else if(x.charAt(b)==="\""){if(q[q.length-1]==="\""){q.pop();}else{q.push("\"");}}else if(x.charAt(b)==="'"){if(q[q.length-1]==="'"){q.pop();}else{q.push("'");}}}}else if(x.charAt(a)===x.charAt(a+1)&&(x.charAt(a)==="\""||x.charAt(a)==="'")){a+=1;}else if(x.charAt(a-1)==="="&&(x.charAt(a)==="\""||x.charAt(a)==="'")){o=false;for(m=a-1;m>0;m-=1){if((x.charAt(m)==="\""&&x.charAt(a)==="\"")||(x.charAt(m)==="'"&&x.charAt(a)==="'")||x.charAt(m)==="<"){break;}else if(x.charAt(m)===">"){o=true;break;}}if(!o){n=false;for(b=a+1;b"){b=p+8;break;}}}else if(x.substr(b,6).toLowerCase()===""){b=p+7;break;}}}else if(x.substr(b,5)===""){b=p;break;}}}else if(x.charAt(b)==="<"&&x.charAt(b+1)==="%"){for(p=b+5;p"){b=p;break;}}}else if(x.charAt(b)===">"||x.charAt(b)==="<"){n=true;}else if((x.charAt(b-1)!=="\\"&&((x.charAt(a)==="\""&&x.charAt(b)==="\"")||(x.charAt(a)==="'"&&x.charAt(b)==="'")))||b===c-1){if(k!==h&&l===1){l=0;h-=1;k-=1;}else if(k===h){for(e=i+1;e>a;e+=1){if(!/\s/.test(x.charAt(e))){break;}}j=e;if(i"){break;}}h+=1;a=b+2;}else{h+=1;j=a;}}else if(x.charAt(a+1)==="<"&&x.charAt(a)!==">"){for(b=a;b>0;b-=1){if(!/\s/.test(x.charAt(b))&&x.charAt(b)!==">"){h+=1;k+=1;j=a;break;}else if(x.charAt(b)===">"){if(h!==k){k+=1;i=a;}break;}}}else if(x.charAt(a)===">"){k+=1;i=a;}}return d;}());(function(){var a=0,b=0,c=d.length,e=0,f=0,g=0,h=0,i=0,j=0,k=0,y=x.split("");for(a=0;aj;b-=1){h+=1;if(/\s/.test(y[b])){for(k=b-1;k>j;k-=1){if(!/\s/.test(y[k])){if(y[k]!=="="){h+=1;}else if(/\s/.test(y[k-1])){h-=1;}b=k;break;}}}}if(/\s/.test(y[i])){h-=1;}inner.push(["<",h,g]);}else if(y[e]===">"){y[e]="]";for(b=e;b>j;b-=1){h+=1;if(/\s/.test(y[b])){for(k=b-1;k>j;k-=1){if(!/\s/.test(y[k])){if(y[k]!=="="){h+=1;}else if(/\s/.test(y[k-1])){h-=1;}b=k;break;}}}}if(/\s/.test(y[i])){h-=1;}inner.push([">",h,g]);}}}x=y.join("");}());}()),elements=(function(){var i=0,y=markupmin(x,args.mode,args.html).split(""),a="",b=function(end){var a=[],b=end.length,c=end.split("").reverse(),d=0,e="",loop=y.length;if(i>0&&y[i-1]===" "){e=" ";}for(i;i0;e-=1){if(!/\s/.test(y[e])){break;}}if(y[e]===")"||y[e]==="]"||y[e]==="}"||/\w/.test(y[e])){q="";}else{q="/";}}else{q=y[c];}}}else if(y[c-1]!=="\\"&&((q==="'"&&y[c]==="'")||(q==="\""&&y[c]==="\"")||(q==="/"&&y[c]==="/")||(q==="//"&&(y[c]==="\n"||(y[c-4]&&y[c-4]==="/"&&y[c-3]==="/"&&y[c-2]==="-"&&y[c-1]==="-"&&y[c]===">")))||(q==="/*"&&y[c-1]==="*"&&y[c]==="/"))){q="";}if(((z==="script"&&q==="")||z==="style")&&y[c]==="<"&&y[c+1]==="/"&&y[c+2].toLowerCase()==="s"){if(z==="script"&&(y[c+3].toLowerCase()==="c"&&y[c+4].toLowerCase()==="r"&&y[c+5].toLowerCase()==="i"&&y[c+6].toLowerCase()==="p"&&y[c+7].toLowerCase()==="t")){break;}else if(z==="style"&&(y[c+3].toLowerCase()==="t"&&y[c+4].toLowerCase()==="y"&&y[c+5].toLowerCase()==="l"&&y[c+6].toLowerCase()==="e")){break;}}else if(z==="other"&&y[c]==="<"){break;}else{d=d+y[c];}}i=c-1;if(args.content){if(d.charAt(0)===" "&&d.charAt(d.length-1)===" "){d=" text ";}else if(d.charAt(0)===" "){d=" text";}else if(d.charAt(d.length-1)===" "){d="text ";}else{d="text";}}return d;},loop=y.length;for(i=0;i"));token.push("T_comment");}else if(y[i]==="<"&&y[i+1]==="!"&&y[i+2]==="-"&&y[i+3]==="-"&&y[i+4]==="#"){build.push(b("-->"));token.push("T_ssi");}else if(y[i]==="<"&&y[i+1]==="!"&&y[i+2]!=="-"&&token[token.length-1]!=="T_script"){build.push(b(">"));token.push("T_sgml");}else if(y[i]==="<"&&y[i+1]==="?"&&y[i+2].toLowerCase()==="x"&&y[i+3].toLowerCase()==="m"&&y[i+4].toLowerCase()==="l"){build.push(b("?>"));token.push("T_xml");}else if(y[i]==="<"&&y[i+1]==="?"&&y[i+2].toLowerCase()==="p"&&y[i+3].toLowerCase()==="h"&&y[i+4].toLowerCase()==="p"){build.push(b("?>"));token.push("T_php");}else if(y[i]==="<"&&y[i+1].toLowerCase()==="s"&&y[i+2].toLowerCase()==="c"&&y[i+3].toLowerCase()==="r"&&y[i+4].toLowerCase()==="i"&&y[i+5].toLowerCase()==="p"&&y[i+6].toLowerCase()==="t"){build.push(b(">"));a=build[build.length-1].toLowerCase().replace(/'/g,"\"");if(a.charAt(a.length-2)==="/"){token.push("T_singleton");}else if(a.indexOf(" type=\"")===-1||a.indexOf(" type=\"text/javascript\"")!==-1||a.indexOf(" type=\"application/javascript\"")!==-1||a.indexOf(" type=\"application/x-javascript\"")!==-1||a.indexOf(" type=\"text/ecmascript\"")!==-1||a.indexOf(" type=\"application/ecmascript\"")!==-1){token.push("T_script");}else{token.push("T_tag_start");}}else if(y[i]==="<"&&y[i+1].toLowerCase()==="s"&&y[i+2].toLowerCase()==="t"&&y[i+3].toLowerCase()==="y"&&y[i+4].toLowerCase()==="l"&&y[i+5].toLowerCase()==="e"){build.push(b(">"));a=build[build.length-1].toLowerCase().replace(/'/g,"\"");if(a.indexOf(" type=\"")===-1||a.indexOf(" type=\"text/css\"")!==-1){token.push("T_style");}else{token.push("T_tag_start");}}else if(y[i]==="<"&&y[i+1]==="%"){build.push(b("%>"));token.push("T_asp");}else if(y[i]==="<"&&y[i+1]==="/"){build.push(b(">"));token.push("T_tag_end");}else if(y[i]==="<"&&token[token.length-1]!=="T_script"&&token[token.length-1]!=="T_style"&&(y[i+1]!=="!"||y[i+1]!=="?"||y[i+1]!=="/"||y[i+1]!=="%")){for(c=i;c"){build.push(b("/>"));token.push("T_singleton");break;}else if(y[c+1]===">"){build.push(b(">"));token.push("T_tag_start");break;}}}}else if(y[i-1]===">"&&(y[i]!=="<"||(y[i]!==" "&&y[i+1]!=="<"))){if(token[token.length-1]==="T_script"){build.push(cgather("script"));token.push("T_content");}else if(token[token.length-1]==="T_style"){build.push(cgather("style"));token.push("T_content");}else if(y[i-1]+y[i]+y[i+1]!=="> <"){build.push(cgather("other"));token.push("T_content");}}}}()),code_type=(function(){var i=0,Z=token.length;for(i=0;i");if(token[i]==="T_sgml"||token[i]==="T_xml"){cinfo.push("parse");}else if(token[i]==="T_asp"||token[i]==="T_php"||token[i]==="T_ssi"){cinfo.push("singleton");}else if(token[i]==="T_comment"){cinfo.push("comment");}else if((token[i]==="T_content"&&build[i]!==" ")&&token[i-1]==="T_script"){cinfo.push("external");}else if(token[i]==="T_content"&&token[i-1]==="T_style"){cinfo.push("external");}else if(token[i]==="T_content"&&build[i].charAt(0)===" "&&build[i].charAt(build[i].length-1)===" "){cinfo.push("mixed_both");}else if(token[i]==="T_content"&&build[i].charAt(0)===" "&&build[i].charAt(build[i].length-1)!==" "){cinfo.push("mixed_start");}else if(token[i]==="T_content"&&build[i].charAt(0)!==" "&&build[i].charAt(build[i].length-1)===" "){cinfo.push("mixed_end");}else if(token[i]==="T_content"){cinfo.push("content");}else if(token[i]==="T_tag_start"){cinfo.push("start");}else if(token[i]==="T_style"){build[i]=build[i].replace(/\s+/g," ");cinfo.push("start");}else if(token[i]==="T_script"){build[i]=build[i].replace(/\s+/g," ");cinfo.push("start");}else if(token[i]==="T_singleton"){cinfo.push("singleton");}else if(token[i]==="T_tag_end"){cinfo.push("end");}}sum=[].concat(build);}()),tab_check=(function(){var a=0,b=args.insize,c=args.inchar,d=[];for(a=0;a-1;k-=1){if(cinfo[k]==="start"&&level[k]==="x"){m+=1;}else if(cinfo[k]==="end"){m-=1;}else if(cinfo[k]==="start"&&level[k]!=="x"){return level.push(level[k]+m);}else if(k===0){if(cinfo[k]!=="start"){return level.push(0);}else if(cinfo[i]==="mixed_start"||cinfo[i]==="content"||(cinfo[i]==="singleton"&&build[i].charAt(0)!==" ")){return level.push("x");}else{return level.push(1);}}}},e=function(){var z=function(y){for(y;y>0;y-=1){if(level[y]!=="x"){return level.push(level[y]+1);}}},w=function(){var k=0,q=false,u=function(){var y=0,t=function(){var k=0,s=0,l=0;for(s=i-1;s>0;s-=1){if((cinfo[s]==="start"&&cinfo[s+1]==="start"&&level[s]===level[s+1]-1)||(cinfo[s]==="start"&&cinfo[s-1]!=="start"&&level[s]===level[s-1])){break;}}for(k=s+1;k0;y-=1){if(cinfo[y]!=="mixed_end"||(cinfo[y]==="start"&&level[y]!=="x")){if(cinfo[y-1]==="end"){q=true;if(cinfo[i-1]==="mixed_both"&&level[i-1]===level[y]-t()){return level.push(level[y]-(t()+1));}else if(cinfo[i-2]==="start"&&(cinfo[i-1]==="mixed_end"||cinfo[i-1]==="mixed_both")){return level.push(level[y]);}else if(level[y]!=="x"){if(cinfo[y]==="mixed_both"&&y!==i-t()){if(y===i-1){return level.push(level[y]-1);}else{return level.push(level[y]+t());}}else if(cinfo[i-1]==="mixed_end"&&t()===0){return level.push(level[y]-1);}else{if(level[i-1]==="x"&&(cinfo[i-2]!=="end"||(cinfo[i-2]==="end"&&level[i-2]!=="x"))){return level.push(level[y]+t());}else{return level.push(level[y]-t());}}}}else{q=false;return;}}}},r=function(){var l=0,k=0;for(k=i;k>0;k-=1){if(cinfo[k]==="end"){l+=1;}else if(cinfo[k]==="start"){l-=1;}if(l===0){return k;}}};if(cinfo[i-1]==="end"&&level[i-1]!=="x"){if(cinfo[i-2]==="start"&&level[i-2]==="x"){for(k=i-2;k>0;k-=1){if(level[k]!=="x"){break;}}if(cinfo[k]==="start"){return c("end");}else{return level.push(level[k]-1);}}else if(cinfo[i-2]==="start"&&level[i-2]!=="x"){return level.push(level[i-2]-1);}else{return level.push(level[i-1]-1);}}else{u();if(q){return;}else{return(function(){var y=0,q=0;for(q=r();q>0;q-=1){if(cinfo[q]==="start"){y+=1;}else if(cinfo[q]==="end"){y-=1;}if(level[q]!=="x"){if(cinfo[q]==="end"&&cinfo[q-1]==="start"&&level[q-1]!=="x"){return level.push(level[q]);}else if(level[i-1]==="x"&&build[i].charAt(0)!==" "&&cinfo[i-1]!=="mixed_end"&&(cinfo[i-2]!=="end"||level[i-2]!=="x")&&(cinfo[i-3]!=="end"||level[i-3]!=="x")){return level.push("x");}else{return level.push(level[q]+(y-1));}}}y=0;for(q=i;q>-1;q-=1){if(cinfo[q]==="start"){y+=1;}else if(cinfo[q]==="end"){y-=1;}}return level.push(y);}());}}};if(cinfo[i-1]==="end"||cinfo[i-1]==="mixed_both"||cinfo[i-1]==="mixed_end"){return w();}else if(cinfo[i-1]==="mixed_start"||cinfo[i-1]==="content"){return level.push("x");}else if(cinfo[i-1]==="external"){return(function(){var a=0,yy=-1;for(a=i-2;a>0;a-=1){if(cinfo[a]==="start"){yy+=1;}else if(cinfo[a]==="end"){yy-=1;}if(level[a]!=="x"){break;}}if(cinfo[a]==="end"){yy+=1;}return level.push(level[a]+yy);}());}else if(build[i].charAt(0)!==" "){if((cinfo[i-1]==="singleton"||cinfo[i-1]==="content")&&level[i-1]==="x"){return level.push("x");}return(function(){var a=0,yy=0;for(a=i-1;a>0;a-=1){if(cinfo[a]==="singleton"&&level[a]==="x"&&((cinfo[a-1]==="singleton"&&level[a-1]!=="x")||cinfo[a-1]!=="singleton")){yy+=1;}if(level[a]!==0&&level[a]!=="x"&&cinfo[i-1]!=="start"){if(cinfo[a]==="mixed_both"||cinfo[a]==="mixed_start"){return level.push(level[a]-yy);}else if(level[a]===yy||(cinfo[a]==="singleton"&&(cinfo[a-1]==="content"||cinfo[a-1]==="mixed_start"))){return level.push(level[a]);}else{return level.push(level[a]-1);}}else if(cinfo[a]==="start"&&level[a]==="x"){return z(a);}else if(cinfo[i-1]==="start"){return level.push(level[a]);}}return level.push(0);}());}else{return c("end");}},f=function(z){var k=0,l=0,m=0,n=(function(){var j=0;if(z===1){k=0;l=0;m=0;}else{for(j=z-1;j>0;j-=1){if(cinfo[j]!=="comment"){k=j;break;}}if(k===1){l=0;m=0;}else{for(j=k-1;j>0;j-=1){if(cinfo[j]!=="comment"){l=j;break;}}if(l===1){m=0;}else{for(j=l-1;j>0;j-=1){if(cinfo[j]!=="comment"){m=j;break;}}}}}}()),p=function(){var j=0,v=1,u=-1;for(j=k;j>0;j-=1){if(cinfo[j]==="start"){u-=1;if(level[j]==="x"){v+=1;}}else if(cinfo[j]==="end"){u+=1;v-=1;}if(level[j]===0){k=0;for(l=i-1;l>j;l-=1){if(cinfo[l]==="start"){k+=1;}else if(cinfo[l]==="end"){k-=1;}}if(k>0){if(level[j+1]==="x"){return level.push(((u)*-1)-1);}else if(cinfo[j]!=="external"&&(args.comments!=="noindent"||(args.comments==="noindent"&&cinfo[j]!=="comment"))){return level.push((u+1)*-1);}}else{for(k=i-1;k>0;k-=1){if(level[k]!=="x"){return level.push(level[k]);}}}}if(level[j]!=="x"&&level[i-1]!=="x"){if(cinfo[j]==="start"||cinfo[j]==="end"){return level.push(level[j]+v);}else{return level.push(level[j]+v-1);}}else if(u===-1&&level[j]==="x"){break;}else if(u===1&&level[j]!=="x"&&cinfo[j]!=="mixed_start"&&cinfo[j]!=="content"){if(cinfo[j-1]==="mixed_end"||(level[i-1]==="x"&&cinfo[i-1]==="end"&&cinfo[j]!=="end")){return level.push(level[j]-u-1);}else{return level.push(level[j]-u);}}else if(u===0&&level[j]!=="x"){return c("start");}}return c("start");};if(i-1===0&&cinfo[0]==="start"){return level.push(1);}else if(cinfo[k]==="mixed_start"||cinfo[k]==="content"||cinfo[i-1]==="mixed_start"||cinfo[i-1]==="content"||(cinfo[i]==="singleton"&&(cinfo[i-1]==="start"||cinfo[i-1]==="singleton")&&build[i].charAt(0)!==" ")){return level.push("x");}else if((cinfo[i-1]==="comment"&&level[i-1]===0)||((cinfo[m]==="mixed_start"||cinfo[m]==="content")&&cinfo[l]==="end"&&(cinfo[k]==="mixed_end"||cinfo[k]==="mixed_both"))){return c("start");}else if(cinfo[i-1]==="comment"&&level[i-1]!=="x"){return level.push(level[i-1]);}else if((cinfo[k]==="start"&&level[k]==="x")||(cinfo[k]!=="mixed_end"&&cinfo[k]!=="mixed_both"&&level[k]==="x")){if(level[i-1]==="x"&&build[i].charAt(0)!==" "&&cinfo[i-1]!=="start"&&build[i-1].charAt(build[i-1].length-1)!==" "){if((cinfo[i-1]==="end"&&cinfo[i-2]==="end")||(cinfo[i-1]==="end"&&cinfo[i]!=="end"&&cinfo[i+1]!=="mixed_start"&&cinfo[i+1]!=="content")){return c("start");}else{return level.push("x");}}else{return p();}}else if(cinfo[k]==="end"&&level[k]!=="x"&&(cinfo[k-1]!=="start"||(cinfo[k-1]==="start"&&level[k-1]!=="x"))){if(level[k]<0){return c("start");}else{return level.push(level[k]);}}else if(cinfo[m]!=="mixed_start"&&cinfo[m]!=="content"&&(cinfo[k]==="mixed_end"||cinfo[k]==="mixed_both")){return(function(){var a=0,l=0,p=0,m=0;for(a=k;a>0;a-=1){if(cinfo[a]==="end"){l+=1;}if(cinfo[a]==="start"){p+=1;}if(level[a]===0&&a!==0){m=a;}if(cinfo[k]==="mixed_both"&&level[a]!=="x"){return level.push(level[a]);}else if(cinfo[a]!=="comment"&&cinfo[a]!=="content"&&cinfo[a]!=="external"&&cinfo[a]!=="mixed_end"&&level[a]!=="x"){if(cinfo[a]==="start"&&level[a]!=="x"){if(cinfo[i-1]!=="end"){return level.push(level[a]+(p-l));}else if((level[a]===level[a-1]&&cinfo[a-1]!=="end"&&level[a+1]!=="x")||(cinfo[i-2]==="start"&&level[i-2]!=="x"&&level[i-1]==="x")){return level.push(level[a]+1);}else if(p<=1){return level.push(level[a]);}}else if(l>0){if(p>1){if(m!==0){return c("start");}else{return level.push(level[a]+1);}}else{return level.push(level[a]-l+1);}}else{return level.push(level[a]+p);}}}return c("start");}());}else if(cinfo[k]==="start"&&level[k]!=="x"){return(function(){var a=0;for(a=i-1;a>-1;a-=1){if(cinfo[a]!=="comment"&&cinfo[a]!=="content"&&cinfo[a]!=="external"&&cinfo[a]!=="mixed_end"){if(cinfo[i+1]&&build[i].charAt(0)!==" "&&(cinfo[i+1]==="content"||cinfo[i+1]==="mixed_end")){return level.push("x");}else{return level.push(level[a]+1);}}}return level.push(0);}());}else if(build[i].charAt(0)!==" "&&(cinfo[i-1]==="singleton"||cinfo[i-1]==="content"||cinfo[i-1]==="mixed_start")){return level.push("x");}else{return c("start");}},h=function(){var z;if(cinfo[i]!=="start"&&level[i-1]==="x"&&cinfo[i-1]!=="content"&&build[i].charAt(0)!==" "&&cinfo[i-1]!=="mixed_start"&&cinfo[i-1]!=="mixed_end"){return level.push("x");}else if(cinfo[i]!=="start"&&build[i]===" "){build[i]="";return level.push("x");}else{if(cinfo[i-1]!=="comment"){f(i);}else{for(z=i-1;z>0;z-=1){if(cinfo[z]!=="comment"){break;}}f(z+1);}}},innerfix=(function(){var a=0,b="",c=0,d=0,e=inner.length,f=[];for(a=0;a"&&f[c]==="]"){f[c]=">";}build[d]=f.join("");}}}()),algorithm=(function(){var test=false,test1=false,cdata=[],cdata1=[],cdataStart=(/^(\s*\/*<\!\[+[A-Z]+\[+)/),cdataEnd=(/(\/*\]+>\s*)$/),scriptStart=(/^(\s*<\!\-\-)/),scriptEnd=(/(\-\->\s*)$/),ops={},loop=cinfo.length;for(i=0;i\s*)/.test(build[i])){if(build[i].charAt(0)===" "){build[i]=build[i].substr(1);}if(build[i].charAt(build[i].length-1)===" "){build[i]=build[i].substr(0,build[i].length-1);}cinfo[i]="comment";token[i]="T_comment";if(args.comments!=="noindent"){h();}else{level.push(0);}}else if(token[i-1]==="T_script"){level.push(0);if(scriptStart.test(build[i])){test=true;build[i]=build[i].replace(scriptStart,"");}else if(cdataStart.test(build[i])){cdata=cdataStart.exec(build[i]);build[i]=build[i].replace(cdataStart,"");}if(scriptEnd.test(build[i])&&!/(\/\/\-\->\s*)$/.test(build[i])){test1=true;build[i]=build[i].replace(scriptEnd,"");}else if(cdataEnd.test(build[i])){cdata1=cdataEnd.exec(build[i]);build[i]=build[i].replace(cdataEnd,"");}ops.source=build[i];ops.insize=args.insize;ops.inchar=args.inchar;ops.preserve=true;ops.preserve_max=1;ops.inlevel=0;ops.space=true;ops.braces=args.indent;ops.inarray=false;ops.comments=args.comments;build[i]=js_beautify(ops);if(test){build[i]="";}else if(cdata1[0]!==""){build[i]=build[i]+"\n"+cdata1[0];}build[i]=build[i].replace(/(\/\/(\s)+\-\->(\s)*)$/,"//-->").replace(/^(\s*)/,"").replace(/\s*$/,"");}else if(token[i-1]==="T_style"){level.push(0);if(scriptStart.test(build[i])){test=true;build[i]=build[i].replace(scriptStart,"");}else if(cdataStart.test(build[i])){cdata=cdataStart.exec(build[i]);build[i]=build[i].replace(cdataStart,"");}if(scriptEnd.test(build[i])&&!/(\/\/\-\->\s*)$/.test(build[i])){test1=true;build[i].replace(scriptEnd,"");}else if(cdataEnd.test(build[i])){cdata1=cdataEnd.exec(build[i]);build[i]=build[i].replace(cdataEnd,"");}build[i]=cleanCSS(build[i],args.insize,args.inchar,args.comments,true);if(test){build[i]="";}else if(cdata1[0]!==""){build[i]=build[i]+"\n"+cdata1[0];}build[i]=build[i].replace(/^(\s*)/,"").replace(/\s*$/,"");}}else{if(cinfo[i]==="comment"&&args.comments!=="noindent"){h();}else if(cinfo[i]==="comment"&&args.comments==="noindent"){level.push(0);}else if(cinfo[i]==="content"){level.push("x");}else if(cinfo[i]==="parse"){h();}else if(cinfo[i]==="mixed_both"){h();}else if(cinfo[i]==="mixed_start"){h();}else if(cinfo[i]==="mixed_end"){build[i]=build[i].slice(0,build[i].length-1);level.push("x");}else if(cinfo[i]==="start"){h();}else if(cinfo[i]==="end"){e();}else if(cinfo[i]==="singleton"){h();}}}}());}()),write_tabs=(function(){var i=0,loop=build.length,tab_math=function(x){var a=0,b=(typeof level[i]==="number")?level[i]:0,indent=[];for(a=0;a0;b-=1){if(level[b]!=="x"){break;}}for(a=0;a0;b-=1){if(cinfo[b]==="start"){a+=1;}else if(cinfo[b]==="end"){a-=1;}if(level[b]!=="x"){break;}}if(cinfo[b]==="end"){a+=1;}for(c=0;c0.4){z="bad";}else{z="good";}break;case 1:if((b[2][x]/g)<0.25){y="bad";}else{y="good";}if((b[3][x]/f)<0.6){z="bad";}else{z="good";}break;case 2:if((b[2][x]/g)>0.05){y="bad";}else{y="good";}if((b[3][x]/f)>0.05){z="bad";}else{z="good";}break;}w=[""];w.push(b[2][x]);w.push("");w.push(v(x));w.push("");w.push(((b[2][x]/g)*100).toFixed(2));w.push("%");w.push(b[3][x]);w.push("");w.push(u(x));w.push("");w.push(((b[3][x]/f)*100).toFixed(2));w.push("%");return w.join("");},o=(function(){var a=0,c="",d=[],e=[],h=(function(){var a=0,c=["*** Start Tags","End Tags","Singleton Tags","Comments","Flat String","String with Space at Start","String with Space at End","String with Space at Start and End","SGML","XML","Total Parsing Declarations","SSI","ASP","PHP","Total Server Side Tags","*** Script Tags","*** Style Tags","JavaScript/CSS Code"],d=[],h="",l="",z=b[0].length;for(a=0;a"+c[a]];d.push("");d.push(b[0][a]);d.push("");d.push(h);d.push("");d.push(((b[0][a]/g)*100).toFixed(2));d.push("%");d.push(b[1][a]);d.push("");d.push(l);d.push("");d.push(((b[1][a]/f)*100).toFixed(2));d.push("%");if(a===3){d.push("Total Common Tags");d.push(p(0));d.push("Content");}else if(a===7){d.push("Total Content");d.push(p(1));d.push("Parsing Declarations");}else if(a===10){d.push("Server Side Tags");}else if(a===14){d.push("Style and Script Code/Tags");}else if(a===17){d.push("Total Script and Style Tags/Code");d.push(p(2));}c[a]=d.join("");}return c.join("");}()),i=["
    "],z=m.length;i.push(function(){var a=0,b=0,z=g,h=[],i=[],j=0,k=0,l=[],m=[],w=[],x="",punctuation=function(y){return y.replace(/(\,|\.|\?|\!|\:) /," ");};for(a=0;ah[k][0]&&h[b][1]!==""){k=b;}}m.push(h[k]);if(h[k]!==h[a]){h[k]=h[a];}else{h[k]=[0,""];}if(m.length===11){break;}}if(m.length<2){return"";}else if(m.length>10){b=10;}else{b=m.length;}for(a=0;a"+m[a][1].replace(/&/g,"&")+""+m[a][0]+""+h[a]+""+((m[a][0]/j)*100).toFixed(2)+"%";}if(m[10]){m[10]="";}if(b>10){m[m.length-1]="";}i.push("");i.push("");i.push(m.join(""));i.push("
    This table demonstrates Zipf's Law by listing the 10 most occuring words in the content and the number of times they occurred.
    Word RankMost Occurring Word by RankNumber of InstancesRatio Increased Over Next Most Frequence OccurancePercentage from ");i.push(insertComma(j));if(j>1){i.push(" Total");}i.push(" Word");if(j>1){i.push("s");}i.push("
    ");return i.join("");}());i.push("");i.push(h);d=[];for(a=0;a"];e.push(m[a].replace(/\&/g,"&").replace(//g,">").replace(/"/g,"""));e.push("");d[a]=e.join("");}}if(d.length>0){c="

    HTML elements making HTTP requests:

      "+d.join("")+"
    ";}else{c="";}i.push("
    Analysis of markup pieces.
    TypeQuantity of Tags/ContentPercentage Quantity in SectionPercentage Quantity of Total** Character SizePercentage Size in SectionPercentage Size of Total
    Total Pieces");i.push(g);i.push("100.00%100.00%");i.push(f);i.push("100.00%100.00%
    Common Tags

    * The number of requests is determined from the input submitted only and does not count the additional HTTP requests supplied from dynamically executed code, frames, iframes, css, or other external entities.

    **");i.push("Character size is measured from the individual pieces of tags and content specifically between minification and beautification.

    *** The number of starting <script> and <style> tags is subtracted from the total number of start tags.");i.push("The combination of those three values from the table above should equal the number of end tags or the code is in error.

    ");i.push(c);return i.join("");}()),r=function(x,y){return(((b[3][0]+x)/f)/((b[3][1]*y)/f));},n=(function(){var a="",c=f/7500,d=build.join("").length,e=args.source.length,h=0,i=["

    If the input is content it receives an efficiency score of "],k="",l="",t="",u="";a=c.toFixed(0);if(c>0){c=(m.length-a)*4;}else{c=0;}if(b[3][1]===0){b[2][1]=0.00000001;b[3][1]=0.00000001;}h=(((b[2][0]+b[2][2]-c)/g)/(b[2][1]/g));k=(h/r(b[3][2],1)).toPrecision(2);l=(h/r(b[1][15],1)).toPrecision(2);t=(h/r(b[3][2],4)).toPrecision(2);u=(h/r(b[1][15],4)).toPrecision(2);if(k===l){l="";u="";}else{l=", or "+l+" if inline script code and style tags are removed";u=", or "+u+" if inline script code and style tags are removed";}i.push(k);i.push("");i.push(l);i.push(". The efficiency score if this input is a large form or application is ");i.push(t);i.push("");i.push(u);i.push(". Efficient markup achieves scores higher than 2.00 and excellent markup achieves scores higher than 4.00. The score reflects the highest number of tags to pieces of content where the weight of those tags is as small as possible compared to the weight of the content.");i.push("The score is a performance metric only and is not associated with validity or well-formedness, but semantic code typically achieves the highest scores. All values are rounded to the nearest hundreth.

    Total input size: ");i.push(insertComma(e));i.push(" characters

    Total output size: ");i.push(insertComma(d));i.push(" characters

    * Total number of HTTP requests in supplied HTML: ");i.push(m.length);i.push("

    ");return i.join("");}()),s=(function(){var a=0,c=["

    "],q="";if(b[0][0]+b[0][15]+b[0][16]!==b[0][1]){q="s";a=(b[0][0]+b[0][15]+b[0][16])-b[0][1];if(a>0){if(a===1){q="";}c.push(a);c.push(" more start tag");c.push(q);c.push(" than end tag");c.push(q);c.push("!");}else{if(a===-1){q="";}c.push(a*-1);c.push(" more end tag");c.push(q);c.push(" than start tag");c.push(q);c.push("!");}c.push(" The combined total number of start tags, script tags, and style tags should equal the number of end tags. For HTML this problem may be solved by selecting the 'Presume SGML type HTML' option.

    ");}else{return"";}return c.join("");}());summary=s+n+o;}());return build.join("").replace(/\n(\s)+\n/g,"\n\n");},diffview=function(args){(function(){if(typeof args.baseTextLines!=="string"){args.baseTextLines="Error: Cannot build diff view; baseTextLines is not defined.";}if(typeof args.newTextLines!=="string"){args.newTextLines="Error: Cannot build diff view; newTextLines is not defined.";}if(args.inline!==true){args.inline=false;}if(isNaN(Number(args.contextSize))){args.contextSize="";}if(typeof args.baseTextName!=="string"){args.baseTextName="Base Source";}if(typeof args.newTextName!=="string"){args.newTextName="New Source";}if(typeof args.tchar!=="string"){args.tchar="";}if(isNaN(Number(args.tsize))){if(args.tchar===""){args.tsize=0;}else{args.tsize=1;}}}());var node=[""],errorout=0,diffline=0,tab=(function(){var a=Number(args.tsize),b=0,c=[];if(args.tchar===""){return"";}for(b=0;b-1&&crpos>-1)||crpos<0)?"\n":"\r",lines=str.replace(/\&/g,"&").replace(/\$#lt;/g,"%#lt;").replace(/\$#gt;/g,"%#gt;").replace(//g,"$#gt;");if(linebreak==="\n"){str=str.replace(/\r/g,"");}else{str=str.replace(/\n/g,"");}return lines.split(linebreak);},bta=stringAsLines(args.baseTextLines),nta=stringAsLines(args.newTextLines),baseTextName=args.baseTextName,newTextName=args.newTextName,opcodes=(function(){var junkdict={},isbjunk=function(key){if(junkdict.hasOwnProperty(key)){return junkdict[key];}},a=bta,b=nta,matching_blocks=[],bxj=[],opcodes=[],answer=[],get_matching_blocks=function(){var c=0,d=0,alo=0,ahi=0,blo=0,bhi=0,qi=[],i=0,j=0,k=0,x=[],i1=0,i2=0,j1=0,j2=0,k1=0,k2=0,la=a.length,lb=b.length,queue=[[0,la,0,lb]],non_adjacent=[],ntuplecomp=function(a,b){var i=0,mlen=Math.max(a.length,b.length);for(i=0;ib[i]){return 1;}}return(a.length===b.length)?0:((a.length=blo){if(j>=bhi){break;}if(l[0]===j-1){k=l[1]+1;}else{k=1;}if(k>bestsize){besti=i-k+1;bestj=j-k+1;bestsize=k;}}l=[j,k];}}while(besti>alo&&bestj>blo&&!isbjunk(b[bestj-1])&&a[besti-1]===b[bestj-1]){besti-=1;bestj-=1;bestsize+=1;}while(besti+bestsizealo&&bestj>blo&&isbjunk(b[bestj-1])&&a[besti-1]===b[bestj-1]){besti-=1;bestj-=1;bestsize+=1;}while(besti+bestsize0){matching_blocks.push(x);if(alo-1;c-=1){if(bxj[c][1]===elt){break;}}if(c>-1){if(n>=200&&100>n){bxj.splice(c,1);}}else{bxj.push([i,elt]);}}}()),result=(function(){var ai=0,bj=0,size=0,tag="",c=0,i=0,j=0,blocks=get_matching_blocks(),d=blocks.length;for(c=0;c0){answer.push(["equal",ai,i,bj,j]);}}}());}());return answer;}());if(inline){node.push("");}else{node.push("");}(function(){var idx=0,b=0,be=0,n=0,ne=0,rowcnt=0,i=0,jump=0,tb=(tab==="")?"":new RegExp("^(("+tab.replace(/\\/g,"\\")+")+)"),noTab=function(str){var a=0,b=str.length,c=[];for(a=0;ak){r=j-k;zx=i-r;ax[zx]=""+ax[zx];ax[zx+r]=""+ax[zx+r];bx[p]=""+bx[p];}else{r=k-j;zx=p-r;ax[i]=""+ax[i];bx[zx]=""+bx[zx];bx[zx+r]=""+bx[zx+r];}c=ax.join("").replace(/\$#34;/g,"\"").replace(/\$#39;/g,"'");d=bx.join("").replace(/\$#34;/g,"\"").replace(/\$#39;/g,"'");return[c,d];}());}errorout-=1;ax=a.split("");bx=b.split("");zx=Math.max(ax.length,bx.length);entity=function(z){var a=z.length,b=[];for(n=0;n/g,i=0,j=0,o=0,p=[],q=false;for(i=k;i";bx[i-1]=bx[i-1]+"";errorout+=1;n=true;break;}else if(typeof ax[i-1]!=="string"&&typeof bx[i-1]==="string"){ax[i-1]="";bx[i-1]=bx[i]+"";errorout+=1;n=true;break;}else if(typeof ax[i-1]==="string"&&typeof bx[i-1]!=="string"){ax[i-1]=ax[i]+"";bx[i-1]="";errorout+=1;n=true;break;}}else if(ax[i]===undefined&&(bx[i]===""||bx[i]===" ")){ax[i]="";}else if(bx[i]===undefined&&(ax[i]===""||ax[i]===" ")){bx[i]="";}}}for(j=i+1;j"+bx[o]&&em.test(bx[j-1])&&(j-2<0||ax[j-2]!==bx[o+1])){ax[j-1]=ax[j-1].replace(em,"");ax.splice(j-1,0,"");bx[o-1]=bx[o-1]+"";k=o;if(o-j>0){p=[];for(o;o>j;o-=1){p.push("");}ax=p.concat(ax);}n=false;break;}else if(bx[j-1]===""+ax[o]&&em.test(ax[j-1])&&(j-2<0||bx[j-2]!==ax[o+1])){bx[j-1]=bx[j-1].replace(em,"");bx.splice(j-1,0,"");ax[o-1]=ax[o-1]+"";k=o;if(o-j>0){p=[];for(o;o>j;o-=1){p.push("");}bx=p.concat(bx);}n=false;break;}else if(bx[j]===ax[o]&&((ax[o-1]!==")"&&ax[o-1]!=="}"&&ax[o-1]!=="]"&&ax[o-1]!==">"&&bx[j-1]!==")"&&bx[j-1]!=="}"&&bx[j-1]!=="]"&&bx[j-1]!==">")||(o===zx-1||bx[j+1]===ax[o+1]))){if(bx[j-1]===""+ax[o-1]){bx[j-1]=bx[j-1].replace(//,"");ax[o-1]=ax[o-1]+"";k=j;n=false;break;}if(ax.length>bx.length&&ax[o-1].substr(4)===bx[j-1]){ax[o-2]=ax[o-2]+"";bx[j-2]=bx[j-2]+"";bx[j-1]=bx[j-1].replace(//,"");}else if(ax[o-1]!==bx[j-1]&&!em.test(ax[o-1])){ax[o-1]=ax[o-1]+"";bx[j-1]=bx[j-1]+"";}else{ax[o-1]=""+ax[o-1];bx[j-1]=""+bx[j-1];}k=o;if(o-j>0){p=[];for(o;o>j;o-=1){p.push("");}bx=p.concat(bx);}n=false;break;}else if(ax[j]===bx[o]&&((bx[o-1]!==")"&&bx[o-1]!=="}"&&bx[o-1]!=="]"&&bx[o-1]!==">"&&ax[j-1]!==")"&&ax[j-1]!=="}"&&ax[j-1]!=="]"&&ax[j-1]!==">")||(o===zx-1||ax[j+1]===bx[o+1]))){if(ax[j-1]===""+bx[o-1]){ax[j-1]=ax[j-1].replace(//,"");bx[o-1]=bx[o-1]+"";k=j;n=false;break;}if(bx.length>ax.length&&bx[o-1].substr(4)===ax[j-1]){bx[o-2]=bx[o-2]+"";ax[j-2]=ax[j-2]+"";ax[j-1]=ax[j-1].replace(//,"");}else if(bx[o-1]!==ax[j-1]&&!em.test(bx[o-1])){bx[o-1]=bx[o-1]+"";ax[j-1]=ax[j-1]+"";}else{bx[o-1]=""+bx[o-1];ax[j-1]=""+ax[j-1];}k=o;if(o-j>0){p=[];for(o;o>j;o-=1){p.push("");}ax=p.concat(ax);}n=false;break;}}if(n){for(o=j+1;o";bx[o-1]=bx[o-1]+"";k=o;n=false;q=true;break;}}if(q){q=false;break;}}}zx=Math.max(ax.length,bx.length);}};for(p=0;p").length>c.split("").length){c+="";}if(d.split("").length>d.split("").length){d+="";}}return[c,d];};for(idx=0;idx-1&&opcodes.length>1&&((idx>0&&i===context)||(idx===0&&i===0))&&change==="equal"){jump=rowcnt-((idx===0?1:2)*context);if(jump>1){node.push("");if(inline){node.push("");}node.push("");b+=jump;n+=jump;i+=jump-1;if(idx+1===opcodes.length){break;}}}if(change!=="equal"){diffline+=1;}node.push("");if(tab!==""){if(!btest&&typeof bta[b+1]==="string"&&typeof nta[n]==="string"&&btab[b+1]===ntab[n]&&btab[b]!==ntab[n]&&(typeof nta[n-1]!=="string"||(btab[b]!==ntab[n-1]))){btest=true;}else if(!ntest&&typeof nta[n+1]==="string"&&typeof bta[b]==="string"&&ntab[n+1]===btab[b]&&ntab[n]!==btab[b]&&(typeof bta[b-1]!=="string"||(ntab[n]!==btab[b-1]))){ntest=true;}}if(inline){if(ntest||change==="insert"){node.push("");}else if(btest||change==="delete"){node.push("");}else if(change==="replace"){if(b");node.push(b+1);node.push("");}if(b");}if(n");}}else if(b");node.push(b+1);node.push("");}if(btest){b+=1;btest=false;}else if(ntest){n+=1;ntest=false;}else{b+=1;n+=1;}}else{if(!btest&&!ntest&&typeof bta[b]==="string"&&typeof nta[n]==="string"){if(change==="replace"&&b");node.push(b+1);node.push("");}else{node.push("");}if(n");node.push(n+1);node.push("");}else{node.push("");}if(b");node.push(b+1);node.push("");node.push("");btest=false;b+=1;}else if(ntest||(typeof bta[b]!=="string"&&typeof nta[n]==="string")){node.push("");node.push("");ntest=false;n+=1;}node.push("");}}}}());node.push("
    ");node.push(baseTextName);node.push(" vs. ");node.push(newTextName);node.push("
    ");node.push(baseTextName);node.push("");node.push(newTextName);node.push("
    ......
    ");node.push(n+1);node.push("");node.push(nta[n]);node.push("
    ");node.push(b+1);node.push("");node.push(bta[b]);node.push("
    ");node.push(z[0]);node.push("
    ");node.push(n+1);node.push("");node.push(z[1]);node.push("
    ");node.push(n+1);node.push("");node.push(bta[b]);node.push("
    ");if(z.length===2){node.push(z[0]);}else{node.push(bta[b]);}node.push("");if(z.length===2){node.push(z[1]);}else{node.push(nta[n]);}node.push("");node.push(bta[b]);node.push("");node.push(n+1);node.push("");node.push(nta[n]);node.push("
    Original diff view created by jsdifflib. Diff view rewritten by Austin Cheney.
    ");return[node.join("").replace(/\$#gt;/g,">").replace(/\$#lt;/g,"<").replace(/\%#lt;/g,"$#lt;").replace(/\%#gt;/g,"$#gt;"),errorout,diffline];},core=function(api){var start=(function(){if(!api.source||api.source===""){api.source="Source sample is missing.";}if(!api.mode||api.mode===""||(api.mode!=="minify"&&api.mode!=="diff")){api.mode="beautify";}if(api.mode==="diff"&&(!api.diff||api.diff==="")){api.diff="Diff sample is missing.";}if(!api.lang||api.lang===""||(api.lang!=="css"&&api.lang!=="markup"&&api.lang!=="csv"&&api.lang!=="text")){api.lang="auto";}if(typeof api.topcoms!=="boolean"){api.topcoms=false;}if(!api.csvchar||typeof api.csvchar!=="string"||api.csvchar===""){api.csvchar=",";}if(!api.comments||api.comments!=="noindent"){api.comments="indent";}if(typeof api.content!=="boolean"){api.content=false;}if(typeof api.force_indent!=="boolean"){api.force_indent=false;}if(!api.context||isNaN(api.context)){api.context="";}if(!api.diffview||api.diffview!=="inline"){api.diffview="sidebyside";}if(!api.html||typeof api.html!=="boolean"){if(api.html==="html-yes"){api.html=true;}else{api.html=false;}}if(api.insize===undefined||isNaN(api.insize)){api.insize=4;}if(typeof api.inchar!=="string"){api.inchar=" ";}if(!api.indent||api.indent!=="allman"){api.indent="";}if(typeof api.quote!=="boolean"){api.quote=false;}if(typeof api.semicolon!=="boolean"){api.semicolon=false;}if(!api.style||api.style!=="noindent"){api.style="indent";}if(typeof api.content!=="boolean"){api.content=false;}if(typeof api.sourcelabel!=="string"||api.sourcelabel.length<1){api.sourcelabel="base";}if(typeof api.difflabel!=="string"||api.difflabel.length<1){api.difflabel="base";}}()),auto="",autotest=false,spacetest=(/^\s+$/g),apioutput="",apidiffout="",args={},proctime=function(){var d="",e="",f=0,h=0,g=new Date(),b=((g.getTime()-startTime)/1000),c=b.toFixed(3),plural=function(x,y){var a="";if(x>1){a=x+y+"s ";}else{a=x+y+" ";}return a;},minute=function(){d=(b/60).toFixed(1);f=Number(d.toString().split(".")[0]);c=(b-(f*60)).toFixed(3);d=plural(d," minute");};if(b>=60&&b<3600){minute();}else if(b>=3600){e=(b/3600).toFixed(1);h=Number(e.toString().split(".")[0]);b=b-(h*3600);e=plural(e," hour");minute();}return"

    Execution time: "+e+d+c+" seconds

    ";},pdcomment=function(){var a="",b=api.source.length,c=api.source.indexOf("/*prettydiff.com")+16,d=true,e=[],f=-1,g=0,h=[],i="";if(api.source.indexOf("/*prettydiff.com")===-1&&api.diff.indexOf("/*prettydiff.com")===-1){return;}if(c===15&&typeof api.diff!=="undefined"){c=api.diff.indexOf("/*prettydiff.com")+16;d=false;}else if(c===15){return;}for(c;c\s*)$/.test(a)){for(d=1;d([a-z0-9\s])*<\/?[a-z]+>/i.test(a)&&/^(\s*<)/.test(a)&&/(>\s*)$/.test(a))||(/^(\s*\s*)$/i.test(a))){api.lang="markup";if(api.html===true){auto="HTML";}else{auto="markup";}}else if(api.mode==="diff"){api.lang="text";auto="unknown";}else{api.lang="javascript";auto="JavaScript";}if(auto==="unknown"){if(api.mode==="diff"){auto="Plain Text";}else{auto="JavaScript";}auto="

    Language set to auto, but language could not be determined. Language defaulted to "+auto+".

    ";}else{auto="

    Language set to auto. Presumed language is "+auto+".

    ";}}());}pdcomment();if(api.mode==="minify"){if(api.lang==="css"){apioutput=jsmin(api.source,3,"css",true,api.topcoms);}else if(api.lang==="csv"){apioutput=csvmin(api.source,api.csvchar);}else if(api.lang==="markup"){apioutput=markupmin(api.source,"",api.html,api.topcoms);}else if(api.lang==="text"){apioutput=api.source;}else{apioutput=jsmin(api.source,2,"javascript",true,api.topcoms);}return(function(){var sizediff=function(){var a=0,b=0,c=api.source,d=c.length,f=0,g=apioutput.length,h=d-g,i=0,j=0,k=((h/d)*100).toFixed(2)+"%",l="";for(a=0;a
    Minification efficiency report
    Output SizeNumber of Lines From Input
    "+g+""+(b+1)+"
    Operating SystemInput SizeSize DifferencePercentage of Decrease
    Unix/Linux"+d+""+h+""+k+"
    Windows"+f+""+i+""+l+"
    ";};if(autotest===true){return[apioutput,proctime()+auto+sizediff()];}else{return[apioutput,proctime()+sizediff()];}}());}else if(api.mode==="beautify"){if(api.lang==="css"){apioutput=cleanCSS(api.source,api.insize,api.inchar,api.comments,true);apidiffout=summary;}else if(api.lang==="csv"){apioutput=csvbeauty(api.source,api.csvchar);apidiffout="";}else if(api.lang==="markup"){args={};args.source=api.source;args.insize=api.insize;args.inchar=api.inchar;args.mode="beautify";args.comments=api.comments;args.style=api.style;args.html=api.html;args.force_indent=api.force_indent;apioutput=markup_beauty(args);apidiffout=summary;if(api.inchar!=="\t"){apioutput=apioutput.replace(/\n[\t]* \/>/g,"");}}else if(api.lang==="text"){apioutput=api.source;apidiffout="";}else{args={};args.source=api.source;args.insize=api.insize;args.inchar=api.inchar;args.preserve=true;args.preserve_max=1;args.inlevel=0;args.space=true;args.braces=api.indent;args.inarray=false;args.comments=api.comments;apioutput=js_beautify(args);apidiffout=summary;}if(!apidiffout){apidiffout="";}if(autotest===true&&api.lang!=="csv"&&api.lang!=="text"){return[apioutput,proctime()+auto+apidiffout];}else{return[apioutput,proctime()+apidiffout];}}else if(api.mode==="diff"){if(api.lang==="css"){apioutput=jsmin(api.source,3,"css",false);apioutput=cleanCSS(apioutput,api.insize,api.inchar,api.comments,false);apidiffout=jsmin(api.diff,3,"css",false);apidiffout=cleanCSS(apidiffout,api.insize,api.inchar,api.comments,false);}else if(api.lang==="csv"){apioutput=csvbeauty(api.source,api.csvchar);apidiffout=csvbeauty(api.diff,api.csvchar);}else if(api.lang==="markup"){args={};args.source=api.source;args.insize=api.insize;args.inchar=api.inchar;args.mode="diff";args.comments=api.comments;args.style=api.style;args.html=api.html;args.content=api.content;args.force_indent=api.force_indent;apioutput=markup_beauty(args).replace(/\n[\t]* \/>/g,"");args.source=api.diff;apidiffout=markup_beauty(args).replace(/\n[\t]* \/>/g,"");}else if(api.lang==="text"){apioutput=api.source;apidiffout=api.diff;}else{args={};args.insize=api.insize;args.inchar=api.inchar;args.preserve=true;args.preserve_max=1;args.inlevel=0;args.space=true;args.braces=api.indent;args.inarray=false;args.comments=api.comments;args.content=api.content;apioutput=jsmin(api.source,3,"javascript",false);args.source=apioutput;apioutput=js_beautify(args);apidiffout=jsmin(api.diff,3,"javascript",false);args.source=apidiffout;apidiffout=js_beautify(args);}if(api.quote===true){apioutput=apioutput.replace(/'/g,"\"");apidiffout=apidiffout.replace(/'/g,"\"");}if(api.semicolon===true){apioutput=apioutput.replace(/;\n/g,"\n");apidiffout=apidiffout.replace(/;\n/g,"\n");}if(api.sourcelabel===""||spacetest.test(api.sourcelabel)){api.sourcelabel="Base Text";}if(api.difflabel===""||spacetest.test(api.difflabel)){api.difflabel="New Text";}if(api.diffview==="inline"){api.diffview=true;}return(function(){var a=[],s="s",t="s";if(apioutput==="Error: This does not appear to be JavaScript."||apidiffout==="Error: This does not appear to be JavaScript."){a[1]=["

    Error: Please try using the option labeled Plain Text (diff only). The input does not appear to be markup, CSS, or JavaScript.

    ",0,0];}else{args={};args.baseTextLines=apioutput;args.newTextLines=apidiffout;args.baseTextName=api.sourcelabel;args.newTextName=api.difflabel;args.contextSize=api.context;args.inline=api.diffview;if(args.lang==="text"){args.tchar="";}else{args.tchar=api.inchar;}args.tsize=api.insize;a[1]=diffview(args);if(a[1][2]===1){t="";if(a[1][1]===0){s="";}}}a[0]="

    Number of differences: "+(a[1][1]+a[1][2])+" difference"+s+" from "+a[1][2]+" line"+t+" of code.

    ";if(autotest===true){return[a[1][0],proctime()+auto+a[0]];}else{return[a[1][0],proctime()+a[0]];}}());}};return core(api);}; \ No newline at end of file