YUI.add("test-console",function(c,e){function t(){t.superclass.constructor.apply(this,arguments)}c.namespace("Test").Console=c.extend(t,c.Console,{initializer:function(e){this.on("entry",this._onEntry),this.plug(c.Plugin.ConsoleFilters,{category:c.merge({info:!0,pass:!1,fail:!0,status:!1},e&&e.filters||{}),defaultVisibility:!1,source:{TestRunner:!0}}),c.Test.Runner.on("complete",c.bind(this._parseCoverage,this))},_isIstanbul:function(e){var t=c.Object.keys(e)[0],n=!1;return e[t].s!==undefined&&e[t].fnMap!==undefined&&(n=!0),n=e.s!==undefined&&e.fnMap!==undefined?!0:n},parseYUITestCoverage:function(e){var t={lines:{hit:0,miss:0,total:0,percent:0},functions:{hit:0,miss:0,total:0,percent:0}};c.Object.each(e,function(e){t.lines.total+=e.coveredLines,t.lines.hit+=e.calledLines,t.lines.miss+=e.coveredLines-e.calledLines,t.lines.percent=Math.floor(t.lines.hit/t.lines.total*100),t.functions.total+=e.coveredFunctions,t.functions.hit+=e.calledFunctions,t.functions.miss+=e.coveredFunctions-e.calledFunctions,t.functions.percent=Math.floor(t.functions.hit/t.functions.total*100)}),e="Lines: Hit:"+t.lines.hit+" Missed:"+t.lines.miss+" Total:"+t.lines.total+" Percent:"+t.lines.percent+"%\n",e+="Functions: Hit:"+t.functions.hit+" Missed:"+t.functions.miss+" Total:"+t.functions.total+" Percent:"+t.functions.percent+"%",this.log("Coverage: "+e,"info","TestRunner")},_blankSummary:function(){return{lines:{total:0,covered:0,pct:"Unknown"},statements:{total:0,covered:0,pct:"Unknown"},functions:{total:0,covered:0,pct:"Unknown"},branches:{total:0,covered:0,pct:"Unknown"}}},_addDerivedInfoForFile:function(e){var o,i=e.statementMap,a=e.s;e.l||(e.l=o={},c.Object.each(a,function(e,t){var n=i[t].start.line,t=a[t],s=o[n];(void 0===s||s<t)&&(o[n]=t)}))},_percent:function(e,t){var n=100;return n=0<t?Math.floor((1e5*e/t+5)/10)/100:n},_computeSimpleTotals:function(e,t){var t=e[t],n={total:0,covered:0};return c.Object.each(t,function(e){n.total+=1,e&&(n.covered+=1)}),n.pct=this._percent(n.covered,n.total),n},_computeBranchTotals:function(e){var e=e.b,n={total:0,covered:0};return c.Object.each(e,function(e){var t=c.Array.filter(e,function(e){return 0<e});n.total+=e.length,n.covered+=t.length}),n.pct=this._percent(n.covered,n.total),n},parseIstanbul:function(e){var s=this,o="Coverage Report:\n";c.Object.each(e,function(e,t){var n=s._blankSummary();s._addDerivedInfoForFile(e),n.lines=s._computeSimpleTotals(e,"l"),n.functions=s._computeSimpleTotals(e,"f"),n.statements=s._computeSimpleTotals(e,"s"),n.branches=s._computeBranchTotals(e),o+=t+":\n",c.Array.each(["lines","functions","statements","branches"],function(e){o+="    "+e+": "+n[e].covered+"/"+n[e].total+" : "+n[e].pct+"%\n"})}),this.log(o,"info","TestRunner")},_parseCoverage:function(){var e=c.Test.Runner.getCoverage();e&&(this._isIstanbul(e)?this.parseIstanbul(e):this.parseYUITestCoverage(e))},_onEntry:function(e){e=e.message;"info"===e.category&&/\s(?:case|suite)\s|yuitests\d+|began/.test(e.message)?e.category="status":"fail"===e.category&&this.printBuffer()}},{NAME:"testConsole",ATTRS:{entryTemplate:{value:'<div class="{entry_class} {cat_class} {src_class}"><div class="{entry_content_class}">{message}</div></div>'},height:{value:"350px"},newestOnTop:{value:!1},style:{value:"block"},width:{value:c.UA.ie&&c.UA.ie<9?"100%":"inherit"}}})},"patched-v3.18.7",{requires:["console-filters","test","array-extras"],skinnable:!0});