/*prettydiff.com api.topcoms:true,api.insize:4,api.inchar:" " */ /*global markupmin, js_beautify, cleanCSS, markup_summary*/ /* This code may be used internally to Travelocity without limitation, exclusion, or restriction. If this code is used externally the following comment must be included everywhere this code is used. */ /*********************************************************************** This is written by Austin Cheney on 7 May 2009. Anybody may use this code without permission so long as this comment exists verbatim in each instance of its use. http://www.travelocity.com/ http://mailmarkup.org/ http://prettydiff.com/ **********************************************************************/ var markup_beauty=function(c){(function(){if(!c.source||typeof c.source!=="string"){c.source=""}if(c.insize===undefined||isNaN(c.insize)){c.insize=4}if(typeof c.inchar!=="string"||c.inchar.length<1){c.inchar=" "}if(!c.mode||c.mode!=="diff"){c.mode="beautify"}if(!c.comments||c.comments!=="indent"){c.comments="noindent"}if(!c.style||c.style!=="indent"){c.style="noindent"}if(typeof c.html!=="boolean"){c.html=false}if(typeof c.content!=="boolean"){c.content=false}if(typeof c.force_indent!=="boolean"){c.force_indent=false}}());var d=[],g=[],f=[],h=[],b=[],e=[],a=c.source;(function(){var j=function(k){k=k.replace(//g,"\nprettydiffcdatae");return k};a=a.replace(/\/+/g,i)}());(function(){var i=(function(){var I=0,H=0,G=c.source.length,F=[],E=0,D=-1,C=0,B=0,A=-1,z=0,y=0,x=false,w=false,v=0,u=[">"],t=false,J=0;for(I=0;I"){if(/>"){if(/>"){I=H;D+=1;break}}}else{if(a.charAt(I)==="<"&&a.charAt(I+1)==="%"){for(H=I+2;H"){I=H;D+=1;break}}}else{if(a.charAt(I)==="<"&&a.charAt(I+1)==="!"&&a.charAt(I+2)==="["){for(H=I+2;H"){I=H;D+=1;break}}}else{if(a.charAt(I)==="<"&&a.charAt(I+1)==="!"&&/[A-Z]|\[/.test(a.charAt(I+2))){for(H=I+3;HH+3&&a.charAt(H+1)==="!"&&a.charAt(H+2)==="-"&&a.charAt(H+3)==="-"){for(J=H+4;J"){H=J;break}}}else{if(a.charAt(H)===">"&&u[u.length-1]===">"&&u.length===1){D+=1;if(t){F.push([I,H,D,I])}t=false;I=H;u=[">"];break}else{if(a.charAt(H)==="<"){u.push(">");t=true}else{if(a.charAt(H)===">"&&u.length>1){u.pop();t=true}else{if(a.charAt(H)==="["){u.push("]")}else{if(a.charAt(H)==="]"){u.pop()}else{if(a.charAt(H)==='"'){if(u[u.length-1]==='"'){u.pop()}else{u.push('"')}}else{if(a.charAt(H)==="'"){if(u[u.length-1]==="'"){u.pop()}else{u.push("'")}}}}}}}}}}}else{if(a.charAt(I)===a.charAt(I+1)&&(a.charAt(I)==='"'||a.charAt(I)==="'")){I+=1}else{if(a.charAt(I-1)==="="&&(a.charAt(I)==='"'||a.charAt(I)==="'")){w=false;for(y=I-1;y>0;y-=1){if((a.charAt(y)==='"'&&a.charAt(I)==='"')||(a.charAt(y)==="'"&&a.charAt(I)==="'")||a.charAt(y)==="<"){break}else{if(a.charAt(y)===">"){w=true;break}}}if(!w){x=false;for(H=I+1;H"){H=v+8;break}}}else{if(a.substr(H,6).toLowerCase()===""){H=v+7;break}}}else{if(a.substr(H,5)===""){H=v;break}}}else{if(a.charAt(H)==="<"&&a.charAt(H+1)==="%"){for(v=H+5;v"){H=v;break}}}else{if(a.charAt(H)===">"||a.charAt(H)==="<"){x=true}else{if((a.charAt(H-1)!=="\\"&&((a.charAt(I)==='"'&&a.charAt(H)==='"')||(a.charAt(I)==="'"&&a.charAt(H)==="'")))||H===G-1){if(A!==D&&z===1){z=0;D-=1;A-=1}else{if(A===D){for(E=C+1;E>I;E+=1){if(!/\s/.test(a.charAt(E))){break}}B=E;if(C"){break}}D+=1;I=H+2}else{D+=1;B=I}}else{if(a.charAt(I+1)==="<"&&a.charAt(I)!==">"){for(H=I;H>0;H-=1){if(!/\s/.test(a.charAt(H))&&a.charAt(H)!==">"){D+=1;A+=1;B=I;break}else{if(a.charAt(H)===">"){if(D!==A){A+=1;C=I}break}}}}else{if(a.charAt(I)===">"){A+=1;C=I}}}}}}}}}}}}return F}());(function(){var v=0,u=0,s=i.length,r=0,q=0,p=0,o=0,n=0,m=0,l=0,t=a.split("");for(v=0;vm;u-=1){o+=1;if(/\s/.test(t[u])){for(l=u-1;l>m;l-=1){if(!/\s/.test(t[l])){if(t[l]!=="="){o+=1}else{if(/\s/.test(t[l-1])){o-=1}}u=l;break}}}}if(/\s/.test(t[n])){o-=1}b.push(["<",o,p])}else{if(t[r]===">"){t[r]="]";for(u=r;u>m;u-=1){o+=1;if(/\s/.test(t[u])){for(l=u-1;l>m;l-=1){if(!/\s/.test(t[l])){if(t[l]!=="="){o+=1}else{if(/\s/.test(t[l-1])){o-=1}}u=l;break}}}}if(/\s/.test(t[n])){o-=1}b.push([">",o,p])}}}}a=t.join("")}())}());(function(){var m=0,p=markupmin({source:a,comments:c.mode,presume_html:c.html}).split(""),l="",j=function(s){var r=[],i=s.length,w=s.split("").reverse(),v=0,u="",t=true,q=p.length;if(m>0&&p[m-1]===" "){u=" "}for(m;m"){if(p[m]==="["){t=false}if(t&&p[m]===">"){w=[">"];i=1}}if(r[r.length-1]===w[0]){if(i===1){return u+r.join("")}for(v=0;v0;s-=1){if(!/\s/.test(p[s])){break}}if(p[s]===")"||p[s]==="]"||p[s]==="}"||/\w/.test(p[s])){r=""}else{r="/"}}else{r=p[v]}}}}}else{if(p[v-1]!=="\\"&&((r==="'"&&p[v]==="'")||(r==='"'&&p[v]==='"')||(r==="/"&&p[v]==="/")||(r==="//"&&(p[v]==="\n"||(p[v-4]&&p[v-4]==="/"&&p[v-3]==="/"&&p[v-2]==="-"&&p[v-1]==="-"&&p[v]===">")))||(r==="/*"&&p[v-1]==="*"&&p[v]==="/"))){r=""}}if(((u==="script"&&r==="")||u==="style")&&p[v]==="<"&&p[v+1]==="/"&&p[v+2].toLowerCase()==="s"){if(u==="script"&&(p[v+3].toLowerCase()==="c"&&p[v+4].toLowerCase()==="r"&&p[v+5].toLowerCase()==="i"&&p[v+6].toLowerCase()==="p"&&p[v+7].toLowerCase()==="t")){break}else{if(u==="style"&&(p[v+3].toLowerCase()==="t"&&p[v+4].toLowerCase()==="y"&&p[v+5].toLowerCase()==="l"&&p[v+6].toLowerCase()==="e")){break}}}else{if(u==="other"&&p[v]==="<"){break}else{t=t+p[v]}}}m=v-1;if(c.content){if(t.charAt(0)===" "&&t.charAt(t.length-1)===" "){t=" text "}else{if(t.charAt(0)===" "){t=" text"}else{if(t.charAt(t.length-1)===" "){t="text "}else{t="text"}}}}return t},k=p.length;for(m=0;m"));d.push("T_comment")}else{if(p[m]==="<"&&p[m+1]==="!"&&p[m+2]==="-"&&p[m+3]==="-"&&p[m+4]==="#"){g.push(j("-->"));d.push("T_ssi")}else{if(p[m]==="<"&&p[m+1]==="!"&&p[m+2]!=="-"){g.push(j("]>"));d.push("T_sgml")}else{if(p[m]==="<"&&p[m+1]==="?"&&p[m+2].toLowerCase()==="x"&&p[m+3].toLowerCase()==="m"&&p[m+4].toLowerCase()==="l"){g.push(j("?>"));d.push("T_xml")}else{if(p[m]==="<"&&p[m+1]==="?"&&p[m+2].toLowerCase()==="p"&&p[m+3].toLowerCase()==="h"&&p[m+4].toLowerCase()==="p"){g.push(j("?>"));d.push("T_php")}else{if(p[m]==="<"&&p[m+1].toLowerCase()==="s"&&p[m+2].toLowerCase()==="c"&&p[m+3].toLowerCase()==="r"&&p[m+4].toLowerCase()==="i"&&p[m+5].toLowerCase()==="p"&&p[m+6].toLowerCase()==="t"){g.push(j(">"));l=g[g.length-1].toLowerCase().replace(/'/g,'"');if(l.charAt(l.length-2)==="/"){d.push("T_singleton")}else{if(l.indexOf(' type="')===-1||l.indexOf(' type="text/javascript"')!==-1||l.indexOf(' type="application/javascript"')!==-1||l.indexOf(' type="application/x-javascript"')!==-1||l.indexOf(' type="text/ecmascript"')!==-1||l.indexOf(' type="application/ecmascript"')!==-1){d.push("T_script")}else{d.push("T_tag_start")}}}else{if(p[m]==="<"&&p[m+1].toLowerCase()==="s"&&p[m+2].toLowerCase()==="t"&&p[m+3].toLowerCase()==="y"&&p[m+4].toLowerCase()==="l"&&p[m+5].toLowerCase()==="e"){g.push(j(">"));l=g[g.length-1].toLowerCase().replace(/'/g,'"');if(l.indexOf(' type="')===-1||l.indexOf(' type="text/css"')!==-1){d.push("T_style")}else{d.push("T_tag_start")}}else{if(p[m]==="<"&&p[m+1]==="%"){g.push(j("%>"));d.push("T_asp")}else{if(p[m]==="<"&&p[m+1]==="/"){g.push(j(">"));d.push("T_tag_end")}else{if(p[m]==="<"&&d[d.length-1]!=="T_script"&&d[d.length-1]!=="T_style"&&(p[m+1]!=="!"||p[m+1]!=="?"||p[m+1]!=="/"||p[m+1]!=="%")){for(o=m;o"){g.push(j("/>"));d.push("T_singleton");break}else{if(p[o+1]===">"){g.push(j(">"));d.push("T_tag_start");break}}}}}else{if(p[m-1]===">"&&(p[m]!=="<"||(p[m]!==" "&&p[m+1]!=="<"))){if(d[d.length-1]==="T_script"){g.push(n("script"));d.push("T_content")}else{if(d[d.length-1]==="T_style"){g.push(n("style"));d.push("T_content")}else{if(p[m-1]+p[m]+p[m+1]!=="> <"){g.push(n("other"));d.push("T_content")}}}}}}}}}}}}}}}}}}());(function(){var j=0,k=d.length;for(j=0;j");if(d[j]==="T_sgml"||d[j]==="T_xml"){f.push("parse")}else{if(d[j]==="T_asp"||d[j]==="T_php"||d[j]==="T_ssi"){f.push("singleton")}else{if(d[j]==="T_comment"){f.push("comment")}else{if((d[j]==="T_content"&&g[j]!==" ")&&d[j-1]==="T_script"){f.push("external")}else{if(d[j]==="T_content"&&d[j-1]==="T_style"){f.push("external")}else{if(d[j]==="T_content"&&g[j].charAt(0)===" "&&g[j].charAt(g[j].length-1)===" "){f.push("mixed_both")}else{if(d[j]==="T_content"&&g[j].charAt(0)===" "&&g[j].charAt(g[j].length-1)!==" "){f.push("mixed_start")}else{if(d[j]==="T_content"&&g[j].charAt(0)!==" "&&g[j].charAt(g[j].length-1)===" "){f.push("mixed_end")}else{if(d[j]==="T_content"){f.push("content")}else{if(d[j]==="T_tag_start"){f.push("start")}else{if(d[j]==="T_style"){g[j]=g[j].replace(/\s+/g," ");f.push("start")}else{if(d[j]==="T_script"){g[j]=g[j].replace(/\s+/g," ");f.push("start")}else{if(d[j]==="T_singleton"){f.push("singleton")}else{if(d[j]==="T_tag_end"){f.push("end")}}}}}}}}}}}}}}}e=[].concat(g)}());(function(){var l=0,j="",m=0,k=0;if(!c.html){return}k=f.length;for(m=0;m-1;p-=1){if(f[p]==="start"&&h[p]==="x"){i+=1}else{if(f[p]==="end"){i-=1}else{if(f[p]==="start"&&h[p]!=="x"){return h.push(h[p]+i)}}}if(p===0){if(f[p]!=="start"){return h.push(0)}if(f[j]==="mixed_start"||f[j]==="content"||(f[j]==="singleton"&&g[j].charAt(0)!==" ")){return h.push("x")}return h.push(1)}}},m=function(){var o=function(p){for(p;p>0;p-=1){if(h[p]!=="x"){return h.push(h[p]+1)}}},i=function(){var p=0,v=false,s=function(){var r=0,q=function(){var w=0,x=0,u=0;for(x=j-1;x>0;x-=1){if((f[x]==="start"&&f[x+1]==="start"&&h[x]===h[x+1]-1)||(f[x]==="start"&&f[x-1]!=="start"&&h[x]===h[x-1])){break}}for(w=x+1;w0;r-=1){if(f[r]!=="mixed_end"||(f[r]==="start"&&h[r]!=="x")){if(f[r-1]==="end"){v=true;if(f[j-1]==="mixed_both"&&h[j-1]===h[r]-q()){return h.push(h[r]-(q()+1))}if(f[j-2]==="start"&&(f[j-1]==="mixed_end"||f[j-1]==="mixed_both")){return h.push(h[r])}if(h[r]!=="x"){if(f[r]==="mixed_both"&&r!==j-q()){if(r===j-1){return h.push(h[r]-1)}return h.push(h[r]+q())}if(f[j-1]==="mixed_end"&&q()===0){return h.push(h[r]-1)}if(h[j-1]==="x"&&(f[j-2]!=="end"||(f[j-2]==="end"&&h[j-2]!=="x"))){return h.push(h[r]+q())}return h.push(h[r]-q())}}else{v=false;return}}}},t=function(){var q=0,r=0;for(r=j;r>0;r-=1){if(f[r]==="end"){q+=1}else{if(f[r]==="start"){q-=1}}if(q===0){return r}}};if(f[j-1]==="end"&&h[j-1]!=="x"){if(f[j-2]==="start"&&h[j-2]==="x"){for(p=j-2;p>0;p-=1){if(h[p]!=="x"){break}}if(f[p]==="start"){return n("end")}return h.push(h[p]-1)}if(f[j-2]==="start"&&h[j-2]!=="x"){return h.push(h[j-2]-1)}return h.push(h[j-1]-1)}s();if(v){return}return(function(){var u=0,r=0;for(r=t();r>0;r-=1){if(f[r]==="start"){u+=1}else{if(f[r]==="end"){u-=1}}if(h[r]!=="x"){if(f[r]==="end"&&f[r-1]==="start"&&h[r-1]!=="x"){return h.push(h[r])}if(h[j-1]==="x"&&g[j].charAt(0)!==" "&&f[j-1]!=="mixed_end"&&(f[j-2]!=="end"||h[j-2]!=="x")&&(f[j-3]!=="end"||h[j-3]!=="x")){return h.push("x")}return h.push(h[r]+(u-1))}}u=0;for(r=j;r>-1;r-=1){if(f[r]==="start"){u+=1}else{if(f[r]==="end"){u-=1}}}return h.push(u)}())};if(f[j-1]==="end"||f[j-1]==="mixed_both"||f[j-1]==="mixed_end"){return i()}if(f[j-1]==="mixed_start"||f[j-1]==="content"){return h.push("x")}if(f[j-1]==="external"){return(function(){var p=0,q=-1;for(p=j-2;p>0;p-=1){if(f[p]==="start"){q+=1}else{if(f[p]==="end"){q-=1}}if(h[p]!=="x"){break}}if(f[p]==="end"){q+=1}return h.push(h[p]+q)}())}if(g[j].charAt(0)!==" "){if(f[j-1]==="singleton"||f[j-1]==="content"){return h.push("x")}return(function(){var p=0,q=0;for(p=j-1;p>0;p-=1){if(f[p]==="singleton"&&h[p]==="x"&&((f[p-1]==="singleton"&&h[p-1]!=="x")||f[p-1]!=="singleton")){q+=1}if(h[p]!==0&&h[p]!=="x"&&f[j-1]!=="start"){if(f[p]==="mixed_both"||f[p]==="mixed_start"){return h.push(h[p]-q)}if(h[p]===q||(f[p]==="singleton"&&(f[p-1]==="content"||f[p-1]==="mixed_start"))){return h.push(h[p])}return h.push(h[p]-1)}if(f[p]==="start"&&h[p]==="x"){return o(p)}if(f[j-1]==="start"){return h.push(h[p])}}return h.push(0)}())}return n("end")},l=function(s){var q=0,o=0,i=0,r=function(){var w=0,p=1,t=-1;for(w=q;w>0;w-=1){if(f[w]==="start"){t-=1;if(h[w]==="x"){p+=1}}else{if(f[w]==="end"){t+=1;p-=1}}if(h[w]===0){q=0;for(o=j-1;o>w;o-=1){if(f[o]==="start"){q+=1}else{if(f[o]==="end"){q-=1}}}if(q>0){if(h[w+1]==="x"){return h.push(((t)*-1)-1)}if(f[w]!=="external"&&(c.comments!=="noindent"||(c.comments==="noindent"&&f[w]!=="comment"))){return h.push((t+1)*-1)}}else{for(q=j-1;q>0;q-=1){if(h[q]!=="x"){return h.push(h[q])}}}}if(h[w]!=="x"&&h[j-1]!=="x"){if(f[w]==="start"||f[w]==="end"){return h.push(h[w]+p)}return h.push(h[w]+p-1)}if(t===-1&&h[w]==="x"){break}else{if(t===1&&h[w]!=="x"&&f[w]!=="mixed_start"&&f[w]!=="content"){if(f[w-1]==="mixed_end"||(h[j-1]==="x"&&f[j-1]==="end"&&f[w]!=="end")){return h.push(h[w]-t-1)}return h.push(h[w]-t)}}if(t===0&&h[w]!=="x"){return n("start")}}return n("start")};(function(){var p=0;if(s===1){q=0;o=0;i=0}else{for(p=s-1;p>0;p-=1){if(f[p]!=="comment"){q=p;break}}if(q===1){o=0;i=0}else{for(p=q-1;p>0;p-=1){if(f[p]!=="comment"){o=p;break}}if(o===1){i=0}else{for(p=o-1;p>0;p-=1){if(f[p]!=="comment"){i=p;break}}}}}}());if(j-1===0&&f[0]==="start"){return h.push(1)}if(f[q]==="mixed_start"||f[q]==="content"||f[j-1]==="mixed_start"||f[j-1]==="content"||(f[j]==="singleton"&&(f[j-1]==="start"||f[j-1]==="singleton"||f[j-1]==="end")&&g[j].charAt(0)!==" ")){return h.push("x")}if((f[j-1]==="comment"&&h[j-1]===0)||((f[i]==="mixed_start"||f[i]==="content")&&f[o]==="end"&&(f[q]==="mixed_end"||f[q]==="mixed_both"))){return n("start")}if(f[j-1]==="comment"&&h[j-1]!=="x"){return h.push(h[j-1])}if((f[q]==="start"&&h[q]==="x")||(f[q]!=="mixed_end"&&f[q]!=="mixed_both"&&h[q]==="x")){if(h[j-1]==="x"&&g[j].charAt(0)!==" "&&f[j-1]!=="start"&&g[j-1].charAt(g[j-1].length-1)!==" "){if((f[j-1]==="end"&&f[j-2]==="end")||(f[j-1]==="end"&&f[j]!=="end"&&f[j+1]!=="mixed_start"&&f[j+1]!=="content")){return n("start")}return h.push("x")}return r()}if(f[q]==="end"&&h[q]!=="x"&&(f[q-1]!=="start"||(f[q-1]==="start"&&h[q-1]!=="x"))){if(h[q]<0){return n("start")}return h.push(h[q])}if(f[i]!=="mixed_start"&&f[i]!=="content"&&(f[q]==="mixed_end"||f[q]==="mixed_both")){return(function(){var v=0,u=0,w=0,t=0;for(v=q;v>0;v-=1){if(f[v]==="end"){u+=1}if(f[v]==="start"){w+=1}if(h[v]===0&&v!==0){t=v}if(f[q]==="mixed_both"&&h[v]!=="x"){return h.push(h[v])}if(f[v]!=="comment"&&f[v]!=="content"&&f[v]!=="external"&&f[v]!=="mixed_end"&&h[v]!=="x"){if(f[v]==="start"&&h[v]!=="x"){if(f[j-1]!=="end"){return h.push(h[v]+(w-u))}if((h[v]===h[v-1]&&f[v-1]!=="end"&&h[v+1]!=="x")||(f[j-2]==="start"&&h[j-2]!=="x"&&h[j-1]==="x")){return h.push(h[v]+1)}if(w<=1){return h.push(h[v])}}else{if(u>0){if(w>1){if(t!==0){return n("start")}return h.push(h[v]+1)}return h.push(h[v]-u+1)}}return h.push(h[v]+w)}}return n("start")}())}if(f[q]==="start"&&h[q]!=="x"){return(function(){var p=0;for(p=j-1;p>-1;p-=1){if(f[p]!=="comment"&&f[p]!=="content"&&f[p]!=="external"&&f[p]!=="mixed_end"){if(f[j+1]&&g[j].charAt(0)!==" "&&(f[j+1]==="mixed_end"||f[j+1]==="content"||(g[j+1].charAt(0)!==" "&&f[j+1]==="singleton"))){return h.push("x")}return h.push(h[p]+1)}}return h.push(0)}())}if(g[j].charAt(0)!==" "&&(f[j-1]==="singleton"||f[j-1]==="content"||f[j-1]==="mixed_start")){return h.push("x")}return n("start")},k=function(){var i;if(f[j]!=="start"&&h[j-1]==="x"&&f[j-1]!=="content"&&g[j].charAt(0)!==" "&&f[j-1]!=="mixed_start"&&f[j-1]!=="mixed_end"){return h.push("x")}if(f[j]!=="start"&&g[j]===" "){g[j]="";return h.push("x")}if(f[j-1]!=="comment"){l(j)}else{for(i=j-1;i>0;i-=1){if(f[i]!=="comment"){break}}l(i+1)}};(function(){var o=0,i="",s=0,r=0,q=b.length,p=[];for(o=0;o"&&p[s]==="]"){p[s]=">"}}g[r]=p.join("")}}}());(function(){var t=false,o=false,v=[],u=[],i=(/^(\s*\/*<\!\[+[A-Z]+\[+)/),q=(/(\/*\]+>\s*)$/),p=(/^(\s*<\!\-\-)/),s=(/(\-\->\s*)$/),r=f.length;for(j=0;j\s*/.test(g[j])){if(g[j].charAt(0)===" "){g[j]=g[j].substr(1)}if(g[j].charAt(g[j].length-1)===" "){g[j]=g[j].substr(0,g[j].length-1)}f[j]="comment";d[j]="T_comment";if(c.comments!=="noindent"){k()}else{h.push(0)}}else{if(d[j-1]==="T_script"){h.push(0);if(p.test(g[j])){t=true;g[j]=g[j].replace(p,"")}else{if(i.test(g[j])){v=i.exec(g[j]);g[j]=g[j].replace(i,"")}}if(s.test(g[j])&&!/(\/\/\-\->\s*)$/.test(g[j])){o=true;g[j]=g[j].replace(s,"")}else{if(q.test(g[j])){u=q.exec(g[j]);g[j]=g[j].replace(q,"")}}if(typeof js_beautify==="function"){g[j]=js_beautify({source:g[j],insize:api.insize,inchar:api.inchar,preserve:true,preserve_max:1,inlevel:0,space:true,braces:c.indent,inarray:false,comments:c.comments})}if(t){g[j]=""}else{if(u[0]!==""){g[j]=g[j]+"\n"+u[0]}}g[j]=g[j].replace(/(\/\/(\s)+\-\->(\s)*)$/,"//-->").replace(/^(\s*)/,"").replace(/(\s*)$/,"")}else{if(d[j-1]==="T_style"){h.push(0);if(p.test(g[j])){t=true;g[j]=g[j].replace(p,"")}else{if(i.test(g[j])){v=i.exec(g[j]);g[j]=g[j].replace(i,"")}}if(s.test(g[j])&&!/(\/\/\-\->\s*)$/.test(g[j])){o=true;g[j].replace(s,"")}else{if(q.test(g[j])){u=q.exec(g[j]);g[j]=g[j].replace(q,"")}}if(typeof cleanCSS==="function"){g[j]=cleanCSS({source:g[j],size:c.insize,character:c.inchar,comment:c.comments,alter:true})}if(t){g[j]=""}else{if(u[0]!==""){g[j]=g[j]+"\n"+u[0]}}g[j]=g[j].replace(/^(\s*)/,"").replace(/(\s*)$/,"")}}}}else{if(f[j]==="comment"&&c.comments!=="noindent"){k()}else{if(f[j]==="comment"&&c.comments==="noindent"){h.push(0)}else{if(f[j]==="content"){h.push("x")}else{if(f[j]==="parse"){k()}else{if(f[j]==="mixed_both"){k()}else{if(f[j]==="mixed_start"){k()}else{if(f[j]==="mixed_end"){g[j]=g[j].slice(0,g[j].length-1);h.push("x")}else{if(f[j]==="start"){k()}else{if(f[j]==="end"){m()}else{if(f[j]==="singleton"){k()}}}}}}}}}}}}}}}())}());(function(){var n=(function(){var p=0,i=c.insize,r=c.inchar,q=[];for(p=0;p0);return y};for(v=0;vv+3&&r[v+1]==="!"&&r[v+2]==="-"&&r[v+3]==="-"){if(v===0||r[v-1].charAt(0)!=="["){r[v]="\n"+q()+"<"}for(s=v+4;s"){v=s;break}}}else{if(r[v]==="<"&&(v===0||r[v-1].charAt(0)!=="[")){r[v]="\n"+q()+"<"}}}}}w=r.join("").replace(/\s>/g,">")}return w},l=function(q){var r=0,p=0,i=[];for(p=m;p>0;p-=1){if(h[p]!=="x"){break}}for(r=0;r0;p-=1){if(f[p]==="start"){r+=1}else{if(f[p]==="end"){r-=1}}if(h[p]!=="x"){break}}if(f[p]==="end"){r+=1}for(t=0;t0.4){r="bad"}else{r="good"}break;case 1:if((v[2][m]/t)<0.25){s="bad"}else{s="good"}if((v[3][m]/u)<0.6){r="bad"}else{r="good"}break;case 2:if((v[2][m]/t)>0.05){s="bad"}else{s="good"}if((v[3][m]/u)>0.05){r="bad"}else{r="good"}break}n=[""];n.push(v[2][m]);n.push("");n.push(o(m));n.push("");n.push(((v[2][m]/t)*100).toFixed(2));n.push("%");n.push(v[3][m]);n.push("");n.push(p(m));n.push("");n.push(((v[3][m]/u)*100).toFixed(2));n.push("%");return n.join("")},k=(function(){var m=0,x="",s=[],p=[],o=(function(){var A=0,E=["*** 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=[],B="",y="",C=v[0].length;for(A=0;A"+E[A]];D.push("");D.push(v[0][A]);D.push("");D.push(B);D.push("");D.push(((v[0][A]/t)*100).toFixed(2));D.push("%");D.push(v[1][A]);D.push("");D.push(y);D.push("");D.push(((v[1][A]/u)*100).toFixed(2));D.push("%");if(A===3){D.push("Total Common Tags");D.push(j(0));D.push("Content")}else{if(A===7){D.push("Total Content");D.push(j(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(j(2))}}}}}E[A]=D.join("")}return E.join("")}()),n=["
"],r=q.length;n.push((function(){var M=0,K=0,J=t,I=[],H=[],G=0,F=0,E=[],D=[],C=[],B="",A=[],N=[],L="",y=function(z){return z.replace(/(\,|\.|\?|\!|\:) /," ")};for(M=0;MI[F][0]&&I[K][1]!==""){F=K}}B=I[F][1];if(B.length<3||B.length>30||!(/[a-zA-Z]/).test(B)||(/&\#?\w+;/).test(B)||B==="the"||B==="and"||B==="for"||B==="are"||B==="this"||B==="from"||B==="with"||B==="that"){D.push(I[F])}else{D.push(I[F]);C.push(I[F])}if(I[F]!==I[M]){I[F]=I[M]}else{I[F]=[0,""]}if(C.length===11){break}}if(D.length<2){return""}K=D.length;for(M=0;M9){D[M]=""}else{A[M]=(D[M+1])?(D[M][0]/D[M+1][0]).toFixed(2):"1.00";D[M]=""+(M+1)+""+D[M][1].replace(/&/g,"&")+""+D[M][0]+""+A[M]+""+((D[M][0]/G)*100).toFixed(2)+"%"}}if(D[10]){D[10]=""}if(C.length>10){K=10}else{K=C.length}A=[];for(M=0;M"+C[M][1].replace(/&/g,"&")+""+C[M][0]+""+A[M]+""+((C[M][0]/G)*100).toFixed(2)+"%"}if(C[10]){C[10]=""}if(K>10){C[C.length-1]=""}H.push("");H.push("");H.push(B);if(B!==L&&C.length>2){H.push("");H.push(L)}H.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 ");H.push(G.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","));if(G>1){H.push(" Total")}H.push(" Word");if(G>1){H.push("s")}B=D.join("");L=C.join("");H.push("
Unfiltered Word Set
Filtered Word Set
");return H.join("")}()));n.push("");n.push(o);s=[];for(m=0;m"];p.push(q[m].replace(/\&/g,"&").replace(//g,">").replace(/"/g,"""));p.push("");s[m]=p.join("")}}if(s.length>0){x="

HTML elements making HTTP requests:

    "+s.join("")+"
"}else{x=""}n.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");n.push(t);n.push("100.00%100.00%");n.push(u);n.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.

**");n.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.");n.push("The combination of those three values from the table above should equal the number of end tags or the code is in error.

");n.push(x);return n.join("")}()),i=function(m,n){return(((v[3][0]+m)/u)/((v[3][1]*n)/u))},l=(function(){var y="",x=u/7500,s=g.join("").length,r=c.source.length,p=0,o=["

If the input is content it receives an efficiency score of "],n="",m="",A="",z="";y=x.toFixed(0);if(x>0){x=(q.length-y)*4}else{x=0}if(v[3][1]===0){v[2][1]=1e-8;v[3][1]=1e-8}p=(((v[2][0]+v[2][2]-x)/t)/(v[2][1]/t));n=(p/i(v[3][2],1)).toPrecision(2);m=(p/i(v[1][15],1)).toPrecision(2);A=(p/i(v[3][2],4)).toPrecision(2);z=(p/i(v[1][15],4)).toPrecision(2);if(n===m){m="";z=""}else{m=", or "+m+" if inline script code and style tags are removed";z=", or "+z+" if inline script code and style tags are removed"}o.push(n);o.push("");o.push(m);o.push(". The efficiency score if this input is a large form or application is ");o.push(A);o.push("");o.push(z);o.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.");o.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: ");o.push(r.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","));o.push(" characters

Total output size: ");o.push(s.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","));o.push(" characters

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

");return o.join("")}()),w=(function(){var m=0,o=["

"],n="";if(v[0][0]+v[0][15]+v[0][16]!==v[0][1]){n="s";m=(v[0][0]+v[0][15]+v[0][16])-v[0][1];if(m>0){if(m===1){n=""}o.push(m);o.push(" more start tag");o.push(n);o.push(" than end tag");o.push(n);o.push("!")}else{if(m===-1){n=""}o.push(m*-1);o.push(" more end tag");o.push(n);o.push(" than start tag");o.push(n);o.push("!")}o.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 o.join("")}());summary=w+l+k}());return g.join("").replace(/\n(\s)+\n/g,"\n\n").replace(/^\s+/,"")};