text: !function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}function e(){for(var t=(new n).getTime();u.length&&(new n).getTime()-t<100;)u.shift()();s=u.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var s=0;s<r.length;s++){var i=r[s];".."==i?o.pop():"."!=i&&o.push(i)}return t(o.join("/"))}},t.register("browser/debug.js",function(t){t.exports=function(){return function(){}}}),t.register("browser/diff.js",function(t){var e=function(){function t(t){return{newPos:t.newPos,components:t.components.slice(0)}}function e(t){for(var e=[],n=0;n<t.length;n++)t[n]&&e.push(t[n]);return e}function n(t){var e=t;return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,r=e.length,s=o+r,i=[{newPos:-1,components:[]}],a=this.extractCommon(i[0],n,e,0);if(i[0].newPos+1>=o&&a+1>=r)return i[0].components;for(var u=1;s>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=i[l-1],p=i[l+1];a=(p?p.newPos:0)-l,f&&(i[l-1]=void 0);var h=f&&f.newPos+1<o,d=p&&a>=0&&r>a;if(h||d){!h||d&&f.newPos<p.newPos?(c=t(p),this.pushComponent(c.components,e[a],void 0,!0)):(c=t(f),c.newPos++,this.pushComponent(c.components,n[c.newPos],!0,void 0));var a=this.extractCommon(c,n,e,l);if(c.newPos+1>=o&&a+1>=r)return c.components;i[l]=c}else i[l]=void 0}},pushComponent:function(t,e,n,o){var r=t[t.length-1];r&&r.added===n&&r.removed===o?t[t.length-1]={value:this.join(r.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var r=e.length,s=n.length,i=t.newPos,a=i-o;r>i+1&&s>a+1&&this.equals(e[i+1],n[a+1]);)i++,a++,this.pushComponent(t.components,e[i],void 0,void 0);return t.newPos=i,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var r=new o,s=new o(!0),i=new o;s.tokenize=i.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new o(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new o;return u.tokenize=function(t){return t.split(/^/m)},{Diff:o,diffChars:function(t,e){return r.diff(t,e)},diffWords:function(t,e){return s.diff(t,e)},diffWordsWithSpace:function(t,e){return i.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,o,r){function s(t){return t.map(function(t){return" "+t})}function i(t,e,n){var o=l[l.length-2],r=e===l.length-2,s=e===l.length-3&&(n.added!==o.added||n.removed!==o.removed);/\n$/.test(n.value)||!r&&!s||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof o?"":"	"+o)),a.push("+++ "+t+("undefined"==typeof r?"":"	"+r));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g<l.length;g++){var m=l[g],v=m.lines||m.value.replace(/\n$/,"").split("\n");if(m.lines=v,m.added||m.removed){if(!c){var y=l[g-1];c=h,f=d,y&&(p=s(y.lines.slice(-4)),c-=p.length,f-=p.length)}p.push.apply(p,v.map(function(t){return(m.added?"+":"-")+t})),i(p,g,m),m.added?d+=v.length:h+=v.length}else{if(c)if(v.length<=8&&g<l.length-2)p.push.apply(p,s(v));else{var w=Math.min(v.length,4);a.push("@@ -"+c+","+(h-c+w)+" +"+f+","+(d-f+w)+" @@"),a.push.apply(a,p),a.push.apply(a,s(v.slice(0,w))),v.length<=4&&i(a,g,m),c=0,f=0,p=[]}h+=v.length,d+=v.length}}return a.join("\n")+"\n"},applyPatch:function(t,e){for(var n=e.split("\n"),o=[],r=!1,s=!1,i="I"===n[0][0]?4:0;i<n.length;i++)if("@"===n[i][0]){var a=n[i].split(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/);o.unshift({start:a[3],oldlength:a[2],oldlines:[],newlength:a[4],newlines:[]})}else"+"===n[i][0]?o[0].newlines.push(n[i].substr(1)):"-"===n[i][0]?o[0].oldlines.push(n[i].substr(1)):" "===n[i][0]?(o[0].newlines.push(n[i].substr(1)),o[0].oldlines.push(n[i].substr(1))):"\\"===n[i][0]&&("+"===n[i-1][0]?r=!0:"-"===n[i-1][0]&&(s=!0));for(var u=t.split("\n"),i=o.length-1;i>=0;i--){for(var l=o[i],c=0;c<l.oldlength;c++)if(u[l.start-1+c]!==l.oldlines[c])return!1;Array.prototype.splice.apply(u,[l.start-1,+l.oldlength].concat(l.newlines))}if(r)for(;!u[u.length-1];)u.pop();else s&&u.push("");return u.join("\n")},convertChangesToXML:function(t){for(var e=[],o=0;o<t.length;o++){var r=t[o];r.added?e.push("<ins>"):r.removed&&e.push("<del>"),e.push(n(r.value)),r.added?e.push("</ins>"):r.removed&&e.push("</del>")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],o=0;o<t.length;o++)e=t[o],n.push([e.added?1:e.removed?-1:0,e.value]);return n}}}();"undefined"!=typeof t&&(t.exports=e)}),t.register("browser/events.js",function(t,e){function n(t){return"[object Array]"=={}.toString.call(t)}function o(){}e.EventEmitter=o,o.prototype.on=function(t,e){return this.$events||(this.$events={}),this.$events[t]?n(this.$events[t])?this.$events[t].push(e):this.$events[t]=[this.$events[t],e]:this.$events[t]=e,this},o.prototype.addListener=o.prototype.on,o.prototype.once=function(t,e){function n(){o.removeListener(t,n),e.apply(this,arguments)}var o=this;return n.listener=e,this.on(t,n),this},o.prototype.removeListener=function(t,e){if(this.$events&&this.$events[t]){var o=this.$events[t];if(n(o)){for(var r=-1,s=0,i=o.length;i>s;s++)if(o[s]===e||o[s].listener&&o[s].listener===e){r=s;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),s=0,i=r.length;i>s;s++)r[s].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,s=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,s,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,s,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,r-c/2+1,s+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.type="hook"}function r(){}var s=n("./runnable");t.exports=o,r.prototype=s.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),s=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);return i.grep(o.fullTitle()),o},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var s=new r(t,n);return o.addTest(s),s},t.it.only=function(e,n){var o=t.it(e,n),r="^"+s.escapeRegexp(o.fullTitle())+"$";return i.grep(new RegExp(r)),o},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var s=o.create(n[0],i);n.unshift(s),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test"),s=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n),r="^"+s.escapeRegexp(o.fullTitle())+"$";i.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),s=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=e[0];if(o.pending)var n=null;var s=new r(t,n);return o.addTest(s),s},t.test.only=function(e,n){var o=t.test(e,n),r="^"+s.escapeRegexp(o.fullTitle())+"$";i.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow)}var s=n("browser/path"),i=n("./utils");e=t.exports=r,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(o){}if(!e)try{e=n(t)}catch(o){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(o){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,o=this.suite,r=this.files.length;this.files.forEach(function(i){i=s.resolve(i),o.emit("pre-require",global,i,e),o.emit("require",n(i),i,e),o.emit("post-require",global,i,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var s=n.failures+" of "+t.total+" tests failed";r(s,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),s=new this._reporter(r);return r.ignoreLeaks=!1!==o.ignoreLeaks,r.asyncOnly=o.asyncOnly,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,s),e.reporters.Base.useColors=o.useColors,r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*i;case"seconds":case"second":case"s":return n*s;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=i?Math.round(t/i)+"m":t>=s?Math.round(t/s)+"s":t+"ms"}function o(t){return r(t,u,"day")||r(t,a,"hour")||r(t,i,"minute")||r(t,s,"second")||t+" ms"}function r(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var s=1e3,i=60*s,a=60*i,u=24*a,l=365.25*u;t.exports=function(t,r){return r=r||{},"string"==typeof t?e(t):r.long?o(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new m}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new m,e.duration=new m-e.start}),t.on("pending",function(){e.pending++}))}function s(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function i(t,e){var n=u(t,"WordsWithSpace",e),o=n.split("\n");if(o.length>4){var r=String(o.length).length;n=o.map(function(t,e){return s(++e,r)+" | "+t}).join("\n")}return n="\n"+y("diff removed","actual")+" "+y("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm,"      ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?r+c("diff added",t):"-"===t[0]?r+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:r+t}function o(t){return null!=t}var r="      ";msg=d.createPatch("string",t.actual,t.expected);var s=msg.split("\n").splice(4);return"\n      "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+s.map(n).filter(o).join("\n")}function u(t,e,n){var o=n?l(t.actual):t.actual,r=n?l(t.expected):t.expected;return d["diff"+e](o,r).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"<tab>").replace(/\r/g,"<CR>").replace(/\n/g,"<LF>\n")}function c(t,e){return e.split("\n").map(function(e){return y(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=n("browser/tty"),d=n("browser/diff"),g=n("../ms"),m=global.Date,v=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=o,e.useColors=v||void 0!==r.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==r.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var y=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"[0m":n};e.window={width:v?r.stdout.getWindowSize?r.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){v&&r.stdout.write("[?25l")},show:function(){v&&r.stdout.write("[?25h")},deleteLine:function(){v&&r.stdout.write("[2K")},beginningOfLine:function(){v&&r.stdout.write("[0G")},CR:function(){v?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):r.stdout.write("\n")}},e.list=function(t){console.error(),t.forEach(function(t,n){var o=y("error title","  %s) %s:\n")+y("error message","     %s")+y("error stack","\n%s\n"),r=t.err,s=r.message||"",u=r.stack||s,l=u.indexOf(s)+s.length,c=u.slice(0,l),h=r.actual,d=r.expected,g=!0;if(r.uncaught&&(c="Uncaught "+c),r.showDiff&&p(h,d)&&(g=!1,r.actual=h=f(h),r.expected=d=f(d)),"string"==typeof h&&"string"==typeof d){o=y("error title","  %s) %s:\n%s")+y("error stack","\n%s\n");var m=s.match(/^([^:]+): expected/);c=m?"\n      "+y("error message",m[1]):"",c+=e.inlineDiffs?i(r,g):a(r,g)}u=u.slice(l?l+1:l).replace(/^/gm,"  "),console.error(o,n+1,t.fullTitle(),c,u)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=y("bright pass"," ")+y("green"," %d passing")+y("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=y("pending"," ")+y("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=y("fail","  %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join("  ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s<section class="suite">',e()),++n,console.log("%s<h1>%s</h1>",e(),s.escape(t.title)),console.log("%s<dl>",e()))}),t.on("suite end",function(t){t.root||(console.log("%s</dl>",e()),--n,console.log("%s</section>",e()),--n)}),t.on("pass",function(t){console.log("%s  <dt>%s</dt>",e(),s.escape(t.title));var n=s.escape(s.clean(t.fn.toString()));console.log("%s  <dd><pre><code>%s</code></pre></dd>",e(),n)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,.75*i.window.width|0),o=0;t.on("start",function(){r.stdout.write("\n  ")}),t.on("pending",function(){r.stdout.write(a("pending",i.symbols.dot))}),t.on("pass",function(t){++o%n==0&&r.stdout.write("\n  "),r.stdout.write("slow"==t.speed?a("bright yellow",i.symbols.dot):a(t.speed,i.symbols.dot))}),t.on("fail",function(){++o%n==0&&r.stdout.write("\n  "),r.stdout.write(a("fail",i.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function s(){}var i=n("./base"),a=i.color;e=t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",u=a.readFileSync(o,"utf8"),l=e.compile(u,{filename:o}),c=this;i.call(this,t,!1),t.on("end",function(){r.stdout.write(l({cov:c.cov,coverageClass:s}))})}function s(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var i=n("./json-cov"),a=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this,v=this.stats,y=(t.total,s(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],j=w[3].getElementsByTagName("em")[0],E=y.getElementsByTagName("canvas")[0],_=s('<ul id="mocha-report"></ul>'),C=[_];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,o=E.getContext("2d"),o.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&i("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&i("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=s('<li class="suite"><h1><a href="%s">%s</a></h1></li>',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(o);var r=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(j,(r/1e3).toFixed(2)),"passed"==t.state)var i=m.testURL(t),a=s('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="%s" class="replay">‣</a></h2></li>',t.speed,t.title,t.duration,i);else if(t.pending)var a=s('<li class="test pass pending"><h2>%e</h2></li>',t.title);else{var a=s('<li class="test fail"><h2>%e <a href="?grep=%e" class="replay">‣</a></h2></li>',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(s('<pre class="error">%e</pre>',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=s("<pre><code>%e</code></pre>",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(s('<div id="mocha-error">%s</div>',t))}function s(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n<e.length;n++){var o=e[n].getElementsByClassName(t);0==o.length&&(e[n].className+=" hidden")}}function a(){for(var t=document.getElementsByClassName("suite hidden"),e=0;e<t.length;++e)t[e].className=t[e].className.replace("suite hidden","suite")}function u(t,e){t.textContent?t.textContent=e:t.innerText=e}function l(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var c=n("./base"),f=n("../utils"),p=n("../browser/progress"),h=f.escape,d=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o;var g='<ul id="mocha-stats"><li class="progress"><canvas width="40" height="40"></canvas></li><li class="passes"><a href="#">passes:</a> <em>0</em></li><li class="failures"><a href="#">failures:</a> <em>0</em></li><li class="duration">duration: <em>0</em>s</li></ul>';o.prototype.suiteURL=function(t){return"?grep="+encodeURIComponent(t.fullTitle())},o.prototype.testURL=function(t){return"?grep="+encodeURIComponent(t.fullTitle())}}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Nyan=n("./nyan"),e.XUnit=n("./xunit"),e.Markdown=n("./markdown"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream")}),t.register("reporters/json-cov.js",function(t,e,n){function o(t,e){var n=this,e=1==arguments.length?!0:e;u.call(this,t);var o=[],i=[],l=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){l.push(t)}),t.on("fail",function(t){i.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},u=n.cov=s(t);u.stats=n.stats,u.tests=o.map(a),u.failures=i.map(a),u.passes=l.map(a),e&&r.stdout.write(JSON.stringify(u,null,2))})}function s(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var o=i(n,t[n]);e.files.push(o),e.hits+=o.hits,e.misses+=o.misses,e.sloc+=o.sloc}return e.files.sort(function(t,e){return t.filename.localeCompare(e.filename)}),e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function i(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){r.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;i.call(this,t);var n=[],o=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:a.map(s)};r.stdout.write(JSON.stringify(t,null,2))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return"  "+u("runway",t)}i.call(this,t);var n=this,o=(this.stats,.75*i.window.width|0),s=t.total,l=r.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n  "),a.hide()}),t.on("test end",function(t){var n=-1==f?o*++p/s|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("[4F\n\n"),l.write(e()),l.write("\n  "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(o-n).join("⋅")+"\n")),l.write(e()),l.write("[0m")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function s(){}var i=n("./base"),a=i.cursor,u=i.color;e=t.exports=o,i.colors.plane=0,i.colors["plane crash"]=31,i.colors.runway=90,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){r.stdout.write(u("pass","    "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark","  -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark","  "+i.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail","  %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function s(){}var i=n("./base"),a=i.cursor,u=i.color;e=t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var s in t)"suite"!=s&&(s&&(n=" - ["+s+"](#"+i.slug(t[s].suite.fullTitle())+")\n"),s&&(r+=Array(e).join("  ")+n),r+=o(t[s],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}s.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=i.slug(t.fullTitle());l+='<a name="'+n+'"></a>\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=i.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){r.stdout.write("# TOC\n"),r.stdout.write(a(t.suite)),r.stdout.write(l)})}var s=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){i.call(this,t),t.on("start",function(){r.stdout.write("[2J"),r.stdout.write("[1;3H")}),t.on("end",this.epilogue.bind(this))}function s(){}var i=n("./base");e=t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t<e.numberOfLines;t++)s("\n");e.epilogue()})}function s(t){r.stdout.write(t)}function i(){}{var a=n("./base");a.color}e=t.exports=o,o.prototype.draw=function(){this.appendRainbow(),this.drawScoreboard(),this.drawRainbow(),this.drawNyanCat(),this.tick=!this.tick},o.prototype.drawScoreboard=function(){function t(t,e){s(" "),s("["+t+"m"+e+"[0m"),s("\n")}var e=this.stats,n=a.colors;t(n.green,e.passes),t(n.fail,e.failures),t(n.pending,e.pending),s("\n"),this.cursorUp(this.numberOfLines)},o.prototype.appendRainbow=function(){for(var t=this.tick?"_":"-",e=this.rainbowify(t),n=0;n<this.numberOfLines;n++){var o=this.trajectories[n];o.length>=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){s("["+t.scoreboardWidth+"C"),s(e.join("")),s("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",o="";s(n),s("_,------,"),s("\n"),s(n),o=t.tick?"  ":"   ",s("_|"+o+"/\\_/\\ "),s("\n"),s(n),o=t.tick?"_":"__";
  var r=t.tick?"~":"^";s(r+"|"+o+this.face()+" "),s("\n"),s(n),o=t.tick?" ":"  ",s(o+'""  "" '),s("\n"),this.cursorUp(this.numberOfLines)},o.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},o.prototype.cursorUp=function(t){s("["+t+"A")},o.prototype.cursorDown=function(t){s("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),s=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*s+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+"[0m"},i.prototype=a.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){i.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*i.window.width|0),s=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||i.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/s,n=o*t|0,i=o-n;a.CR(),r.stdout.write("[J"),r.stdout.write(u("progress","  "+e.open)),r.stdout.write(Array(n).join(e.complete)),r.stdout.write(Array(i).join(e.incomplete)),r.stdout.write(u("progress",e.close)),e.verbose&&r.stdout.write(u("progress"," "+l+" of "+s))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function s(){}var i=n("./base"),a=i.cursor,u=i.color;e=t.exports=o,i.colors.progress=90,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join("  ")}i.call(this,t);var n=this,o=(this.stats,0),s=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(u("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){r.stdout.write(e()+u("pass","  ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+u("pending","  - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+u("checkmark","  "+i.symbols.ok)+u("pass"," %s ");a.CR(),console.log(n,t.title)}else{var n=e()+u("checkmark","  "+i.symbols.ok)+u("pass"," %s ")+u(t.speed,"(%dms)");a.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){a.CR(),console.log(e()+u("fail","  %d) %s"),++s,t.title)}),t.on("end",n.epilogue.bind(n))}function s(){}var i=n("./base"),a=i.cursor,u=i.color;e=t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){s.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,r(t)),n.stack&&console.log(n.stack.replace(/^/gm,"  "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function r(t){return t.fullTitle().replace(/#/g,"")}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(s),console.log("</testsuite>")})}function r(){}function s(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,a(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var r,s=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+s,o&&(r+=o+"</"+t+s),r}function a(t){return"<![CDATA["+c(t)+"]]>"}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,r.prototype=u.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function r(){}var s=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=o,r.prototype=s.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#<Suite>":"ctx"==t?"#<Context>":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},o.prototype.run=function(t){function e(t){r||(r=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new u-a,o=!0,t(n)}}var o,r,s=this,i=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&i&&(this.timer=l(function(){n(new Error("timeout of "+i+"ms exceeded")),s.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function s(){}function i(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||r.nextTick,s.prototype=a.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e<f.length;++e)~l.indexOf(t,f[e])||t.push(f[e]);return t},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(u("globals %j",t),l.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e,n=this._globals,o=this.globalProps(),s=r.kill;s&&1==n.length-o.length||2!=n.length-o.length&&this.prevGlobalsLength!=o.length&&(this.prevGlobalsLength=o.length,e=i(n,o),this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?i.failures&&r.bail()?e():(i.currentRunnable=o,o.ctx.currentTest=i.test,i.emit("hook",o),o.on("error",function(t){i.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&i.fail(i.test,r),e?i.failHook(o,e):(i.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,s=r["_"+t],i=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=s,n(t)):void o(e.pop())}):(r.suite=s,n())}var r=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(o=s.shift(),!o)return e();var i=r._grep.test(o.fullTitle());return r._invert&&(i=!i),i?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n()}var o,r=this,s=t.tests.slice();this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var r=this.grepTotal(t),s=this,i=0;return u("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){s.runTests(t,n)})):e()},o.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),r.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),r.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function r(){}var s=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=s.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}function r(){}var s=n("./runnable");t.exports=o,r.prototype=s.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function r(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\/\/(.*)/gm,'<span class="comment">//$1</span>').replace(/('.*?')/gm,'<span class="string">$1</span>').replace(/(\d+\.\d+)/gm,'<span class="number">$1</span>').replace(/(\d+)/gm,'<span class="number">$1</span>').replace(/\bnew *(\w+)/gm,'<span class="keyword">new</span> <span class="init">$1</span>').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'<span class="keyword">$1</span>')}var s=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,r=0,s=t.length;s>r;r++)o=e(o,t[r],r,t);return o},e.filter=function(t,e){for(var n=[],o=0,r=t.length;r>o;o++){var s=t[o];e(s,o,t)&&n.push(s)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),s.watchFile(t,n,function(n,o){o.mtime<n.mtime&&e(t)})})},e.files=function(t,n){return n=n||[],s.readdirSync(t).filter(o).forEach(function(o){o=a(t,o),s.statSync(o).isDirectory()?e.files(o,n):o.match(/\.(js|coffee|litcoffee|coffee.md)$/)&&n.push(o)}),n},e.slug=function(t){return t.toLowerCase().replace(/ +/g,"-").replace(/[^-\w]/g,"")},e.clean=function(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var n=t.match(/^\n?(\s*)/)[1],o=new RegExp("^"+n,"gm");return t=t.replace(o,""),e.trim(t)},e.escapeRegexp=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},e.trim=function(t){return t.replace(/^\s+|\s+$/g,"")},e.parseQuery=function(t){return e.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),r=e.slice(++n);return t[o]=decodeURIComponent(r),t},{})},e.highlightTags=function(t){for(var e=document.getElementsByTagName(t),n=0,o=e.length;o>n;++n)e[n].innerHTML=r(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,o=global.setTimeout,r=(global.setInterval,global.clearTimeout,global.clearInterval,{});r.exit=function(){},r.stdout={},r.removeListener=function(t){"uncaughtException"==t&&(global.onerror=function(){})},r.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})};var s,i=global.Mocha=t("mocha"),a=global.mocha=new i({reporter:"html"}),u=[];i.Runner.immediately=function(t){u.push(t),s||(s=o(e,0))},a.ui=function(t){return i.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=i.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),i.prototype.run.call(a,function(){global.document&&i.utils.highlightTags("code"),t&&t()})},i.process=r}();