diff --git a/browser/dist/tests-unit.js b/browser/dist/tests-unit.js index 7b41ed2..3815405 100644 --- a/browser/dist/tests-unit.js +++ b/browser/dist/tests-unit.js @@ -1,4 +1,4 @@ -/*! Unit.js v1.1.1 | (c) 2014 Nicolas Tallefourtane | http://unitjs.com/license.html */ +/*! Unit.js v1.1.2 | (c) 2015 Nicolas Tallefourtane | http://unitjs.com/license.html */ !function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports,__webpack_require__){"use strict";function once(fn){var returnValue,called=!1;return function(){return called||(called=!0,returnValue=fn.apply(this,arguments)),returnValue}}function getTodos(listId,callback){jQuery.ajax({url:"/todo/"+listId+"/items",success:function(data){callback(null,data)}})}var test=unitjs;describe("Unit.js provides several API unified and several assertion styles",function(){it("Unit.js style",function(){test.string("foobar").isEqualTo("foobar").isIdenticalTo("foobar")}),it("Assert library of Node.js",function(){test.assert(!0),test.assert.equal("foobar","foobar"),test.assert.strictEqual("foobar","foobar");var assert=test.assert;assert(!0),assert.equal("foobar","foobar"),assert.strictEqual("foobar","foobar")}),it("Should.js library",function(){test.should("foobar").be.type("string"),test.should(!0).be.ok,test.should("foobar").be.equal("foobar");var should=test.should;"foobar".should.be.type("string"),(!0).should.be.ok,"foobar".should.be.equal("foobar"),should("foobar").be.type("string"),should(!0).be.ok,should("foobar").be.equal("foobar")}),it("Must.js library",function(){test.must("foobar").be.a.string(),test.must(!0).be["true"](),test.must("foobar").be.equal("foobar");var must=test.must;"foobar".must.be.a.string(),(!0).must.be["true"](),"foobar".must.be.equal("foobar"),must("foobar").be.a.string(),must(!0).be["true"](),must("foobar").be.equal("foobar")}),it("Unit.js is expressive and fluent",function(){var num,arr,obj={fluent:"is awesome"},copy_obj=obj;test.object(obj).isIdenticalTo(copy_obj).isNotIdenticalTo({fluent:"is awesome"}).isNotEqualTo({fluent:"is awesome"}).is({fluent:"is awesome"}).hasProperty("fluent","is awesome").given(num=10).number(num).isBetween(5,15).then().error(function(){test.number(num/1).isInfinite()})["if"](num=.4*num).number(num).isApprox(5,1.5).when(function(){arr=[],arr.push(num),arr.push("fluent")}).array(arr).hasLength(2).hasValue("fluent")["if"](arr.push("test flow")).and(arr.push("is expressive")).array(arr).hasLength(4).hasValues(["fluent","test flow","is expressive"])})}),describe("Control flow",function(){describe("Performs the tests without entangled with the flow of other series of tests",function(){it("Series launched with chaining",function(){test.exception(function(){throw test.string("serie1-1").isEqualTo("serie1-1").string("serie1-2").isEqualTo("serie1-2").string("serie1-3").isEqualTo("serie1-3"),new Error("Whoops1-1 !")}).hasMessage("Whoops1-1 !").hasMessage(/Whoop/).string("serie2-1").isEqualTo("serie2-1").exception(function(){throw test.string("serie2-1").isEqualTo("serie2-1").string("serie2-2").isEqualTo("serie2-2").string("serie2-3").isEqualTo("serie2-3"),new Error("Whoops2-1 !")}).hasMessage("Whoops2-1 !").hasMessage(/Whoop/).string("serie3-1").isEqualTo("serie3-1").exception(function(){throw new Error("Whoops3-1 !")}).hasMessage("Whoops3-1 !").string("serie4-1").isEqualTo("serie4-1").exception(function(){throw new Error("Whoops4-1 !")}).hasMessage("Whoops4-1 !").string("serie5-1").isEqualTo("serie5-1").string("serie5-2").isEqualTo("serie5-2").string("serie5-3").isEqualTo("serie5-3").then().string("serie5-4").isEqualTo("serie5-4")}),it("Series launched without chaining",function(){test.exception(function(){throw test.string("serie1-1").isEqualTo("serie1-1"),test.string("serie1-2").isEqualTo("serie1-2"),test.string("serie1-3").isEqualTo("serie1-3"),new Error("Whoops1-1 !")}).hasMessage("Whoops1-1 !").hasMessage(/Whoop/),test.string("serie2-1").isEqualTo("serie2-1"),test.exception(function(){throw test.string("serie2-1").isEqualTo("serie2-1"),test.string("serie2-2").isEqualTo("serie2-2"),test.string("serie2-3").isEqualTo("serie2-3"),new Error("Whoops2-1 !")}).hasMessage("Whoops2-1 !").hasMessage(/Whoop/),test.string("serie3-1").isEqualTo("serie3-1"),test.exception(function(){throw new Error("Whoops3-1 !")}).hasMessage("Whoops3-1 !"),test.string("serie4-1").isEqualTo("serie4-1"),test.exception(function(){throw new Error("Whoops4-1 !")}).hasMessage("Whoops4-1 !"),test.string("serie5-1").isEqualTo("serie5-1"),test.string("serie5-2").isEqualTo("serie5-2"),test.string("serie5-3").isEqualTo("serie5-3"),test.string("serie5-4").isEqualTo("serie5-4")}),it("Chaining with dependency injection",function(){test.$provider("getStrProvider",function(self){return test.object(self).isIdenticalTo(test.$di._container),self.fromSelf="ok from self",function(val){return test.string(val),val}})["case"]("Test the chain of provider",function(){var fn=test.$di.get("getStrProvider");test["function"](fn).string(fn("ok1")).isIdenticalTo("ok1").string(test.$di.get("fromSelf")).isIdenticalTo("ok from self")}).$invoke("getStrProvider",function(getStr){return test.string(getStr("ok2")).isIdenticalTo("ok2"),test})["case"]("Test the chain of a factorized function").$factory("chainStrTest","getStrProvider",function(getStr){return test["function"](getStr).string(getStr("from factory"))}).$di.get("chainStrTest").isIdenticalTo("from factory")}),it("Series with helpers",function(){var str,indicator,log=console.log;console.log=test.spy(),test.given(str="serie1-1").string(str).isEqualTo("serie1-1").when('change "str" value',function(){str="serie1-2"}).then(function(){indicator=!0,test.string(str).isEqualTo("serie1-2")})["case"]('Checks that "then" execute the function argument').bool(indicator).isTrue().string("1").dump("test.dump()").is("1").bool(console.log.called).isTrue().then(function(){console.log=log}).then("Check break of flow").exception(function(){test.string("1")["case"]().is("1")}).exception(function(){test.string("1")["if"]().is("1")}).exception(function(){test.string("1").and().is("1")}).exception(function(){test.string("1")["case"].is("1")}).exception(function(){test.string("1")["if"].is("1")}).exception(function(){test.string("1").and.is("1")}).exception(function(){test.string("1").given().is("1")}).exception(function(){test.string("1").when().is("1")}).exception(function(){test.string("1").then().is("1")}).then("The context of flow",function(){var flow=test.string("1").bool(!0).isTrue();test.object(flow).hasProperty("isTrue").hasProperty("isFalse").hasNotProperty("hasValue").object(test.string("1")).hasProperty("hasValue")})})})}),describe("Passes IOC container",function(){beforeEach(function(){test.$di.set("spy",test.spy()).provider("assertSpy","spy",function(spy){return function(num){return test.assert(spy.callCount===num),test}}).set("callSpy",function(){return test.$di.get("spy"),test})}),afterEach(function(){test.$di.remove("spy").remove("assertSpy").remove("callSpy")}),it("case()",function(){test["case"](function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({})["case"](function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("given()",function(){test.given(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).given(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("when()",function(){test.when(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).when(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("then()",function(){test.then(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).then(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("if()",function(){test["if"](function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({})["if"](function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("and()",function(){test.and(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).and(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("wait()",function(done){var calledAt,spy=test.spy(function(){calledAt=new Date,calledAt=calledAt.getTime()}),defAt=new Date;test.wait(20,spy),setTimeout(function(){test.assert(spy.calledOnce),defAt=defAt.getTime(),test.number(calledAt).isGreaterThan(defAt+18),done()},25)}),it("dump()",function(){var log=console.log;console.log=test.spy(),test.string("1").dump("test.dump()").is("1").bool(console.log.called).isTrue(),console.log=log}),it("stats",function(){var countAssert,countAssertOk,total;test.object(test.stats).object(test.stats.assertions).object(test.stats.total).number(test.stats.total.assertions).isGreaterThan(2).number(test.stats.assertions.isObject).isGreaterThan(1).number(test.stats.assertions.isNumber).isGreaterThan(1)["case"]("assert",function(){total=test.stats.total.assertions,countAssert=test.stats.assertions.assert||0,countAssertOk=test.stats.assertions["assert.ok"]||0,test.assert(!0),test.assert.ok(!0),test.number(test.stats.total.assertions).is(total+2).number(test.stats.assertions.assert).is(countAssert+1).number(test.stats.assertions["assert.ok"]).is(countAssertOk+1)})})});var jQuery={ajax:function(){}};describe("Unit.js provides sinon.js",function(){describe("Spies",function(){it("calls the original function",function(){var callback=test.spy(),proxy=once(callback);proxy(),test.assert(callback.called)}),it("calls the original function only once",function(){var callback=test.spy(),proxy=once(callback);proxy(),proxy(),test.assert(callback.calledOnce),test.assert.strictEqual(callback.callCount,1)}),it("calls original function with right this and args",function(){var callback=test.spy(),proxy=once(callback),obj={};proxy.call(obj,1,2,3),test.assert(callback.calledOn(obj)),test.assert(callback.calledWith(1,2,3))})}),describe("Stubs",function(){it("returns the return value from the original function",function(){var callback=test.stub().returns(42),proxy=once(callback);test.assert.strictEqual(proxy(),42)})}),describe("Testing Ajax",function(){after(function(){jQuery.ajax.restore()}),it("makes a GET request for todo items",function(){test.stub(jQuery,"ajax"),getTodos(42,test.spy()),test.assert(jQuery.ajax.calledWithMatch({url:"/todo/42/items"}))})}),describe("Mocks",function(){it("returns the return value from the original function",function(){var myAPI={method:function(){}},mock=test.mock(myAPI);mock.expects("method").once().returns(42);var proxy=once(myAPI.method);test.assert.equal(proxy(),42),mock.verify()}),it("test should call a method with exceptions",function(){var myAPI={method:function(){}},mock=test.mock(myAPI);mock.expects("method").once()["throws"](),test.exception(function(){myAPI.method()}).isInstanceOf(Error),mock.verify()})}),describe("Matchers",function(){it("test should assert fuzzy",function(){var book={pages:42,author:"cjno"},spy=test.spy();spy(book),test.sinon.assert.calledWith(spy,test.sinon.match({author:"cjno"})),test.sinon.assert.calledWith(spy,test.sinon.match.has("pages",42))}),it("test should stub method differently based on argument types",function(){var callback=test.stub();callback.withArgs(test.sinon.match.string).returns(!0),callback.withArgs(test.sinon.match.number)["throws"]("TypeError"),test.bool(callback("abc")).isTrue(),test.exception(function(){callback(123)}).isValid(function(err){return"TypeError"===err.name?!0:void 0})}),it("Combining matchers",function(){var stringOrNumber=test.sinon.match.string.or(test.sinon.match.number),bookWithPages=test.sinon.match.object.and(test.sinon.match.has("pages")),book={pages:42,author:"cjno"},spy=test.spy(),otherSpy=test.spy();spy(book),otherSpy(10),test.sinon.assert.calledWith(spy,bookWithPages),test.sinon.assert.calledWith(otherSpy,stringOrNumber)}),it("Custom matchers",function(){var equal10=test.sinon.match(function(value){return 10===value},"value is not equal to 10"),spy=test.spy(),otherSpy=test.spy();spy(10),otherSpy(42),test.sinon.assert.calledWith(spy,equal10),test.exception(function(){test.sinon.assert.calledWith(otherSpy,equal10)}).hasMessage(/value is not equal to 10/)})}),describe("Sandbox",function(){it("test using test.sinon.test sandbox",test.sinon.test(function(){var myAPI={method:function(){}},mockMyApi=this.mock(myAPI).expects("method").once().returns(42),proxy=once(myAPI.method);test.number(proxy()).isIdenticalTo(42),mockMyApi.verify()}))})}),describe("Asserter array()",function(){describe("array() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.array([]).hasHeader).isUndefined().value(test.array([]).isError).isUndefined().value(test.array([]).hasMessage).isUndefined().value(test.array([]).isInfinite).isUndefined()}),it("Assert that the tested value is an `array`",function(){var Foo=function(){};test.array([]).array(["a","b","c"]).array(new Array)["case"]("Test failure",function(){test.exception(function(){test.array({})}).exception(function(){test.array("Foo")}).exception(function(){test.array(Foo)}).exception(function(){test.array(1)}).exception(function(){test.array(void 0)}).exception(function(){test.array(!0)}).exception(function(){test.array(!1)}).exception(function(){test.array(null)}).exception(function(){test.array(function(){})})})})}),describe("Assertions of array()",function(){it("is(expected)",function(){test.array(["foo",[0,1]]).is(["foo",[0,1]])["case"]("Test failure",function(){test.exception(function(){test.array(["foo",[0,1]]).is(["foo",[0,"1"]])}).exception(function(){test.array(["foo",[0,1]]).is(["foo",[0,1,2]])}).exception(function(){test.array(["foo",[0,1]]).is(["foo",[0]])}).exception(function(){test.array(["foo",[0,1]]).is(["foobar",[0,1]])})})}),it("isNot(expected)",function(){test.array(["foo",[0,1]]).isNot(["foo",[0,"1"]]).exception(function(){test.array(["foo",[0,1]]).isNot(["foo",[0,1]])})}),it("isIdenticalTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isIdenticalTo(arr2).exception(function(){test.array(arr).isIdenticalTo([1])})}),it("isNotIdenticalTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isNotIdenticalTo([1]).exception(function(){test.array(arr).isNotIdenticalTo(arr2)})}),it("isEqualTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isEqualTo(arr2).exception(function(){test.array(arr).isEqualTo([1])})}),it("isNotEqualTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isNotEqualTo([1]).exception(function(){test.array(arr).isNotEqualTo(arr2)})}),it("match(expected)",function(){test.array(["a","b","c"]).match(/[a-z]/).array([42,10]).match(function(actual){return 10===actual[1]}).exception(function(){test.array([42,"10"]).match(function(actual){return 10===actual[1]})})}),it("notMatch(expected)",function(){test.array(["a","b","c"]).notMatch(/[d-z]/).array([42,10]).notMatch(function(actual){return"10"===actual[1]}).exception(function(){test.array([42,"10"]).notMatch(function(actual){return 42===actual[0]})})}),it("isValid(expected)",function(){test.array(["a","b","c"]).isValid(/[a-z]/).array([42,10]).isValid(function(actual){return 10===actual[1]}).exception(function(){test.array([42,"10"]).isValid(function(actual){return 10===actual[1]})})}),it("isNotValid(expected)",function(){test.array(["a","b","c"]).isNotValid(/[d-z]/).array([42,10]).isNotValid(function(actual){return"10"===actual[1]}).exception(function(){test.array([42,"10"]).isNotValid(function(actual){return 42===actual[0]})})}),it("matchEach(expected)",function(){test.array([10,11,12]).matchEach(function(it){return it>=10}).exception(function(){test.array([10,11,12]).matchEach(function(it){return it>=11})})}),it("notMatchEach(expected)",function(){test.array([10,11,12]).notMatchEach(function(it){return it>=13}).exception(function(){test.array([10,11,12]).notMatchEach(function(it){return it>=11})})}),it("isEmpty()",function(){test.array([]).isEmpty().exception(function(){test.array([0]).isEmpty()}).exception(function(){test.array([""]).isEmpty()})}),it("isNotEmpty()",function(){test.array(["a"]).isNotEmpty().exception(function(){test.array([]).isNotEmpty()})}),it("hasLength(expected)",function(){test.array([1,2]).hasLength(2).exception(function(){test.array([1,2]).hasLength(1)})}),it("hasNotLength(expected)",function(){test.array([1,2]).hasNotLength(1).exception(function(){test.array([1,2]).hasNotLength(2)})}),it("isEnumerable(property)",function(){var arr=["is enumerable"];test.array(arr).isEnumerable(0).array(arr).isNotEnumerable("length").exception(function(){test.array(arr).isEnumerable("length")})}),it("isNotEnumerable(property)",function(){var arr=["is enumerable"];test.array(arr).isNotEnumerable("length").array(arr).isEnumerable(0).exception(function(){test.array(arr).isNotEnumerable(0)})}),it("hasProperty(property [, value])",function(){test.array(["a","b"]).hasProperty(1).hasProperty(0,"a").exception(function(){test.array(["a","b"]).hasProperty(3)}).exception(function(){test.array(["a","b"]).hasProperty(0,"b")})}),it("hasNotProperty(property [, value])",function(){test.array(["a","b"]).hasNotProperty(2).hasNotProperty(0,"b").exception(function(){test.array(["a","b"]).hasNotProperty(0)}).exception(function(){test.array(["a","b"]).hasNotProperty(1,"b")})}),it("hasKey(key [, value])",function(){test.array(["a","b"]).hasKey(1).hasKey(0,"a").exception(function(){test.array(["a","b"]).hasKey(3)}).exception(function(){test.array(["a","b"]).hasKey(0,"b")})}),it("notHasKey(key [, value])",function(){test.array(["a","b"]).notHasKey(2).notHasKey(0,"b").exception(function(){test.array(["a","b"]).notHasKey(0)}).exception(function(){test.array(["a","b"]).notHasKey(1,"b")})}),it("hasValue(expected)",function(){test.array([1,42,3]).hasValue(42).exception(function(){test.array([1,42,3]).hasValue(0)})}),it("notHasValue(expected)",function(){test.array([1,42,3]).notHasValue(4).exception(function(){test.array([1,42,3]).notHasValue(42)})}),it("hasValues(expected)",function(){test.array([1,42,3]).hasValues([42,3]).exception(function(){test.array([1,42,3]).hasValues([42,3,10])})}),it("notHasValues(expected)",function(){test.array([1,42,3]).notHasValues([4,2]).exception(function(){test.array([1,42,3]).notHasValues([4,1])})}),it("contains(expected [, ...])",function(){test.array([1,2,3]).contains([3]).array([1,2,3]).contains([1,3]).array([1,2,3]).contains([3],[1,3]).array([1,2,3,{a:{b:{d:12}}}]).contains([2],[1,2],[{a:{b:{d:12}}}]).array([[1],[2],[3]]).contains([[3]]).array([[1],[2],[3,4]]).contains([[3]]).array([{a:"a"},{b:"b",c:"c"}]).contains([{a:"a"}],[{b:"b"}]).exception(function(){test.array([1,2,3]).contains([0])})}),it("notContains(expected [, ...])",function(){test.array([[1],[2],[3,4]]).notContains([[0]]).array([{a:"a"},{b:"b",c:"c"}]).notContains([{a:"b"}],[{c:"b"}]).exception(function(){test.array([{a:"a"},{b:"b",c:"c"}]).notContains([{a:"a"}],[{b:"b"}])})}),it("isReverseOf(expected)",function(){test.array([1,2,3]).isReverseOf([3,2,1]).exception(function(){test.array([1,2,3]).isReverseOf([1,2,3])}).exception(function(){test.array([1,2,3]).isReverseOf([3,2,2,1])})}),it("isNotReverseOf(expected)",function(){test.array([1,2,2,3]).isNotReverseOf([3,2,1]).exception(function(){test.array([3,2,1]).isNotReverseOf([3,2,1])})})})}),describe("Asserter bool()",function(){describe("bool() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.bool(!0).hasHeader).isUndefined().value(test.bool(!0).hasProperty).isUndefined().value(test.bool(!0).hasMessage).isUndefined()}),it("Assert that the tested value is a `boolean`",function(){test.bool(!0).bool(!1)["case"]("Test failure",function(){test.exception(function(){test.bool()}).exception(function(){test.bool(0)}).exception(function(){test.bool(1)}).exception(function(){test.bool(void 0)}).exception(function(){test.bool(null)}).exception(function(){test.bool("")}).exception(function(){test.bool("true")}).exception(function(){test.bool("false")}).exception(function(){test.bool("1")}).exception(function(){test.bool("0")}).exception(function(){test.bool([])}).exception(function(){test.bool({})}).exception(function(){test.bool(new Boolean("false")).isFalse()}).exception(function(){test.bool(Boolean("false")).isFalse()})})})}),describe("Assertions of bool()",function(){it("isTrue()",function(){test.bool(!0).isTrue().exception(function(){test.bool(!1).isTrue()})}),it("isNotTrue()",function(){test.bool(!1).isNotTrue().exception(function(){test.bool(!0).isNotTrue()})}),it("isFalse()",function(){test.bool(!1).isFalse().exception(function(){test.bool(!0).isFalse()})}),it("isNotFalse()",function(){test.bool(!0).isNotFalse().exception(function(){test.bool(!1).isNotFalse()})})})}),describe("Asserter date()",function(){describe("date() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.date(new Date).hasHeader).isUndefined().value(test.date(new Date).hasProperty).isUndefined().value(test.date(new Date).hasMessage).isUndefined().value(test.date(new Date).isInfinite).isUndefined()}),it("Assert that the tested value is an instance of `Date`",function(){test.date(new Date).date(new Date("2010, 5, 20"))["case"]("Test failure",function(){test.exception(function(){test.date("2010 5 20")}).exception(function(){test.date(2010)}).exception(function(){test.date(Date)})})})}),describe("Assertions of date()",function(){it("is(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).is(new Date("2010, 5, 20"))["case"]("Test failure",function(){test.exception(function(){test.date(date).is(/2010/)}).exception(function(){test.date(date).is(new Date("2011, 5, 20"))})})}),it("isNot(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNot(new Date("2012, 02, 28"))["case"]("Test failure",function(){test.exception(function(){test.date(date).isNot(new Date("2010, 5, 20"))}).exception(function(){test.date(date).isNot(date)})})}),it("isIdenticalTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isIdenticalTo(date).exception(function(){test.date(date).isIdenticalTo(new Date("2010, 5, 20"))})}),it("isNotIdenticalTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotIdenticalTo(new Date("2010, 5, 20")).exception(function(){test.date(date).isNotIdenticalTo(date)})}),it("isEqualTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isEqualTo(date).exception(function(){test.date(date).isEqualTo(new Date("2010, 5, 20"))})}),it("isNotEqualTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotEqualTo(new Date("2010, 5, 20")).exception(function(){test.date(date).isNotEqualTo(date)})}),it("match(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).match(/2010/).exception(function(){test.date(date).match(/03/)})}),it("notMatch(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).notMatch(/03/).exception(function(){test.date(date).notMatch(/02/)})}),it("isValid(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isValid(/2010/).exception(function(){test.date(date).isValid(/03/)})}),it("isNotValid(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotValid(/03/).exception(function(){test.date(date).isNotValid(/02/)})}),it("isBetween(begin, end)",function(){var date=new Date("2010, 5, 20");test.date(date).isBetween(new Date("1982, 02, 17"),new Date("2012, 02, 28")).exception(function(){test.date(date).isBetween(new Date("2012, 02, 28"),new Date("1982, 02, 17"))})}),it("isNotBetween(begin, end)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotBetween(new Date("2011, 02, 17"),new Date("2012, 02, 28")).exception(function(){test.date(date).isNotBetween(new Date("1982, 02, 17"),new Date("2012, 02, 28"))})}),it("isBefore(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isBefore(new Date("2012, 02, 28")).exception(function(){test.date(date).isBefore(new Date("1982, 02, 17"))})}),it("isAfter(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isAfter(new Date("1982, 02, 17")).exception(function(){test.date(date).isAfter(new Date("2012, 02, 28"))})})})}),describe("Asserter error()",function(){describe("error() behavior",function(){it("Does not contains inappropriate assertions from the assertions containers",function(){var indicator=0,trigger=function(){throw new Error("Whoops!")},deletedAssertions=["isType","isNotType","isObject","isArray","isString","isNumber","isBool","isBoolean","isNull","isUndefined","isRegExp","isNotRegExp","isDate","isNotDate","isArguments","isNotArguments","isEmpty","isNotEmpty","hasLength","hasNotLength","hasProperties","hasNotProperties","hasOwnProperties","hasKeys","notHasKeys","hasValue","notHasValue","hasValues","notHasValues","contains","notContains","startsWith","notStartsWith","endsWith","notEndsWith"];test.value(test.error(trigger).hasHeader).isUndefined().value(test.error(trigger).isInfinite).isUndefined(),deletedAssertions.map(function(method){test.value(test.error(trigger)[method]).isUndefined(),indicator++});var error=test.error(trigger);test.exception(function(){test.value(error.hasMessage).isUndefined()}),test.number(indicator).isIdenticalTo(deletedAssertions.length)}),it("Fails if the tested exception is not an instance of Error",function(){var allCatch={number:!0,string:!0,object:!0,array:!0},status={number:!1,string:!1,object:!1,array:!1},check=function(name,trigger){try{test.error(trigger)}catch(e){status[name]=!0}},error=function(){throw new Error("foo")},number=function(){throw 1},string=function(){throw"Error"},object=function(){throw{name:Error,message:"Whoops!"}},array=function(){throw[Error]};test.error(error).when(function(){check("number",number),check("string",string),check("object",object),check("array",array)}).object(status).is(allCatch);var allCatch={number:!0,string:!0,object:!0,array:!0},status={number:!1,string:!1,object:!1,array:!1},check=function(name,trigger){try{test.exception(trigger)}catch(e){status[name]=!0}};test.exception(error).isError().when(function(){check("number",number),check("string",string),check("object",object),check("array",array)}).object(status).isNot(allCatch).is({number:!1,string:!1,object:!1,array:!1})}),it("dependency injection",function(){var spy=test.spy();test.$di.set("spyException",spy),test.error(function(){throw this.spyException("arg1","arg2"),new Error("Whoops!")}).bool(spy.calledOnce&&spy.calledWithExactly("arg1","arg2")).isTrue()})}),describe("Assertions of error()",function(){it("is(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).is(error).is(new Error("Whoops !"))["case"]("Test failure",function(){test.value(function(){test.error(trigger).is({message:"Whoops !"})})["throws"]().value(function(){test.error(trigger).is(new TypeError("Whoops !"))})["throws"]()})}),it("isNot(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isNot({message:"Whoops !"}).value(function(){test.error(trigger).isNot(error)})["throws"]()}),it("isIdenticalTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isIdenticalTo(error).value(function(){test.error(trigger).isIdenticalTo(new Error("Whoops !"))})["throws"]()}),it("isNotIdenticalTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isNotIdenticalTo(new Error("Whoops !")).value(function(){test.error(trigger).isNotIdenticalTo(error)})["throws"]()}),it("isEqualTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isEqualTo(error).value(function(){test.error(trigger).isEqualTo(new Error("Whoops !"))})["throws"]()}),it("isNotEqualTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isNotEqualTo(new Error("Whoops !")).value(function(){test.error(trigger).isNotEqualTo(error)})["throws"]()}),it("match(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.error(trigger).match("Whoops!").match(/Whoops/).match(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.error(trigger).match("Hey")})["throws"]().value(function(){test.error(trigger).match(/Hey/)})["throws"]().value(function(){test.error(trigger).match(function(error){return error instanceof RegExp})})["throws"]()})}),it("notMatch(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.error(trigger).notMatch("Yeah an error").notMatch(/Yeah/).notMatch(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.error(trigger).notMatch("Whoops!")})["throws"]().value(function(){test.error(trigger).notMatch(/Whoops/)})["throws"]()})}),it("isValid(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.error(trigger).isValid("Whoops!").isValid(/Whoops/).isValid(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.error(trigger).isValid("Hey")})["throws"]().value(function(){test.error(trigger).isValid(/Hey/)})["throws"]().value(function(){test.error(trigger).isValid(function(error){return error instanceof RegExp})})["throws"]()})}),it("isNotValid(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.error(trigger).isNotValid("Yeah an error").isNotValid(/Yeah/).isNotValid(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.error(trigger).isNotValid("Whoops!")})["throws"]().value(function(){test.error(trigger).isNotValid(/Whoops/)})["throws"]()})}),it("isEnumerable(property)",function(){var error=new Error("Whoops !");error.foo="bar",test.error(function(){throw error}).isEnumerable("foo").value(function(){test.error(function(){throw error}).isEnumerable("message")})["throws"]()}),it("isNotEnumerable(property)",function(){var error=new Error("Whoops !");error.foo="bar",test.error(function(){throw error}).isNotEnumerable("message").value(function(){test.error(function(){throw error}).isNotEnumerable("foo")})["throws"]()}),it("isFrozen()",function(){var error=new Error("Whoops !"),frozenError=new Error("Whoops !"); Object.freeze(frozenError),test.error(function(){throw frozenError}).isFrozen().value(function(){test.error(function(){throw error}).isFrozen()})["throws"]()}),it("isNotFrozen()",function(){var error=new Error("Whoops !"),frozenError=new Error("Whoops !");Object.freeze(frozenError),test.error(function(){throw error}).isNotFrozen().value(function(){test.error(function(){throw frozenError}).isNotFrozen()})["throws"]()}),it("isInstanceOf(expected)",function(){test.error(function(){throw new TypeError("Whoops !")}).isInstanceOf(TypeError).value(function(){test.error(function(){throw new Error("Bad type")}).isInstanceOf(TypeError)})["throws"]()}),it("isNotInstanceOf(expected)",function(){test.error(function(){throw new Error("Whoops !")}).isNotInstanceOf(TypeError).value(function(){test.error(function(){throw new TypeError("Bad type")}).isNotInstanceOf(TypeError)})["throws"]()}),it("hasProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasProperty("message").hasProperty("message","Whoops !").hasProperty("constructor")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasProperty("foo")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasProperty("message","whoops")})["throws"]()})}),it("hasNotProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("foo").hasNotProperty("message","whoops")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("message")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("message","Whoops !")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("constructor")})["throws"]()})}),it("hasOwnProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("message").hasOwnProperty("message","Whoops !")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("foo")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("message","Grrrr !")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("constructor")})["throws"]()})}),it("hasNotOwnProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasNotOwnProperty("foo").hasNotOwnProperty("message","Grrrr !").hasNotOwnProperty("constructor")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message","Whoops !")})["throws"]()})}),it("hasKey(key [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasKey("message").hasKey("message","Whoops !").hasKey("constructor")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasKey("foo")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasKey("message","whoops")})["throws"]()})}),it("notHasKey(key [, value])",function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("foo").notHasKey("message","whoops")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("message")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("message","Whoops !")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("constructor")})["throws"]()})}),it("hasMessage(expected)",function(){var exception,indicator=test.createCollection(),trigger=function(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")},resetIndicator=function(){indicator.setAll({})};test.error(trigger).hasMessage("I'm a ninja !").bool(indicator.get("error constructor called")).isTrue().then(resetIndicator()).error(trigger).hasMessage(/ninja/).bool(indicator.get("error constructor called")).isTrue().then(resetIndicator())["case"](exception=test.error(trigger)).error(function(){indicator.set("ninjaa is not in error message",!0),exception.hasMessage(/ninjaa/)}).bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue().then(resetIndicator()).value(function(){indicator.set("ninjaa is not in error message",!0),test.error(trigger).hasMessage(/ninjaa/)})["throws"]().bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue()})})}),describe("Asserter exception()",function(){describe("exception() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.exception(function(){throw new Error("hu")}).hasHeader).isUndefined().value(test.exception(function(){throw new Error("hu")}).isBetween).isUndefined()}),it("Takes a function that will throws an exception",function(){var indicator,trigger=function(){throw indicator=!0,new Error("I'm a ninja !")};test.exception(trigger).bool(indicator).isTrue().given(indicator=!1).exception(function(){throw indicator=!0,new Error("Whoops!")}).bool(indicator).isTrue()}),it("Error if the trigger don't throws an exception",function(){var indicator;test.given(indicator=!1).value(function(){test.exception(function(){indicator=!0})})["throws"]().bool(indicator).isTrue()}),it("Assert that thrown with the Error class and a given message",function(){var exception,indicator=test.createCollection(),fn=function(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")},resetIndicator=function(){indicator.setAll({})};test.exception(fn).isError().hasMessage("I'm a ninja !").bool(indicator.get("error constructor called")).isTrue().when(exception=test.exception(fn)).exception(function(){exception.isError().hasMessage("I'm a not ninja !")}).given(resetIndicator()).exception(fn).isError().hasMessage(/ninja/).bool(indicator.get("error constructor called")).isTrue().when(exception=test.exception(fn)).exception(function(){exception.isError().hasMessage(/ninjaa/)}).given(resetIndicator()).exception(function(){throw indicator.set("Whoops error, is called",!0),new Error("Whoops!")}).hasMessage("Whoops!").isInstanceOf(Error).bool(indicator.get("Whoops error, is called")).isTrue()}),it("dependency injection",function(){var spy=test.spy();test.$di.set("spyException",spy),test.exception(function(){throw this.spyException("arg1","arg2"),new Error("Whoops!")}).bool(spy.calledOnce&&spy.calledWithExactly("arg1","arg2")).isTrue()})}),describe("Assertions of exception()",function(){it("is(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).is(error).is(new Error("Whoops !"))["case"]("Test failure",function(){test.value(function(){test.exception(trigger).is({message:"Whoops !"})})["throws"]().value(function(){test.exception(trigger).is(new String("Whoops !"))})["throws"]()})}),it("isNot(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isNot({message:"Whoops !"}).value(function(){test.exception(trigger).isNot(error)})["throws"]()}),it("isIdenticalTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isIdenticalTo(error).value(function(){test.exception(trigger).isIdenticalTo(new Error("Whoops !"))})["throws"]()}),it("isNotIdenticalTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isNotIdenticalTo(new Error("Whoops !")).value(function(){test.exception(trigger).isNotIdenticalTo(error)})["throws"]()}),it("isEqualTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isEqualTo(error).value(function(){test.exception(trigger).isEqualTo(new Error("Whoops !"))})["throws"]()}),it("isNotEqualTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isNotEqualTo(new Error("Whoops !")).value(function(){test.exception(trigger).isNotEqualTo(error)})["throws"]()}),it("match(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.exception(trigger).match("Whoops!").match(/Whoops/).match(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.exception(trigger).match("Hey")})["throws"]().value(function(){test.exception(trigger).match(/Hey/)})["throws"]().value(function(){test.exception(trigger).match(function(error){return error instanceof RegExp})})["throws"]()})}),it("notMatch(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.exception(trigger).notMatch("Yeah an error").notMatch(/Yeah/).notMatch(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.exception(trigger).notMatch("Whoops!")})["throws"]().value(function(){test.exception(trigger).notMatch(/Whoops/)})["throws"]()})}),it("isValid(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.exception(trigger).isValid("Whoops!").isValid(/Whoops/).isValid(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.exception(trigger).isValid("Hey")})["throws"]().value(function(){test.exception(trigger).isValid(/Hey/)})["throws"]().value(function(){test.exception(trigger).isValid(function(error){return error instanceof RegExp})})["throws"]()})}),it("isNotValid(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.exception(trigger).isNotValid("Yeah an error").isNotValid(/Yeah/).isNotValid(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.exception(trigger).isNotValid("Whoops!")})["throws"]().value(function(){test.exception(trigger).isNotValid(/Whoops/)})["throws"]()})}),it("isType(expected)",function(){var trigger=function(){throw new Error("Whoops !")};test.exception(trigger).isType("object").exception(function(){throw"Whoops !"}).isType("string").value(function(){test.exception(trigger).isType("function")})["throws"]()}),it("isNotType(expected)",function(){var trigger=function(){throw new Error("Whoops !")};test.exception(trigger).isNotType("string").exception(function(){throw"Whoops !"}).isNotType("object").value(function(){test.exception(trigger).isNotType("object")})["throws"]()}),it("isObject()",function(){test.exception(function(){throw new Error("Whoops !")}).isObject().value(function(){test.exception(function(){throw"error"}).isObject()})["throws"]()}),it("isArray()",function(){test.exception(function(){throw["error"]}).isArray().value(function(){test.exception(function(){throw new Error("Whoops !")}).isArray()})["throws"]()}),it("isString()",function(){test.exception(function(){throw"error"}).isString().value(function(){test.exception(function(){throw new Error("Whoops !")}).isString()})["throws"]()}),it("isNumber()",function(){test.exception(function(){throw 0}).isNumber().value(function(){test.exception(function(){throw"0"}).isNumber()})["throws"]()}),it("isBool()",function(){test.exception(function(){throw!1}).isBool().value(function(){test.exception(function(){throw 0}).isBool()})["throws"]()}),it("isBoolean()",function(){test.exception(function(){throw!0}).isBoolean().value(function(){test.exception(function(){throw 1}).isBoolean()})["throws"]()}),it("isNull()",function(){test.exception(function(){throw null}).isNull().value(function(){test.exception(function(){throw 0}).isNull()})["throws"]()}),it("isUndefined()",function(){test.exception(function(){throw void 0}).isUndefined().value(function(){test.exception(function(){throw 0}).isUndefined()})["throws"]()}),it("isRegExp()",function(){test.exception(function(){throw new RegExp("whoops")}).isRegExp().value(function(){test.exception(function(){throw new Error("Whoops !")}).isRegExp()})["throws"]()}),it("isNotRegExp()",function(){test.exception(function(){throw new Error("Whoops !")}).isNotRegExp().value(function(){test.exception(function(){throw new RegExp("whoops")}).isNotRegExp()})["throws"]()}),it("isDate()",function(){test.exception(function(){throw new Date}).isDate().value(function(){test.exception(function(){throw new Error("Whoops !")}).isDate()})["throws"]()}),it("isNotDate()",function(){test.exception(function(){throw new Error("Whoops !")}).isNotDate().value(function(){test.exception(function(){throw new Date}).isNotDate()})["throws"]()}),it("isArguments()",function(){var error=function(){return arguments};test.exception(function(){throw error(1,2,3)}).isArguments().value(function(){test.exception(function(){throw new Error("Whoops !")}).isArguments()})["throws"]()}),it("isNotArguments()",function(){var error=function(){return arguments};test.exception(function(){throw new Error("Whoops !")}).isNotArguments().value(function(){test.exception(function(){throw error(1,2,3)}).isNotArguments()})["throws"]()}),it("isEmpty()",function(){test.exception(function(){throw""}).isEmpty().exception(function(){throw[]}).isEmpty().exception(function(){throw{}}).isEmpty().exception(function(){throw new Error("Whoops !")}).isEmpty().value(function(){test.exception(function(){throw"Whoops !"}).isEmpty()})["throws"]()}),it("isNotEmpty()",function(){test.exception(function(){throw"Whoops !"}).isNotEmpty()["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw""}).isNotEmpty()})["throws"]().value(function(){test.exception(function(){throw[]}).isNotEmpty()})["throws"]().value(function(){test.exception(function(){throw{}}).isNotEmpty()})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).isNotEmpty()})["throws"]()})}),it("isError()",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")},resetIndicator=function(){indicator.setAll({})};test.exception(trigger).isInstanceOf(Error).bool(indicator.get("error constructor called")).isTrue().given(resetIndicator()).exception(trigger).isError().bool(indicator.get("error constructor called")).isTrue()}),it("hasLength(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasLength(2).value(function(){test.exception(function(){throw{message:"error",code:42}}).hasLength(1)})["throws"]()}),it("hasNotLength(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasNotLength(1).hasNotLength(3).value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotLength(2)})["throws"]()}),it("isEnumerable(property)",function(){test.exception(function(){throw{message:"error",code:42}}).isEnumerable("message").isEnumerable("code").value(function(){test.exception(function(){throw new Error("Whoops !")}).isEnumerable("message")})["throws"]()}),it("isNotEnumerable(property)",function(){test.exception(function(){throw new Error("Whoops !")}).isNotEnumerable("message").value(function(){test.exception(function(){throw{message:"error",code:42}}).isNotEnumerable("message")})["throws"]()}),it("isFrozen()",function(){var error={message:"error",code:42},frozenError={message:"error",code:42};Object.freeze(frozenError),test.exception(function(){throw frozenError}).isFrozen().value(function(){test.exception(function(){throw error}).isFrozen()})["throws"]()}),it("isNotFrozen()",function(){var error={message:"error",code:42},frozenError={message:"error",code:42};Object.freeze(frozenError),test.exception(function(){throw error}).isNotFrozen().value(function(){test.exception(function(){throw frozenError}).isNotFrozen()})["throws"]()}),it("isInstanceOf(expected)",function(){test.exception(function(){throw new TypeError("Whoops !")}).isInstanceOf(TypeError).value(function(){test.exception(function(){throw new Error("Bad type")}).isInstanceOf(TypeError)})["throws"]()}),it("isNotInstanceOf(expected)",function(){test.exception(function(){throw new Error("Whoops !")}).isNotInstanceOf(TypeError).value(function(){test.exception(function(){throw new TypeError("Bad type")}).isNotInstanceOf(TypeError)})["throws"]()}),it("hasProperty(property [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).hasProperty("message").hasProperty("code",42).exception(function(){throw new Error("Whoops !")}).hasProperty("message").hasProperty("message","Whoops !").hasProperty("constructor")["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperty("foo")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperty("code",1)})["throws"]()})}),it("hasNotProperty(property [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperty("foo").hasNotProperty("code",1)["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperty("message")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperty("code",42)})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasNotProperty("constructor")})["throws"]()})}),it("hasOwnProperty(property [, value])",function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("message").hasOwnProperty("message","Whoops !")["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("foo")})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("message","Grrrr !")})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("constructor")})["throws"]()})}),it("hasNotOwnProperty(property [, value])",function(){test.exception(function(){throw new Error("Whoops !")}).hasNotOwnProperty("foo").hasNotOwnProperty("message","Grrrr !").hasNotOwnProperty("constructor")["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message")})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message","Whoops !")})["throws"]()})}),it("hasProperties(properties)",function(){test.exception(function(){throw{message:"error",code:42}}).hasProperties(["message","code"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperties(["message","code","foo"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperties(["message"])})["throws"]()})}),it("hasNotProperties(properties)",function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperties(["foo","bar"]).hasNotProperties(["foo","code","bar"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperties(["message","code"])})["throws"]()})}),it("hasOwnProperties(properties)",function(){test.exception(function(){throw{message:"error",code:42}}).hasOwnProperties(["message","code"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasOwnProperties(["message","code","foo"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasOwnProperties(["message"])})["throws"]()})}),it("hasKey(key [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).hasKey("message").hasKey("code",42).exception(function(){throw new Error("Whoops !")}).hasKey("message").hasKey("message","Whoops !").hasKey("constructor")["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKey("foo")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKey("code",1)})["throws"]()})}),it("notHasKey(key [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).notHasKey("foo").notHasKey("code",1)["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasKey("message")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasKey("code",42)})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).notHasKey("constructor")})["throws"]()})}),it("hasKeys(keys)",function(){test.exception(function(){throw{message:"error",code:42}}).hasKeys(["message","code"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKeys(["message","code","foo"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKeys(["message"])})["throws"]()})}),it("notHasKeys(keys)",function(){test.exception(function(){throw{message:"error",code:42}}).notHasKeys(["foo","bar"]).notHasKeys(["foo","code","bar"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasKeys(["message","code"])})["throws"]()})}),it("hasValue(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasValue("error").hasValue(42)["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValue("err")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValue(2)})["throws"]()})}),it("notHasValue(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).notHasValue("err").notHasValue(2)["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValue("error")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValue(42)})["throws"]()})}),it("hasValues(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasValues(["error"]).hasValues(["error",42])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValues(["foo"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValues(["error",42,"foo"])})["throws"]()})}),it("notHasValues(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).notHasValues(["code"]).notHasValues(["message","code","foo"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValues(["error"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValues(["foo","error"])})["throws"]()})}),it("contains(expected [, ...])",function(){test.exception(function(){throw new Error("Whoops")}).contains({message:"Whoops"}).value(function(){test.exception(function(){throw new Error("Whoops")}).contains({message:"foo"})})["throws"]()}),it("notContains(expected [, ...])",function(){test.exception(function(){throw new Error("Whoops")}).notContains({message:"foo"}).value(function(){test.exception(function(){throw new Error("Whoops")}).notContains({message:"Whoops"})})["throws"]()}),it("startsWith(str)",function(){test.exception(function(){throw"An error occured"}).startsWith("An error").value(function(){test.exception(function(){throw"An error occured"}).startsWith("error")})["throws"]()}),it("notStartsWith(str)",function(){test.exception(function(){throw"An error occured"}).notStartsWith("error").value(function(){test.exception(function(){throw"An error occured"}).notStartsWith("An error")})["throws"]()}),it("endsWith(str)",function(){test.exception(function(){throw"An error occured"}).endsWith("occured").value(function(){test.exception(function(){throw"An error occured"}).endsWith("error")})["throws"]()}),it("notEndsWith(str)",function(){test.exception(function(){throw"An error occured"}).notEndsWith("error").value(function(){test.exception(function(){throw"An error occured"}).notEndsWith("occured")})["throws"]()}),it("hasMessage(expected)",function(){var exception,indicator=test.createCollection(),trigger=function(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")},resetIndicator=function(){indicator.setAll({})};test.exception(trigger).hasMessage("I'm a ninja !").bool(indicator.get("error constructor called")).isTrue().then(resetIndicator()).exception(trigger).hasMessage(/ninja/).bool(indicator.get("error constructor called")).isTrue().then(resetIndicator())["case"](exception=test.exception(trigger)).exception(function(){indicator.set("ninjaa is not in error message",!0),exception.hasMessage(/ninjaa/)}).bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue().then(resetIndicator()).value(function(){indicator.set("ninjaa is not in error message",!0),test.exception(trigger).hasMessage(/ninjaa/)})["throws"]().bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue()})})}),describe("Asserter function()",function(){describe("function() behavior",function(){it("Does not contains assertions from the assertions containers",function(){var fn=function(){};test.value(test["function"](fn).hasHeader).isUndefined().value(test["function"](fn).isAfter).isUndefined().value(test["function"](fn).hasMessage).isUndefined()}),it("Assert that the tested value is a `function`",function(){var fn=function(){};test["function"](fn)["function"](Date)["case"]("Test failure",function(){test.exception(function(){test["function"](fn())}).exception(function(){test["function"]({})}).exception(function(){test["function"]([])}).exception(function(){test["function"](new Date)}).exception(function(){test["function"]("foobar")}).exception(function(){test["function"](1)}).exception(function(){test["function"](!0)}).exception(function(){test["function"](!1)}).exception(function(){test["function"](null)}).exception(function(){test["function"](void 0)}).exception(function(){test["function"]()})})})}),describe("Assertions of function()",function(){it("is(expected)",function(){var fn=function(){},ref=fn;test["function"](ref).is(fn).exception(function(){test["function"](fn).is(function(){})})}),it("isNot(expected)",function(){var fn=function(){},otherFunction=function(){};test["function"](fn).isNot(otherFunction).isNot(function(){}).exception(function(){test["function"](fn).isNot(fn)})}),it("isIdenticalTo(expected)",function(){var fn=function(){},ref=fn;test["function"](ref).isIdenticalTo(fn).exception(function(){test["function"](fn).isIdenticalTo(function(){})})}),it("isNotIdenticalTo(expected)",function(){var fn=function(){},otherFunction=function(){};test["function"](fn).isNotIdenticalTo(otherFunction).isNotIdenticalTo(function(){}).exception(function(){test["function"](fn).isNotIdenticalTo(fn)})}),it("isEqualTo(expected)",function(){var fn=function(){},ref=fn;test["function"](ref).isEqualTo(fn).exception(function(){test["function"](fn).isEqualTo(function(){})})}),it("isNotEqualTo(expected)",function(){var fn=function(){},otherFunction=function(){};test["function"](fn).isNotEqualTo(otherFunction).isNotEqualTo(function(){}).exception(function(){test["function"](fn).isNotEqualTo(fn)})}),it("match(expected)",function(){function myFunction(){}var fn=function(){return"hello"};test["function"](fn).match("function").match("func").match(function(it){return"hello"===it()})["function"](Date).match("Date")["function"](myFunction).match("myFunction").match(/my/).match(/[a-z]/i)["case"]("Test failure",function(){test.exception(function(){test["function"](fn).match(function(it){return"hey"===it()})}).exception(function(){test["function"](fn).match("someFunction")}).exception(function(){test["function"](myFunction).match(/someFunction/)})})}),it("notMatch(expected)",function(){function myFunction(){}var fn=function(){return"hello"};test["function"](fn).notMatch("foo").notMatch(/[A-Z]/).notMatch(function(it){return"hey"===it()})["function"](Date).notMatch("foo")["function"](myFunction).notMatch("someFunction").notMatch(/some/)["case"]("Test failure",function(){test.exception(function(){test["function"](fn).notMatch(function(it){return"hello"===it()})}).exception(function(){test["function"](fn).notMatch("function")}).exception(function(){test["function"](myFunction).notMatch(/myFunction/)}).exception(function(){test["function"](myFunction).notMatch(/my/)}).exception(function(){test["function"](myFunction).notMatch("myFunction")})})}),it("isValid(expected)",function(){function myFunction(){}var fn=function(){return"hello"};test["function"](fn).isValid("function").isValid("func").isValid(function(it){return"hello"===it()})["function"](Date).isValid("Date")["function"](myFunction).isValid("myFunction").isValid(/my/).isValid(/[a-z]/i)["case"]("Test failure",function(){test.exception(function(){test["function"](fn).isValid(function(it){return"hey"===it()})}).exception(function(){test["function"](fn).isValid("someFunction")}).exception(function(){test["function"](myFunction).isValid(/someFunction/)})})}),it("isNotValid(expected)",function(){function myFunction(){}var fn=function(){return"hello"};test["function"](fn).isNotValid("foo").isNotValid(/[A-Z]/).isNotValid(function(it){return"hey"===it()})["function"](Date).isNotValid("foo")["function"](myFunction).isNotValid("someFunction").isNotValid(/some/)["case"]("Test failure",function(){test.exception(function(){test["function"](fn).isNotValid(function(it){return"hello"===it()})}).exception(function(){test["function"](fn).isNotValid("function")}).exception(function(){test["function"](myFunction).isNotValid(/myFunction/)}).exception(function(){test["function"](myFunction).isNotValid(/my/)}).exception(function(){test["function"](myFunction).isNotValid("myFunction")})})}),it("throws([constructor|expected], [expected])",function(){var fn=function(){},trigger=function(){throw new Error("Whoops!")};test["function"](trigger)["throws"]()["throws"]("Whoops!")["throws"](/whoops/i)["throws"](Error)["throws"](Error,/whoops/i)["case"]("Test failure",function(){test.value(function(){test["function"](fn)["throws"]()})["throws"]().value(function(){test["function"](trigger)["throws"](TypeError)})["throws"]().value(function(){test["function"](trigger)["throws"]("gloops")})["throws"]().value(function(){test["function"](trigger)["throws"](/gloops/)})["throws"]().value(function(){test["function"](trigger)["throws"](TypeError,"gloops") })["throws"]().value(function(){test["function"](trigger)["throws"](Error,"whoops")})["throws"]()})}),it("isError()",function(){var trigger=function(){throw new Error("Whoops!")};test["function"](trigger).isError()["case"]("Test failure",function(){test.value(function(){test["function"](function(){}).isError()})["throws"]().value(function(){test["function"](function(){throw"error"}).isError()})["throws"]()})}),it("hasName(expected)",function(){function myFunction(){}test["function"](Date).hasName("Date")["function"](myFunction).hasName("myFunction")["case"]("Test failure",function(){test.exception(function(){test["function"](new Date).hasName("RegExp")}).exception(function(){test["function"](myFunction).hasName("function")})})})})}),describe("Asserter number()",function(){describe("number() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.number(1).hasHeader).isUndefined().value(test.number(1).hasProperty).isUndefined().value(test.number(1).hasMessage).isUndefined()}),it("Assert that the tested value is a `number`",function(){test.number(2).number(99.98)["case"]("Test failure",function(){test.exception(function(){test.number("0")}).exception(function(){test.number("1")}).exception(function(){test.number(/0/)}).exception(function(){test.number(/1/)}).exception(function(){test.number(!0)}).exception(function(){test.number(!1)}).exception(function(){test.number(null)}).exception(function(){test.number(void 0)})})})}),describe("Assertions of number()",function(){it("is(expected)",function(){test.number(2).is(2)["case"]("Test failure",function(){test.exception(function(){test.number(2).is(-2)}).exception(function(){test.number(2).is(2.02)})})}),it("isNot(expected)",function(){test.number(2).isNot(3).isNot("2").isNot(2.1).isNot(.2).isNot(.02).isNot(-2).exception(function(){test.number(2).isNot(2)})}),it("isIdenticalTo(expected)",function(){test.number(1).isIdenticalTo(1)["case"]("Test failure",function(){test.exception(function(){test.number(2).isIdenticalTo(-2)}).exception(function(){test.number(2).isIdenticalTo(2.02)})})}),it("isNotIdenticalTo(expected)",function(){test.number(2).isNotIdenticalTo(3).isNotIdenticalTo("2").isNotIdenticalTo(2.1).isNotIdenticalTo(.2).isNotIdenticalTo(-2).exception(function(){test.number(2).isNotIdenticalTo(2)})}),it("isEqualTo(expected)",function(){test.number(1).isEqualTo(1).isEqualTo("1")["case"]("Test failure",function(){test.exception(function(){test.number(2).isEqualTo(-2)}).exception(function(){test.number(2).isEqualTo(2.02)})})}),it("isNotEqualTo(expected)",function(){test.number(2).isNotEqualTo(3).isNotEqualTo(-2).isNotEqualTo(2.1).isNotEqualTo("2.1").exception(function(){test.number(2).isNotEqualTo(2)})}),it("match(expected)",function(){test.number(2014).match(/20+[1-4]/).number(2014).match(201).number(2014).match(function(it){return 2014===it}).exception(function(){test.number(2).match(/3/)})}),it("notMatch(expected)",function(){test.number(2014).notMatch(/20+[5-6]/).notMatch(/[a-z]/).number(10).notMatch(8).number(10).notMatch(function(it){return 42===it})["case"]("Test failure",function(){test.exception(function(){test.number(2).notMatch(/2/)}).exception(function(){test.number(2014).notMatch(function(it){return 2014===it})})})}),it("isValid(expected)",function(){test.number(2014).isValid(/20+[1-4]/).number(2014).isValid(201).number(2014).isValid(function(it){return 2014===it}).exception(function(){test.number(2).isValid(/3/)})}),it("isNotValid(expected)",function(){test.number(2014).isNotValid(/20+[5-6]/).isNotValid(/[a-z]/).number(10).isNotValid(8).number(10).isNotValid(function(it){return 42===it})["case"]("Test failure",function(){test.exception(function(){test.number(2).isNotValid(/2/)}).exception(function(){test.number(2014).isNotValid(function(it){return 2014===it})})})}),it("matchEach(expected)",function(){test.number(2014).matchEach([2,4,1,0]).matchEach([2014,function(it){return 2014===it}])["case"]("Test failure",function(){test.exception(function(){test.number(2014).matchEach([2014,function(it){return 2041===it}])}).exception(function(){test.number(2).matchEach([2,3])}).exception(function(){test.number(2014).matchEach([2041,function(it){return 2014===it}])})})}),it("notMatchEach(expected)",function(){test.number(2014).notMatchEach([3,200]).notMatchEach([2012,function(it){return 2014!==it}])["case"]("Test failure",function(){test.exception(function(){test.number(2).notMatchEach([2,3])}).exception(function(){test.number(2014).notMatchEach([2041,function(it){return 2014===it}])}).exception(function(){test.number(2014).notMatchEach([2012,function(it){return 2014===it}])})})}),it("isBetween(begin, end)",function(){test.number(2).isBetween(2,4).number(3).isBetween(2,4).number(4).isBetween(2,4).number(4).isBetween(3.99,4.01).number(1).isBetween(-1.00000001,1.0000000001)["case"]("Test failure",function(){test.exception(function(){test.number(2).isBetween(-3,-1)}).exception(function(){test.number(2).isBetween(3,1)})})}),it("isNotBetween(begin, end)",function(){test.number(1).isNotBetween(2,4).number(5).isNotBetween(2,4).exception(function(){test.number(2).isNotBetween(1,3)})}),it("isBefore(expected)",function(){test.number(1).isBefore(2).isBefore(1.01).exception(function(){test.number(1).isBefore(0)})}),it("isAfter(expected)",function(){test.number(2).isAfter(1).isAfter(1.99).isAfter(-3).exception(function(){test.number(-1).isAfter(0)})}),it("isLessThan(expected)",function(){test.number(1).isLessThan(2).isLessThan(1.01).exception(function(){test.number(1).isLessThan(0)})}),it("isGreaterThan(expected)",function(){test.number(2).isGreaterThan(1).isGreaterThan(1.99).isGreaterThan(-3).exception(function(){test.number(-1).isGreaterThan(0)})}),it("isApprox(num, delta)",function(){test.number(99.98).isApprox(100,.02).exception(function(){test.number(99.98).isApprox(100,.01)})}),it("isInfinite()",function(){test.number(1/0).isInfinite().exception(function(){test.number(1.3333333333333333).isInfinite()})}),it("isNotInfinite()",function(){test.number(1.3333333333333333).isNotInfinite().exception(function(){test.number(1/0).isNotInfinite()})})})}),describe("Asserter object()",function(){describe("object() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.object({}).hasHeader).isUndefined().value(test.object({}).isError).isUndefined().value(test.object({}).hasMessage).isUndefined().value(test.object({}).isInfinite).isUndefined()}),it("Assert that the tested value is an `object`",function(){var Foo=function(){};test.object({}).object([]).object(new Date).object(new RegExp).object(new Foo)["case"]("Test failure",function(){test.exception(function(){test.object("Foo")}).exception(function(){test.object(Foo)}).exception(function(){test.object(1)}).exception(function(){test.object(void 0)}).exception(function(){test.object(!0)}).exception(function(){test.object(!1)}).exception(function(){test.object(null)}).exception(function(){test.object(function(){})})})})}),describe("Assertions of object()",function(){it("is(expected)",function(){test.object({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,1]}).exception(function(){test.object({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,2]})})}),it("isNot(expected)",function(){test.object({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,"1"]}).exception(function(){test.object({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,1]})})}),it("isIdenticalTo(expected)",function(){var obj={},obj2=obj;test.object(obj).isIdenticalTo(obj2).exception(function(){test.object(obj).isIdenticalTo({})})}),it("isNotIdenticalTo(expected)",function(){var obj={},obj2=obj;test.object(obj).isNotIdenticalTo({}).exception(function(){test.object(obj).isNotIdenticalTo(obj2)})}),it("isEqualTo(expected)",function(){var obj={},obj2=obj;test.object(obj).isEqualTo(obj2).exception(function(){test.object(obj).isEqualTo({})})}),it("isNotEqualTo(expected)",function(){var obj={foo:"bar"},obj2=obj;test.object(obj).isNotEqualTo({foo:"bar",baz:"bar"}).exception(function(){test.object(obj).isNotEqualTo(obj2)})}),it("match(expected)",function(){test.object({hello:"world"}).match(function(obj){return"world"==obj.hello}).exception(function(){test.object({hello:"world"}).match(function(obj){return"foo"==obj.hello})})}),it("notMatch(expected)",function(){test.object({hello:"world"}).notMatch(function(obj){return"E.T"==obj.hello}).exception(function(){test.object({hello:"world"}).notMatch(function(obj){return"world"==obj.hello})})}),it("isValid(expected)",function(){test.object({hello:"world"}).isValid(function(obj){return"world"==obj.hello}).exception(function(){test.object({hello:"world"}).isValid(function(obj){return"foo"==obj.hello})})}),it("isNotValid(expected)",function(){test.object({hello:"world"}).isNotValid(function(obj){return"E.T"==obj.hello}).exception(function(){test.object({hello:"world"}).isNotValid(function(obj){return"world"==obj.hello})})}),it("matchEach(expected)",function(){test.object({foo:"bar",hey:"you",joker:1}).matchEach(function(it,key){return"joker"==key?"number"==typeof it:"string"==typeof it}).exception(function(){test.object({foo:"bar",hey:"you",joker:1}).matchEach(function(it){return"string"==typeof it})})}),it("notMatchEach(expected)",function(){test.object({foo:"bar",hey:"you",joker:1}).notMatchEach(function(it,key){return"other"==key?!0:void 0}).exception(function(){test.object({foo:"bar",hey:"you",joker:1}).notMatchEach(function(it,key){return"foo"==key?!0:void 0})}).exception(function(){test.object({foo:"bar",hey:"you",joker:1}).notMatchEach(function(it){return"string"==typeof it})})}),it("isArray()",function(){test.object([]).isArray().exception(function(){test.object({}).isArray()}).exception(function(){test.object(new Date).isArray()})}),it("isRegExp()",function(){test.object(/[0-9]+/).isRegExp().exception(function(){test.object({}).isRegExp()}).exception(function(){test.object(new Date).isRegExp()})}),it("isNotRegExp()",function(){test.object(new Date).isNotRegExp().exception(function(){test.object(/[0-9]+/).isNotRegExp()})}),it("isDate()",function(){test.object(new Date).isDate().exception(function(){test.object({}).isDate()}).exception(function(){test.object(/[0-9]+/).isDate()})}),it("isNotDate()",function(){test.object(/[0-9]+/).isNotDate().exception(function(){test.object(new Date).isNotDate()})}),it("isArguments()",function(){var fn=function(){var args=arguments;test.object(arguments).isArguments(),test.object(args).isArguments()};fn(1,2,3),test.exception(function(){test.object({0:"a"}).isArguments()})}),it("isNotArguments()",function(){var fn=function(){test.object(arguments).isArguments().object([1,2,3]).isNotArguments().object({0:1,1:2,2:3}).isNotArguments()};fn(1,2,3),test.exception(function(){test.object(arguments).isNotArguments()})}),it("isEmpty()",function(){test.object({}).isEmpty().exception(function(){test.object({0:"a"}).isEmpty()})}),it("isNotEmpty()",function(){test.object({hello:"Nico"}).isNotEmpty().exception(function(){test.object({}).isNotEmpty()})}),it("hasLength(expected)",function(){test.object({foo:"bar",other:"baz"}).hasLength(2).exception(function(){test.object({foo:"bar",other:"baz"}).hasLength(3)})}),it("hasNotLength(expected)",function(){test.object({foo:"bar",other:"baz"}).hasNotLength(4).exception(function(){test.object({foo:"bar",other:"baz"}).hasNotLength(2)})}),it("isEnumerable(property)",function(){test.object({prop:"foobar"}).isEnumerable("prop").exception(function(){test.object({prop:"foobar"}).isEnumerable("length")})}),it("isNotEnumerable(property)",function(){test.object(Object.create({},{prop:{enumerable:0}})).isNotEnumerable("prop").exception(function(){test.object({prop:"foobar"}).isNotEnumerable("prop")})}),it("isFrozen()",function(){test.object(Object.freeze({})).isFrozen().exception(function(){test.object({}).isFrozen()})}),it("isNotFrozen()",function(){test.object({}).isNotFrozen().exception(function(){test.object(Object.freeze({})).isNotFrozen()})}),it("isInstanceOf(expected)",function(){test.object(new Date).isInstanceOf(Date).exception(function(){test.object(new Date).isInstanceOf(Error)})}),it("isNotInstanceOf(expected)",function(){test.object(new Date).isNotInstanceOf(RegExp).exception(function(){test.object(new Date).isNotInstanceOf(Object)}).exception(function(){test.object(new Date).isNotInstanceOf(Date)})}),it("hasProperty(property [, value])",function(){test.object({foo:"bar"}).hasProperty("foo").object({foo:"bar"}).hasProperty("foo","bar").exception(function(){test.object({foo:"bar"}).hasProperty("bar")}).exception(function(){test.object({foo:"bar"}).hasProperty("foo","ba")})}),it("hasNotProperty(property [, value])",function(){test.object({foo:"bar"}).hasNotProperty("bar").object({foo:"bar"}).hasNotProperty("foo","baz").exception(function(){test.object({foo:"bar"}).hasNotProperty("foo")}).exception(function(){test.object({foo:"bar"}).hasNotProperty("foo","bar")})}),it("hasOwnProperty(property [, value])",function(){test.object({foo:"bar"}).hasOwnProperty("foo").object({foo:"bar"}).hasOwnProperty("foo","bar").exception(function(){test.object({foo:"bar"}).hasOwnProperty("bar")}).exception(function(){test.object({foo:"bar"}).hasOwnProperty("foo","ba")})}),it("hasNotOwnProperty(property [, value])",function(){test.object({foo:"bar"}).hasNotOwnProperty("bar").object({foo:"bar"}).hasNotOwnProperty("foo","baz").exception(function(){test.object({foo:"bar"}).hasNotOwnProperty("foo")}).exception(function(){test.object({foo:"bar"}).hasNotOwnProperty("foo","bar")})}),it("hasProperties(properties)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasProperties(["other","bar","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasProperties(["other","bar"])})}),it("hasNotProperties(properties)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasNotProperties(["other","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasNotProperties(["bar","other","foo"])})}),it("hasOwnProperties(properties)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasOwnProperties(["other","bar","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasOwnProperties(["other","bar"])})}),it("hasKey(key [, value])",function(){test.object({foo:"bar"}).hasKey("foo").object({foo:"bar"}).hasKey("foo","bar").exception(function(){test.object({foo:"bar"}).hasKey("bar")}).exception(function(){test.object({foo:"bar"}).hasKey("foo","ba")})}),it("notHasKey(key [, value])",function(){test.object({foo:"bar"}).notHasKey("bar").object({foo:"bar"}).notHasKey("foo","baz").exception(function(){test.object({foo:"bar"}).notHasKey("foo")}).exception(function(){test.object({foo:"bar"}).notHasKey("foo","bar")})}),it("hasKeys(keys)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasKeys(["other","bar","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasKeys(["other","bar"])})}),it("notHasKeys(keys)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).notHasKeys(["other","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).notHasKeys(["bar","other","foo"])})}),it("hasValue(expected)",function(){test.object({life:42,love:69}).hasValue(42).exception(function(){test.object({life:42,love:69}).hasValue("42")})}),it("notHasValue(expected)",function(){test.object({life:42,love:69}).notHasValue(4).exception(function(){test.object({life:42,love:69}).notHasValue(42)})}),it("hasValues(expected)",function(){test.object({life:42,love:69}).hasValues([42,69]).exception(function(){test.object([1,42,3]).hasValues([42,3.01])})}),it("notHasValues(expected)",function(){test.object({life:42,love:69}).notHasValues([43,68]).exception(function(){test.object([1,42,3]).notHasValues([1,42,3])})}),it("contains(expected [, ...])",function(){test.object({a:{b:10},b:{c:10,d:11,a:{b:10,c:11}}}).contains({a:{b:10},b:{c:10,a:{c:11}}}).object({a:"a",b:{c:"c"}}).contains({b:{c:"c"}}).contains({b:{c:"c"}},{a:"a"}).exception(function(){test.object({foo:{a:"a"},bar:{b:"b",c:"c"}}).contains({foo:{a:"a"}},{bar:{b:"c"}})})}),it("notContains(expected [, ...])",function(){test.object({a:"a"},{b:"b",c:"c"}).notContains({c:"b"}).exception(function(){test.object({foo:{a:"a"},bar:{b:"b",c:"c"}}).notContains({foo:{a:"a"},bar:{c:"c"}})})}),it("hasName(expected)",function(){test.object(new Date(2010,5,28)).hasName("Date").exception(function(){test.object(new Date(2010,5,28)).hasName("date")})})})}),describe("Asserter regexp()",function(){describe("regexp() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.regexp(new RegExp).hasHeader).isUndefined().value(test.regexp(new RegExp).hasMessage).isUndefined().value(test.regexp(new RegExp).isInfinite).isUndefined()}),it("Assert that the tested value is an instance of `RegExp`",function(){test.regexp(/foobar/).regexp(new RegExp("foo","i"))["case"]("Test failure",function(){test.exception(function(){test.regexp({})}).exception(function(){test.regexp([])}).exception(function(){test.regexp("")}).exception(function(){test.regexp()}).exception(function(){test.regexp(void 0)}).exception(function(){test.regexp(null)}).exception(function(){test.regexp(!0)}).exception(function(){test.regexp(!1)}).exception(function(){test.regexp(0)}).exception(function(){test.regexp(1)}).exception(function(){test.regexp("[a-z]")}).exception(function(){test.regexp("/foobar/")}).exception(function(){test.regexp(RegExp)}).exception(function(){test.regexp(new Date)})})})}),describe("Assertions of regexp()",function(){it("is(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).is(new RegExp(/[a-z]/)).exception(function(){test.regexp(regexp).is(/A-Z/)})}),it("isNot(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).isNot(new RegExp(/[A-Z]/)).exception(function(){test.regexp(regexp).isNot(/[a-z]/)})}),it("isIdenticalTo(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isIdenticalTo(ref).exception(function(){test.regexp(regexp).isIdenticalTo(/[a-z]/)})}),it("isNotIdenticalTo(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).isNotIdenticalTo(new RegExp(/[a-z]/)).exception(function(){test.regexp(regexp).isNotIdenticalTo(regexp)})}),it("isEqualTo(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isEqualTo(ref).exception(function(){test.regexp(regexp).isEqualTo(/[a-z]/)})}),it("isNotEqualTo(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).isNotEqualTo(new RegExp(/[a-z]/)).exception(function(){test.regexp(regexp).isNotEqualTo(regexp)})}),it("match(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).match(function(reg){return reg===ref}).exception(function(){test.regexp(regexp).match(function(actual){return"[A-Z]"==actual.source})})}),it("notMatch(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).notMatch(function(actual){var reg=new RegExp(/[a-z]/);return reg===ref||reg===actual}).exception(function(){test.regexp(regexp).notMatch(function(actual){return"[a-z]"==actual.source})})}),it("isValid(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isValid(function(reg){return reg===ref}).exception(function(){test.regexp(regexp).isValid(function(actual){return"[A-Z]"==actual.source})})}),it("isNotValid(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isNotValid(function(actual){var reg=new RegExp(/[a-z]/);return reg===ref||reg===actual}).exception(function(){test.regexp(regexp).isNotValid(function(actual){return"[a-z]"==actual.source})})}),it("isEnumerable(property)",function(){var regexp=new RegExp(/[a-z]/);Object.defineProperty(regexp,"myCustom",{enumerable:!0,value:"static"}),test.regexp(regexp).isEnumerable("myCustom").exception(function(){test.regexp(regexp).isEnumerable("ignoreCase")})}),it("isNotEnumerable(property)",function(){var regexp=new RegExp(/[a-z]/);Object.defineProperty(regexp,"myCustom",{enumerable:!0,value:"static"}),test.regexp(regexp).isNotEnumerable("lastIndex").isNotEnumerable("ignoreCase").isNotEnumerable("multiline").exception(function(){test.regexp(regexp).isNotEnumerable("myCustom")})}),it("isFrozen",function(){var regexp=new RegExp(/[a-z]/);Object.freeze(regexp),test.regexp(regexp).isFrozen().exception(function(){test.regexp(/[a-z]/).isFrozen()})}),it("isNotFrozen",function(){var regexp=new RegExp(/[a-z]/),regexpFrozen=new RegExp(/[a-z]/);Object.freeze(regexpFrozen),test.regexp(regexp).isNotFrozen().exception(function(){test.regexp(regexpFrozen).isNotFrozen()})}),it("hasProperty(property [, value])",function(){test.regexp(/[a-z]/).hasProperty("lastIndex").hasProperty("constructor").exception(function(){test.regexp(/[a-z]/).hasProperty("foo")})}),it("hasNotProperty(property [, value])",function(){test.regexp(/[a-z]/).hasNotProperty("foobar").exception(function(){test.regexp(/[a-z]/).hasNotProperty("lastIndex")})}),it("hasOwnProperty(property [, value])",function(){test.regexp(/[a-z]/).hasOwnProperty("lastIndex").exception(function(){test.regexp(/[a-z]/).hasOwnProperty("constructor")})}),it("hasNotOwnProperty(property [, value])",function(){test.regexp(/[a-z]/).hasNotOwnProperty("constructor").exception(function(){test.regexp(/[a-z]/).hasNotOwnProperty("lastIndex")})}),it("hasKey(key [,value ])",function(){test.regexp(/[a-z]/).hasKey("lastIndex").hasKey("constructor").exception(function(){test.regexp(/[a-z]/).hasKey("foo")})}),it("notHasKey(key [,value])",function(){test.regexp(/[a-z]/).notHasKey("foobar").exception(function(){test.regexp(/[a-z]/).notHasKey("lastIndex")})})})}),describe("Asserter string()",function(){describe("string() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.string("").hasHeader).isUndefined().value(test.string("").hasProperty).isUndefined().value(test.string("").hasMessage).isUndefined().value(test.string("").isInfinite).isUndefined()}),it("Assert that the tested value is a `string`",function(){test.string("").string("Hello")["case"]("Test failure",function(){test.exception(function(){test.string()}).exception(function(){test.string({})}).exception(function(){test.string([])}).exception(function(){test.string(1)}).exception(function(){test.string(/foobar/)}).exception(function(){test.string(!0)}).exception(function(){test.string(!1)}).exception(function(){test.string(null)}).exception(function(){test.string(void 0)})})})}),describe("Assertions of string()",function(){it("is(expected)",function(){var str="Hello world !";test.string(str).is("Hello world !").exception(function(){test.string(str).is("foo")})}),it("isNot(expected)",function(){var str="Hello world !";test.string(str).isNot("hello world !").exception(function(){test.string(str).isNot("Hello world !")})}),it("isIdenticalTo(expected)",function(){var str="Hello world !";test.string(str).isIdenticalTo("Hello world !").exception(function(){test.string(str).isIdenticalTo("Hello World !")})}),it("isNotIdenticalTo(expected)",function(){var str="Hello world !";test.string(str).isNotIdenticalTo("hello world !").exception(function(){test.string(str).isNotIdenticalTo("Hello world !")})}),it("isEqualTo(expected)",function(){var str="Hello world !";test.string(str).isEqualTo("Hello world !").exception(function(){test.string(str).isEqualTo("Hello World !")})}),it("isNotEqualTo(expected)",function(){var str="Hello world !";test.string(str).isNotEqualTo("hello world !").exception(function(){test.string(str).isNotEqualTo("Hello world !")})}),it("match(expected)",function(){test.string("Hello").match("Hello"),test.string("Hello world !").match(/world/i),test.string("hello").match(function(it){return"hello"===it}),test.exception(function(){test.string("hello").match(/foo/)})}),it("notMatch(expected)",function(){test.string("foobar").notMatch("some value").notMatch(/[foo]+bazzz$/).string("foo").notMatch(function(it){return"bar"===it}).exception(function(){test.string("Hello Nico!").notMatch(/nico/i)})}),it("isValid(expected)",function(){test.string("Hello").isValid("Hello"),test.string("Hello world !").isValid(/world/i),test.string("hello").isValid(function(it){return"hello"===it}),test.exception(function(){test.string("hello").isValid(/foo/)})}),it("isNotValid(expected)",function(){test.string("foobar").isNotValid("some value").isNotValid(/[foo]+bazzz$/).string("foo").isNotValid(function(it){return"bar"===it}).exception(function(){test.string("Hello Nico!").notMatch(/nico/i)})}),it("matchEach(expected)",function(){var str="Hello Nico!";test.string(str).matchEach([/hello/i,"Nico",function(it){return"Hello Nico!"===it}])["case"]("Test failure",function(){test.exception(function(){test.string(str).matchEach([/hello/i,"nico",function(it){return"Hello Nico!"===it}])}).exception(function(){test.string(str).matchEach([/hello/i,"Nico",function(it){return"Hello nico!"===it}])})})}),it("notMatchEach(expected)",function(){var str="Hello Nico!";test.string(str).notMatchEach([/foo/i,"bad word",function(it){return"Bye"===it}])["case"]("Test failure",function(){test.exception(function(){test.string(str).notMatchEach([/hello/,"Nico",function(it){return"Hello !"===it}])}).exception(function(){test.string(str).notMatchEach([/hello/,"nico",function(it){return"Hello Nico!"===it}])})})}),it("isEmpty()",function(){test.string("").isEmpty().exception(function(){test.string(str).isEmpty()})}),it("isNotEmpty()",function(){test.string("a").isNotEmpty().exception(function(){test.string("").isNotEmpty()})}),it("hasLength(expected)",function(){test.string("Hello Nico").hasLength(10).exception(function(){test.string("abc").hasLength(4)})}),it("hasNotLength(expected)",function(){test.string("Hello Nico").hasNotLength(11).exception(function(){test.string("abc").hasNotLength(3)})}),it("hasValue(expected)",function(){test.string("Hello, Nico!").hasValue("Nico").exception(function(){test.string("Hello").hasValue("hello")})}),it("notHasValue(expected)",function(){test.string("Hello, Nico!").notHasValue("Bye").exception(function(){test.string("Hello").notHasValue("Hello")})}),it("hasValues(expected)",function(){test.string("Hello Nico!").hasValues(["Hello","Nico"]).exception(function(){test.string("Hello Nico!").hasValues(["Hi","Nico"])})}),it("notHasValues(expected)",function(){test.string("Sarah Connor ?").notHasValues(["next","door"]).exception(function(){test.string("Hello Nico!").notHasValues(["Hi","Nico"])})}),it("contains(expected [, ...])",function(){test.string("hello boy").contains("boy").string("KISS principle : Keep it Simple, Stupid").contains(["Simple"],["principle"],[":"]).exception(function(){test.string("Hello").contains("hello")})}),it("notContains(expected [, ...])",function(){test.string("hello boy").notContains("bye").exception(function(){test.string("Hello").notContains("Hello")})}),it("startsWith(str)",function(){test.string("foobar").startsWith("foo").exception(function(){test.string("Hello the world").startsWith("world")})}),it("notStartsWith(str)",function(){test.string("foobar").notStartsWith("bar").exception(function(){test.string("Hello the world").notStartsWith("Hello")})}),it("endsWith(str)",function(){test.string("foobar").endsWith("bar").exception(function(){test.string("Hello the world").endsWith("Hello")})}),it("notEndsWith(str)",function(){test.string("foobar").notEndsWith("foo").exception(function(){test.string("Hello the world").notEndsWith("world")})})})});var rawAssertions=__webpack_require__(1);describe("Asserter undefined()",function(){describe("undefined() behavior",function(){it("Does not contains assertions from the assertions containers",function(){var assertions=rawAssertions.call(this,void 0);for(var method in assertions)("hasOwnProperty"!=method||test.undefined(void 0)[method]!==Object.hasOwnProperty)&&test.value(test.undefined(void 0)[method]).isUndefined();test.exception(function(){test.value(test.undefined(void 0).hasOwnProperty).isUndefined()})}),it("Assert that the tested value is `undefined`",function(){test.undefined(void 0).undefined()["case"]("Test failure",function(){test.exception(function(){test.undefined(0)}).exception(function(){test.undefined(1)}).exception(function(){test.undefined("undefined")}).exception(function(){test.undefined(null)}).exception(function(){test.undefined(!1)}).exception(function(){test.undefined(!0)}).exception(function(){test.undefined("")}).exception(function(){test.undefined([])}).exception(function(){test.undefined({})}).exception(function(){test.undefined(function(){})})})})})});var rawAssertions=__webpack_require__(1);describe("Asserter value()",function(){describe("value() behavior",function(){it("value() has all assertions",function(){var assertions=rawAssertions.call(this,void 0);for(var method in assertions)test.value(test.value(void 0)[method]).exists();test.exception(function(){test.value(test.value(void 0).foobar_not_exist).exists()})})}),describe("Assertions of value()",function(){it("is(expected)",function(){test.value({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,1]}).exception(function(){test.value({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,2]})})}),it("isNot(expected)",function(){test.value({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,"1"]}).exception(function(){test.value({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,1]})})}),it("isIdenticalTo(expected)",function(){test.value(1).isIdenticalTo(1).exception(function(){test.value(1).isIdenticalTo(2)})}),it("isNotIdenticalTo(expected)",function(){test.value("1").isNotIdenticalTo(1).exception(function(){test.value(1).isNotIdenticalTo(1)})}),it("isEqualTo(expected)",function(){test.value("1").isEqualTo(1).exception(function(){test.value(1).isEqualTo(1.1)})}),it("isNotEqualTo(expected)",function(){test.value("foobar").isNotEqualTo([]).exception(function(){test.value("foobar").isNotEqualTo("foobar")})}),it("match(expected)",function(){test.value("foobar").match(/[fo]+bar$/).value(["a","b","c"]).match(/[a-z]/).value(10).match(10).exception(function(){test.value("foobar").match("whoops")})}),it("notMatch(expected)",function(){test.value("foobar").notMatch(/[foo]+bazzz$/).value(["a","b","c"]).notMatch(/[d-z]/).value(10).notMatch(8).exception(function(){test.value("foobar").notMatch("foobar")})}),it("matchEach(expected)",function(){test.value([10,11,12]).matchEach(function(it){return it>=10}).exception(function(){test.value([10,11,12]).matchEach(function(it){return it>=11})})}),it("notMatchEach(expected)",function(){test.value([10,11,12]).notMatchEach(function(it){return it>=13}).exception(function(){test.value([10,11,12]).notMatchEach(function(it){return it>=11})})}),it("isValid(expected)",function(){test.value(42).isValid(function(actual){return 42===actual}).exception(function(){test.value(42).isValid(function(actual){return"expected value"===actual})})}),it("isNotValid(expected)",function(){test.value(42).isNotValid(function(actual){return 44===actual}).exception(function(){test.value(42).isNotValid(function(actual){return 42===actual})})}),it("isType(expected)",function(){test.value("foobar").isType("string").value(0).isType("number").value(1).isType("number").value(1.2).isType("number").value("1").isType("string").value({}).isType("object").value(void 0).isType("undefined").value(null).isType("object").value(!0).isType("boolean").value(!1).isType("boolean").exception(function(){test.value("1").isType("number")})}),it("isNotType(expected)",function(){test.value({}).isNotType("string").value("0").isNotType("number").value("1").isNotType("number").value("1.2").isNotType("number").value(1).isNotType("string").value(null).isNotType("undefined").value(void 0).isNotType("object").value("true").isNotType("boolean").value("false").isNotType("boolean").exception(function(){test.value("1").isNotType("string") diff --git a/browser/dist/unit.js b/browser/dist/unit.js index d875e08..1dbebb5 100644 --- a/browser/dist/unit.js +++ b/browser/dist/unit.js @@ -1,30 +1,51 @@ -/*! Unit.js v1.1.1 | (c) 2014 Nicolas Tallefourtane | http://unitjs.com/license.html */ -/*! Sinon.JS v1.12.1 | (c) 2014 Christian Johansen (christian@cjohansen.no) | https://github.com/cjohansen/Sinon.JS/blob/master/LICENSE */ -!function(e,t){"function"==typeof define&&define.amd?define([],function(){return e.sinon=t()}):"object"==typeof exports?module.exports=t():e.sinon=t()}(this,function(){var samsam,formatio;!function(){function define(e,t,n){"samsam"==e?samsam=t():"function"==typeof t&&0===e.length?lolex=t():"function"==typeof n&&(formatio=n(samsam))}define.amd={},("function"==typeof define&&define.amd&&function(e){define("samsam",e)}||"object"==typeof module&&function(e){module.exports=e()}||function(e){this.samsam=e()})(function(){function e(e){var t=e;return"number"==typeof e&&e!==t}function t(e){return f.toString.call(e).split(/[ \]]/)[1]}function n(e){if("Arguments"===t(e))return!0;if("object"!=typeof e||"number"!=typeof e.length||"Array"===t(e))return!1;if("function"==typeof e.callee)return!0;try{e[e.length]=6,delete e[e.length]}catch(n){return!0}return!1}function r(e){if(!e||1!==e.nodeType||!d)return!1;try{e.appendChild(d),e.removeChild(d)}catch(t){return!1}return!0}function i(e){var t,n=[];for(t in e)f.hasOwnProperty.call(e,t)&&n.push(t);return n}function o(e){return"function"==typeof e.getTime&&e.getTime()==e.valueOf()}function s(e){return 0===e&&1/e===-1/0}function a(t,n){return t===n||e(t)&&e(n)?0!==t||s(t)===s(n):void 0}function u(s,u){function l(e){return"object"!=typeof e||null===e||e instanceof Boolean||e instanceof Date||e instanceof Number||e instanceof RegExp||e instanceof String?!1:!0}function c(e,t){var n;for(n=0;nq;q++){if(j=k[q],!f.hasOwnProperty.call(u,j))return!1;if(R=s[j],D=u[j],N=l(R),I=l(D),P=N?c(d,R):-1,M=I?c(h,D):-1,L=-1!==P?p[P]:v+"["+JSON.stringify(j)+"]",F=-1!==M?m[M]:w+"["+JSON.stringify(j)+"]",y[L+F])return!0;if(-1===P&&N&&(d.push(R),p.push(L)),-1===M&&I&&(h.push(D),m.push(F)),N&&I&&(y[L+F]=!0),!g(R,D,L,F))return!1}return!0}(s,u,"$1","$2")}function l(e,t){if(0===t.length)return!0;var n,r,i,o;for(n=0,r=e.length;r>n;++n)if(c(e[n],t[0])){for(i=0,o=t.length;o>i;++i)if(!c(e[n+i],t[i]))return!1;return!0}return!1}var c,f=Object.prototype,d="undefined"!=typeof document&&document.createElement("div");return c=function h(e,n){if(n&&"function"==typeof n.test)return n.test(e);if("function"==typeof n)return n(e)===!0;if("string"==typeof n){n=n.toLowerCase();var r="string"==typeof e||!!e;return r&&String(e).toLowerCase().indexOf(n)>=0}if("number"==typeof n)return n===e;if("boolean"==typeof n)return n===e;if("Array"===t(e)&&"Array"===t(n))return l(e,n);if(n&&"object"==typeof n){var i;for(i in n){var o=e[i];if("undefined"==typeof o&&"function"==typeof e.getAttribute&&(o=e.getAttribute(i)),"undefined"==typeof o||!h(o,n[i]))return!1}return!0}throw new Error("Matcher was not a string, a number, a function, a boolean or an object")},{isArguments:n,isElement:r,isDate:o,isNegZero:s,identical:a,deepEqual:u,match:c,keys:i}}),("function"==typeof define&&define.amd&&function(e){define("formatio",["samsam"],e)}||"object"==typeof module&&function(e){module.exports=e(require("samsam"))}||function(e){this.formatio=e(this.samsam)})(function(e){function t(e){if(!e)return"";if(e.displayName)return e.displayName;if(e.name)return e.name;var t=e.toString().match(/function\s+([^\(]+)/m);return t&&t[1]||""}function n(e,n){var r,i,o=t(n&&n.constructor),a=e.excludeConstructors||s.excludeConstructors||[];for(r=0,i=a.length;i>r;++r){if("string"==typeof a[r]&&a[r]===o)return"";if(a[r].test&&a[r].test(o))return""}return o}function r(e,t){if("object"!=typeof e)return!1;var n,r;for(n=0,r=t.length;r>n;++n)if(t[n]===e)return!0;return!1}function i(t,n,o,s){if("string"==typeof n){var u=t.quoteStrings,l="boolean"!=typeof u||u;return o||l?'"'+n+'"':n}if("function"==typeof n&&!(n instanceof RegExp))return i.func(n);if(o=o||[],r(n,o))return"[Circular]";if("[object Array]"===Object.prototype.toString.call(n))return i.array.call(t,n,o);if(!n)return String(1/n===-1/0?"-0":n);if(e.isElement(n))return i.element(n);if("function"==typeof n.toString&&n.toString!==Object.prototype.toString)return n.toString();var c,f;for(c=0,f=a.length;f>c;c++)if(n===a[c].object)return a[c].value;return i.object.call(t,n,o,s)}function o(e){for(var t in e)this[t]=e[t]}var s={excludeConstructors:["Object",/^.$/],quoteStrings:!0,limitChildrenCount:0},a=(Object.prototype.hasOwnProperty,[]);return"undefined"!=typeof global&&a.push({object:global,value:"[object global]"}),"undefined"!=typeof document&&a.push({object:document,value:"[object HTMLDocument]"}),"undefined"!=typeof window&&a.push({object:window,value:"[object Window]"}),i.func=function(e){return"function "+t(e)+"() {}"},i.array=function(e,t){t=t||[],t.push(e);var n,r,o=[];for(r=this.limitChildrenCount>0?Math.min(this.limitChildrenCount,e.length):e.length,n=0;r>n;++n)o.push(i(this,e[n],t));return r0?Math.min(this.limitChildrenCount,p.length):p.length,c=0;d>c;++c)a=p[c],l=t[a],u=r(l,o)?"[Circular]":i(this,l,o,s+2),u=(/\s/.test(a)?'"'+a+'"':a)+": "+u,m+=u.length,h.push(u);var y=n(this,t),g=y?"["+y+"] ":"",v="";for(c=0,f=s;f>c;++c)v+=" ";return d80?g+"{\n "+v+h.join(",\n "+v)+"\n"+v+"}":g+"{ "+h.join(", ")+" }"},i.element=function(e){var t,n,r,i,o,s=e.tagName.toLowerCase(),a=e.attributes,u=[];for(r=0,i=a.length;i>r;++r)t=a.item(r),n=t.nodeName.toLowerCase().replace("html:",""),o=t.nodeValue,("contenteditable"!==n||"inherit"!==o)&&o&&u.push(n+'="'+o+'"');var l="<"+s+(u.length>0?" ":""),c=e.innerHTML;c.length>20&&(c=c.substr(0,20)+"[...]");var f=l+u.join(" ")+">"+c+"";return f.replace(/ contentEditable="inherit"/,"")},o.prototype={functionName:t,configure:function(e){return new o(e)},constructorName:function(e){return n(this,e)},ascii:function(e,t,n){return i(this,e,t,n)}},o.prototype}),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.lolex=e()}}(function(){var define,module,exports;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s3||!/^(\d\d:){0,2}\d\d?$/.test(e))throw new Error("tick only understands numbers and 'h:m:s'");for(;i--;){if(t=parseInt(n[i],10),t>=60)throw new Error("Invalid time "+e);o+=t*Math.pow(60,r-i-1)}return 1e3*o}function getEpoch(e){if(!e)return 0;if("function"==typeof e.getTime)return e.getTime();if("number"==typeof e)return e;throw new TypeError("now should be milliseconds since UNIX epoch")}function inRange(e,t,n){return n&&n.callAt>=e&&n.callAt<=t}function mirrorDateProperties(e,t){t.now?e.now=function(){return e.clock.now}:delete e.now,t.toSource?e.toSource=function(){return t.toSource()}:delete e.toSource,e.toString=function(){return t.toString()},e.prototype=t.prototype,e.parse=t.parse,e.UTC=t.UTC,e.prototype.toUTCString=t.prototype.toUTCString;for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function createDate(){function e(t,n,r,i,o,s,a){switch(arguments.length){case 0:return new NativeDate(e.clock.now);case 1:return new NativeDate(t);case 2:return new NativeDate(t,n);case 3:return new NativeDate(t,n,r);case 4:return new NativeDate(t,n,r,i);case 5:return new NativeDate(t,n,r,i,o);case 6:return new NativeDate(t,n,r,i,o,s);default:return new NativeDate(t,n,r,i,o,s,a)}}return mirrorDateProperties(e,NativeDate)}function addTimer(e,t){if("undefined"==typeof t.func)throw new Error("Callback must be provided to timer calls");return e.timers||(e.timers={}),t.id=id++,t.createdAt=e.now,t.callAt=e.now+(t.delay||0),e.timers[t.id]=t,addTimerReturnsObject?{id:t.id,ref:function(){},unref:function(){}}:t.id}function firstTimerInRange(e,t,n){var r=e.timers,i=null;for(var o in r)inRange(t,n,r[o])&&(!i||~compareTimers(i,r[o]))&&(i=r[o]);return i}function compareTimers(e,t){return e.callAtt.callAt?1:e.immediate&&!t.immediate?-1:!e.immediate&&t.immediate?1:e.createdAtt.createdAt?1:e.idt.id?1:void 0}function callTimer(clock,timer){"number"==typeof timer.interval?clock.timers[timer.id].callAt+=timer.interval:delete clock.timers[timer.id];try{"function"==typeof timer.func?timer.func.apply(null,timer.args):eval(timer.func)}catch(e){var exception=e}if(clock.timers[timer.id]){if(exception)throw exception}else if(exception)throw exception}function uninstall(e,t){for(var n,r=0,i=e.methods.length;i>r;r++)if(n=e.methods[r],t[n].hadOwnProperty)t[n]=e["_"+n];else try{delete t[n]}catch(o){}e.methods=[]}function hijackMethod(e,t,n){if(n[t].hadOwnProperty=Object.prototype.hasOwnProperty.call(e,t),n["_"+t]=e[t],"Date"==t){var r=mirrorDateProperties(n[t],e[t]);e[t]=r}else{e[t]=function(){return n[t].apply(n,arguments)};for(var i in n[t])n[t].hasOwnProperty(i)&&(e[t][i]=n[t][i])}e[t].clock=n}var timeoutResult=setTimeout(function(){},0),addTimerReturnsObject="object"==typeof timeoutResult;clearTimeout(timeoutResult);var NativeDate=Date,id=1,timers={setTimeout:setTimeout,clearTimeout:clearTimeout,setImmediate:"undefined"!=typeof setImmediate?setImmediate:void 0,clearImmediate:"undefined"!=typeof clearImmediate?clearImmediate:void 0,setInterval:setInterval,clearInterval:clearInterval,Date:Date},keys=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};exports.timers=timers;var createClock=exports.createClock=function(e){var t={now:getEpoch(e),timeouts:{},Date:createDate()};return t.Date.clock=t,t.setTimeout=function(e,n){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,2),delay:n})},t.clearTimeout=function(e){e&&(t.timers||(t.timers=[]),"object"==typeof e&&(e=e.id),e in t.timers&&delete t.timers[e])},t.setInterval=function(e,n){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,2),delay:n,interval:n})},t.clearInterval=function(e){t.clearTimeout(e)},t.setImmediate=function(e){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,1),immediate:!0})},t.clearImmediate=function(e){t.clearTimeout(e)},t.tick=function(e){e="number"==typeof e?e:parseTime(e);for(var n,r=t.now,i=t.now+e,o=t.now,s=firstTimerInRange(t,r,i);s&&i>=r;){if(t.timers[s.id]){r=t.now=s.callAt;try{callTimer(t,s)}catch(a){n=n||a}}s=firstTimerInRange(t,o,i),o=r}if(t.now=i,n)throw n;return t.now},t.reset=function(){t.timers={}},t};exports.install=function(e,t,n){"number"==typeof e&&(n=t,t=e,e=null),e||(e=global);var r=createClock(t);r.uninstall=function(){uninstall(r,e)},r.methods=n||[],0===r.methods.length&&(r.methods=keys(timers));for(var i=0,o=r.methods.length;o>i;i++)hijackMethod(e,r.methods[i],r);return r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})}();var define,sinon=function(){"use strict";function e(e,n,r){t=r.exports=e("./sinon/util/core"),e("./sinon/extend"),e("./sinon/typeOf"),e("./sinon/times_in_words"),e("./sinon/spy"),e("./sinon/call"),e("./sinon/behavior"),e("./sinon/stub"),e("./sinon/mock"),e("./sinon/collection"),e("./sinon/assert"),e("./sinon/sandbox"),e("./sinon/test"),e("./sinon/test_case"),e("./sinon/match"),e("./sinon/format"),e("./sinon/log_error")}var t,n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;return r?define(e):n?(e(require,module.exports,module),t=module.exports):t={},t}();if(function(e){function t(e){var t=!1;try{e.appendChild(l),t=l.parentNode==e}catch(n){return!1}finally{try{e.removeChild(l)}catch(n){}}return t}function n(e){return l&&e&&1===e.nodeType&&t(e)}function r(e){return"function"==typeof e||!!(e&&e.constructor&&e.call&&e.apply)}function i(e){return"number"==typeof e&&isNaN(e)}function o(e,t){for(var n in t)c.call(e,n)||(e[n]=t[n])}function s(e){return"function"==typeof e&&"function"==typeof e.restore&&e.restore.sinon}function a(e){return e.wrapMethod=function(e,t,n){if(!e)throw new TypeError("Should wrap property of object");if("function"!=typeof n)throw new TypeError("Method wrapper should be function");var i,s=e[t];if(r(s)){if(s.restore&&s.restore.sinon)i=new TypeError("Attempted to wrap "+t+" which is already wrapped");else if(s.calledBefore){var a=s.returns?"stubbed":"spied on";i=new TypeError("Attempted to wrap "+t+" which is already "+a)}}else i=new TypeError("Attempted to wrap "+typeof s+" property "+t+" as function");if(i)throw s&&s.stackTrace&&(i.stack+="\n--------------\n"+s.stackTrace),i;var u=e.hasOwnProperty?e.hasOwnProperty(t):c.call(e,t);return e[t]=n,n.displayName=t,n.stackTrace=new Error("Stack Trace for original").stack,n.restore=function(){u||delete e[t],e[t]===n&&(e[t]=s)},n.restore.sinon=!0,o(n,s),n},e.create=function(e){var t=function(){};return t.prototype=e,new t},e.deepEqual=function t(r,o){if(e.match&&e.match.isMatcher(r))return r.test(o);if("object"!=typeof r||"object"!=typeof o)return i(r)&&i(o)?!0:r===o;if(n(r)||n(o))return r===o;if(r===o)return!0;if(null===r&&null!==o||null!==r&&null===o)return!1;if(r instanceof RegExp&&o instanceof RegExp)return r.source===o.source&&r.global===o.global&&r.ignoreCase===o.ignoreCase&&r.multiline===o.multiline;var s=Object.prototype.toString.call(r);if(s!=Object.prototype.toString.call(o))return!1;if("[object Date]"==s)return r.valueOf()===o.valueOf();var a,u=0,l=0;if("[object Array]"==s&&r.length!==o.length)return!1;for(a in r){if(u+=1,!(a in o))return!1;if(!t(r[a],o[a]))return!1}for(a in o)l+=1;return u==l},e.functionName=function(e){var t=e.displayName||e.name;if(!t){var n=e.toString().match(/function ([^\s\(]+)/);t=n&&n[1]}return t},e.functionToString=function(){if(this.getCall&&this.callCount)for(var e,t,n=this.callCount;n--;){e=this.getCall(n).thisValue;for(t in e)if(e[t]===this)return t}return this.displayName||"sinon fake"},e.getConfig=function(t){var n={};t=t||{};var r=e.defaultConfig;for(var i in r)r.hasOwnProperty(i)&&(n[i]=t.hasOwnProperty(i)?t[i]:r[i]);return n},e.defaultConfig={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0},e.timesInWords=function(e){return 1==e&&"once"||2==e&&"twice"||3==e&&"thrice"||(e||0)+" times"},e.calledInOrder=function(e){for(var t=1,n=e.length;n>t;t++)if(!e[t-1].calledBefore(e[t])||!e[t].called)return!1;return!0},e.orderByFirstCall=function(e){return e.sort(function(e,t){var n=e.getCall(0),r=t.getCall(0),i=n&&n.callId||-1,o=r&&r.callId||-1;return o>i?-1:1})},e.createStubInstance=function(t){if("function"!=typeof t)throw new TypeError("The constructor should be a function.");return e.stub(e.create(t.prototype))},e.restore=function(e){if(null!==e&&"object"==typeof e)for(var t in e)s(e[t])&&e[t].restore();else s(e)&&e.restore()},e}function u(e,t){a(t)}var l="undefined"!=typeof document&&document.createElement("div"),c=Object.prototype.hasOwnProperty,f="undefined"!=typeof module&&module.exports&&"function"==typeof require,d="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(d)define(u);else if(f)u(require,module.exports);else{if(!e)return;a(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){function t(e){var t,r,i,o=Array.prototype.slice.call(arguments,1);for(r=0;rt;t+=1)if(!e.deepEqual(arguments[t],this.args[t]))return!1;return!0},calledWithMatch:function(){for(var t=0,n=arguments.length;n>t;t+=1){var r=this.args[t],i=arguments[t];if(!e.match||!e.match(i).test(r))return!1}return!0},calledWithExactly:function(){return arguments.length==this.args.length&&this.calledWith.apply(this,arguments)},notCalledWith:function(){return!this.calledWith.apply(this,arguments)},notCalledWithMatch:function(){return!this.calledWithMatch.apply(this,arguments)},returned:function(t){return e.deepEqual(t,this.returnValue)},threw:function(e){return"undefined"!=typeof e&&this.exception?this.exception===e||this.exception.name===e:!!this.exception},calledWithNew:function(){return this.proxy.prototype&&this.thisValue instanceof this.proxy},calledBefore:function(e){return this.callIde.callId},callArg:function(e){this.args[e]()},callArgOn:function(e,t){this.args[e].apply(t)},callArgWith:function(e){this.callArgOnWith.apply(this,[e,null].concat(r.call(arguments,1)))},callArgOnWith:function(e,t){var n=r.call(arguments,2);this.args[e].apply(t,n)},"yield":function(){this.yieldOn.apply(this,[null].concat(r.call(arguments,0)))},yieldOn:function(e){for(var n=this.args,i=0,o=n.length;o>i;++i)if("function"==typeof n[i])return void n[i].apply(e,r.call(arguments,1));t(this.proxy," cannot yield since no callback was passed.",n)},yieldTo:function(e){this.yieldToOn.apply(this,[e,null].concat(r.call(arguments,1)))},yieldToOn:function(e,n){for(var i=this.args,o=0,s=i.length;s>o;++o)if(i[o]&&"function"==typeof i[o][e])return void i[o][e].apply(n,r.call(arguments,2));t(this.proxy," cannot yield to '"+e+"' since no callback was passed.",i)},toString:function(){for(var t=this.proxy.toString()+"(",n=[],r=0,i=this.args.length;i>r;++r)n.push(e.format(this.args[r]));return t=t+n.join(", ")+")","undefined"!=typeof this.returnValue&&(t+=" => "+e.format(this.returnValue)),this.exception&&(t+=" !"+this.exception.name,this.exception.message&&(t+="("+this.exception.message+")")),t}};return i.invokeCallback=i.yield,n.toString=i.toString,e.spyCall=n,n}function n(e,n,r){var i=e("./util/core");e("./match"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(sinon){function makeApi(sinon){function spy(e,t){if(!t&&"function"==typeof e)return spy.create(e);if(!e&&!t)return spy.create(function(){});var n=e[t];return sinon.wrapMethod(e,t,spy.create(n))}function matchingFake(e,t,n){if(e)for(var r=0,i=e.length;i>r;r++)if(e[r].matches(t,n))return e[r]}function incrementCallCount(){this.called=!0,this.callCount+=1,this.notCalled=!1,this.calledOnce=1==this.callCount,this.calledTwice=2==this.callCount,this.calledThrice=3==this.callCount}function createCallProperties(){this.firstCall=this.getCall(0),this.secondCall=this.getCall(1),this.thirdCall=this.getCall(2),this.lastCall=this.getCall(this.callCount-1)}function createProxy(func){var p;return func.length?eval("p = (function proxy("+vars.substring(0,2*func.length-1)+") { return p.invoke(func, this, slice.call(arguments)); });"):p=function(){return p.invoke(func,this,slice.call(arguments))},p}function delegateToCalls(e,t,n,r){spyApi[e]=function(){if(!this.called)return r?r.apply(this,arguments):!1;for(var i,o=0,s=0,a=this.callCount;a>s;s+=1)if(i=this.getCall(s),i[n||e].apply(i,arguments)&&(o+=1,t))return!0;return o===this.callCount}}var push=Array.prototype.push,slice=Array.prototype.slice,callId=0,vars="a,b,c,d,e,f,g,h,i,j,k,l",uuid=0,spyApi={reset:function(){if(this.invoking){var e=new Error("Cannot reset Sinon function while invoking it. Move the call to .reset outside of the callback.");throw e.name="InvalidResetException",e}if(this.called=!1,this.notCalled=!0,this.calledOnce=!1,this.calledTwice=!1,this.calledThrice=!1,this.callCount=0,this.firstCall=null,this.secondCall=null,this.thirdCall=null,this.lastCall=null,this.args=[],this.returnValues=[],this.thisValues=[],this.exceptions=[],this.callIds=[],this.fakes)for(var t=0;te||e>=this.callCount?null:sinon.spyCall(this,this.thisValues[e],this.args[e],this.returnValues[e],this.exceptions[e],this.callIds[e])},getCalls:function(){var e,t=[];for(e=0;ee.callIds[e.callCount-1]:!1},withArgs:function(){var e=slice.call(arguments);if(this.fakes){var t=matchingFake(this.fakes,e,!0);if(t)return t}else this.fakes=[];var n=this,r=this.instantiateFake();r.matchingAguments=e,r.parent=this,push.call(this.fakes,r),r.withArgs=function(){return n.withArgs.apply(n,arguments)};for(var i=0;in;++n){var i=" "+e.getCall(n).toString();/\n/.test(t[n-1])&&(i="\n"+i),push.call(t,i)}return t.length>0?"\n"+t.join("\n"):""},t:function(e){for(var t=[],n=0,r=e.callCount;r>n;++n)push.call(t,sinon.format(e.thisValues[n]));return t.join(", ")},"*":function(e,t){for(var n=[],r=0,i=t.length;i>r;++r)push.call(n,sinon.format(t[r]));return n.join(", ")}},sinon.extend(spy,spyApi),spy.spyCall=sinon.spyCall,sinon.spy=spy,spy}function loadDependencies(e,t,n){var r=e("./util/core");e("./call"),n.exports=makeApi(r)}var isNode="undefined"!=typeof module&&module.exports&&"function"==typeof require,isAMD="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(isAMD)define(loadDependencies);else if(isNode)loadDependencies(require,module.exports,module); -else{if(!sinon)return;makeApi(sinon)}}("object"==typeof sinon&&sinon||null),function(e){function t(e,t){return"string"==typeof e?(this.exception=new Error(t||""),this.exception.name=e):this.exception=e?e:new Error("Error"),this}function n(e,t){var n=e.callArgAt;if(0>n){for(var r=e.callArgProp,i=0,o=t.length;o>i;++i){if(!r&&"function"==typeof t[i])return t[i];if(r&&t[i]&&"function"==typeof t[i][r])return t[i][r]}return null}return t[n]}function r(e){function r(t,n,r){if(t.callArgAt<0){var i;return i=t.callArgProp?e.functionName(t.stub)+" expected to yield to '"+t.callArgProp+"', but no object with such a property was passed.":e.functionName(t.stub)+" expected to yield, but no callback was passed.",r.length>0&&(i+=" Received ["+s.call(r,", ")+"]"),i}return"argument at index "+t.callArgAt+" is not a function: "+n}function i(e,t){if("number"==typeof e.callArgAt){var i=n(e,t);if("function"!=typeof i)throw new TypeError(r(e,i,t));e.callbackAsync?a(function(){i.apply(e.callbackContext,e.callbackArguments)}):i.apply(e.callbackContext,e.callbackArguments)}}var u={create:function(t){var n=e.extend({},e.behavior);return delete n.create,n.stub=t,n},isPresent:function(){return"number"==typeof this.callArgAt||this.exception||"number"==typeof this.returnArgAt||this.returnThis||this.returnValueDefined},invoke:function(e,t){if(i(this,t),this.exception)throw this.exception;return"number"==typeof this.returnArgAt?t[this.returnArgAt]:this.returnThis?e:this.returnValue},onCall:function(e){return this.stub.onCall(e)},onFirstCall:function(){return this.stub.onFirstCall()},onSecondCall:function(){return this.stub.onSecondCall()},onThirdCall:function(){return this.stub.onThirdCall()},withArgs:function(){throw new Error('Defining a stub by invoking "stub.onCall(...).withArgs(...)" is not supported. Use "stub.withArgs(...).onCall(...)" to define sequential behavior for calls with certain arguments.')},callsArg:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.callArgAt=e,this.callbackArguments=[],this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgOn:function(e,t){if("number"!=typeof e)throw new TypeError("argument index is not number");if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=e,this.callbackArguments=[],this.callbackContext=t,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgWith:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.callArgAt=e,this.callbackArguments=o.call(arguments,1),this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgOnWith:function(e,t){if("number"!=typeof e)throw new TypeError("argument index is not number");if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=e,this.callbackArguments=o.call(arguments,2),this.callbackContext=t,this.callArgProp=void 0,this.callbackAsync=!1,this},yields:function(){return this.callArgAt=-1,this.callbackArguments=o.call(arguments,0),this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},yieldsOn:function(e){if("object"!=typeof e)throw new TypeError("argument context is not an object");return this.callArgAt=-1,this.callbackArguments=o.call(arguments,1),this.callbackContext=e,this.callArgProp=void 0,this.callbackAsync=!1,this},yieldsTo:function(e){return this.callArgAt=-1,this.callbackArguments=o.call(arguments,1),this.callbackContext=void 0,this.callArgProp=e,this.callbackAsync=!1,this},yieldsToOn:function(e,t){if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=-1,this.callbackArguments=o.call(arguments,2),this.callbackContext=t,this.callArgProp=e,this.callbackAsync=!1,this},"throws":t,throwsException:t,returns:function(e){return this.returnValue=e,this.returnValueDefined=!0,this},returnsArg:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.returnArgAt=e,this},returnsThis:function(){return this.returnThis=!0,this}};for(var l in u)u.hasOwnProperty(l)&&l.match(/^(callsArg|yields)/)&&!l.match(/Async/)&&(u[l+"Async"]=function(e){return function(){var t=this[e].apply(this,arguments);return this.callbackAsync=!0,t}}(l));return e.behavior=u,u}function i(e,t,n){var i=e("./util/core");n.exports=r(i)}var o=Array.prototype.slice,s=Array.prototype.join,a=function(){return"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:"function"==typeof setImmediate?setImmediate:function(e){setTimeout(e,0)}}(),u="undefined"!=typeof module&&module.exports&&"function"==typeof require,l="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(l)define(i);else if(u)i(require,module.exports,module);else{if(!e)return;r(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){function t(n,r,i){if(i&&"function"!=typeof i)throw new TypeError("Custom stub should be function");var o;if(o=i?e.spy&&e.spy.create?e.spy.create(i):i:t.create(),!n&&"undefined"==typeof r)return e.stub.create();if("undefined"==typeof r&&"object"==typeof n){for(var s in n)"function"==typeof n[s]&&t(n,s);return n}return e.wrapMethod(n,r,o)}function n(t){return t.defaultBehavior||r(t)||e.behavior.create(t)}function r(e){return e.parent&&i(e.parent)}function i(e){var t=e.behaviors[e.callCount-1];return t&&t.isPresent()?t:n(e)}var o=0,s={create:function(){var n=function(){return i(n).invoke(this,arguments)};n.id="stub#"+o++;var r=n;return n=e.spy.create(n),n.func=r,e.extend(n,t),n.instantiateFake=e.stub.create,n.displayName="stub",n.toString=e.functionToString,n.defaultBehavior=null,n.behaviors=[],n},resetBehavior:function(){var e;if(this.defaultBehavior=null,this.behaviors=[],delete this.returnValue,delete this.returnArgAt,this.returnThis=!1,this.fakes)for(e=0;en;n+=1)t(e[n])}function r(e){return 0==e?"never called":"called "+c(e)}function i(e){var t=e.minCalls,n=e.maxCalls;if("number"==typeof t&&"number"==typeof n){var r=c(t);return t!=n&&(r="at least "+r+" and at most "+c(n)),r}return"number"==typeof t?"at least "+c(t):"at most "+c(n)}function o(e){var t="number"==typeof e.minCalls;return!t||e.callCount>=e.minCalls}function s(e){return"number"!=typeof e.maxCalls?!1:e.callCount==e.maxCalls}function a(e,t){return l&&l.isMatcher(e)?e.test(t):!0}var u=[].push,l=e.match;e.extend(t,{create:function(n){if(!n)throw new TypeError("object is null");var r=e.extend({},t);return r.object=n,delete r.create,r},expects:function(t){if(!t)throw new TypeError("method is falsy");if(this.expectations||(this.expectations={},this.proxies=[]),!this.expectations[t]){this.expectations[t]=[];var n=this;e.wrapMethod(this.object,t,function(){return n.invokeMethod(t,this,arguments)}),u.call(this.proxies,t)}var r=e.expectation.create(t);return u.call(this.expectations[t],r),r},restore:function(){var e=this.object;n(this.proxies,function(t){"function"==typeof e[t].restore&&e[t].restore()})},verify:function(){var t=this.expectations||{},r=[],i=[];return n(this.proxies,function(e){n(t[e],function(e){e.met()?u.call(i,e.toString()):u.call(r,e.toString())})}),this.restore(),r.length>0?e.expectation.fail(r.concat(i).join("\n")):i.length>0&&e.expectation.pass(r.concat(i).join("\n")),!0},invokeMethod:function(t,n,r){var i,o=this.expectations&&this.expectations[t],s=o&&o.length||0;for(i=0;s>i;i+=1)if(!o[i].met()&&o[i].allowsCall(n,r))return o[i].apply(n,r);var a,l=[],c=0;for(i=0;s>i;i+=1)o[i].allowsCall(n,r)?a=a||o[i]:c+=1,u.call(l," "+o[i].toString());return 0===c?a.apply(n,r):(l.unshift("Unexpected call: "+e.spyCall.toString.call({proxy:t,args:r})),void e.expectation.fail(l.join("\n")))}});var c=e.timesInWords,f=Array.prototype.slice;return e.expectation={minCalls:1,maxCalls:1,create:function(t){var n=e.extend(e.stub.create(),e.expectation);return delete n.create,n.method=t,n},invoke:function(t,n,r){return this.verifyCallAllowed(n,r),e.spy.invoke.apply(this,arguments)},atLeast:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not number");return this.limitsSet||(this.maxCalls=null,this.limitsSet=!0),this.minCalls=e,this},atMost:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not number");return this.limitsSet||(this.minCalls=null,this.limitsSet=!0),this.maxCalls=e,this},never:function(){return this.exactly(0)},once:function(){return this.exactly(1)},twice:function(){return this.exactly(2)},thrice:function(){return this.exactly(3)},exactly:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not a number");return this.atLeast(e),this.atMost(e)},met:function(){return!this.failed&&o(this)},verifyCallAllowed:function(t,n){if(s(this)&&(this.failed=!0,e.expectation.fail(this.method+" already called "+c(this.maxCalls))),"expectedThis"in this&&this.expectedThis!==t&&e.expectation.fail(this.method+" called with "+t+" as thisValue, expected "+this.expectedThis),"expectedArguments"in this){n||e.expectation.fail(this.method+" received no arguments, expected "+e.format(this.expectedArguments)),n.lengthr;r+=1)a(this.expectedArguments[r],n[r])||e.expectation.fail(this.method+" received wrong arguments "+e.format(n)+", didn't match "+this.expectedArguments.toString()),e.deepEqual(this.expectedArguments[r],n[r])||e.expectation.fail(this.method+" received wrong arguments "+e.format(n)+", expected "+e.format(this.expectedArguments))}},allowsCall:function(t,n){if(this.met()&&s(this))return!1;if("expectedThis"in this&&this.expectedThis!==t)return!1;if(!("expectedArguments"in this))return!0;if(n=n||[],n.lengthr;r+=1){if(!a(this.expectedArguments[r],n[r]))return!1;if(!e.deepEqual(this.expectedArguments[r],n[r]))return!1}return!0},withArgs:function(){return this.expectedArguments=f.call(arguments),this},withExactArgs:function(){return this.withArgs.apply(this,arguments),this.expectsExactArgCount=!0,this},on:function(e){return this.expectedThis=e,this},toString:function(){var t=(this.expectedArguments||[]).slice();this.expectsExactArgCount||u.call(t,"[...]");var n=e.spyCall.toString.call({proxy:this.method||"anonymous mock expectation",args:t}),o=n.replace(", [...","[, ...")+" "+i(this);return this.met()?"Expectation met: "+o:"Expected "+o+" ("+r(this.callCount)+")"},verify:function(){return this.met()?e.expectation.pass(this.toString()):e.expectation.fail(this.toString()),!0},pass:function(t){e.assert.pass(t)},fail:function(e){var t=new Error(e);throw t.name="ExpectationError",t}},e.mock=t,t}function n(e,n,r){var i=e("./util/core");e("./call"),e("./match"),e("./spy"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){return e.fakes||(e.fakes=[]),e.fakes}function n(e,n){for(var r=t(e),i=0,o=r.length;o>i;i+=1)"function"==typeof r[i][n]&&r[i][n]()}function r(e){for(var n=t(e),r=0;rr;++r)if(n[r]==t)return n.splice(r,1)},dispatchEvent:function(e){for(var t=e.type,n=this.eventListeners&&this.eventListeners[t]||[],r=0;r=0;o--)e(i[o]);"function"==typeof t.onCreate&&t.onCreate(this)}function n(){this.eventListeners={progress:[],load:[],abort:[],error:[]}}function r(e){if(e.readyState!==t.OPENED)throw new Error("INVALID_STATE_ERR");if(e.sendFlag)throw new Error("INVALID_STATE_ERR")}function i(e,t){t=t.toLowerCase();for(var n in e)if(n.toLowerCase()==t)return n;return null}function o(e,t){if(e)for(var n=0,r=e.length;r>n;n+=1)t(e[n])}function s(e,t){for(var n=0;nt.UNSENT&&this.sendFlag&&(this.readyStateChange(t.DONE),this.sendFlag=!1),this.readyState=t.UNSENT,this.dispatchEvent(new n.Event("abort",!1,!1,this)),this.upload.dispatchEvent(new n.Event("abort",!1,!1,this)),"function"==typeof this.onerror&&this.onerror()},getResponseHeader:function(e){return this.readyStater;++r)if(n[r]==t)return n.splice(r,1)},n.prototype.dispatchEvent=function(e){for(var t,n=this.eventListeners[e.type]||[],r=0;null!=(t=n[r]);r++)t(e)};var g=function(e,t,n){switch(n.length){case 0:return e[t]();case 1:return e[t](n[0]);case 2:return e[t](n[0],n[1]);case 3:return e[t](n[0],n[1],n[2]);case 4:return e[t](n[0],n[1],n[2],n[3]);case 5:return e[t](n[0],n[1],n[2],n[3],n[4])}};t.filters=[],t.addFilter=function(e){this.filters.push(e)};var v=/MSIE 6/;t.defake=function(e,n){var r=new m.workingXHR;o(["open","setRequestHeader","send","abort","getResponseHeader","getAllResponseHeaders","addEventListener","overrideMimeType","removeEventListener"],function(t){e[t]=function(){return g(r,t,arguments)}});var i=function(t){o(t,function(t){try{e[t]=r[t]}catch(n){if(!v.test(navigator.userAgent))throw n}})},s=function(){e.readyState=r.readyState,r.readyState>=t.HEADERS_RECEIVED&&i(["status","statusText"]),r.readyState>=t.LOADING&&i(["responseText","response"]),r.readyState===t.DONE&&i(["responseXML"]),e.onreadystatechange&&e.onreadystatechange.call(e,{target:e})};if(r.addEventListener){for(var a in e.eventListeners)e.eventListeners.hasOwnProperty(a)&&o(e.eventListeners[a],function(e){r.addEventListener(a,e)});r.addEventListener("readystatechange",s)}else r.onreadystatechange=s;g(r,"open",n)},t.useFilters=!1,t.parseXML=function(e){var t;if("undefined"!=typeof DOMParser){var n=new DOMParser;t=n.parseFromString(e,"text/xml")}else t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},t.statusCodes={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Multiple Choice",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};var w="undefined"!=typeof module&&module.exports&&"function"==typeof require,b="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(b)define(d);else if(w)d(require,module.exports,module);else{if("undefined"==typeof sinon)return;f(sinon)}}("undefined"!=typeof self?self:this),"undefined"==typeof sinon)var sinon={};return function(){function e(){}function t(t){return e.prototype=t,new e}function n(e){var t=e;if("[object Array]"!=Object.prototype.toString.call(e)&&(t=[200,{},e]),"string"!=typeof t[2])throw new TypeError("Fake server response body should be string, but was "+typeof t[2]);return t}function r(e,t,n){var r=e.method,i=!r||r.toLowerCase()==t.toLowerCase(),o=e.url,s=!o||o==n||"function"==typeof o.test&&o.test(n);return i&&s}function i(e,t){var n=t.url;if((!/^https?:\/\//.test(n)||l.test(n))&&(n=n.replace(l,"")),r(e,this.getHTTPMethod(t),n)){if("function"==typeof e.response){var i=e.url,o=[t].concat(i&&"function"==typeof i.exec?i.exec(n).slice(1):[]);return e.response.apply(e,o)}return!0}return!1}function o(e){e.fakeServer={create:function(){var n=t(this);return this.xhr=e.useFakeXMLHttpRequest(),n.requests=[],this.xhr.onCreate=function(e){n.addRequest(e)},n},addRequest:function(e){var t=this;a.call(this.requests,e),e.onSend=function(){t.handleRequest(this),t.autoRespond&&!t.responding&&(setTimeout(function(){t.responding=!1,t.respond()},t.autoRespondAfter||10),t.responding=!0)}},getHTTPMethod:function(e){if(this.fakeHTTPMethods&&/post/i.test(e.method)){var t=(e.requestBody||"").match(/_method=([^\b;]+)/);return t?t[1]:e.method}return e.method},handleRequest:function(e){e.async?(this.queue||(this.queue=[]),a.call(this.queue,e)):this.processRequest(e)},log:function(t,n){var r;r="Request:\n"+e.format(n)+"\n\n",r+="Response:\n"+e.format(t)+"\n\n",e.log(r)},respondWith:function(e,t,r){return 1==arguments.length&&"function"!=typeof e?void(this.response=n(e)):(this.responses||(this.responses=[]),1==arguments.length&&(r=e,t=e=null),2==arguments.length&&(r=t,t=e,e=null),void a.call(this.responses,{method:e,url:t,response:"function"==typeof r?r:n(r)}))},respond:function(){arguments.length>0&&this.respondWith.apply(this,arguments);for(var e,t=this.queue||[],n=t.splice(0,t.length);e=n.shift();)this.processRequest(e)},processRequest:function(t){try{if(t.aborted)return;var n=this.response||[404,{},""];if(this.responses)for(var r=this.responses.length,o=r-1;o>=0;o--)if(i.call(this,this.responses[o],t)){n=this.responses[o].response;break}4!=t.readyState&&(this.log(n,t),t.respond(n[0],n[1],n[2]))}catch(s){e.logError("Fake server request processing",s)}},restore:function(){return this.xhr.restore&&this.xhr.restore.apply(this.xhr,arguments)}}}function s(e,t,n){var r=e("./core");e("./fake_xml_http_request"),o(r),n.exports=r}var a=[].push,u="undefined"!=typeof window?window.location:{},l=new RegExp("^"+u.protocol+"//"+u.host),c="undefined"!=typeof module&&module.exports&&"function"==typeof require,f="function"==typeof define&&"object"==typeof define.amd&&define.amd;f?define(s):c?s(require,module.exports,module):o(sinon)}(),function(){function e(e){function t(){}t.prototype=e.fakeServer,e.fakeServerWithClock=new t,e.fakeServerWithClock.addRequest=function(t){if(t.async&&("object"==typeof setTimeout.clock?this.clock=setTimeout.clock:(this.clock=e.useFakeTimers(),this.resetClock=!0),!this.longestTimeout)){var n=this.clock.setTimeout,r=this.clock.setInterval,i=this;this.clock.setTimeout=function(e,t){return i.longestTimeout=Math.max(t,i.longestTimeout||0),n.apply(this,arguments)},this.clock.setInterval=function(e,t){return i.longestTimeout=Math.max(t,i.longestTimeout||0),r.apply(this,arguments)}}return e.fakeServer.addRequest.call(this,t)},e.fakeServerWithClock.respond=function(){var t=e.fakeServer.respond.apply(this,arguments);return this.clock&&(this.clock.tick(this.longestTimeout||0),this.longestTimeout=0,this.resetClock&&(this.clock.restore(),this.resetClock=!1)),t},e.fakeServerWithClock.restore=function(){return this.clock&&this.clock.restore(),e.fakeServer.restore.apply(this,arguments)}}function t(t){var n=t("./core");t("./fake_server"),t("./fake_timers"),e(n)}var n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;r?define(t):n?t(require):e(sinon)}(),function(){function e(e){function t(e,t,n,i){i&&(!t.injectInto||n in t.injectInto?r.call(e.args,i):(t.injectInto[n]=i,e.injectedKeys.push(n)))}function n(t){var n=e.create(e.sandbox);return t.useFakeServer&&("object"==typeof t.useFakeServer&&(n.serverPrototype=t.useFakeServer),n.useFakeServer()),t.useFakeTimers&&("object"==typeof t.useFakeTimers?n.useFakeTimers.apply(n,t.useFakeTimers):n.useFakeTimers()),n}var r=[].push;return e.sandbox=e.extend(e.create(e.collection),{useFakeTimers:function(){return this.clock=e.useFakeTimers.apply(e,arguments),this.add(this.clock)},serverPrototype:e.fakeServer,useFakeServer:function(){var t=this.serverPrototype||e.fakeServer;return t&&t.create?(this.server=t.create(),this.add(this.server)):null},inject:function(t){return e.collection.inject.call(this,t),this.clock&&(t.clock=this.clock),this.server&&(t.server=this.server,t.requests=this.server.requests),t.match=e.match,t},restore:function(){e.collection.restore.apply(this,arguments),this.restoreContext()},restoreContext:function(){if(this.injectedKeys){for(var e=0,t=this.injectedKeys.length;t>e;e++)delete this.injectInto[this.injectedKeys[e]];this.injectedKeys=[]}},create:function(r){if(!r)return e.create(e.sandbox);var i=n(r);i.args=i.args||[],i.injectedKeys=[],i.injectInto=r.injectInto;var o,s,a=i.inject({});if(r.properties)for(var u=0,l=r.properties.length;l>u;u++)o=r.properties[u],s=a[o]||"sandbox"==o&&i,t(i,r,o,s);else t(i,r,"sandbox",s);return i},match:e.match}),e.sandbox.useFakeXMLHttpRequest=e.sandbox.useFakeServer,e.sandbox}function t(t,n,r){var i=t("./util/core");t("./util/fake_server"),t("./util/fake_timers"),t("./collection"),r.exports=e(i)}var n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(r)define(t);else if(n)t(require,module.exports,module);else{if(!sinon)return; -e(sinon)}}(),function(e){function t(e){function t(t){function n(){var n=e.getConfig(e.config);n.injectInto=n.injectIntoThis&&this||n.injectInto;var r,i,o=e.sandbox.create(n),s=!1,a=Array.prototype.slice.call(arguments);if(a.length>0&&"function"==typeof a[arguments.length-1]){var u=a[arguments.length-1];a[arguments.length-1]=function(e){if(e)throw o.restore(),r;o.verifyAndRestore(),u(e)},s=!0}var l=a.concat(o.args);try{i=t.apply(this,l)}catch(c){r=c}if(!s){if("undefined"!=typeof r)throw o.restore(),r;o.verifyAndRestore()}return i}var r=typeof t;if("function"!=r)throw new TypeError("sinon.test needs to wrap a test function, got "+r);return t.length?function(){return n.apply(this,arguments)}:n}return t.config={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0},e.test=t,t}function n(e,n,r){var i=e("./util/core");e("./sandbox"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e,t,n){return function(){t&&t.apply(this,arguments);var r,i;try{i=e.apply(this,arguments)}catch(o){r=o}if(n&&n.apply(this,arguments),r)throw r;return i}}function n(e){function n(n,r){if(!n||"object"!=typeof n)throw new TypeError("sinon.testCase needs an object with test functions");r=r||"test";var i,o,s,a=new RegExp("^"+r),u={},l=n.setUp,c=n.tearDown;for(i in n)if(n.hasOwnProperty(i)){if(o=n[i],/^(setUp|tearDown)$/.test(i))continue;"function"==typeof o&&a.test(i)?(s=o,(l||c)&&(s=t(o,l,c)),u[i]=e.test(s)):u[i]=n[i]}return u}return e.testCase=n,n}function r(e,t,r){var i=e("./util/core");e("./test"),r.exports=n(i)}var i="undefined"!=typeof module&&module.exports&&"function"==typeof require,o="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(o)define(r);else if(i)r(require,module.exports,module);else{if(!e)return;n(e)}}("object"==typeof sinon&&sinon||null),function(e,t){function n(e){function n(){for(var e,t=0,n=arguments.length;n>t;++t)e=arguments[t],e||a.fail("fake is not a spy"),"function"!=typeof e&&a.fail(e+" is not a function"),"function"!=typeof e.getCall&&a.fail(e+" is not stubbed")}function r(e,n){e=e||t;var r=e.fail||a.fail;r.call(e,n)}function o(e,t,o){2==arguments.length&&(o=t,t=e),a[e]=function(s){n(s);var u=i.call(arguments,1),l=!1;l="function"==typeof t?!t(s):"function"==typeof s[t]?!s[t].apply(s,u):!s[t],l?r(this,s.printf.apply(s,[o].concat(u))):a.pass(e)}}function s(e,t){return!e||/^fail/.test(t)?t:e+t.slice(0,1).toUpperCase()+t.slice(1)}var a;return a={failException:"AssertError",fail:function(e){var t=new Error(e);throw t.name=this.failException||a.failException,t},pass:function(){},callOrder:function(){n.apply(null,arguments);var t="",o="";if(e.calledInOrder(arguments))a.pass("callOrder");else{try{t=[].join.call(arguments,", ");for(var s=i.call(arguments),u=s.length;u;)s[--u].called||s.splice(u,1);o=e.orderByFirstCall(s).join(", ")}catch(l){}r(this,"expected "+t+" to be called in order but were called as "+o)}},callCount:function(t,i){if(n(t),t.callCount!=i){var o="expected %n to be called "+e.timesInWords(i)+" but was called %c%C";r(this,t.printf(o))}else a.pass("callCount")},expose:function(e,t){if(!e)throw new TypeError("target is null or undefined");var n=t||{},r="undefined"==typeof n.prefix&&"assert"||n.prefix,i="undefined"==typeof n.includeFail||!!n.includeFail;for(var o in this)"expose"==o||!i&&/^(fail)/.test(o)||(e[s(r,o)]=this[o]);return e},match:function(t,n){var i=e.match(n);if(i.test(t))a.pass("match");else{var o=["expected value to match"," expected = "+e.format(n)," actual = "+e.format(t)];r(this,o.join("\n"))}}},o("called","expected %n to have been called at least once but was never called"),o("notCalled",function(e){return!e.called},"expected %n to not have been called but was called %c%C"),o("calledOnce","expected %n to be called once but was called %c%C"),o("calledTwice","expected %n to be called twice but was called %c%C"),o("calledThrice","expected %n to be called thrice but was called %c%C"),o("calledOn","expected %n to be called with %1 as this but was called with %t"),o("alwaysCalledOn","expected %n to always be called with %1 as this but was called with %t"),o("calledWithNew","expected %n to be called with new"),o("alwaysCalledWithNew","expected %n to always be called with new"),o("calledWith","expected %n to be called with arguments %*%C"),o("calledWithMatch","expected %n to be called with match %*%C"),o("alwaysCalledWith","expected %n to always be called with arguments %*%C"),o("alwaysCalledWithMatch","expected %n to always be called with match %*%C"),o("calledWithExactly","expected %n to be called with exact arguments %*%C"),o("alwaysCalledWithExactly","expected %n to always be called with exact arguments %*%C"),o("neverCalledWith","expected %n to never be called with arguments %*%C"),o("neverCalledWithMatch","expected %n to never be called with match %*%C"),o("threw","%n did not throw exception%C"),o("alwaysThrew","%n did not always throw exception%C"),e.assert=a,a}function r(e,t,r){var i=e("./util/core");e("./match"),r.exports=n(i)}var i=Array.prototype.slice,o="undefined"!=typeof module&&module.exports&&"function"==typeof require,s="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(s)define(r);else if(o)r(require,module.exports,module);else{if(!e)return;n(e)}}("object"==typeof sinon&&sinon||null,"undefined"!=typeof window?window:"undefined"!=typeof self?self:global),"undefined"==typeof sinon&&(this.sinon={}),function(e){function t(t){function n(){this.readyState=n.UNSENT,this.requestBody=null,this.requestHeaders={},this.status=0,this.timeout=null,"function"==typeof n.onCreate&&n.onCreate(this)}function i(e){if(e.readyState!==n.OPENED)throw new Error("INVALID_STATE_ERR");if(e.sendFlag)throw new Error("INVALID_STATE_ERR")}function o(e){if(e.readyState==n.UNSENT)throw new Error("Request not sent");if(e.readyState==n.DONE)throw new Error("Request done")}function s(e){if("string"!=typeof e){var t=new Error("Attempted to respond to fake XDomainRequest with "+e+", which is not a string.");throw t.name="InvalidBodyException",t}}t.xdr=r,t.extend(n.prototype,t.EventTarget,{open:function(e,t){this.method=e,this.url=t,this.responseText=null,this.sendFlag=!1,this.readyStateChange(n.OPENED)},readyStateChange:function(e){this.readyState=e;var r="";switch(this.readyState){case n.UNSENT:break;case n.OPENED:break;case n.LOADING:this.sendFlag&&(r="onprogress");break;case n.DONE:r=this.isTimeout?"ontimeout":this.errorFlag||this.status<200||this.status>299?"onerror":"onload"}if(r&&"function"==typeof this[r])try{this[r]()}catch(i){t.logError("Fake XHR "+r+" handler",i)}},send:function(e){i(this),/^(get|head)$/i.test(this.method)||(this.requestBody=e),this.requestHeaders["Content-Type"]="text/plain;charset=utf-8",this.errorFlag=!1,this.sendFlag=!0,this.readyStateChange(n.OPENED),"function"==typeof this.onSend&&this.onSend(this)},abort:function(){this.aborted=!0,this.responseText=null,this.errorFlag=!0,this.readyState>t.FakeXDomainRequest.UNSENT&&this.sendFlag&&(this.readyStateChange(t.FakeXDomainRequest.DONE),this.sendFlag=!1)},setResponseBody:function(e){o(this),s(e);var t=this.chunkSize||10,r=0;this.responseText="";do this.readyStateChange(n.LOADING),this.responseText+=e.substring(r,r+t),r+=t;while(r=3?e[2]:this.actual};e.length>=2&&(r.expected=e[1]),e.length>=4&&(r.inspect=e.slice(3)),i(t,r)},stats:{assertions:{},total:{assertions:0}}}},function(t,e,r){function n(t){return this instanceof n?void(this.actual=t):new n(t)}function i(t){return t instanceof Boolean||t instanceof String||t instanceof Number?t.valueOf():t}var o=r(29),s=r(30);t.exports=n,n.prototype=Object.create(o,{constructor:{value:n,writable:!0,configurable:!0}}),n.AssertionError=s,Object.defineProperty(Object.prototype,"must",{get:function(){return new n(i(this))},set:function(t){Object.defineProperty(this,"must",{value:t,configurable:!0,enumrable:!0,writable:!0})},configurable:!0})},function(t,e,r){(function(n){/*! +/*! Unit.js v1.1.2 | (c) 2015 Nicolas Tallefourtane | http://unitjs.com/license.html */ +/*! Sinon.JS v1.12.2 | (c) 2015 Christian Johansen (christian@cjohansen.no) | https://github.com/cjohansen/Sinon.JS/blob/master/LICENSE */ +!function(e,t){"function"==typeof define&&define.amd?define([],function(){return e.sinon=t()}):"object"==typeof exports?module.exports=t():e.sinon=t()}(this,function(){var samsam,formatio;!function(){function define(e,t,n){"samsam"==e?samsam=t():"function"==typeof t&&0===e.length?lolex=t():"function"==typeof n&&(formatio=n(samsam))}define.amd={},("function"==typeof define&&define.amd&&function(e){define("samsam",e)}||"object"==typeof module&&function(e){module.exports=e()}||function(e){this.samsam=e()})(function(){function e(e){var t=e;return"number"==typeof e&&e!==t}function t(e){return f.toString.call(e).split(/[ \]]/)[1]}function n(e){if("Arguments"===t(e))return!0;if("object"!=typeof e||"number"!=typeof e.length||"Array"===t(e))return!1;if("function"==typeof e.callee)return!0;try{e[e.length]=6,delete e[e.length]}catch(n){return!0}return!1}function r(e){if(!e||1!==e.nodeType||!d)return!1;try{e.appendChild(d),e.removeChild(d)}catch(t){return!1}return!0}function i(e){var t,n=[];for(t in e)f.hasOwnProperty.call(e,t)&&n.push(t);return n}function o(e){return"function"==typeof e.getTime&&e.getTime()==e.valueOf()}function s(e){return 0===e&&1/e===-1/0}function a(t,n){return t===n||e(t)&&e(n)?0!==t||s(t)===s(n):void 0}function u(s,u){function l(e){return"object"!=typeof e||null===e||e instanceof Boolean||e instanceof Date||e instanceof Number||e instanceof RegExp||e instanceof String?!1:!0}function c(e,t){var n;for(n=0;nq;q++){if(j=k[q],!f.hasOwnProperty.call(u,j))return!1;if(R=s[j],D=u[j],N=l(R),I=l(D),P=N?c(d,R):-1,M=I?c(h,D):-1,L=-1!==P?p[P]:v+"["+JSON.stringify(j)+"]",F=-1!==M?y[M]:w+"["+JSON.stringify(j)+"]",m[L+F])return!0;if(-1===P&&N&&(d.push(R),p.push(L)),-1===M&&I&&(h.push(D),y.push(F)),N&&I&&(m[L+F]=!0),!g(R,D,L,F))return!1}return!0}(s,u,"$1","$2")}function l(e,t){if(0===t.length)return!0;var n,r,i,o;for(n=0,r=e.length;r>n;++n)if(c(e[n],t[0])){for(i=0,o=t.length;o>i;++i)if(!c(e[n+i],t[i]))return!1;return!0}return!1}var c,f=Object.prototype,d="undefined"!=typeof document&&document.createElement("div");return c=function h(e,n){if(n&&"function"==typeof n.test)return n.test(e);if("function"==typeof n)return n(e)===!0;if("string"==typeof n){n=n.toLowerCase();var r="string"==typeof e||!!e;return r&&String(e).toLowerCase().indexOf(n)>=0}if("number"==typeof n)return n===e;if("boolean"==typeof n)return n===e;if("undefined"==typeof n)return"undefined"==typeof e;if(null===n)return null===e;if("Array"===t(e)&&"Array"===t(n))return l(e,n);if(n&&"object"==typeof n){if(n===e)return!0;var i;for(i in n){var o=e[i];if("undefined"==typeof o&&"function"==typeof e.getAttribute&&(o=e.getAttribute(i)),null===n[i]||"undefined"==typeof n[i]){if(o!==n[i])return!1}else if("undefined"==typeof o||!h(o,n[i]))return!1}return!0}throw new Error("Matcher was not a string, a number, a function, a boolean or an object")},{isArguments:n,isElement:r,isDate:o,isNegZero:s,identical:a,deepEqual:u,match:c,keys:i}}),("function"==typeof define&&define.amd&&function(e){define("formatio",["samsam"],e)}||"object"==typeof module&&function(e){module.exports=e(require("samsam"))}||function(e){this.formatio=e(this.samsam)})(function(e){function t(e){if(!e)return"";if(e.displayName)return e.displayName;if(e.name)return e.name;var t=e.toString().match(/function\s+([^\(]+)/m);return t&&t[1]||""}function n(e,n){var r,i,o=t(n&&n.constructor),a=e.excludeConstructors||s.excludeConstructors||[];for(r=0,i=a.length;i>r;++r){if("string"==typeof a[r]&&a[r]===o)return"";if(a[r].test&&a[r].test(o))return""}return o}function r(e,t){if("object"!=typeof e)return!1;var n,r;for(n=0,r=t.length;r>n;++n)if(t[n]===e)return!0;return!1}function i(t,n,o,s){if("string"==typeof n){var u=t.quoteStrings,l="boolean"!=typeof u||u;return o||l?'"'+n+'"':n}if("function"==typeof n&&!(n instanceof RegExp))return i.func(n);if(o=o||[],r(n,o))return"[Circular]";if("[object Array]"===Object.prototype.toString.call(n))return i.array.call(t,n,o);if(!n)return String(1/n===-1/0?"-0":n);if(e.isElement(n))return i.element(n);if("function"==typeof n.toString&&n.toString!==Object.prototype.toString)return n.toString();var c,f;for(c=0,f=a.length;f>c;c++)if(n===a[c].object)return a[c].value;return i.object.call(t,n,o,s)}function o(e){for(var t in e)this[t]=e[t]}var s={excludeConstructors:["Object",/^.$/],quoteStrings:!0,limitChildrenCount:0},a=(Object.prototype.hasOwnProperty,[]);return"undefined"!=typeof global&&a.push({object:global,value:"[object global]"}),"undefined"!=typeof document&&a.push({object:document,value:"[object HTMLDocument]"}),"undefined"!=typeof window&&a.push({object:window,value:"[object Window]"}),i.func=function(e){return"function "+t(e)+"() {}"},i.array=function(e,t){t=t||[],t.push(e);var n,r,o=[];for(r=this.limitChildrenCount>0?Math.min(this.limitChildrenCount,e.length):e.length,n=0;r>n;++n)o.push(i(this,e[n],t));return r0?Math.min(this.limitChildrenCount,p.length):p.length,c=0;d>c;++c)a=p[c],l=t[a],u=r(l,o)?"[Circular]":i(this,l,o,s+2),u=(/\s/.test(a)?'"'+a+'"':a)+": "+u,y+=u.length,h.push(u);var m=n(this,t),g=m?"["+m+"] ":"",v="";for(c=0,f=s;f>c;++c)v+=" ";return d80?g+"{\n "+v+h.join(",\n "+v)+"\n"+v+"}":g+"{ "+h.join(", ")+" }"},i.element=function(e){var t,n,r,i,o,s=e.tagName.toLowerCase(),a=e.attributes,u=[];for(r=0,i=a.length;i>r;++r)t=a.item(r),n=t.nodeName.toLowerCase().replace("html:",""),o=t.nodeValue,("contenteditable"!==n||"inherit"!==o)&&o&&u.push(n+'="'+o+'"');var l="<"+s+(u.length>0?" ":""),c=e.innerHTML;c.length>20&&(c=c.substr(0,20)+"[...]");var f=l+u.join(" ")+">"+c+"";return f.replace(/ contentEditable="inherit"/,"")},o.prototype={functionName:t,configure:function(e){return new o(e)},constructorName:function(e){return n(this,e)},ascii:function(e,t,n){return i(this,e,t,n)}},o.prototype}),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.lolex=e()}}(function(){var define,module,exports;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s3||!/^(\d\d:){0,2}\d\d?$/.test(e))throw new Error("tick only understands numbers and 'h:m:s'");for(;i--;){if(t=parseInt(n[i],10),t>=60)throw new Error("Invalid time "+e);o+=t*Math.pow(60,r-i-1)}return 1e3*o}function getEpoch(e){if(!e)return 0;if("function"==typeof e.getTime)return e.getTime();if("number"==typeof e)return e;throw new TypeError("now should be milliseconds since UNIX epoch")}function inRange(e,t,n){return n&&n.callAt>=e&&n.callAt<=t}function mirrorDateProperties(e,t){t.now?e.now=function(){return e.clock.now}:delete e.now,t.toSource?e.toSource=function(){return t.toSource()}:delete e.toSource,e.toString=function(){return t.toString()},e.prototype=t.prototype,e.parse=t.parse,e.UTC=t.UTC,e.prototype.toUTCString=t.prototype.toUTCString;for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function createDate(){function e(t,n,r,i,o,s,a){switch(arguments.length){case 0:return new NativeDate(e.clock.now);case 1:return new NativeDate(t);case 2:return new NativeDate(t,n);case 3:return new NativeDate(t,n,r);case 4:return new NativeDate(t,n,r,i);case 5:return new NativeDate(t,n,r,i,o);case 6:return new NativeDate(t,n,r,i,o,s);default:return new NativeDate(t,n,r,i,o,s,a)}}return mirrorDateProperties(e,NativeDate)}function addTimer(e,t){if("undefined"==typeof t.func)throw new Error("Callback must be provided to timer calls");return e.timers||(e.timers={}),t.id=id++,t.createdAt=e.now,t.callAt=e.now+(t.delay||0),e.timers[t.id]=t,addTimerReturnsObject?{id:t.id,ref:function(){},unref:function(){}}:t.id}function firstTimerInRange(e,t,n){var r=e.timers,i=null;for(var o in r)inRange(t,n,r[o])&&(!i||~compareTimers(i,r[o]))&&(i=r[o]);return i}function compareTimers(e,t){return e.callAtt.callAt?1:e.immediate&&!t.immediate?-1:!e.immediate&&t.immediate?1:e.createdAtt.createdAt?1:e.idt.id?1:void 0}function callTimer(clock,timer){"number"==typeof timer.interval?clock.timers[timer.id].callAt+=timer.interval:delete clock.timers[timer.id];try{"function"==typeof timer.func?timer.func.apply(null,timer.args):eval(timer.func)}catch(e){var exception=e}if(clock.timers[timer.id]){if(exception)throw exception}else if(exception)throw exception}function uninstall(e,t){for(var n,r=0,i=e.methods.length;i>r;r++)if(n=e.methods[r],t[n].hadOwnProperty)t[n]=e["_"+n];else try{delete t[n]}catch(o){}e.methods=[]}function hijackMethod(e,t,n){if(n[t].hadOwnProperty=Object.prototype.hasOwnProperty.call(e,t),n["_"+t]=e[t],"Date"==t){var r=mirrorDateProperties(n[t],e[t]);e[t]=r}else{e[t]=function(){return n[t].apply(n,arguments)};for(var i in n[t])n[t].hasOwnProperty(i)&&(e[t][i]=n[t][i])}e[t].clock=n}var timeoutResult=setTimeout(function(){},0),addTimerReturnsObject="object"==typeof timeoutResult;clearTimeout(timeoutResult);var NativeDate=Date,id=1,timers={setTimeout:setTimeout,clearTimeout:clearTimeout,setImmediate:"undefined"!=typeof setImmediate?setImmediate:void 0,clearImmediate:"undefined"!=typeof clearImmediate?clearImmediate:void 0,setInterval:setInterval,clearInterval:clearInterval,Date:Date},keys=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};exports.timers=timers;var createClock=exports.createClock=function(e){var t={now:getEpoch(e),timeouts:{},Date:createDate()};return t.Date.clock=t,t.setTimeout=function(e,n){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,2),delay:n})},t.clearTimeout=function(e){e&&(t.timers||(t.timers=[]),"object"==typeof e&&(e=e.id),e in t.timers&&delete t.timers[e])},t.setInterval=function(e,n){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,2),delay:n,interval:n})},t.clearInterval=function(e){t.clearTimeout(e)},t.setImmediate=function(e){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,1),immediate:!0})},t.clearImmediate=function(e){t.clearTimeout(e)},t.tick=function(e){e="number"==typeof e?e:parseTime(e);for(var n,r=t.now,i=t.now+e,o=t.now,s=firstTimerInRange(t,r,i);s&&i>=r;){if(t.timers[s.id]){r=t.now=s.callAt;try{callTimer(t,s)}catch(a){n=n||a}}s=firstTimerInRange(t,o,i),o=r}if(t.now=i,n)throw n;return t.now},t.reset=function(){t.timers={}},t};exports.install=function(e,t,n){"number"==typeof e&&(n=t,t=e,e=null),e||(e=global);var r=createClock(t);r.uninstall=function(){uninstall(r,e)},r.methods=n||[],0===r.methods.length&&(r.methods=keys(timers));for(var i=0,o=r.methods.length;o>i;i++)hijackMethod(e,r.methods[i],r);return r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})}();var define,sinon=function(){"use strict";function e(e,n,r){t=r.exports=e("./sinon/util/core"),e("./sinon/extend"),e("./sinon/typeOf"),e("./sinon/times_in_words"),e("./sinon/spy"),e("./sinon/call"),e("./sinon/behavior"),e("./sinon/stub"),e("./sinon/mock"),e("./sinon/collection"),e("./sinon/assert"),e("./sinon/sandbox"),e("./sinon/test"),e("./sinon/test_case"),e("./sinon/match"),e("./sinon/format"),e("./sinon/log_error")}var t,n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;return r?define(e):n?(e(require,module.exports,module),t=module.exports):t={},t}();if(function(e){function t(e){var t=!1;try{e.appendChild(l),t=l.parentNode==e}catch(n){return!1}finally{try{e.removeChild(l)}catch(n){}}return t}function n(e){return l&&e&&1===e.nodeType&&t(e)}function r(e){return"function"==typeof e||!!(e&&e.constructor&&e.call&&e.apply)}function i(e){return"number"==typeof e&&isNaN(e)}function o(e,t){for(var n in t)c.call(e,n)||(e[n]=t[n])}function s(e){return"function"==typeof e&&"function"==typeof e.restore&&e.restore.sinon}function a(e){return e.wrapMethod=function(e,t,n){if(!e)throw new TypeError("Should wrap property of object");if("function"!=typeof n)throw new TypeError("Method wrapper should be function");var i,s=e[t];if(r(s)){if(s.restore&&s.restore.sinon)i=new TypeError("Attempted to wrap "+t+" which is already wrapped");else if(s.calledBefore){var a=s.returns?"stubbed":"spied on";i=new TypeError("Attempted to wrap "+t+" which is already "+a)}}else i=new TypeError("Attempted to wrap "+typeof s+" property "+t+" as function");if(i)throw s&&s.stackTrace&&(i.stack+="\n--------------\n"+s.stackTrace),i;var u=e.hasOwnProperty?e.hasOwnProperty(t):c.call(e,t);return e[t]=n,n.displayName=t,n.stackTrace=new Error("Stack Trace for original").stack,n.restore=function(){u||delete e[t],e[t]===n&&(e[t]=s)},n.restore.sinon=!0,o(n,s),n},e.create=function(e){var t=function(){};return t.prototype=e,new t},e.deepEqual=function t(r,o){if(e.match&&e.match.isMatcher(r))return r.test(o);if("object"!=typeof r||"object"!=typeof o)return i(r)&&i(o)?!0:r===o;if(n(r)||n(o))return r===o;if(r===o)return!0;if(null===r&&null!==o||null!==r&&null===o)return!1;if(r instanceof RegExp&&o instanceof RegExp)return r.source===o.source&&r.global===o.global&&r.ignoreCase===o.ignoreCase&&r.multiline===o.multiline;var s=Object.prototype.toString.call(r);if(s!=Object.prototype.toString.call(o))return!1;if("[object Date]"==s)return r.valueOf()===o.valueOf();var a,u=0,l=0;if("[object Array]"==s&&r.length!==o.length)return!1;for(a in r){if(u+=1,!(a in o))return!1;if(!t(r[a],o[a]))return!1}for(a in o)l+=1;return u==l},e.functionName=function(e){var t=e.displayName||e.name;if(!t){var n=e.toString().match(/function ([^\s\(]+)/);t=n&&n[1]}return t},e.functionToString=function(){if(this.getCall&&this.callCount)for(var e,t,n=this.callCount;n--;){e=this.getCall(n).thisValue;for(t in e)if(e[t]===this)return t}return this.displayName||"sinon fake"},e.getConfig=function(t){var n={};t=t||{};var r=e.defaultConfig;for(var i in r)r.hasOwnProperty(i)&&(n[i]=t.hasOwnProperty(i)?t[i]:r[i]);return n},e.defaultConfig={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0},e.timesInWords=function(e){return 1==e&&"once"||2==e&&"twice"||3==e&&"thrice"||(e||0)+" times"},e.calledInOrder=function(e){for(var t=1,n=e.length;n>t;t++)if(!e[t-1].calledBefore(e[t])||!e[t].called)return!1;return!0},e.orderByFirstCall=function(e){return e.sort(function(e,t){var n=e.getCall(0),r=t.getCall(0),i=n&&n.callId||-1,o=r&&r.callId||-1;return o>i?-1:1})},e.createStubInstance=function(t){if("function"!=typeof t)throw new TypeError("The constructor should be a function.");return e.stub(e.create(t.prototype))},e.restore=function(e){if(null!==e&&"object"==typeof e)for(var t in e)s(e[t])&&e[t].restore();else s(e)&&e.restore()},e}function u(e,t){a(t)}var l="undefined"!=typeof document&&document.createElement("div"),c=Object.prototype.hasOwnProperty,f="undefined"!=typeof module&&module.exports&&"function"==typeof require,d="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(d)define(u);else if(f)u(require,module.exports);else{if(!e)return;a(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){function t(e){var t,r,i,o=Array.prototype.slice.call(arguments,1);for(r=0;rt;t+=1)if(!e.deepEqual(arguments[t],this.args[t]))return!1;return!0},calledWithMatch:function(){for(var t=0,n=arguments.length;n>t;t+=1){var r=this.args[t],i=arguments[t];if(!e.match||!e.match(i).test(r))return!1}return!0},calledWithExactly:function(){return arguments.length==this.args.length&&this.calledWith.apply(this,arguments)},notCalledWith:function(){return!this.calledWith.apply(this,arguments)},notCalledWithMatch:function(){return!this.calledWithMatch.apply(this,arguments)},returned:function(t){return e.deepEqual(t,this.returnValue)},threw:function(e){return"undefined"!=typeof e&&this.exception?this.exception===e||this.exception.name===e:!!this.exception},calledWithNew:function(){return this.proxy.prototype&&this.thisValue instanceof this.proxy},calledBefore:function(e){return this.callIde.callId},callArg:function(e){this.args[e]()},callArgOn:function(e,t){this.args[e].apply(t)},callArgWith:function(e){this.callArgOnWith.apply(this,[e,null].concat(r.call(arguments,1)))},callArgOnWith:function(e,t){var n=r.call(arguments,2);this.args[e].apply(t,n)},"yield":function(){this.yieldOn.apply(this,[null].concat(r.call(arguments,0)))},yieldOn:function(e){for(var n=this.args,i=0,o=n.length;o>i;++i)if("function"==typeof n[i])return void n[i].apply(e,r.call(arguments,1));t(this.proxy," cannot yield since no callback was passed.",n)},yieldTo:function(e){this.yieldToOn.apply(this,[e,null].concat(r.call(arguments,1)))},yieldToOn:function(e,n){for(var i=this.args,o=0,s=i.length;s>o;++o)if(i[o]&&"function"==typeof i[o][e])return void i[o][e].apply(n,r.call(arguments,2));t(this.proxy," cannot yield to '"+e+"' since no callback was passed.",i)},toString:function(){for(var t=this.proxy.toString()+"(",n=[],r=0,i=this.args.length;i>r;++r)n.push(e.format(this.args[r]));return t=t+n.join(", ")+")","undefined"!=typeof this.returnValue&&(t+=" => "+e.format(this.returnValue)),this.exception&&(t+=" !"+this.exception.name,this.exception.message&&(t+="("+this.exception.message+")")),t}};return i.invokeCallback=i["yield"],n.toString=i.toString,e.spyCall=n,n}function n(e,n,r){var i=e("./util/core");e("./match"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(sinon){function makeApi(sinon){function spy(e,t){if(!t&&"function"==typeof e)return spy.create(e);if(!e&&!t)return spy.create(function(){});var n=e[t];return sinon.wrapMethod(e,t,spy.create(n))}function matchingFake(e,t,n){if(e)for(var r=0,i=e.length;i>r;r++)if(e[r].matches(t,n))return e[r]}function incrementCallCount(){this.called=!0,this.callCount+=1,this.notCalled=!1,this.calledOnce=1==this.callCount,this.calledTwice=2==this.callCount,this.calledThrice=3==this.callCount}function createCallProperties(){this.firstCall=this.getCall(0),this.secondCall=this.getCall(1),this.thirdCall=this.getCall(2),this.lastCall=this.getCall(this.callCount-1)}function createProxy(func){var p;return func.length?eval("p = (function proxy("+vars.substring(0,2*func.length-1)+") { return p.invoke(func, this, slice.call(arguments)); });"):p=function(){return p.invoke(func,this,slice.call(arguments))},p}function delegateToCalls(e,t,n,r){spyApi[e]=function(){if(!this.called)return r?r.apply(this,arguments):!1;for(var i,o=0,s=0,a=this.callCount;a>s;s+=1)if(i=this.getCall(s),i[n||e].apply(i,arguments)&&(o+=1,t))return!0;return o===this.callCount}}var push=Array.prototype.push,slice=Array.prototype.slice,callId=0,vars="a,b,c,d,e,f,g,h,i,j,k,l",uuid=0,spyApi={reset:function(){if(this.invoking){var e=new Error("Cannot reset Sinon function while invoking it. Move the call to .reset outside of the callback.");throw e.name="InvalidResetException",e}if(this.called=!1,this.notCalled=!0,this.calledOnce=!1,this.calledTwice=!1,this.calledThrice=!1,this.callCount=0,this.firstCall=null,this.secondCall=null,this.thirdCall=null,this.lastCall=null,this.args=[],this.returnValues=[],this.thisValues=[],this.exceptions=[],this.callIds=[],this.fakes)for(var t=0;te||e>=this.callCount?null:sinon.spyCall(this,this.thisValues[e],this.args[e],this.returnValues[e],this.exceptions[e],this.callIds[e])},getCalls:function(){var e,t=[];for(e=0;ee.callIds[e.callCount-1]:!1},withArgs:function(){var e=slice.call(arguments);if(this.fakes){var t=matchingFake(this.fakes,e,!0);if(t)return t}else this.fakes=[];var n=this,r=this.instantiateFake();r.matchingAguments=e,r.parent=this,push.call(this.fakes,r),r.withArgs=function(){return n.withArgs.apply(n,arguments)};for(var i=0;in;++n){var i=" "+e.getCall(n).toString();/\n/.test(t[n-1])&&(i="\n"+i),push.call(t,i)}return t.length>0?"\n"+t.join("\n"):""},t:function(e){for(var t=[],n=0,r=e.callCount;r>n;++n)push.call(t,sinon.format(e.thisValues[n]));return t.join(", ")},"*":function(e,t){for(var n=[],r=0,i=t.length;i>r;++r)push.call(n,sinon.format(t[r]));return n.join(", ")}},sinon.extend(spy,spyApi),spy.spyCall=sinon.spyCall,sinon.spy=spy,spy}function loadDependencies(e,t,n){var r=e("./util/core");e("./call"),n.exports=makeApi(r)}var isNode="undefined"!=typeof module&&module.exports&&"function"==typeof require,isAMD="function"==typeof define&&"object"==typeof define.amd&&define.amd; +if(isAMD)define(loadDependencies);else if(isNode)loadDependencies(require,module.exports,module);else{if(!sinon)return;makeApi(sinon)}}("object"==typeof sinon&&sinon||null),function(e){function t(e,t){return"string"==typeof e?(this.exception=new Error(t||""),this.exception.name=e):this.exception=e?e:new Error("Error"),this}function n(e,t){var n=e.callArgAt;if(0>n){for(var r=e.callArgProp,i=0,o=t.length;o>i;++i){if(!r&&"function"==typeof t[i])return t[i];if(r&&t[i]&&"function"==typeof t[i][r])return t[i][r]}return null}return t[n]}function r(e){function r(t,n,r){if(t.callArgAt<0){var i;return i=t.callArgProp?e.functionName(t.stub)+" expected to yield to '"+t.callArgProp+"', but no object with such a property was passed.":e.functionName(t.stub)+" expected to yield, but no callback was passed.",r.length>0&&(i+=" Received ["+s.call(r,", ")+"]"),i}return"argument at index "+t.callArgAt+" is not a function: "+n}function i(e,t){if("number"==typeof e.callArgAt){var i=n(e,t);if("function"!=typeof i)throw new TypeError(r(e,i,t));e.callbackAsync?a(function(){i.apply(e.callbackContext,e.callbackArguments)}):i.apply(e.callbackContext,e.callbackArguments)}}var u={create:function(t){var n=e.extend({},e.behavior);return delete n.create,n.stub=t,n},isPresent:function(){return"number"==typeof this.callArgAt||this.exception||"number"==typeof this.returnArgAt||this.returnThis||this.returnValueDefined},invoke:function(e,t){if(i(this,t),this.exception)throw this.exception;return"number"==typeof this.returnArgAt?t[this.returnArgAt]:this.returnThis?e:this.returnValue},onCall:function(e){return this.stub.onCall(e)},onFirstCall:function(){return this.stub.onFirstCall()},onSecondCall:function(){return this.stub.onSecondCall()},onThirdCall:function(){return this.stub.onThirdCall()},withArgs:function(){throw new Error('Defining a stub by invoking "stub.onCall(...).withArgs(...)" is not supported. Use "stub.withArgs(...).onCall(...)" to define sequential behavior for calls with certain arguments.')},callsArg:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.callArgAt=e,this.callbackArguments=[],this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgOn:function(e,t){if("number"!=typeof e)throw new TypeError("argument index is not number");if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=e,this.callbackArguments=[],this.callbackContext=t,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgWith:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.callArgAt=e,this.callbackArguments=o.call(arguments,1),this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgOnWith:function(e,t){if("number"!=typeof e)throw new TypeError("argument index is not number");if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=e,this.callbackArguments=o.call(arguments,2),this.callbackContext=t,this.callArgProp=void 0,this.callbackAsync=!1,this},yields:function(){return this.callArgAt=-1,this.callbackArguments=o.call(arguments,0),this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},yieldsOn:function(e){if("object"!=typeof e)throw new TypeError("argument context is not an object");return this.callArgAt=-1,this.callbackArguments=o.call(arguments,1),this.callbackContext=e,this.callArgProp=void 0,this.callbackAsync=!1,this},yieldsTo:function(e){return this.callArgAt=-1,this.callbackArguments=o.call(arguments,1),this.callbackContext=void 0,this.callArgProp=e,this.callbackAsync=!1,this},yieldsToOn:function(e,t){if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=-1,this.callbackArguments=o.call(arguments,2),this.callbackContext=t,this.callArgProp=e,this.callbackAsync=!1,this},"throws":t,throwsException:t,returns:function(e){return this.returnValue=e,this.returnValueDefined=!0,this},returnsArg:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.returnArgAt=e,this},returnsThis:function(){return this.returnThis=!0,this}};for(var l in u)u.hasOwnProperty(l)&&l.match(/^(callsArg|yields)/)&&!l.match(/Async/)&&(u[l+"Async"]=function(e){return function(){var t=this[e].apply(this,arguments);return this.callbackAsync=!0,t}}(l));return e.behavior=u,u}function i(e,t,n){var i=e("./util/core");n.exports=r(i)}var o=Array.prototype.slice,s=Array.prototype.join,a=function(){return"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:"function"==typeof setImmediate?setImmediate:function(e){setTimeout(e,0)}}(),u="undefined"!=typeof module&&module.exports&&"function"==typeof require,l="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(l)define(i);else if(u)i(require,module.exports,module);else{if(!e)return;r(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){function t(n,r,i){if(i&&"function"!=typeof i)throw new TypeError("Custom stub should be function");var o;if(o=i?e.spy&&e.spy.create?e.spy.create(i):i:t.create(),!n&&"undefined"==typeof r)return e.stub.create();if("undefined"==typeof r&&"object"==typeof n){for(var s in n)"function"==typeof n[s]&&t(n,s);return n}return e.wrapMethod(n,r,o)}function n(t){return t.defaultBehavior||r(t)||e.behavior.create(t)}function r(e){return e.parent&&i(e.parent)}function i(e){var t=e.behaviors[e.callCount-1];return t&&t.isPresent()?t:n(e)}var o=0,s={create:function(){var n=function(){return i(n).invoke(this,arguments)};n.id="stub#"+o++;var r=n;return n=e.spy.create(n),n.func=r,e.extend(n,t),n.instantiateFake=e.stub.create,n.displayName="stub",n.toString=e.functionToString,n.defaultBehavior=null,n.behaviors=[],n},resetBehavior:function(){var e;if(this.defaultBehavior=null,this.behaviors=[],delete this.returnValue,delete this.returnArgAt,this.returnThis=!1,this.fakes)for(e=0;en;n+=1)t(e[n])}function r(e){return 0==e?"never called":"called "+c(e)}function i(e){var t=e.minCalls,n=e.maxCalls;if("number"==typeof t&&"number"==typeof n){var r=c(t);return t!=n&&(r="at least "+r+" and at most "+c(n)),r}return"number"==typeof t?"at least "+c(t):"at most "+c(n)}function o(e){var t="number"==typeof e.minCalls;return!t||e.callCount>=e.minCalls}function s(e){return"number"!=typeof e.maxCalls?!1:e.callCount==e.maxCalls}function a(e,t){return l&&l.isMatcher(e)?e.test(t):!0}var u=[].push,l=e.match;e.extend(t,{create:function(n){if(!n)throw new TypeError("object is null");var r=e.extend({},t);return r.object=n,delete r.create,r},expects:function(t){if(!t)throw new TypeError("method is falsy");if(this.expectations||(this.expectations={},this.proxies=[]),!this.expectations[t]){this.expectations[t]=[];var n=this;e.wrapMethod(this.object,t,function(){return n.invokeMethod(t,this,arguments)}),u.call(this.proxies,t)}var r=e.expectation.create(t);return u.call(this.expectations[t],r),r},restore:function(){var e=this.object;n(this.proxies,function(t){"function"==typeof e[t].restore&&e[t].restore()})},verify:function(){var t=this.expectations||{},r=[],i=[];return n(this.proxies,function(e){n(t[e],function(e){e.met()?u.call(i,e.toString()):u.call(r,e.toString())})}),this.restore(),r.length>0?e.expectation.fail(r.concat(i).join("\n")):i.length>0&&e.expectation.pass(r.concat(i).join("\n")),!0},invokeMethod:function(t,n,r){var i,o=this.expectations&&this.expectations[t],s=o&&o.length||0;for(i=0;s>i;i+=1)if(!o[i].met()&&o[i].allowsCall(n,r))return o[i].apply(n,r);var a,l=[],c=0;for(i=0;s>i;i+=1)o[i].allowsCall(n,r)?a=a||o[i]:c+=1,u.call(l," "+o[i].toString());return 0===c?a.apply(n,r):(l.unshift("Unexpected call: "+e.spyCall.toString.call({proxy:t,args:r})),void e.expectation.fail(l.join("\n")))}});var c=e.timesInWords,f=Array.prototype.slice;return e.expectation={minCalls:1,maxCalls:1,create:function(t){var n=e.extend(e.stub.create(),e.expectation);return delete n.create,n.method=t,n},invoke:function(t,n,r){return this.verifyCallAllowed(n,r),e.spy.invoke.apply(this,arguments)},atLeast:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not number");return this.limitsSet||(this.maxCalls=null,this.limitsSet=!0),this.minCalls=e,this},atMost:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not number");return this.limitsSet||(this.minCalls=null,this.limitsSet=!0),this.maxCalls=e,this},never:function(){return this.exactly(0)},once:function(){return this.exactly(1)},twice:function(){return this.exactly(2)},thrice:function(){return this.exactly(3)},exactly:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not a number");return this.atLeast(e),this.atMost(e)},met:function(){return!this.failed&&o(this)},verifyCallAllowed:function(t,n){if(s(this)&&(this.failed=!0,e.expectation.fail(this.method+" already called "+c(this.maxCalls))),"expectedThis"in this&&this.expectedThis!==t&&e.expectation.fail(this.method+" called with "+t+" as thisValue, expected "+this.expectedThis),"expectedArguments"in this){n||e.expectation.fail(this.method+" received no arguments, expected "+e.format(this.expectedArguments)),n.lengthr;r+=1)a(this.expectedArguments[r],n[r])||e.expectation.fail(this.method+" received wrong arguments "+e.format(n)+", didn't match "+this.expectedArguments.toString()),e.deepEqual(this.expectedArguments[r],n[r])||e.expectation.fail(this.method+" received wrong arguments "+e.format(n)+", expected "+e.format(this.expectedArguments))}},allowsCall:function(t,n){if(this.met()&&s(this))return!1;if("expectedThis"in this&&this.expectedThis!==t)return!1;if(!("expectedArguments"in this))return!0;if(n=n||[],n.lengthr;r+=1){if(!a(this.expectedArguments[r],n[r]))return!1;if(!e.deepEqual(this.expectedArguments[r],n[r]))return!1}return!0},withArgs:function(){return this.expectedArguments=f.call(arguments),this},withExactArgs:function(){return this.withArgs.apply(this,arguments),this.expectsExactArgCount=!0,this},on:function(e){return this.expectedThis=e,this},toString:function(){var t=(this.expectedArguments||[]).slice();this.expectsExactArgCount||u.call(t,"[...]");var n=e.spyCall.toString.call({proxy:this.method||"anonymous mock expectation",args:t}),o=n.replace(", [...","[, ...")+" "+i(this);return this.met()?"Expectation met: "+o:"Expected "+o+" ("+r(this.callCount)+")"},verify:function(){return this.met()?e.expectation.pass(this.toString()):e.expectation.fail(this.toString()),!0},pass:function(t){e.assert.pass(t)},fail:function(e){var t=new Error(e);throw t.name="ExpectationError",t}},e.mock=t,t}function n(e,n,r){var i=e("./util/core");e("./call"),e("./match"),e("./spy"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){return e.fakes||(e.fakes=[]),e.fakes}function n(e,n){for(var r=t(e),i=0,o=r.length;o>i;i+=1)"function"==typeof r[i][n]&&r[i][n]()}function r(e){for(var n=t(e),r=0;rr;++r)if(n[r]==t)return n.splice(r,1)},dispatchEvent:function(e){for(var t=e.type,n=this.eventListeners&&this.eventListeners[t]||[],r=0;r=0;o--)e(i[o]);"function"==typeof t.onCreate&&t.onCreate(this)}function n(){this.eventListeners={progress:[],load:[],abort:[],error:[]}}function r(e){if(e.readyState!==t.OPENED)throw new Error("INVALID_STATE_ERR");if(e.sendFlag)throw new Error("INVALID_STATE_ERR")}function i(e,t){t=t.toLowerCase();for(var n in e)if(n.toLowerCase()==t)return n;return null}function o(e,t){if(e)for(var n=0,r=e.length;r>n;n+=1)t(e[n])}function s(e,t){for(var n=0;nt.UNSENT&&this.sendFlag&&(this.readyStateChange(t.DONE),this.sendFlag=!1),this.readyState=t.UNSENT,this.dispatchEvent(new n.Event("abort",!1,!1,this)),this.upload.dispatchEvent(new n.Event("abort",!1,!1,this)),"function"==typeof this.onerror&&this.onerror()},getResponseHeader:function(e){return this.readyStater;++r)if(n[r]==t)return n.splice(r,1)},n.prototype.dispatchEvent=function(e){for(var t,n=this.eventListeners[e.type]||[],r=0;null!=(t=n[r]);r++)t(e)};var g=function(e,t,n){switch(n.length){case 0:return e[t]();case 1:return e[t](n[0]);case 2:return e[t](n[0],n[1]);case 3:return e[t](n[0],n[1],n[2]);case 4:return e[t](n[0],n[1],n[2],n[3]);case 5:return e[t](n[0],n[1],n[2],n[3],n[4])}};t.filters=[],t.addFilter=function(e){this.filters.push(e)};var v=/MSIE 6/;t.defake=function(e,n){var r=new y.workingXHR;o(["open","setRequestHeader","send","abort","getResponseHeader","getAllResponseHeaders","addEventListener","overrideMimeType","removeEventListener"],function(t){e[t]=function(){return g(r,t,arguments)}});var i=function(t){o(t,function(t){try{e[t]=r[t]}catch(n){if(!v.test(navigator.userAgent))throw n}})},s=function(){e.readyState=r.readyState,r.readyState>=t.HEADERS_RECEIVED&&i(["status","statusText"]),r.readyState>=t.LOADING&&i(["responseText","response"]),r.readyState===t.DONE&&i(["responseXML"]),e.onreadystatechange&&e.onreadystatechange.call(e,{target:e})};if(r.addEventListener){for(var a in e.eventListeners)e.eventListeners.hasOwnProperty(a)&&o(e.eventListeners[a],function(e){r.addEventListener(a,e)});r.addEventListener("readystatechange",s)}else r.onreadystatechange=s;g(r,"open",n)},t.useFilters=!1,t.parseXML=function(e){var t;if("undefined"!=typeof DOMParser){var n=new DOMParser;t=n.parseFromString(e,"text/xml")}else t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},t.statusCodes={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choice",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};var w="undefined"!=typeof module&&module.exports&&"function"==typeof require,b="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(b)define(d);else if(w)d(require,module.exports,module);else{if("undefined"==typeof sinon)return;f(sinon)}}("undefined"!=typeof self?self:this),"undefined"==typeof sinon)var sinon={};return function(){function e(){}function t(t){return e.prototype=t,new e}function n(e){var t=e;if("[object Array]"!=Object.prototype.toString.call(e)&&(t=[200,{},e]),"string"!=typeof t[2])throw new TypeError("Fake server response body should be string, but was "+typeof t[2]);return t}function r(e,t,n){var r=e.method,i=!r||r.toLowerCase()==t.toLowerCase(),o=e.url,s=!o||o==n||"function"==typeof o.test&&o.test(n);return i&&s}function i(e,t){var n=t.url;if((!/^https?:\/\//.test(n)||l.test(n))&&(n=n.replace(l,"")),r(e,this.getHTTPMethod(t),n)){if("function"==typeof e.response){var i=e.url,o=[t].concat(i&&"function"==typeof i.exec?i.exec(n).slice(1):[]);return e.response.apply(e,o)}return!0}return!1}function o(e){e.fakeServer={create:function(){var n=t(this);return this.xhr=e.useFakeXMLHttpRequest(),n.requests=[],this.xhr.onCreate=function(e){n.addRequest(e)},n},addRequest:function(e){var t=this;a.call(this.requests,e),e.onSend=function(){t.handleRequest(this),t.autoRespond&&!t.responding&&(setTimeout(function(){t.responding=!1,t.respond()},t.autoRespondAfter||10),t.responding=!0)}},getHTTPMethod:function(e){if(this.fakeHTTPMethods&&/post/i.test(e.method)){var t=(e.requestBody||"").match(/_method=([^\b;]+)/);return t?t[1]:e.method}return e.method},handleRequest:function(e){e.async?(this.queue||(this.queue=[]),a.call(this.queue,e)):this.processRequest(e)},log:function(t,n){var r;r="Request:\n"+e.format(n)+"\n\n",r+="Response:\n"+e.format(t)+"\n\n",e.log(r)},respondWith:function(e,t,r){return 1==arguments.length&&"function"!=typeof e?void(this.response=n(e)):(this.responses||(this.responses=[]),1==arguments.length&&(r=e,t=e=null),2==arguments.length&&(r=t,t=e,e=null),void a.call(this.responses,{method:e,url:t,response:"function"==typeof r?r:n(r)}))},respond:function(){arguments.length>0&&this.respondWith.apply(this,arguments);for(var e,t=this.queue||[],n=t.splice(0,t.length);e=n.shift();)this.processRequest(e)},processRequest:function(t){try{if(t.aborted)return;var n=this.response||[404,{},""];if(this.responses)for(var r=this.responses.length,o=r-1;o>=0;o--)if(i.call(this,this.responses[o],t)){n=this.responses[o].response;break}4!=t.readyState&&(this.log(n,t),t.respond(n[0],n[1],n[2]))}catch(s){e.logError("Fake server request processing",s)}},restore:function(){return this.xhr.restore&&this.xhr.restore.apply(this.xhr,arguments)}}}function s(e,t,n){var r=e("./core");e("./fake_xml_http_request"),o(r),n.exports=r}var a=[].push,u="undefined"!=typeof window?window.location:{},l=new RegExp("^"+u.protocol+"//"+u.host),c="undefined"!=typeof module&&module.exports&&"function"==typeof require,f="function"==typeof define&&"object"==typeof define.amd&&define.amd;f?define(s):c?s(require,module.exports,module):o(sinon)}(),function(){function e(e){function t(){}t.prototype=e.fakeServer,e.fakeServerWithClock=new t,e.fakeServerWithClock.addRequest=function(t){if(t.async&&("object"==typeof setTimeout.clock?this.clock=setTimeout.clock:(this.clock=e.useFakeTimers(),this.resetClock=!0),!this.longestTimeout)){var n=this.clock.setTimeout,r=this.clock.setInterval,i=this;this.clock.setTimeout=function(e,t){return i.longestTimeout=Math.max(t,i.longestTimeout||0),n.apply(this,arguments)},this.clock.setInterval=function(e,t){return i.longestTimeout=Math.max(t,i.longestTimeout||0),r.apply(this,arguments)}}return e.fakeServer.addRequest.call(this,t)},e.fakeServerWithClock.respond=function(){var t=e.fakeServer.respond.apply(this,arguments);return this.clock&&(this.clock.tick(this.longestTimeout||0),this.longestTimeout=0,this.resetClock&&(this.clock.restore(),this.resetClock=!1)),t},e.fakeServerWithClock.restore=function(){return this.clock&&this.clock.restore(),e.fakeServer.restore.apply(this,arguments)}}function t(t){var n=t("./core");t("./fake_server"),t("./fake_timers"),e(n)}var n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;r?define(t):n?t(require):e(sinon)}(),function(){function e(e){function t(e,t,n,i){i&&(!t.injectInto||n in t.injectInto?r.call(e.args,i):(t.injectInto[n]=i,e.injectedKeys.push(n)))}function n(t){var n=e.create(e.sandbox);return t.useFakeServer&&("object"==typeof t.useFakeServer&&(n.serverPrototype=t.useFakeServer),n.useFakeServer()),t.useFakeTimers&&("object"==typeof t.useFakeTimers?n.useFakeTimers.apply(n,t.useFakeTimers):n.useFakeTimers()),n}var r=[].push;return e.sandbox=e.extend(e.create(e.collection),{useFakeTimers:function(){return this.clock=e.useFakeTimers.apply(e,arguments),this.add(this.clock)},serverPrototype:e.fakeServer,useFakeServer:function(){var t=this.serverPrototype||e.fakeServer;return t&&t.create?(this.server=t.create(),this.add(this.server)):null},inject:function(t){return e.collection.inject.call(this,t),this.clock&&(t.clock=this.clock),this.server&&(t.server=this.server,t.requests=this.server.requests),t.match=e.match,t},restore:function(){e.collection.restore.apply(this,arguments),this.restoreContext()},restoreContext:function(){if(this.injectedKeys){for(var e=0,t=this.injectedKeys.length;t>e;e++)delete this.injectInto[this.injectedKeys[e]];this.injectedKeys=[]}},create:function(r){if(!r)return e.create(e.sandbox);var i=n(r);i.args=i.args||[],i.injectedKeys=[],i.injectInto=r.injectInto;var o,s,a=i.inject({});if(r.properties)for(var u=0,l=r.properties.length;l>u;u++)o=r.properties[u],s=a[o]||"sandbox"==o&&i,t(i,r,o,s);else t(i,r,"sandbox",s);return i},match:e.match}),e.sandbox.useFakeXMLHttpRequest=e.sandbox.useFakeServer,e.sandbox}function t(t,n,r){var i=t("./util/core");t("./util/fake_server"),t("./util/fake_timers"),t("./collection"),r.exports=e(i)}var n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd; +if(r)define(t);else if(n)t(require,module.exports,module);else{if(!sinon)return;e(sinon)}}(),function(e){function t(e){function t(t){function n(){var n=e.getConfig(e.config);n.injectInto=n.injectIntoThis&&this||n.injectInto;var r,i,o=e.sandbox.create(n),s=!1,a=Array.prototype.slice.call(arguments);if(a.length>0&&"function"==typeof a[arguments.length-1]){var u=a[arguments.length-1];a[arguments.length-1]=function(e){if(e)throw o.restore(),r;o.verifyAndRestore(),u(e)},s=!0}var l=a.concat(o.args);try{i=t.apply(this,l)}catch(c){r=c}if(!s){if("undefined"!=typeof r)throw o.restore(),r;o.verifyAndRestore()}return i}var r=typeof t;if("function"!=r)throw new TypeError("sinon.test needs to wrap a test function, got "+r);return t.length?function(){return n.apply(this,arguments)}:n}return t.config={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0},e.test=t,t}function n(e,n,r){var i=e("./util/core");e("./sandbox"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e,t,n){return function(){t&&t.apply(this,arguments);var r,i;try{i=e.apply(this,arguments)}catch(o){r=o}if(n&&n.apply(this,arguments),r)throw r;return i}}function n(e){function n(n,r){if(!n||"object"!=typeof n)throw new TypeError("sinon.testCase needs an object with test functions");r=r||"test";var i,o,s,a=new RegExp("^"+r),u={},l=n.setUp,c=n.tearDown;for(i in n)if(n.hasOwnProperty(i)){if(o=n[i],/^(setUp|tearDown)$/.test(i))continue;"function"==typeof o&&a.test(i)?(s=o,(l||c)&&(s=t(o,l,c)),u[i]=e.test(s)):u[i]=n[i]}return u}return e.testCase=n,n}function r(e,t,r){var i=e("./util/core");e("./test"),r.exports=n(i)}var i="undefined"!=typeof module&&module.exports&&"function"==typeof require,o="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(o)define(r);else if(i)r(require,module.exports,module);else{if(!e)return;n(e)}}("object"==typeof sinon&&sinon||null),function(e,t){function n(e){function n(){for(var e,t=0,n=arguments.length;n>t;++t)e=arguments[t],e||a.fail("fake is not a spy"),"function"!=typeof e&&a.fail(e+" is not a function"),"function"!=typeof e.getCall&&a.fail(e+" is not stubbed")}function r(e,n){e=e||t;var r=e.fail||a.fail;r.call(e,n)}function o(e,t,o){2==arguments.length&&(o=t,t=e),a[e]=function(s){n(s);var u=i.call(arguments,1),l=!1;l="function"==typeof t?!t(s):"function"==typeof s[t]?!s[t].apply(s,u):!s[t],l?r(this,s.printf.apply(s,[o].concat(u))):a.pass(e)}}function s(e,t){return!e||/^fail/.test(t)?t:e+t.slice(0,1).toUpperCase()+t.slice(1)}var a;return a={failException:"AssertError",fail:function(e){var t=new Error(e);throw t.name=this.failException||a.failException,t},pass:function(){},callOrder:function(){n.apply(null,arguments);var t="",o="";if(e.calledInOrder(arguments))a.pass("callOrder");else{try{t=[].join.call(arguments,", ");for(var s=i.call(arguments),u=s.length;u;)s[--u].called||s.splice(u,1);o=e.orderByFirstCall(s).join(", ")}catch(l){}r(this,"expected "+t+" to be called in order but were called as "+o)}},callCount:function(t,i){if(n(t),t.callCount!=i){var o="expected %n to be called "+e.timesInWords(i)+" but was called %c%C";r(this,t.printf(o))}else a.pass("callCount")},expose:function(e,t){if(!e)throw new TypeError("target is null or undefined");var n=t||{},r="undefined"==typeof n.prefix&&"assert"||n.prefix,i="undefined"==typeof n.includeFail||!!n.includeFail;for(var o in this)"expose"==o||!i&&/^(fail)/.test(o)||(e[s(r,o)]=this[o]);return e},match:function(t,n){var i=e.match(n);if(i.test(t))a.pass("match");else{var o=["expected value to match"," expected = "+e.format(n)," actual = "+e.format(t)];r(this,o.join("\n"))}}},o("called","expected %n to have been called at least once but was never called"),o("notCalled",function(e){return!e.called},"expected %n to not have been called but was called %c%C"),o("calledOnce","expected %n to be called once but was called %c%C"),o("calledTwice","expected %n to be called twice but was called %c%C"),o("calledThrice","expected %n to be called thrice but was called %c%C"),o("calledOn","expected %n to be called with %1 as this but was called with %t"),o("alwaysCalledOn","expected %n to always be called with %1 as this but was called with %t"),o("calledWithNew","expected %n to be called with new"),o("alwaysCalledWithNew","expected %n to always be called with new"),o("calledWith","expected %n to be called with arguments %*%C"),o("calledWithMatch","expected %n to be called with match %*%C"),o("alwaysCalledWith","expected %n to always be called with arguments %*%C"),o("alwaysCalledWithMatch","expected %n to always be called with match %*%C"),o("calledWithExactly","expected %n to be called with exact arguments %*%C"),o("alwaysCalledWithExactly","expected %n to always be called with exact arguments %*%C"),o("neverCalledWith","expected %n to never be called with arguments %*%C"),o("neverCalledWithMatch","expected %n to never be called with match %*%C"),o("threw","%n did not throw exception%C"),o("alwaysThrew","%n did not always throw exception%C"),e.assert=a,a}function r(e,t,r){var i=e("./util/core");e("./match"),r.exports=n(i)}var i=Array.prototype.slice,o="undefined"!=typeof module&&module.exports&&"function"==typeof require,s="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(s)define(r);else if(o)r(require,module.exports,module);else{if(!e)return;n(e)}}("object"==typeof sinon&&sinon||null,"undefined"!=typeof window?window:"undefined"!=typeof self?self:global),"undefined"==typeof sinon&&(this.sinon={}),function(e){function t(t){function n(){this.readyState=n.UNSENT,this.requestBody=null,this.requestHeaders={},this.status=0,this.timeout=null,"function"==typeof n.onCreate&&n.onCreate(this)}function i(e){if(e.readyState!==n.OPENED)throw new Error("INVALID_STATE_ERR");if(e.sendFlag)throw new Error("INVALID_STATE_ERR")}function o(e){if(e.readyState==n.UNSENT)throw new Error("Request not sent");if(e.readyState==n.DONE)throw new Error("Request done")}function s(e){if("string"!=typeof e){var t=new Error("Attempted to respond to fake XDomainRequest with "+e+", which is not a string.");throw t.name="InvalidBodyException",t}}t.xdr=r,t.extend(n.prototype,t.EventTarget,{open:function(e,t){this.method=e,this.url=t,this.responseText=null,this.sendFlag=!1,this.readyStateChange(n.OPENED)},readyStateChange:function(e){this.readyState=e;var r="";switch(this.readyState){case n.UNSENT:break;case n.OPENED:break;case n.LOADING:this.sendFlag&&(r="onprogress");break;case n.DONE:r=this.isTimeout?"ontimeout":this.errorFlag||this.status<200||this.status>299?"onerror":"onload"}if(r&&"function"==typeof this[r])try{this[r]()}catch(i){t.logError("Fake XHR "+r+" handler",i)}},send:function(e){i(this),/^(get|head)$/i.test(this.method)||(this.requestBody=e),this.requestHeaders["Content-Type"]="text/plain;charset=utf-8",this.errorFlag=!1,this.sendFlag=!0,this.readyStateChange(n.OPENED),"function"==typeof this.onSend&&this.onSend(this)},abort:function(){this.aborted=!0,this.responseText=null,this.errorFlag=!0,this.readyState>t.FakeXDomainRequest.UNSENT&&this.sendFlag&&(this.readyStateChange(t.FakeXDomainRequest.DONE),this.sendFlag=!1)},setResponseBody:function(e){o(this),s(e);var t=this.chunkSize||10,r=0;this.responseText="";do this.readyStateChange(n.LOADING),this.responseText+=e.substring(r,r+t),r+=t;while(r=3?e[2]:this.actual};e.length>=2&&(r.expected=e[1]),e.length>=4&&(r.inspect=e.slice(3)),i(t,r)},stats:{assertions:{},total:{assertions:0}}}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var i=r(32),o=r(53),s=r(33),a=function l(t){s.staticShouldUnWrap(i.isWrapperType(t)&&l.warn);var e=i.isWrapperType(t)?t.valueOf():t;return new l.Assertion(e,l.format)},u="SHOULDJS_WARN",c="undefined"!=typeof n&&{NODE_ENV:"production"}[u]&&"true"==={NODE_ENV:"production"}[u];a.warn="undefined"==typeof c?!0:c,a.AssertionError=r(34),a.Assertion=r(35),a.format=o,e=t.exports=a,a.extend=function(t,e){t=t||"should",e=e||Object.prototype,Object.defineProperty(e,t,{set:function(){},get:function(){return a(i.isWrapperType(this)?this.valueOf():this)},configurable:!0})},a.extend("should",Object.prototype),a.use=function(t){return t(this,this.Assertion),this},a.use(r(36)).use(r(37)).use(r(38)).use(r(39)).use(r(40)).use(r(41)).use(r(42)).use(r(43)).use(r(44)).use(r(45)).use(r(46))}).call(e,r(51))},function(t,e,r){function n(t,e){return p.isUndefined(e)?""+e:!p.isNumber(e)||!isNaN(e)&&isFinite(e)?p.isFunction(e)||p.isRegExp(e)?e.toString():e:e.toString()}function i(t,e){return p.isString(t)?t.length=0;n--)if(i[n]!=o[n])return!1;for(n=i.length-1;n>=0;n--)if(r=i[n],!u(t[r],e[r]))return!1;return!0}function f(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function h(t,e,r,n){var i;p.isString(r)&&(n=r,r=null);try{e()}catch(o){i=o}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&s(i,r,"Missing expected exception"+n),!t&&f(i,r)&&s(i,r,"Got unwanted exception"+n),t&&i&&r&&!f(i,r)||!t&&i)throw i}var p=r(56),d=Array.prototype.slice,y=Object.prototype.hasOwnProperty,g=t.exports=a;g.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var e=t.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=e.name,a=n.indexOf("\n"+i);if(a>=0){var u=n.indexOf("\n",a+1);n=n.substring(u+1)}this.stack=n}}},p.inherits(g.AssertionError,Error),g.fail=s,g.ok=a,g.equal=function(t,e,r){t!=e&&s(t,e,r,"==",g.equal)},g.notEqual=function(t,e,r){t==e&&s(t,e,r,"!=",g.notEqual)},g.deepEqual=function(t,e,r){u(t,e)||s(t,e,r,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,r){u(t,e)&&s(t,e,r,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,r){t!==e&&s(t,e,r,"===",g.strictEqual)},g.notStrictEqual=function(t,e,r){t===e&&s(t,e,r,"!==",g.notStrictEqual)},g["throws"]=function(){h.apply(this,[!0].concat(d.call(arguments)))},g.doesNotThrow=function(){h.apply(this,[!1].concat(d.call(arguments)))},g.ifError=function(t){if(t)throw t};var v=Object.keys||function(t){var e=[];for(var r in t)y.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";function n(t,e){"undefined"==typeof a.assertions[t]&&(a.assertions[t]=0),a.assertions[t]++,e&&a.total.assertions++}var i=r(24),o=r(23),s=r(22),a=r(21).stats,u=r(21).fail;t.exports=function(t){return{is:function(e){return n("is",!0),s(t).eql(e),this},isNot:function(e){return n("isNot",!0),s(t).not.eql(e),this},isEqualTo:function(e){return n("isEqualTo",!0),i.equal(t,e,"(actual == expected), actual "+typeof t+" is not equal to expected "+typeof e),this},isNotEqualTo:function(e){return n("isNotEqualTo",!0),i.notEqual(t,e,"(actual != expected), actual "+typeof t+" is equal to expected"+typeof e),this},isStrictEqualTo:function(e){return n("isStrictEqualTo",!0),i.strictEqual(t,e,"(actual === expected), actual "+typeof t+" is not identical to expected "+typeof e),this},isNotStrictEqualTo:function(e){return n("isNotStrictEqualTo",!0),i.notStrictEqual(t,e,"(actual !== expected), actual "+typeof t+" is identical to expected "+typeof e),this},isIdenticalTo:function(t){return n("isIdenticalTo"),this.isStrictEqualTo(t)},isNotIdenticalTo:function(t){return n("isNotIdenticalTo"),this.isNotStrictEqualTo(t)},match:function(e){return n("match",!0),"function"==typeof e?(e(t)!==!0&&u("actual value tested must match."),this):(s(t).match(e),this)},notMatch:function(e){return n("notMatch",!0),"function"==typeof e?(e(t)&&u("actual value tested ("+t+") must not match ("+e+")"),this):(s(t).not.match(e),this)},matchEach:function(e){if(n("matchEach",!0),"function"==typeof e){if("object"==typeof t)for(var r in t)e(t[r],r)!==!0&&u("matchEach()",t[r],e);else e(t)!==!0&&u("matchEach()",t,e);return this}for(var i in e)if("function"!=typeof e[i])this.match(e[i]);else{if("object"==typeof t){for(var r in t)e[i](t[r],r)!==!0&&u("matchEach()",t[r],e[i]);continue}e[i](t)!==!0&&u("matchEach()",t,e[i])}return this},notMatchEach:function(e){if(n("notMatchEach",!0),"function"==typeof e){if("object"==typeof t)for(var r in t)e(t[r],r)&&u("notMatchEach()",t[r],e);else e(t)&&u("notMatchEach()",t,e);return this}for(var i in e)if("function"!=typeof e[i])this.notMatch(e[i]);else{if("object"==typeof t){for(var r in t)e[i](t[r],r)&&u("notMatchEach()",t[r],e[i]);continue}e[i](t)&&u("notMatchEach()",t,e[i])}return this},isValid:function(t){return n("isValid"),this.match(t)},isNotValid:function(t){return n("isNotValid"),this.notMatch(t)},isType:function(e){return n("isType",!0),o(t).type(e),this},isNotType:function(e){return n("isNotType",!0),o(t).not.type(e),this},isObject:function(){return n("isObject",!0),s(t).object(),this},isArray:function(){return n("isArray",!0),s(t).array(),this},isFunction:function(){return n("isFunction",!0),s(t)["function"](),this},isString:function(){return n("isString",!0),s(t).string(),this},isNumber:function(){return n("isNumber",!0),s(t).number(),this},isBool:function(){return n("isBool"),this.isBoolean()},isBoolean:function(){return n("isBoolean",!0),s(t)["boolean"](),this},isNull:function(){return n("isNull",!0),s(t)["null"](),this},isUndefined:function(){return n("isUndefined",!0),s(t).undefined(),this},isRegExp:function(){return n("isRegExp",!0),s(t).regexp(),this},isNotRegExp:function(){return n("isNotRegExp",!0),s(t).not.regexp(),this},isDate:function(){return n("isDate",!0),s(t).date(),this},isNotDate:function(){return n("isNotDate",!0),s(t).not.date(),this},isArguments:function(){return n("isArguments",!0),o(t).arguments,this},isNotArguments:function(){return n("isNotArguments",!0),o(t).not.arguments,this},isTrue:function(){return n("isTrue",!0),s(t)["true"](),this},isNotTrue:function(){return n("isNotTrue",!0),s(t).not["true"](),this},isTruthy:function(){return n("isTruthy",!0),s(t).truthy(),this},isNotTruthy:function(){return n("isNotTruthy",!0),s(t).not.truthy(),this},isFalse:function(){return n("isFalse",!0),s(t)["false"](),this},isNotFalse:function(){return n("isNotFalse",!0),s(t).not["false"](),this},isFalsy:function(){return n("isFalsy",!0),s(t).falsy(),this},isNotFalsy:function(){return n("isNotFalsy",!0),s(t).not.falsy(),this},isEmpty:function(){return n("isEmpty",!0),s(t).empty(),this},isNotEmpty:function(){return n("isNotEmpty",!0),s(t).not.empty(),this},exists:function(){return n("exists",!0),s(t).exist(),this},isError:function(){return n("isError"),this["throws"](Error)},"throws":function(e,r){if(n("throws",!0),arguments.length>2)throw new Error("throws() assertion, takes maximum 2 arguments (constructor and expected).");return 1==arguments.length?"function"==typeof e?i["throws"](t,e):s(t)["throw"](e):2==arguments.length?s(t)["throw"](e,r):s(t)["throw"](),this},hasLength:function(e){if(n("hasLength",!0),"object"==typeof t){var r=0;for(var i in t)r++;r!==e&&u(t+"must has length of "+e)}else s(t).length(e);return this},hasNotLength:function(e){if(n("hasNotLength",!0),"object"==typeof t){var r=0;for(var i in t)r++;r===e&&u(t+"must has not length of "+e)}else s(t).not.length(e);return this},isBetween:function(e,r){return n("isBetween",!0),s(t).between(e,r),this},isNotBetween:function(e,r){return n("isNotBetween",!0),s(t).not.between(e,r),this},isBefore:function(e){return n("isBefore",!0),s(t).before(e),this},isAfter:function(e){return n("isAfter",!0),s(t).after(e),this},isGreaterThan:function(e){return n("isGreaterThan",!0),s(t).above(e),this},isLessThan:function(e){return n("isLessThan",!0),s(t).below(e),this},isApprox:function(e,r){return n("isApprox",!0),o(t).approximately(e,r),this},isInfinite:function(){return n("isInfinite",!0),o(t).Infinity,this},isNotInfinite:function(){return n("isNotInfinite",!0),o(t).not.Infinity,this},isEnumerable:function(e){return n("isEnumerable",!0),s(t).enumerable(e),this},isNotEnumerable:function(e){return n("isNotEnumerable",!0),s(t).nonenumerable(e),this},isFrozen:function(){return n("isFrozen",!0),s(t).frozen(),this},isNotFrozen:function(){return n("isNotFrozen",!0),s(t).not.frozen(),this},isInstanceOf:function(e){return n("isInstanceOf",!0),s(t)["instanceof"](e),this},isNotInstanceOf:function(e){return n("isNotInstanceOf",!0),s(t).not["instanceof"](e),this},hasProperty:function(e,r){if(n("hasProperty",!0),!arguments.length)throw new Error('hasProperty() asserter require the argument "property" (the name of the property).');if(1==arguments.length)s(t).property(e);else{if(2!=arguments.length)throw new Error("hasProperty() asserter, takes maximum 2 arguments (property and value).");s(t).property(e,r)}return this},hasNotProperty:function(e,r){if(n("hasNotProperty",!0),0===arguments.length)throw new Error('hasNotProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).not.property(e);else{if(2!==arguments.length)throw new Error("hasNotProperty() asserter, takes maximum 2 arguments (property and value).");s(t).not.property(e,r)}return this},hasOwnProperty:function(e,r){if(n("hasOwnProperty ",!0),0===arguments.length)throw new Error('hasOwnProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).ownProperty(e);else{if(2!==arguments.length)throw new Error("hasOwnProperty() asserter, takes maximum 2 arguments (property and value).");s(t).ownProperty(e,r)}return this},hasNotOwnProperty:function(e,r){if(n("hasNotOwnProperty",!0),0===arguments.length)throw new Error('hasNotOwnProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).not.ownProperty(e);else{if(2!==arguments.length)throw new Error("hasNotOwnProperty() asserter, takes maximum 2 arguments (property and value).");s(t).not.ownProperty(e,r)}return this},hasProperties:function(e){return n("hasProperties",!0),s(t).keys(e),this},hasNotProperties:function(e){return n("hasNotProperties",!0),s(t).not.keys(e),this},hasOwnProperties:function(e){return n("hasOwnProperties",!0),s(t).ownKeys(e),this},hasKey:function(){return n("hasKey"),this.hasProperty.apply(this,arguments)},notHasKey:function(){return n("notHasKey"),this.hasNotProperty.apply(this,arguments)},hasKeys:function(t){return n("hasKeys"),this.hasProperties(t)},notHasKeys:function(t){return n("notHasKeys"),this.hasNotProperties(t)},hasValue:function(e){return n("hasValue",!0),s(t).include(e),this},notHasValue:function(e){return n("notHasValue",!0),s(t).not.include(e),this},hasValues:function(e){n("hasValues",!0);for(var r in e)s(t).include(e[r]);return this},notHasValues:function(e){n("notHasValues",!0);for(var r in e)s(t).not.include(e[r]);return this},contains:function(e){if(n("contains",!0),arguments.length>1)for(var r in arguments)o(t).containDeep(arguments[r]);else o(t).containDeep(e);return this},notContains:function(e){if(n("notContains",!0),arguments.length>1)for(var r in arguments)o(t).not.containDeep(arguments[r]);else o(t).not.containDeep(e);return this},isReverseOf:function(e){return n("isReverseOf"),this.is(e.reverse()),s(t).permutationOf(e),this},isNotReverseOf:function(e){return n("isNotReverseOf"),this.isNot(e.reverse()),s(t).not.permutationOf(e),this},startsWith:function(e){return n("startsWith",!0),o(t).startWith(e),this},notStartsWith:function(e){return n("notStartsWith",!0),o(t).not.startWith(e),this},endsWith:function(e){return n("endsWith",!0),o(t).endWith(e),this},notEndsWith:function(e){return n("notEndsWith",!0),o(t).not.endWith(e),this},hasHttpStatus:function(e){return n("hasHttpStatus",!0),s(t).property("statusCode",e),this},notHasHttpStatus:function(e){return n("notHasHttpStatus",!0),s(t).not.property("statusCode",e),this},hasHeader:function(e,r){if(n("hasHeader",!0),0===arguments.length||arguments.length>2)throw new Error('hasHeader() asserter, takes minimum the "field" argument, maximum 2 arguments (field and value).');return s(t).property("headers"),1===arguments.length?s(t.headers).property(e.toLowerCase()):s(t.headers).property(e.toLowerCase(),r),this},notHasHeader:function(e,r){if(n("notHasHeader",!0),0===arguments.length||arguments.length>2)throw new Error('notHasHeader() asserter, takes minimum the "field" argument, maximum 2 arguments (field and value).');return 1===arguments.length?s(t.headers).not.property(e.toLowerCase()):s(t.headers).not.property(e.toLowerCase(),r),this},hasHeaderJson:function(){return n("hasHeaderJson",!0),s(t).property("headers"),s(t.headers).property("content-type"),s(t.headers["content-type"]).match(/application\/json/i),this},notHasHeaderJson:function(){return n("notHasHeaderJson",!0),t&&t.headers&&"content-type"in t.headers&&s(t.headers["content-type"]).not.match(/application\/json/i),this},hasHeaderHtml:function(){return n("hasHeaderHtml",!0),s(t).property("headers"),s(t.headers).property("content-type"),s(t.headers["content-type"]).match(/text\/html/i),this},notHasHeaderHtml:function(){return n("notHasHeaderHtml",!0),t&&t.headers&&"content-type"in t.headers&&s(t.headers["content-type"]).not.match(/text\/html/i),this}}}},function(t){"use strict";t.exports=["is","isNot","isIdenticalTo","isNotIdenticalTo","isEqualTo","isNotEqualTo","isStrictEqualTo","isNotStrictEqualTo","match","notMatch","isValid","isNotValid"]},function(t,e,r){var n=r(22),i=r(47),o=r(4);t.exports=function(t,e){if(t=t||"test.fail()",e=e||{},"expected"in e&&(e.expected=i(e.expected),"undefined"==typeof e.actual&&(t+=" | expected: "+e.expected)),e.inspect){var r=[];for(var s in e.inspect)r.push(i(e.inspect[s]));o.dump.apply(o,r),delete e.inspect}throw new n.AssertionError(t,e)}},function(t,e,r){"use strict";function n(){this.$di=new n.prototype.$di,this.$di.addAll({$api:this,$di:this.$di,$container:this.$di._container,$invoke:this.$wrap(this.$invoke),$inject:this.$wrap(this.$inject),$provider:this.$wrap(this.$provider),$factory:this.$wrap(this.$factory),$singleton:this.$wrap(this.$singleton),$apply:this.$wrap(this.$apply),$wrap:this.$wrap(this.$wrap)})}var i=r(49),o={};n.prototype.Noder=n,n.prototype.$di=i,n.prototype.Collection=i,n.prototype.createCollection=function(t){return t?new this.Collection(t):new this.Collection},n.prototype.createNoder=function(){return new this.Noder},n.prototype.use=function(t){var e=function(t,e){if("function"!=typeof t.__noder)throw new TypeError("Argument #1 passed to Noder.use() is not a valid plugin for Noder.io.A plugin must implement a method named `__noder()` that is used for initialization. Example: `module.exports.__noder = function MyPlugin(noder) {\n // here, the bootstrap\n};`\n\nAPI doc: http://noder.io/api/noder.html#use");t=t.__noder,e.length>1?t.apply(null,Array.prototype.concat.apply([this],Array.prototype.slice.call(e,1))):t(this)}.bind(this);return"string"==typeof t?e(r(50)(t),arguments):e(t,arguments),this},n.prototype.$invoke=function(t,e){return this.$di.invoke(t,e)},n.prototype.$inject=function(t,e){return this.$di.inject(t,e)},n.prototype.$provider=function(t,e,r){return this.$di.provider(t,e,r),this},n.prototype.$factory=function(t,e,r){return this.$di.factory(t,e,r),this},n.prototype.$singleton=function(t,e){return this.$di.singleton(t,e),this},n.prototype.$apply=function(t){return this.$di.apply(t)},n.prototype.$wrap=function(t){return this.$di.wrap(t)},n.prototype.$require=function(t,e,n){var i,s=this;return n=n||this,Object.defineProperty(n,t,{enumerable:!0,configurable:!1,get:function(){return"undefined"!=typeof i?i:s.$require.isLoaded(t,n)?i:(e||(e=t),i="function"==typeof e?e.call(s.$di._container):r(50)(e),o[t]||(o[t]=[]),o[t].push(n),i)},set:function(){throw new Error('"'+t+'" property is not writable because is a placeholder of a property of a lazy loading module.')}}),this},n.prototype.$require.isLoaded=function(t,e){return e?o[t]?(e=e||this,-1!==o[t].indexOf(e)):!1:o[t]?!0:!1},t.exports=new n},function(t,e,r){function n(t){var e=t.displayName||t.name||g(t);return"be an instance of "+e}function i(t,e,r,n){if(t===e)return!0;var u=o(t)?"plain":y(t),c=o(e)?"plain":y(e);if(u!=c)return!1;if("object"==u||"plain"==u||"array"==u){var l=r&&r.indexOf(t),f=n&&n.indexOf(e);if(l!=f)return!1;if(null!=l&&~l)return!0;r=r?r.concat([t]):[t],n=n?n.concat([e]):[e]}switch(u){case"number":if(isNaN(t)&&isNaN(e))return!0;case"boolean":case"string":case"date":return t.valueOf()==e.valueOf();case"regexp":return t.toString()===e.toString();case"array":if(t.length!=e.length)return!1;if(0==t.length)return!0;for(var h=0,d=t.length;d>h;++h)if(!i(t[h],e[h],r,n))return!1;return!0;case"object":if(s(t)!==s(e))return!1;if(a(t)&&a(e))return t.valueOf()===e.valueOf();case"plain":var g=p(t),v=p(e);if(g.length!=v.length)return!1;if(0==g.length)return!0;for(var m in t)if(!i(t[m],e[m],r,n))return!1;return!0}return!1}function o(t){if(!t)return!1;if("object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return null===e?!0:"constructor"in e?e.constructor===Object:!0}function s(t){var e=t&&Object.getPrototypeOf(t);return e&&e.constructor}function a(t){var e="function"==typeof t.valueOf&&t.valueOf;return e&&e!==Object.prototype.valueOf?e:null}function u(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;t=t.slice().sort(),e=e.slice().sort();for(var r=0;r=3&&(o+=" "+g(r)),n=n?Object.create(n):{},n.actual=this.actual,n.caller=arguments.callee.caller,arguments.length>=3&&(n.expected=r),new d(o,n)}}function h(t){return t.apply=t.apply,t.bind=t.bind,t.call=t.call,t.name=t.name,t.toString=t.toString,t.__proto__=this,t}function p(t){var e=[];for(var r in t)e.push(r);return e}var d=r(30),y=r(89),g=r(47);e=t.exports={get a(){return h.call(this,this["instanceof"])},get an(){return h.call(this,this["instanceof"])},get at(){return this},get be(){return h.call(this,this.equal)},get have(){return this},get is(){return h.call(this,this.equal)},get not(){var t=new this.constructor(this.actual);return t.negative=!this.negative,t},get to(){return this}},e["true"]=function(){var t=y(this.actual);f.call(this,"boolean"==t&&1==this.actual,"be",!0)},e["false"]=function(){var t=y(this.actual);f.call(this,"boolean"==t&&0==this.actual,"be",!1)},e["null"]=function(){f.call(this,null===this.actual,"be",null)},e.undefined=function(){f.call(this,void 0===this.actual,"be",void 0)},e["boolean"]=function(){f.call(this,"boolean"==y(this.actual),"be a boolean")},e.number=function(){f.call(this,"number"==y(this.actual),"be a number")},e.string=function(){f.call(this,"string"==y(this.actual),"be a string")},e.date=function(){f.call(this,"date"==y(this.actual),"be a date")},e.regexp=function(){f.call(this,"regexp"==y(this.actual),"be a regular expression")},e.array=function(){f.call(this,Array.isArray(this.actual),"be an array")},e["function"]=function(){f.call(this,"function"==typeof this.actual,"be a function")},e.object=function(){var t=this.actual&&"object"==typeof this.actual;f.call(this,t,"be an object")},e.truthy=function(){f.call(this,this.actual,"be truthy")},e.falsy=function(){f.call(this,!this.actual,"be falsy")},e.exist=function(){f.call(this,null!=this.actual,"exist")},e["instanceof"]=function(t){var e=this.actual instanceof t;f.call(this,e,n,t)},e.instanceOf=e["instanceof"],e.empty=function(){var t;t=Array.isArray(this.actual)||"string"==y(this.actual)?this.actual.length:"object"==typeof this.actual||"function"==typeof this.actual?p(this.actual).length:1,f.call(this,0===t,"be empty")},e.equal=function(t){f.call(this,this.actual===t,"equal",t)},e.eql=function(t){var e=i(this.actual,t);f.call(this,e,"be equivalent to",t,{diffable:!0})},e.include=function(t){var e;if(Array.isArray(this.actual)||"string"==y(this.actual))e=~this.actual.indexOf(t);else for(var r in this.actual)if(this.actual[r]===t){e=!0;break}f.call(this,e,"include",t)},e.contain=e.include,e.permutationOf=function(t){var e=u(this.actual,t);f.call(this,e,"be a permutation of",t,{diffable:!0})},e.match=function(t){var e=t instanceof RegExp?t:new RegExp(t);f.call(this,e.exec(this.actual),"match",e)},e["throw"]=function(t,e){1==arguments.length&&(e=t,t=null);var r,n;try{this.actual.call(null)}catch(i){r=!0,n=i}r&&t&&(r=n instanceof t),r&&arguments.length&&(r=c(n,e));var o=[r,"throw"];arguments.length&&o.push(e),f.apply(this,o)},e.length=function(t){f.call(this,this.actual.length==t,"have length of",t)},e.frozen=function(){f.call(this,Object.isFrozen(this.actual),"be frozen")},e.property=function(t,e){var r=null!=this.actual;r=r&&t in Object(this.actual),r&&arguments.length>1&&(r=this.actual[t]===e);var n='have property "'+t+'"';arguments.length>1&&(n+=" equal to "+g(e)),f.call(this,r,n)},e.ownProperty=function(t,e){var r=null!=this.actual;r=r&&Object.prototype.hasOwnProperty.call(this.actual,t),r&&arguments.length>1&&(r=this.actual[t]===e);var n='have own property "'+t+'"';arguments.length>1&&(n+=" equal to "+g(e)),f.call(this,r,n)},e.own=e.ownProperty,e.keys=function(t){var e=null!=this.actual,r=e&&p(Object(this.actual));e=e&&i(r.sort(),t.sort()),f.call(this,e,"have keys",t)},e.ownKeys=function(t){var e=null!=this.actual,r=e&&Object.keys(Object(this.actual));e=e&&i(r.sort(),t.sort()),f.call(this,e,"have own keys",t)},e.enumerable=function(t){var e=null!=this.actual;e=e&&l(Object(this.actual),t);var r='have enumerable property "'+t+'"';f.call(this,e,r)},e.enumerableProperty=e.enumerable,e.nonenumerable=function(t){var e=null!=this.actual;e=e&&t in Object(this.actual),e=e&&!l(Object(this.actual),t);var r='have nonenumerable property "'+t+'"';f.call(this,e,r)},e.nonenumerableProperty=e.nonenumerable,e.below=function(t){f.call(this,this.actualt,"be above",t)},e.gt=e.above,e.after=e.above,e.least=function(t){f.call(this,this.actual>=t,"be at least",t)},e.gte=e.least,e.between=function(t,e){f.call(this,t<=this.actual&&this.actual<=e,function(){return"be between "+g(t)+" and "+g(e)})}},function(t){function e(t,e){this.message=t,e&&"actual"in e&&(this.actual=e.actual),e&&"expected"in e&&(this.expected=e.expected),e&&"diffable"in e&&(this.diffable=e.diffable);var r=e&&e.caller||arguments.callee.caller;Error.captureStackTrace&&Error.captureStackTrace(this,r)}t.exports=e,e.prototype=Object.create(Error.prototype,{constructor:{value:e,configurable:!0,writable:!0}}),e.prototype.name="AssertionError",e.prototype.__defineGetter__("showDiff",function(){return this.diffable})},function(t,e,r){"use strict";var n=r(52)();t.exports=n},function(t,e,r){(function(t){function n(t){return l(t)&&(t.__ArrayLike||Array.isArray(t))}function i(t){return"number"==typeof t}function o(t){return"string"==typeof t}function s(t){return"boolean"==typeof t}function a(e){return"undefined"!=typeof t&&e instanceof t}function u(t){return l(t)&&"[object Date]"===c(t)}function c(t){return Object.prototype.toString.call(t)}function l(t){return"object"==typeof t&&null!==t}function f(t){return l(t)&&"[object RegExp]"===c(t)}function h(t){return null==t}function p(t){return null===t}function d(t){return"[object Arguments]"===c(t)}function y(t){return l(t)&&"[object Error]"===c(t)||t instanceof Error}function g(t){return void 0===t}/*! - * Should - * Copyright(c) 2010-2014 TJ Holowaychuk - * MIT Licensed +var n=r(32),i=function u(t){return new u.Assertion(t).proxied()};i.AssertionError=r(33),i.Assertion=r(34),i.format=r(49),i.type=r(50),i.config=r(35),e=t.exports=i,i.extend=function(t,e){t=t||"should",e=e||Object.prototype;var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(){},get:function(){return i(n.isWrapperType(this)?this.valueOf():this)},configurable:!0}),{name:t,descriptor:r,proto:e}},i.noConflict=function(t){return t=t||a,t&&(delete t.proto[t.name],t.descriptor&&Object.defineProperty(t.proto,t.name,t.descriptor)),i},i.use=function(t){return t(i,i.Assertion),this},i.use(r(36)).use(r(37)).use(r(38)).use(r(39)).use(r(40)).use(r(41)).use(r(42)).use(r(43)).use(r(44)).use(r(45)).use(r(46));var o=Object.prototype,s="should",a=i.extend(s,o)},function(t,e,r){function n(t,e){return p.isUndefined(e)?""+e:p.isNumber(e)&&!isFinite(e)?e.toString():p.isFunction(e)||p.isRegExp(e)?e.toString():e}function i(t,e){return p.isString(t)?t.length=0;o--)if(s[o]!=a[o])return!1;for(o=s.length-1;o>=0;o--)if(i=s[o],!u(t[i],e[i]))return!1;return!0}function f(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function h(t,e,r,n){var i;p.isString(r)&&(n=r,r=null);try{e()}catch(o){i=o}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&s(i,r,"Missing expected exception"+n),!t&&f(i,r)&&s(i,r,"Got unwanted exception"+n),t&&i&&r&&!f(i,r)||!t&&i)throw i}var p=r(54),d=Array.prototype.slice,g=Object.prototype.hasOwnProperty,y=t.exports=a;y.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var e=t.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=e.name,a=n.indexOf("\n"+i);if(a>=0){var u=n.indexOf("\n",a+1);n=n.substring(u+1)}this.stack=n}}},p.inherits(y.AssertionError,Error),y.fail=s,y.ok=a,y.equal=function(t,e,r){t!=e&&s(t,e,r,"==",y.equal)},y.notEqual=function(t,e,r){t==e&&s(t,e,r,"!=",y.notEqual)},y.deepEqual=function(t,e,r){u(t,e)||s(t,e,r,"deepEqual",y.deepEqual)},y.notDeepEqual=function(t,e,r){u(t,e)&&s(t,e,r,"notDeepEqual",y.notDeepEqual)},y.strictEqual=function(t,e,r){t!==e&&s(t,e,r,"===",y.strictEqual)},y.notStrictEqual=function(t,e,r){t===e&&s(t,e,r,"!==",y.notStrictEqual)},y["throws"]=function(){h.apply(this,[!0].concat(d.call(arguments)))},y.doesNotThrow=function(){h.apply(this,[!1].concat(d.call(arguments)))},y.ifError=function(t){if(t)throw t};var v=Object.keys||function(t){var e=[];for(var r in t)g.call(t,r)&&e.push(r);return e}},function(t,e,r){function n(t){var e=t.displayName||t.name||y(t);return"be an instance of "+e}function i(t,e,r,n){if(t===e)return!0;var u=o(t)?"plain":g(t),c=o(e)?"plain":g(e);if(u!=c)return!1;if("object"==u||"plain"==u||"array"==u){var l=r&&r.indexOf(t),f=n&&n.indexOf(e);if(l!=f)return!1;if(null!=l&&~l)return!0;r=r?r.concat([t]):[t],n=n?n.concat([e]):[e]}switch(u){case"number":if(isNaN(t)&&isNaN(e))return!0;case"boolean":case"string":case"date":return t.valueOf()==e.valueOf();case"regexp":return t.toString()===e.toString();case"array":if(t.length!=e.length)return!1;if(0==t.length)return!0;for(var h=0,d=t.length;d>h;++h)if(!i(t[h],e[h],r,n))return!1;return!0;case"object":if(s(t)!==s(e))return!1;if(a(t)&&a(e))return t.valueOf()===e.valueOf();case"plain":var y=p(t),v=p(e);if(y.length!=v.length)return!1;if(0==y.length)return!0;for(var _ in t)if(!i(t[_],e[_],r,n))return!1;return!0}return!1}function o(t){if(!t)return!1;if("object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return null===e?!0:"constructor"in e?e.constructor===Object:!0}function s(t){var e=t&&Object.getPrototypeOf(t);return e&&e.constructor}function a(t){var e="function"==typeof t.valueOf&&t.valueOf;return e&&e!==Object.prototype.valueOf?e:null}function u(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;t=t.slice().sort(),e=e.slice().sort();for(var r=0;r=3&&(o+=" "+y(r)),n=n?Object.create(n):{},n.actual=this.actual,n.caller=arguments.callee.caller,arguments.length>=3&&(n.expected=r),new d(o,n)}}function h(t){return t.apply=t.apply,t.bind=t.bind,t.call=t.call,t.name=t.name,t.toString=t.toString,t.__proto__=this,t}function p(t){var e=[];for(var r in t)e.push(r);return e}var d=r(26),g=r(59),y=r(51);e=t.exports={get a(){return h.call(this,this["instanceof"])},get an(){return h.call(this,this["instanceof"])},get at(){return this},get be(){return h.call(this,this.equal)},get have(){return this},get is(){return h.call(this,this.equal)},get not(){var t=new this.constructor(this.actual);return t.negative=!this.negative,t},get to(){return this}},e["true"]=function(){var t=g(this.actual);f.call(this,"boolean"==t&&1==this.actual,"be",!0)},e["false"]=function(){var t=g(this.actual);f.call(this,"boolean"==t&&0==this.actual,"be",!1)},e["null"]=function(){f.call(this,null===this.actual,"be",null)},e.undefined=function(){f.call(this,void 0===this.actual,"be",void 0)},e["boolean"]=function(){f.call(this,"boolean"==g(this.actual),"be a boolean")},e.number=function(){f.call(this,"number"==g(this.actual),"be a number")},e.string=function(){f.call(this,"string"==g(this.actual),"be a string")},e.date=function(){f.call(this,"date"==g(this.actual),"be a date")},e.regexp=function(){f.call(this,"regexp"==g(this.actual),"be a regular expression")},e.array=function(){f.call(this,Array.isArray(this.actual),"be an array")},e["function"]=function(){f.call(this,"function"==typeof this.actual,"be a function")},e.object=function(){var t=this.actual&&"object"==typeof this.actual;f.call(this,t,"be an object")},e.truthy=function(){f.call(this,this.actual,"be truthy")},e.falsy=function(){f.call(this,!this.actual,"be falsy")},e.exist=function(){f.call(this,null!=this.actual,"exist")},e["instanceof"]=function(t){var e=this.actual instanceof t;f.call(this,e,n,t)},e.instanceOf=e["instanceof"],e.empty=function(){var t;t=Array.isArray(this.actual)||"string"==g(this.actual)?this.actual.length:"object"==typeof this.actual||"function"==typeof this.actual?p(this.actual).length:1,f.call(this,0===t,"be empty")},e.equal=function(t){f.call(this,this.actual===t,"equal",t)},e.eql=function(t){var e=i(this.actual,t);f.call(this,e,"be equivalent to",t,{diffable:!0})},e.include=function(t){var e;if(Array.isArray(this.actual)||"string"==g(this.actual))e=~this.actual.indexOf(t);else for(var r in this.actual)if(this.actual[r]===t){e=!0;break}f.call(this,e,"include",t)},e.contain=e.include,e.permutationOf=function(t){var e=u(this.actual,t);f.call(this,e,"be a permutation of",t,{diffable:!0})},e.match=function(t){var e=t instanceof RegExp?t:new RegExp(t);f.call(this,e.exec(this.actual),"match",e)},e["throw"]=function(t,e){1==arguments.length&&(e=t,t=null);var r,n;try{this.actual.call(null)}catch(i){r=!0,n=i}r&&t&&(r=n instanceof t),r&&arguments.length&&(r=c(n,e));var o=[r,"throw"];arguments.length&&o.push(e),f.apply(this,o)},e.length=function(t){f.call(this,this.actual.length==t,"have length of",t)},e.frozen=function(){f.call(this,Object.isFrozen(this.actual),"be frozen")},e.property=function(t,e){var r=null!=this.actual;r=r&&t in Object(this.actual),r&&arguments.length>1&&(r=this.actual[t]===e);var n='have property "'+t+'"';arguments.length>1&&(n+=" equal to "+y(e)),f.call(this,r,n)},e.ownProperty=function(t,e){var r=null!=this.actual;r=r&&Object.prototype.hasOwnProperty.call(this.actual,t),r&&arguments.length>1&&(r=this.actual[t]===e);var n='have own property "'+t+'"';arguments.length>1&&(n+=" equal to "+y(e)),f.call(this,r,n)},e.own=e.ownProperty,e.keys=function(t){var e=null!=this.actual,r=e&&p(Object(this.actual));e=e&&i(r.sort(),t.sort()),f.call(this,e,"have keys",t)},e.ownKeys=function(t){var e=null!=this.actual,r=e&&Object.keys(Object(this.actual));e=e&&i(r.sort(),t.sort()),f.call(this,e,"have own keys",t)},e.enumerable=function(t){var e=null!=this.actual;e=e&&l(Object(this.actual),t);var r='have enumerable property "'+t+'"';f.call(this,e,r)},e.enumerableProperty=e.enumerable,e.nonenumerable=function(t){var e=null!=this.actual;e=e&&t in Object(this.actual),e=e&&!l(Object(this.actual),t);var r='have nonenumerable property "'+t+'"';f.call(this,e,r)},e.nonenumerableProperty=e.nonenumerable,e.below=function(t){f.call(this,this.actualt,"be above",t)},e.gt=e.above,e.after=e.above,e.least=function(t){f.call(this,this.actual>=t,"be at least",t)},e.gte=e.least,e.between=function(t,e){f.call(this,t<=this.actual&&this.actual<=e,function(){return"be between "+y(t)+" and "+y(e)})}},function(t){function e(t,e){this.message=t,e&&"actual"in e&&(this.actual=e.actual),e&&"expected"in e&&(this.expected=e.expected),e&&"diffable"in e&&(this.diffable=e.diffable);var r=e&&e.caller||arguments.callee.caller;Error.captureStackTrace&&Error.captureStackTrace(this,r)}t.exports=e,e.prototype=Object.create(Error.prototype,{constructor:{value:e,configurable:!0,writable:!0}}),e.prototype.name="AssertionError",e.prototype.__defineGetter__("showDiff",function(){return this.diffable})},function(t,e,r){"use strict";function n(){this.$di=new n.prototype.$di,this.$di.addAll({$api:this,$di:this.$di,$container:this.$di._container,$invoke:this.$wrap(this.$invoke),$inject:this.$wrap(this.$inject),$provider:this.$wrap(this.$provider),$factory:this.$wrap(this.$factory),$singleton:this.$wrap(this.$singleton),$apply:this.$wrap(this.$apply),$wrap:this.$wrap(this.$wrap)})}var i=r(52),o={};n.prototype.Noder=n,n.prototype.$di=i,n.prototype.Collection=i,n.prototype.createCollection=function(t){return t?new this.Collection(t):new this.Collection},n.prototype.createNoder=function(){return new this.Noder},n.prototype.use=function(t){var e=function(t,e){if("function"!=typeof t.__noder)throw new TypeError("Argument #1 passed to Noder.use() is not a valid plugin for Noder.io.A plugin must implement a method named `__noder()` that is used for initialization. Example: `module.exports.__noder = function MyPlugin(noder) {\n // here, the bootstrap\n};`\n\nAPI doc: http://noder.io/api/noder.html#use");t=t.__noder,e.length>1?t.apply(null,Array.prototype.concat.apply([this],Array.prototype.slice.call(e,1))):t(this)}.bind(this);return"string"==typeof t?e(r(48)(t),arguments):e(t,arguments),this},n.prototype.$invoke=function(t,e){return this.$di.invoke(t,e)},n.prototype.$inject=function(t,e){return this.$di.inject(t,e)},n.prototype.$provider=function(t,e,r){return this.$di.provider(t,e,r),this},n.prototype.$factory=function(t,e,r){return this.$di.factory(t,e,r),this},n.prototype.$singleton=function(t,e){return this.$di.singleton(t,e),this},n.prototype.$apply=function(t){return this.$di.apply(t)},n.prototype.$wrap=function(t){return this.$di.wrap(t)},n.prototype.$require=function(t,e,n){var i,s=this;return n=n||this,Object.defineProperty(n,t,{enumerable:!0,configurable:!1,get:function(){return"undefined"!=typeof i?i:s.$require.isLoaded(t,n)?i:(e||(e=t),i="function"==typeof e?e.call(s.$di._container):r(48)(e),o[t]||(o[t]=[]),o[t].push(n),i)},set:function(){throw new Error('"'+t+'" property is not writable because is a placeholder of a property of a lazy loading module.')}}),this},n.prototype.$require.isLoaded=function(t,e){return e?o[t]?(e=e||this,-1!==o[t].indexOf(e)):!1:o[t]?!0:!1},t.exports=new n},function(t,e,r){"use strict";function n(t,e){"undefined"==typeof a.assertions[t]&&(a.assertions[t]=0),a.assertions[t]++,e&&a.total.assertions++}var i=r(24),o=r(23),s=r(9),a=r(22).stats,u=r(22).fail;t.exports=function(t){return{is:function(e){return n("is",!0),s(t).eql(e),this},isNot:function(e){return n("isNot",!0),s(t).not.eql(e),this},isEqualTo:function(e){return n("isEqualTo",!0),i.equal(t,e,"(actual == expected), actual "+typeof t+" is not equal to expected "+typeof e),this},isNotEqualTo:function(e){return n("isNotEqualTo",!0),i.notEqual(t,e,"(actual != expected), actual "+typeof t+" is equal to expected"+typeof e),this},isStrictEqualTo:function(e){return n("isStrictEqualTo",!0),i.strictEqual(t,e,"(actual === expected), actual "+typeof t+" is not identical to expected "+typeof e),this},isNotStrictEqualTo:function(e){return n("isNotStrictEqualTo",!0),i.notStrictEqual(t,e,"(actual !== expected), actual "+typeof t+" is identical to expected "+typeof e),this},isIdenticalTo:function(t){return n("isIdenticalTo"),this.isStrictEqualTo(t)},isNotIdenticalTo:function(t){return n("isNotIdenticalTo"),this.isNotStrictEqualTo(t)},match:function(e){return n("match",!0),"function"==typeof e?(e(t)!==!0&&u("actual value tested must match."),this):(s(t).match(e),this)},notMatch:function(e){return n("notMatch",!0),"function"==typeof e?(e(t)&&u("actual value tested ("+t+") must not match ("+e+")"),this):(s(t).not.match(e),this)},matchEach:function(e){if(n("matchEach",!0),"function"==typeof e){if("object"==typeof t)for(var r in t)e(t[r],r)!==!0&&u("matchEach()",t[r],e);else e(t)!==!0&&u("matchEach()",t,e);return this}for(var i in e)if("function"!=typeof e[i])this.match(e[i]);else{if("object"==typeof t){for(var r in t)e[i](t[r],r)!==!0&&u("matchEach()",t[r],e[i]);continue}e[i](t)!==!0&&u("matchEach()",t,e[i])}return this},notMatchEach:function(e){if(n("notMatchEach",!0),"function"==typeof e){if("object"==typeof t)for(var r in t)e(t[r],r)&&u("notMatchEach()",t[r],e);else e(t)&&u("notMatchEach()",t,e);return this}for(var i in e)if("function"!=typeof e[i])this.notMatch(e[i]);else{if("object"==typeof t){for(var r in t)e[i](t[r],r)&&u("notMatchEach()",t[r],e[i]);continue}e[i](t)&&u("notMatchEach()",t,e[i])}return this},isValid:function(t){return n("isValid"),this.match(t)},isNotValid:function(t){return n("isNotValid"),this.notMatch(t)},isType:function(e){return n("isType",!0),o(t).type(e),this},isNotType:function(e){return n("isNotType",!0),o(t).not.type(e),this},isObject:function(){return n("isObject",!0),s(t).object(),this},isArray:function(){return n("isArray",!0),s(t).array(),this},isFunction:function(){return n("isFunction",!0),s(t)["function"](),this},isString:function(){return n("isString",!0),s(t).string(),this},isNumber:function(){return n("isNumber",!0),s(t).number(),this},isBool:function(){return n("isBool"),this.isBoolean()},isBoolean:function(){return n("isBoolean",!0),s(t)["boolean"](),this},isNull:function(){return n("isNull",!0),s(t)["null"](),this},isUndefined:function(){return n("isUndefined",!0),s(t).undefined(),this},isRegExp:function(){return n("isRegExp",!0),s(t).regexp(),this},isNotRegExp:function(){return n("isNotRegExp",!0),s(t).not.regexp(),this},isDate:function(){return n("isDate",!0),s(t).date(),this},isNotDate:function(){return n("isNotDate",!0),s(t).not.date(),this},isArguments:function(){return n("isArguments",!0),o(t).arguments,this},isNotArguments:function(){return n("isNotArguments",!0),o(t).not.arguments,this},isTrue:function(){return n("isTrue",!0),s(t)["true"](),this},isNotTrue:function(){return n("isNotTrue",!0),s(t).not["true"](),this},isTruthy:function(){return n("isTruthy",!0),s(t).truthy(),this},isNotTruthy:function(){return n("isNotTruthy",!0),s(t).not.truthy(),this},isFalse:function(){return n("isFalse",!0),s(t)["false"](),this},isNotFalse:function(){return n("isNotFalse",!0),s(t).not["false"](),this},isFalsy:function(){return n("isFalsy",!0),s(t).falsy(),this},isNotFalsy:function(){return n("isNotFalsy",!0),s(t).not.falsy(),this},isEmpty:function(){return n("isEmpty",!0),s(t).empty(),this},isNotEmpty:function(){return n("isNotEmpty",!0),s(t).not.empty(),this},exists:function(){return n("exists",!0),s(t).exist(),this},isError:function(){return n("isError"),this["throws"](Error)},"throws":function(e,r){if(n("throws",!0),arguments.length>2)throw new Error("throws() assertion, takes maximum 2 arguments (constructor and expected).");return 1==arguments.length?"function"==typeof e?i["throws"](t,e):s(t)["throw"](e):2==arguments.length?s(t)["throw"](e,r):s(t)["throw"](),this},hasLength:function(e){if(n("hasLength",!0),"object"==typeof t){var r=0;for(var i in t)r++;r!==e&&u(t+"must has length of "+e)}else s(t).length(e);return this},hasNotLength:function(e){if(n("hasNotLength",!0),"object"==typeof t){var r=0;for(var i in t)r++;r===e&&u(t+"must has not length of "+e)}else s(t).not.length(e);return this},isBetween:function(e,r){return n("isBetween",!0),s(t).between(e,r),this},isNotBetween:function(e,r){return n("isNotBetween",!0),s(t).not.between(e,r),this},isBefore:function(e){return n("isBefore",!0),s(t).before(e),this},isAfter:function(e){return n("isAfter",!0),s(t).after(e),this},isGreaterThan:function(e){return n("isGreaterThan",!0),s(t).above(e),this},isLessThan:function(e){return n("isLessThan",!0),s(t).below(e),this},isApprox:function(e,r){return n("isApprox",!0),o(t).approximately(e,r),this},isInfinite:function(){return n("isInfinite",!0),o(t).Infinity,this},isNotInfinite:function(){return n("isNotInfinite",!0),o(t).not.Infinity,this},isEnumerable:function(e){return n("isEnumerable",!0),s(t).enumerable(e),this},isNotEnumerable:function(e){return n("isNotEnumerable",!0),s(t).nonenumerable(e),this},isFrozen:function(){return n("isFrozen",!0),s(t).frozen(),this},isNotFrozen:function(){return n("isNotFrozen",!0),s(t).not.frozen(),this},isInstanceOf:function(e){return n("isInstanceOf",!0),s(t)["instanceof"](e),this},isNotInstanceOf:function(e){return n("isNotInstanceOf",!0),s(t).not["instanceof"](e),this},hasProperty:function(e,r){if(n("hasProperty",!0),!arguments.length)throw new Error('hasProperty() asserter require the argument "property" (the name of the property).');if(1==arguments.length)s(t).property(e);else{if(2!=arguments.length)throw new Error("hasProperty() asserter, takes maximum 2 arguments (property and value).");s(t).property(e,r)}return this},hasNotProperty:function(e,r){if(n("hasNotProperty",!0),0===arguments.length)throw new Error('hasNotProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).not.property(e);else{if(2!==arguments.length)throw new Error("hasNotProperty() asserter, takes maximum 2 arguments (property and value).");s(t).not.property(e,r)}return this},hasOwnProperty:function(e,r){if(n("hasOwnProperty ",!0),0===arguments.length)throw new Error('hasOwnProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).ownProperty(e);else{if(2!==arguments.length)throw new Error("hasOwnProperty() asserter, takes maximum 2 arguments (property and value).");s(t).ownProperty(e,r)}return this},hasNotOwnProperty:function(e,r){if(n("hasNotOwnProperty",!0),0===arguments.length)throw new Error('hasNotOwnProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).not.ownProperty(e);else{if(2!==arguments.length)throw new Error("hasNotOwnProperty() asserter, takes maximum 2 arguments (property and value).");s(t).not.ownProperty(e,r)}return this},hasProperties:function(e){return n("hasProperties",!0),s(t).keys(e),this},hasNotProperties:function(e){return n("hasNotProperties",!0),s(t).not.keys(e),this},hasOwnProperties:function(e){return n("hasOwnProperties",!0),s(t).ownKeys(e),this},hasKey:function(){return n("hasKey"),this.hasProperty.apply(this,arguments)},notHasKey:function(){return n("notHasKey"),this.hasNotProperty.apply(this,arguments)},hasKeys:function(t){return n("hasKeys"),this.hasProperties(t)},notHasKeys:function(t){return n("notHasKeys"),this.hasNotProperties(t)},hasValue:function(e){return n("hasValue",!0),s(t).include(e),this},notHasValue:function(e){return n("notHasValue",!0),s(t).not.include(e),this},hasValues:function(e){n("hasValues",!0);for(var r in e)s(t).include(e[r]);return this},notHasValues:function(e){n("notHasValues",!0);for(var r in e)s(t).not.include(e[r]);return this},contains:function(e){if(n("contains",!0),arguments.length>1)for(var r in arguments)o(t).containDeep(arguments[r]);else o(t).containDeep(e);return this},notContains:function(e){if(n("notContains",!0),arguments.length>1)for(var r in arguments)o(t).not.containDeep(arguments[r]);else o(t).not.containDeep(e);return this},isReverseOf:function(e){return n("isReverseOf"),this.is(e.reverse()),s(t).permutationOf(e),this},isNotReverseOf:function(e){return n("isNotReverseOf"),this.isNot(e.reverse()),s(t).not.permutationOf(e),this},startsWith:function(e){return n("startsWith",!0),o(t).startWith(e),this},notStartsWith:function(e){return n("notStartsWith",!0),o(t).not.startWith(e),this},endsWith:function(e){return n("endsWith",!0),o(t).endWith(e),this},notEndsWith:function(e){return n("notEndsWith",!0),o(t).not.endWith(e),this},hasHttpStatus:function(e){return n("hasHttpStatus",!0),s(t).property("statusCode",e),this},notHasHttpStatus:function(e){return n("notHasHttpStatus",!0),s(t).not.property("statusCode",e),this},hasHeader:function(e,r){if(n("hasHeader",!0),0===arguments.length||arguments.length>2)throw new Error('hasHeader() asserter, takes minimum the "field" argument, maximum 2 arguments (field and value).');return s(t).property("headers"),1===arguments.length?s(t.headers).property(e.toLowerCase()):s(t.headers).property(e.toLowerCase(),r),this},notHasHeader:function(e,r){if(n("notHasHeader",!0),0===arguments.length||arguments.length>2)throw new Error('notHasHeader() asserter, takes minimum the "field" argument, maximum 2 arguments (field and value).');return 1===arguments.length?s(t.headers).not.property(e.toLowerCase()):s(t.headers).not.property(e.toLowerCase(),r),this},hasHeaderJson:function(){return n("hasHeaderJson",!0),s(t).property("headers"),s(t.headers).property("content-type"),s(t.headers["content-type"]).match(/application\/json/i),this},notHasHeaderJson:function(){return n("notHasHeaderJson",!0),t&&t.headers&&"content-type"in t.headers&&s(t.headers["content-type"]).not.match(/application\/json/i),this},hasHeaderHtml:function(){return n("hasHeaderHtml",!0),s(t).property("headers"),s(t.headers).property("content-type"),s(t.headers["content-type"]).match(/text\/html/i),this},notHasHeaderHtml:function(){return n("notHasHeaderHtml",!0),t&&t.headers&&"content-type"in t.headers&&s(t.headers["content-type"]).not.match(/text\/html/i),this}}}},function(t){"use strict";t.exports=["is","isNot","isIdenticalTo","isNotIdenticalTo","isEqualTo","isNotEqualTo","isStrictEqualTo","isNotStrictEqualTo","match","notMatch","isValid","isNotValid"]},function(t,e,r){(function(e,r){/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2014 Petka Antonov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions:

+ * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * */ -e.isWrapperType=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean},e.merge=function(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t},e.isArray=n,e.isNumber=i,e.isBoolean=s,e.isString=o,e.isBuffer=a,e.isDate=u,e.isObject=l,e.isRegExp=f,e.isNullOrUndefined=h,e.isNull=p,e.isArguments=d,e.isFunction=function(t){return"function"==typeof t||t instanceof Function},e.isError=y,e.isUndefined=g,e.AssertionError=r(24).AssertionError;var v=Object.prototype.hasOwnProperty;e.forOwn=function(t,e,r){for(var n in t)v.call(t,n)&&e.call(r,t[n],n)};var m=/^\s*function\s*(\S*)\s*\(/;e.functionName=function(t){if(t.name)return t.name;var e=t.toString().match(m)[1];return e};var _=r(53).formatPropertyName;e.formatProp=function(t){return _(String(t))},e.formatEqlResult=function(t,r,n,i){return(t.path.length>0?"at "+t.path.map(e.formatProp).join(" -> "):"")+(t.a===r?"":", A has "+i(t.a))+(t.b===n?"":" and B has "+i(t.b))}}).call(e,r(57).Buffer)},function(t,e){function r(t){return function(e){e&&t.concat(i).forEach(function(t){console.warn(n,t)})}}var n="WARN",i=["To disable any warnings add should.warn = false","If you think that is not right, raise issue on github https://github.com/shouldjs/should.js/issues"];e.staticShouldUnWrap=r(["Static version of should was called with primitive type wrapper like should(new Number(10))","current version will unwrap it to assert on primitive value for you","but that will be changed in future versions, make sure you know what are you doing"])},function(t,e,r){t.exports=r(32).AssertionError},function(t,e,r){function n(t,e){this.obj=t,this.format=e}function i(t){return a+t}function o(t){return t.split("\n").map(i).join("\n")}{var s=r(34);r(32)}n.add=function(t,e,r){var i={enumerable:!0};i[r?"get":"value"]=function(){var t=new n(this.obj,this.format);t.anyOne=this.anyOne;try{e.apply(t,arguments)}catch(r){if(this.params=t.params,r instanceof s){if(this.negate)return this.obj=t.obj,this.negate=!1,this;this.nestedErrorMessage=r.message,this.fail()}throw r}return this.params=t.params,this.negate&&(t.negate=!0,this.nestedErrorMessage=t.params.message?t.params.message:t.getMessage(),this.fail()),this.obj=t.obj,this.negate=!1,this},Object.defineProperty(n.prototype,t,i)},n.alias=function(t,e){var r=Object.getOwnPropertyDescriptor(n.prototype,t);if(!r)throw new Error("Alias "+t+" -> "+e+" could not be created as "+t+" not defined");Object.defineProperty(n.prototype,e,r)};var a=" ";n.prototype={constructor:n,assert:function(t){if(t)return this;var e=this.params,r=e.message,n=!1;r||(r=this.getMessage(),n=!0),this.nestedErrorMessage&&r!=this.nestedErrorMessage&&(r=r+"\n"+o(this.nestedErrorMessage));var i=new s({message:r,actual:this.obj,expected:e.expected,stackStartFunction:this.assert});throw i.showDiff=e.showDiff,i.operator=e.operator,i.generatedMessage=n,i},fail:function(){return this.assert(!1)},getMessage:function(){var t=this.format("obj"in this.params?this.params.obj:this.obj),e="expected"in this.params?" "+this.format(this.params.expected):"",r="details"in this.params&&this.params.details?" ("+this.params.details+")":"";return"expected "+t+(this.negate?" not ":" ")+this.params.operator+e+r},get not(){return this.negate=!this.negate,this},get any(){return this.anyOne=!0,this}},t.exports=n},function(t,e,r){/*! +!function(e){t.exports=e()}(function(){var t,n,i;return function o(t,e,r){function n(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,o,t,e,r)}return e[s].exports}for(var i="function"==typeof _dereq_&&_dereq_,s=0;s0},n.prototype._withDomain=function(t){return void 0===u||null==u.domain||t.domain||(t=u.domain.bind(t)),t},n.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),t=this._withDomain(t),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(r){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},n.prototype.invokeLater=function(t,e,r){t=this._withDomain(t),this._lateQueue.push(t,e,r),this._queueTick()},n.prototype.invokeFirst=function(t,e,r){t=this._withDomain(t),this._normalQueue.unshift(t,e,r),this._queueTick()},n.prototype.invoke=function(t,e,r){t=this._withDomain(t),this._normalQueue.push(t,e,r),this._queueTick()},n.prototype.settlePromises=function(t){this._normalQueue._pushOne(t),this._queueTick()},n.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},n.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},n.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},n.prototype._reset=function(){this._isTickUsed=!1},r.exports=new n,r.exports.firstLineError=i},{"./queue.js":28,"./schedule.js":31}],3:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){return this.value}function i(){throw this.reason}function o(t){return this._then(n,null,null,{value:t},void 0)}function s(t){return this._then(i,i,null,{reason:t},void 0)}function a(t){this._setBoundTo(t)}t.prototype.bind=function(e){var n=r(e);if(n instanceof t){if(!n.isFulfilled()){if(n.isRejected())return t.reject(n.reason());var i=this.then(),u=i;return i=i._then(o,s,null,n,void 0),n._then(a,i._reject,null,i,null),i._cancellable()||i._setPendingCancellationParent(u),i}e=n.value()}var i=this.then();return i._setBoundTo(e),i},t.bind=function(e,r){return t.resolve(r).bind(e)},t.prototype._setPendingCancellationParent=function(t){this._settledValue=t},t.prototype._pendingCancellationParent=function(){if(this.isPending()&&void 0!==this._settledValue){var t=this._settledValue;return t.cancellable(),this._settledValue=void 0,t}},t.prototype._setIsBound=function(){this._bitField=131072|this._bitField},t.prototype._unsetIsBound=function(){this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.prototype._setIsMigratingBinding=function(){this._bitField=8388608|this._bitField},t.prototype._unsetIsMigratingBinding=function(){this._bitField=-8388609&this._bitField},t.prototype._isMigratingBinding=function(){return 8388608===(8388608&this._bitField)},t.prototype._setBoundTo=function(t){void 0===t?(this._isBound()&&(this._boundTo=void 0),this._unsetIsBound()):(this._setIsBound(),this._boundTo=t)}}},{}],4:[function(t,e){"use strict";function r(){try{Promise===i&&(Promise=n)}catch(t){}return i}var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise.js")();i.noConflict=r,e.exports=i},{"./promise.js":23}],5:[function(t,e){"use strict";var r=Object.create;if(r){var n=r(null),i=r(null);n[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}{var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier}e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(this._setCancellable(),this._cancellationParent=this._pendingCancellationParent(),this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,r){"use strict";r.exports=function(){function r(t){this._parent=t;var e=this._length=1+(void 0===t?0:t._length);w(this,r),e>32&&this.uncycle()}function n(t,e){for(var r=0;r=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function s(t){for(var e=[],r=0;r0&&(e=e.slice(r)),e}function u(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+c(e)+">, no stack trace)"}function c(t){var e=41;return t.lengtht)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},r.prototype.parent=function(){return this._parent},r.prototype.hasParent=function(){return void 0!==this._parent},r.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=r.parseStackAndMessage(t),a=e.message,u=[e.stack],c=this;void 0!==c;)u.push(s(c.stack.split("\n"))),c=c._parent;o(u),i(u),t.stack=n(a,u),t.__stackCleaned__=!0}},r.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?a(t):[" (No stack trace)"],{message:r,stack:s(e)}},r.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+y(n,t)}else r=e+String(t);"function"==typeof f?f(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},r.unhandledRejection=function(t){r.formatAndLogError(t,"^--- With additional stack trace: ")},r.isSupported=function(){return"function"==typeof w},r.fireRejectionEvent=function(t,e,n,i){var o=!1;try{"function"==typeof e&&(o=!0,"rejectionHandled"===t?e(i):e(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=j(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(b)try{u=b(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||r.formatAndLogError(n,"Unhandled rejection ")};var _=function(){return!1},m=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;r.setBounds=function(t,e){if(r.isSupported()){for(var n,i,o=t.stack.split("\n"),s=e.stack.split("\n"),a=-1,u=-1,c=0;ca||0>u||!n||!i||n!==i||a>=u||(_=function(t){if(d.test(t))return!0;var e=l(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var b,w=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():u(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,g=t,y=e;var r=Error.captureStackTrace;return _=function(t){return d.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return g=/@/,y=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i?(y=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?u(e):e.toString()},null):(g=t,y=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),j=function(){if(p.isNode)return function(t,r,n){return"rejectionHandled"===t?e.emit(t,n):e.emit(t,r,n)};var t=!1,r=!0;try{var n=new self.CustomEvent("test");t=n instanceof CustomEvent}catch(i){}if(!t)try{var o=document.createEvent("CustomEvent");o.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(o)}catch(i){r=!1}r&&(b=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var s={};return s.unhandledRejection="onunhandledRejection".toLowerCase(),s.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=s[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(f=function(t){console.warn(t)},p.isNode&&e.stderr.isTTY?f=function(t){e.stderr.write(""+t+"\n")}:p.isNode||"string"!=typeof(new Error).stack||(f=function(t){console.warn("%c"+t,"color: red")})),r}},{"./async.js":2,"./util.js":38}],8:[function(t,e){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundTo,u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],f=l===Error||null!=l&&l.prototype instanceof Error;if(f&&t instanceof l){var h=s(r).call(o,t);return h===a?(e.e=h.e,e):h}if("function"==typeof l&&!f){var p=n(l,t);if(p===a){t=a.e;break}if(p){var h=s(r).call(o,t);return h===a?(e.e=h.e,e):h}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e){"use strict";e.exports=function(e,r){var n,i,o=t("./async.js"),s=t("./errors.js").Warning,a=t("./util.js"),u=a.canAttachTrace,c=!1||a.isNode&&(!!{NODE_ENV:"production"}.BLUEBIRD_DEBUG||"development"==={NODE_ENV:"production"}.NODE_ENV);return e.prototype._ensurePossibleRejectionHandled=function(){this._setRejectionIsUnhandled(),o.invokeLater(this._notifyUnhandledRejection,this,void 0)},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return c&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(c&&u(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);t.stack=i.message+"\n"+i.stack.join("\n"),t.__stackCleaned__=!0}}},e.prototype._warn=function(t){var e=new s(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){i="function"==typeof t?t:void 0},e.onUnhandledRejectionHandled=function(t){n="function"==typeof t?t:void 0},e.longStackTraces=function(){if(o.haveItemsQueued()&&c===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");c=r.isSupported()},e.hasLongStackTraces=function(){return c&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},c=!1),function(){return c}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e){"use strict";var r=t("./util.js"),n=r.isPrimitive,i=r.wrapsPrimitiveReceiver;e.exports=function(t){var e=function(){return this},r=function(){throw this},o=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(t){return i&&n(t)?this._then(o(t,2),void 0,void 0,void 0,void 0):this._then(e,void 0,void 0,t,void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return i&&n(t)?this._then(o(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e){"use strict";function r(t,e){function r(n){return this instanceof r?(l(this,"message","string"==typeof n?n:e),l(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return c(r,Error),r}function n(t){return this instanceof n?(l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new n(t)}var i,o,s=t("./es5.js"),a=s.freeze,u=t("./util.js"),c=u.inherits,l=u.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),p=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{i=TypeError,o=RangeError}catch(g){i=r("TypeError","type error"),o=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace(),this._callback=e,this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:h,this._init$(void 0,-2)}function a(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var u=t("./util.js"),c=u.tryCatch,l=u.errorObj,f={},h=[];u.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===f){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,h=this._promise._boundTo;this._promise._pushContext();var p=c(u).call(h,t,r,o);if(this._promise._popContext(),p===l)return this._reject(p.e);var d=i(p,this._promise);if(d instanceof e){if(d=d._target(),d._isPending())return a>=1&&this._inFlight++,n[r]=f,d._proxyPromiseArray(this,r);if(!d._isFulfilled())return this._reject(d._reason());p=d._value()}n[r]=p}var g=++this._totalResolved;g>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):a(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):a(t,e,r,i).promise()}}},{"./util.js":38}],20:[function(t,e){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundTo,[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundTo,i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundTo,t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e){"use strict";e.exports=function(){function e(t){if("function"!=typeof t)throw new c("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==e)throw new c("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==l&&this._resolveFromResolver(t)}function r(t){var r=new e(l);r._fulfillmentHandler0=t,r._rejectionHandler0=t,r._progressHandler0=t,r._promise0=t,r._receiver0=t,r._settledValue=t}var n=function(){return new c("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},i=function(){return new e.PromiseInspection(this._target())},o=function(t){return e.reject(new c(t))},s=t("./util.js"),a=t("./async.js"),u=t("./errors.js"),c=e.TypeError=u.TypeError;e.RangeError=u.RangeError,e.CancellationError=u.CancellationError,e.TimeoutError=u.TimeoutError,e.OperationalError=u.OperationalError,e.RejectionError=u.OperationalError,e.AggregateError=u.AggregateError;var l=function(){},f={},h={e:null},p=t("./thenables.js")(e,l),d=t("./promise_array.js")(e,l,p,o),g=t("./captured_trace.js")(),y=t("./debuggability.js")(e,g),v=t("./context.js")(e,g,y),_=t("./catch_filter.js")(h),m=t("./promise_resolver.js"),b=m._nodebackForPromise,w=s.errorObj,j=s.tryCatch;return e.prototype.toString=function(){return"[object Promise]"},e.prototype.caught=e.prototype["catch"]=function(t){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s)return e.reject(new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new _(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},e.prototype.reflect=function(){return this._then(i,i,void 0,this,void 0)},e.prototype.then=function(t,e,r){if(y()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+s.classString(t);arguments.length>1&&(n+=", "+s.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0)},e.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},e.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,f,void 0)},e.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},e.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},e.prototype.all=function(){return new d(this).promise()},e.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},e.is=function(t){return t instanceof e},e.fromNode=function(t){var r=new e(l),n=j(t)(b(r));return n===w&&r._rejectCallback(n.e,!0,!0),r},e.all=function(t){return new d(t).promise()},e.defer=e.pending=function(){var t=new e(l);return new m(t)},e.cast=function(t){var r=p(t);if(!(r instanceof e)){var n=r;r=new e(l),r._fulfillUnchecked(n)}return r},e.resolve=e.fulfilled=e.cast,e.reject=e.rejected=function(t){var r=new e(l);return r._captureStackTrace(),r._rejectCallback(t,!0),r +},e.setScheduler=function(t){if("function"!=typeof t)throw new c("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=a._schedule;return a._schedule=t,e},e.prototype._then=function(t,r,n,i,o){var s=void 0!==o,u=s?o:new e(l);s||(u._propagateFrom(this,5),u._captureStackTrace());var c=this._target();c!==this&&(s||(u._setIsMigrated(),void 0===i&&(u._setIsMigratingBinding(),i=this)));var f=c._addCallbacks(t,r,n,u,i);return c._isResolved()&&!c._isSettlePromisesQueued()&&a.invoke(c._settlePromiseAtPostResolution,c,f),u},e.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},e.prototype._length=function(){return 131071&this._bitField},e.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},e.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},e.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},e.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},e.prototype._setRejected=function(){this._bitField=134217728|this._bitField},e.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},e.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},e.prototype._isFinal=function(){return(33554432&this._bitField)>0},e.prototype._cancellable=function(){return(67108864&this._bitField)>0},e.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},e.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},e.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},e.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},e.prototype._isMigrated=function(){return(4194304&this._bitField)>0},e.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return void 0===e&&this._isBound()?this._boundTo:e},e.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},e.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},e.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},e.prototype._migrateCallbacks=function(t,r){var n=t._fulfillmentHandlerAt(r),i=t._rejectionHandlerAt(r),o=t._progressHandlerAt(r),s=t._promiseAt(r),a=t._receiverAt(r);s instanceof e&&(s._setIsMigrated(),void 0===a&&(a=t,s._setIsMigratingBinding())),this._addCallbacks(n,i,o,s,a)},e.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=131066&&(o=0,this._setLength(0)),0===o)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=t),"function"==typeof e&&(this._rejectionHandler0=e),"function"==typeof r&&(this._progressHandler0=r);else{var s=5*o-5;this[s+3]=n,this[s+4]=i,"function"==typeof t&&(this[s+0]=t),"function"==typeof e&&(this[s+1]=e),"function"==typeof r&&(this[s+2]=r)}return this._setLength(o+1),o},e.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},e.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},e.prototype._resolveCallback=function(t,r){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(n(),!1,!0);var i=p(t,this);if(!(i instanceof e))return this._fulfill(t);var o=1|(r?4:0);this._propagateFrom(i,o);var s=i._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},e.prototype._rejectCallback=function(t,e,r){r||s.markAsOriginatingFromRejection(t);var n=s.ensureErrorObject(t),i=s.canAttachTrace(t)&&"string"==typeof n.stack&&n.stack.length>0;this._attachExtraTrace(n,e?i:!1),this._reject(t,n===t?void 0:n)},e.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=j(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===w&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},e.prototype._settlePromiseFromHandler=function(t,e,r,i){if(!i._isRejected()){i._pushContext();var o;if(o=e!==f||this._isRejected()?j(t).call(e,r):j(t).apply(this._boundTo,r),i._popContext(),o===w||o===i||o===h){var s=o===i?n():o.e;i._rejectCallback(s,!1,!0)}else i._resolveCallback(o)}},e.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},e.prototype._followee=function(){return this._rejectionHandler0},e.prototype._setFollowee=function(t){this._rejectionHandler0=t},e.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},e.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},e.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},e.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},e.prototype._settlePromiseAt=function(t){var r=this._promiseAt(t),n=r instanceof e;if(n&&r._isMigrated())return r._unsetIsMigrated(),a.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,u=this._receiverAt(t);n&&r._isMigratingBinding()&&(r._unsetIsMigratingBinding(),u=u._boundTo),this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,u,s,r):i.call(u,s,r):u instanceof d?u._isResolved()||(this._isFulfilled()?u._promiseFulfilled(s,r):u._promiseRejected(s,r)):n&&(this._isFulfilled()?r._fulfill(s):r._reject(s,o)),t>=4&&4===(31&t)&&a.invokeLater(this._setLength,this,0)},e.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},e.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},e.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},e.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},e.prototype._queueSettlePromises=function(){a.settlePromises(this),this._setSettlePromisesQueued()},e.prototype._fulfillUnchecked=function(t){if(t===this){var e=n();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},e.prototype._rejectUncheckedCheckError=function(t){var e=s.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},e.prototype._rejectUnchecked=function(t,e){if(t===this){var r=n();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void a.throwLater(function(t){throw"stack"in t&&a.invokeFirst(g.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},e.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},e._makeSelfResolutionError=n,t("./method.js")(e,l,p,o),t("./bind.js")(e,l,p),t("./finally.js")(e,h,p),t("./direct_resolve.js")(e),t("./synchronous_inspection.js")(e),t("./join.js")(e,d,p,l),e.Promise=e,t("./map.js")(e,d,o,p,l),t("./using.js")(e,o,p,v),t("./generators.js")(e,o,l,p),t("./nodeify.js")(e),t("./cancel.js")(e),t("./promisify.js")(e,l),t("./props.js")(e,d,p,o),t("./race.js")(e,l,p,o),t("./reduce.js")(e,d,o,p,l),t("./settle.js")(e,d),t("./call_get.js")(e),t("./some.js")(e,d,o),t("./progress.js")(e,d),t("./any.js")(e),t("./each.js")(e,l),t("./timers.js")(e,l),t("./filter.js")(e,l),s.toFastProperties(e),s.toFastProperties(e.prototype),r({a:1}),r({b:2}),r({c:3}),r(1),r(function(){}),r(void 0),r(!1),r(new e(l)),g.setBounds(a.firstLineError,s.lastLineError),e}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var f=this._promise,h=0;l>h;++h){var p=this._isResolved(),d=n(s[h],f);d instanceof e?(d=d._target(),p?d._unsetRejectionIsUnhandled():d._isPending()?d._proxyPromiseArray(this,h):d._isFulfilled()?this._promiseFulfilled(d._value(),h):this._promiseRejected(d._reason(),h)):p||this._promiseFulfilled(d,h)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e){"use strict";function r(t){return t instanceof Error&&h.getPrototypeOf(t)===Error.prototype}function n(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=h.keys(t),i=0;i2){for(var o=arguments.length,s=new Array(o-1),u=1;o>u;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(r);t=null}}}var o,s=t("./util.js"),a=s.maybeWrapAsError,u=t("./errors.js"),c=u.TimeoutError,l=u.OperationalError,f=s.haveGetters,h=t("./es5.js"),p=/^(?:name|message|stack|cause)$/;if(o=f?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=i(t),this.callback=this.asCallback},f){var d={get:function(){return i(this.promise)}};h.defineProperty(o.prototype,"asCallback",d),h.defineProperty(o.prototype,"callback",d)}o._nodebackForPromise=i,o.prototype.toString=function(){return"[object PromiseResolver]"},o.prototype.resolve=o.prototype.fulfill=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},o.prototype.reject=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},o.prototype.progress=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},o.prototype.cancel=function(t){this.promise.cancel(t)},o.prototype.timeout=function(){this.reject(new c("timeout"))},o.prototype.isResolved=function(){return this.promise.isResolved()},o.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=o},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e){"use strict";e.exports=function(e,r){function n(t){return!w.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=p.getDataPropertyOrDefault(t,e+r,b);return n?i(n):!1}function s(t,e,r){for(var n=0;ns;s+=2){var c=o[s],l=o[s+1],f=c+e;t[f]=n===A?A(c,h,c,l,e):n(l,function(){return A(c,h,c,l,e)})}return p.toFastProperties(t),t}function l(t,e){return A(t,e,void 0,t)}var f,h={},p=t("./util.js"),d=t("./promise_resolver.js")._nodebackForPromise,g=p.withAppended,y=p.maybeWrapAsError,v=p.canEvaluate,_=t("./errors").TypeError,m="Async",b={__isPromisified__:!0},w=/^(?:length|name|arguments|caller|prototype|__isPromisified__)$/,j=function(t,e){return p.isIdentifier(t)&&"_"!==t.charAt(0)&&!p.isClass(e)},E=function(t){return t.replace(/([$])/,"\\$")},A=v?f:u;e.promisify=function(t,e){if("function"!=typeof t)throw new _("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?h:e);return p.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new _("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=j);var i=e.promisifier;if("function"!=typeof i&&(i=A),!p.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=p.inheritedDataKeys(t),s=0;si;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e){"use strict";function r(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacityh;++h){var d=t[h];(void 0!==d||h in t)&&e.cast(d)._then(l,f,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var a=i(n,this._promise),u=!1,c=a instanceof e;c&&(a=a._target(),a._isPending()?a._proxyPromiseArray(this,-1):a._isFulfilled()?(n=a._value(),this._gotAccum=!0):(this._reject(a._reason()),u=!0)),c||this._zerothIsAccum||(this._gotAccum=!0),this._callback=r,this._accum=n,u||this._init$(void 0,-5)}function a(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var u=t("./util.js"),c=u.tryCatch,l=u.errorObj;u.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,f=this._gotAccum,h=this._valuesPhase;if(!h)for(h=this._valuesPhase=new Array(s),o=0;s>o;++o)h[o]=0;if(o=h[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=f=!0,h[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=f=!0):0===o?h[r]=1:(h[r]=2,this._accum=t),f){for(var p,d=this._callback,g=this._promise._boundTo,y=this._reducingIndex;s>y;++y)if(o=h[y],2!==o){if(1!==o)return;if(t=n[y],this._promise._pushContext(),u?(a.push(t),p=c(d).call(g,t,y,s)):p=c(d).call(g,this._accum,t,y,s),this._promise._popContext(),p===l)return this._reject(p.e);var v=i(p,this._promise);if(v instanceof e){if(v=v._target(),v._isPending())return h[y]=4,v._proxyPromiseArray(this,y);if(!v._isFulfilled())return this._reject(v._reason());p=v._value()}this._reducingIndex=y+1,this._accum=p}else this._reducingIndex=y+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return a(this,t,e,null)},e.reduce=function(t,e,r,n){return a(t,e,r,n)}}},{"./util.js":38}],31:[function(t,n){"use strict";var i;if(t("./util.js").isNode){var o=e.versions.node.split(".").map(Number);i=0===o[0]&&o[1]>10||o[0]>0?r.setImmediate:e.nextTick}else"undefined"!=typeof MutationObserver?(i=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},i.isStatic=!0):i="undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};n.exports=i},{"./util.js":38}],32:[function(t,e){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var f=a.tryCatch(i)(t);if(f===u){n&&n._pushContext();var l=e.reject(f.e);return n&&n._popContext(),l}if("function"==typeof f)return s(t,f,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(r){l&&(t===r?l._rejectCallback(e._makeSelfResolutionError(),!1,!0):l._resolveCallback(r),l=null)}function s(t){l&&(l._rejectCallback(t,h,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),f=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var h=!0,p=a.tryCatch(n).call(t,o,s,c);return h=!1,l&&p===u&&(l._rejectCallback(p.e,!0,!0),l=null),f}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){"string"!=typeof e&&(e="operation timed out");var r=new s(e);o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(f){return s(f)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new y;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new y;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function f(t,e,r){this._data=t,this._promise=e,this._context=r}function h(t,e,r){this.constructor$(t,e,r)}function p(t){return f.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var d=t("./errors.js").TypeError,g=t("./util.js").inherits,y=e.PromiseInspection;f.prototype.data=function(){return this._data},f.prototype.promise=function(){return this._promise},f.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},f.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},f.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},g(h,f),h.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");t--;for(var s=new Array(t),a=0;t>a;++a){var u=arguments[a];if(f.isDisposer(u)){var h=u;u=u.promise(),u._setDisposable(h)}else{var d=n(u);d instanceof e&&(u=d._then(p,null,null,{resources:s,index:a},void 0))}s[a]=u}var g=e.settle(s).then(o).then(function(t){g._pushContext();var e;try{e=i.apply(void 0,t)}finally{g._popContext()}return e})._then(c,l,void 0,s,void 0);return s.promise=g,g},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new h(t,this,i());throw new d}}},{"./errors.js":13,"./util.js":38}],38:[function(t,r,n){"use strict";function i(){try{return T.apply(this,arguments)}catch(t){return O.e=t,O}}function o(t){return T=t,i}function s(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function a(t){return!s(t)}function u(t){return s(t)?new Error(v(t)):t}function c(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function l(t,e,r){if(!E.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function f(t,e,r){if(s(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return E.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=E.names(t.prototype);return E.isES5?e.length>1:e.length>0&&!(1===e.length&&"constructor"===e[0])}return!1}catch(r){return!1}}function d(t){function e(){}return e.prototype=t,e}function g(t){return k.test(t)}function y(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r; +return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function _(t){try{f(t,"isOperational",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return t instanceof Error&&E.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function j(t,e,r){for(var n=E.names(t),i=0;i * MIT Licensed */ -var n=r(32),i=r(24),o=i.AssertionError;t.exports=function(t){var e=t.format;n.merge(t,i),t.exist=t.exists=function(r,n){if(null==r)throw new o({message:n||"expected "+e(r)+" to exist",stackStartFunction:t.exist})},t.not={},t.not.exist=t.not.exists=function(r,n){if(null!=r)throw new o({message:n||"expected "+e(r)+" to not exist",stackStartFunction:t.not.exist})}}},function(t){/*! +var n=r(50);e.isWrapperType=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean},e.merge=function(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t};var i=Object.prototype.hasOwnProperty;e.forEach=function(t,e,r){for(var n in t)if(i.call(t,n)&&e.call(r,t[n],n,t)===!1)return},e.some=function(t,r,n){var i=!1;return e.forEach(t,function(e,o){return r.call(n,e,o,t)?(i=!0,!1):void 0},n),i};var o=/^\s*function\s*(\S*)\s*\(/;e.functionName=function(t){if(t.name)return t.name;var e=t.toString().match(o)[1];return e};var s=r(49).formatPropertyName;e.formatProp=function(t){return s(String(t))},e.isEmptyObject=function(t){for(var e in t)if(i.call(t,e))return!1;return!0},e.isIndexable=function(t){var e=n(t);return e==n.ARRAY||e==n.BUFFER||e==n.ARGUMENTS||e==n.ARRAY_BUFFER||e==n.TYPED_ARRAY||e==n.DATA_VIEW||e==n.STRING},e.length=function(t){switch(n(t)){case n.ARRAY_BUFFER:case n.TYPED_ARRAY:case n.DATA_VIEW:return t.byteLength;case n.ARRAY:case n.BUFFER:case n.ARGUMENTS:case n.FUNCTION:case n.STRING:return t.length}}},function(t,e,r){function n(t){return u+t}function i(t){return t.split("\n").map(n).join("\n")}var o=r(32),s=r(49),a=function(t){if(o.merge(this,t),t.message||Object.defineProperty(this,"message",{get:function(){return this._message||(this._message=this.generateMessage(),this.generatedMessage=!0),this._message},configurable:!0,enumerable:!1}),Error.captureStackTrace)Error.captureStackTrace(this,this.stackStartFunction);else{var e=new Error;if(e.stack){var r=e.stack;if(this.stackStartFunction){var n=o.functionName(this.stackStartFunction),i=r.indexOf("\n"+n);if(i>=0){var s=r.indexOf("\n",i+1);r=r.substring(s+1)}}this.stack=r}}},u=" ";a.prototype=Object.create(Error.prototype,{name:{value:"AssertionError"},generateMessage:{value:function(){if(!this.operator&&this.previous)return this.previous.message;var t=s(this.actual),e="expected"in this?" "+s(this.expected):"",r="details"in this&&this.details?" ("+this.details+")":"",n=this.previous?"\n"+i(this.previous.message):"";return"expected "+t+(this.negate?" not ":" ")+this.operator+e+r+n}}}),t.exports=a},function(t,e,r){function n(t){this.obj=t,this.anyOne=!1,this.negate=!1,this.params={actual:t}}{var i=r(33),o=r(32);r(49)}n.add=function(t,e,r){var o={enumerable:!0,configurable:!0};r=!!r,o[r?"get":"value"]=function(){var r=new n(this.obj,this,t);r.anyOne=this.anyOne;try{e.apply(r,arguments)}catch(o){if(o instanceof i){if(this.negate)return this.obj=r.obj,this.negate=!1,this.proxied();r!=o.assertion&&(r.params.previous=o),r.negate=!1,r.fail()}throw o}return this.negate&&(r.negate=!0,r.params.details="false negative fail",r.fail()),this.params.operator||(this.params=r.params),this.obj=r.obj,this.negate=!1,this.proxied()},Object.defineProperty(n.prototype,t,o)},n.addChain=function(t,e){e=e||function(){},Object.defineProperty(n.prototype,t,{get:function(){return e(),this.proxied()},enumerable:!0})},n.alias=function(t,e){var r=Object.getOwnPropertyDescriptor(n.prototype,t);if(!r)throw new Error("Alias "+t+" -> "+e+" could not be created as "+t+" not defined");Object.defineProperty(n.prototype,e,r)},n.prototype={constructor:n,assert:function(t){if(t)return this.proxied();var e=this.params;throw"obj"in e&&!("actual"in e)?e.actual=e.obj:"obj"in e||"actual"in e||(e.actual=this.obj),e.stackStartFunction=e.stackStartFunction||this.assert,e.negate=this.negate,e.assertion=this,new i(e)},fail:function(){return this.assert(!1)},get not(){return this.negate=!this.negate,this.proxied()},get any(){return this.anyOne=!0,this.proxied()},proxied:function(){return"function"==typeof Proxy?new Proxy(this,{get:function(t,e){if(e in t)return t[e];throw new Error("Assertion has no property "+o.formatProp(e))}}):this}},t.exports=n},function(t){var e={checkProtoEql:!1};t.exports=e},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -t.exports=function(t,e){function r(t){Object.defineProperty(e.prototype,t,{get:function(){return this},enumerable:!0})}["an","of","a","and","be","have","with","is","which","the"].forEach(r)}},function(t){/*! +var n=r(32),i=r(53),o=r(33);t.exports=function(t){var e=t.format;n.merge(t,i),t.exist=t.exists=function(r,n){if(null==r)throw new o({message:n||"expected "+e(r)+" to exist",stackStartFunction:t.exist})},t.not={},t.not.exist=t.not.exists=function(r,n){if(null!=r)throw new o({message:n||"expected "+e(r)+" to not exist",stackStartFunction:t.not.exist})}}},function(t){t.exports=function(t,e){["an","of","a","and","be","have","with","is","which","the"].forEach(function(t){e.addChain(t)})}},function(t){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed @@ -34,17 +55,17 @@ t.exports=function(t,e){e.add("true",function(){this.is.exactly(!0)},!0),e.alias * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -t.exports=function(t,e){e.add("NaN",function(){this.params={operator:"to be NaN"},this.assert(this.obj!==this.obj)},!0),e.add("Infinity",function(){this.params={operator:"to be Infinity"},this.obj.should.be.a.Number.and.not.a.NaN.and.assert(!isFinite(this.obj))},!0),e.add("within",function(t,e,r){this.params={operator:"to be within "+t+".."+e,message:r},this.assert(this.obj>=t&&this.obj<=e)}),e.add("approximately",function(t,e,r){this.params={operator:"to be approximately "+t+" ±"+e,message:r},this.assert(Math.abs(this.obj-t)<=e)}),e.add("above",function(t,e){this.params={operator:"to be above "+t,message:e},this.assert(this.obj>t)}),e.add("below",function(t,e){this.params={operator:"to be below "+t,message:e},this.assert(this.obj=t&&this.obj<=e)}),e.add("approximately",function(t,e,r){this.params={operator:"to be approximately "+t+" ±"+e,message:r},this.assert(Math.abs(this.obj-t)<=e)}),e.add("above",function(t,e){this.params={operator:"to be above "+t,message:e},this.assert(this.obj>t)}),e.add("below",function(t,e){this.params={operator:"to be below "+t,message:e},this.assert(this.obj0?"at "+t.path.map(s.formatProp).join(" -> "):"")+(t.a===e?"":", A has "+n(t.a))+(t.b===r?"":" and B has "+n(t.b))+(t.showReason?" because "+t.reason:"")).trim()}/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(88),i=(r(33),r(32));t.exports=function(t,e){e.add("eql",function(e,r){this.params={operator:"to equal",expected:e,showDiff:!0,message:r};var o=n(this.obj,e);o.result||(this.params.details=i.formatEqlResult(o,this.obj,e,t.format)),this.assert(o.result)}),e.add("equal",function(t,e){this.params={operator:"to be",expected:t,showDiff:!0,message:e},this.assert(t===this.obj)}),e.alias("equal","exactly")}},function(t,e,r){/*! +var i=r(58),o=r(50),s=r(32);t.exports=function(t,e){e.add("eql",function(e,r){this.params={operator:"to equal",expected:e,message:r};var s=i(this.obj,e,t.config);this.params.details=s.result?"":n(s,this.obj,e,t.format),this.params.showDiff=o(this.obj)==o(e),this.assert(s.result)}),e.add("equal",function(t,e){this.params={operator:"to be",expected:t,message:e},this.params.showDiff=o(this.obj)==o(t),this.assert(t===this.obj)}),e.alias("equal","exactly")}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32);t.exports=function(t,e){e.add("Number",function(){this.params={operator:"to be a number"},this.assert(n.isNumber(this.obj))},!0),e.add("arguments",function(){this.params={operator:"to be arguments"},this.assert(n.isArguments(this.obj))},!0),e.add("type",function(t,e){this.params={operator:"to have type "+t,message:e},(typeof this.obj).should.be.exactly(t,e)}),e.add("instanceof",function(t,e){this.params={operator:"to be an instance of "+n.functionName(t),message:e},this.assert(Object(this.obj)instanceof t)}),e.add("Function",function(){this.params={operator:"to be a function"},this.assert(n.isFunction(this.obj))},!0),e.add("Object",function(){this.params={operator:"to be an object"},this.assert(n.isObject(this.obj))},!0),e.add("String",function(){this.params={operator:"to be a string"},this.assert(n.isString(this.obj))},!0),e.add("Array",function(){this.params={operator:"to be an array"},this.assert(n.isArray(this.obj))},!0),e.add("Boolean",function(){this.params={operator:"to be a boolean"},this.assert(n.isBoolean(this.obj))},!0),e.add("Error",function(){this.params={operator:"to be an error"},this.assert(n.isError(this.obj))},!0),e.add("null",function(){this.params={operator:"to be null"},this.assert(null===this.obj)},!0),e.alias("null","Null"),e.alias("instanceof","instanceOf")}},function(t){/*! +var n=r(32);t.exports=function(t,e){e.add("Number",function(){this.params={operator:"to be a number"},this.have.type("number")},!0),e.add("arguments",function(){this.params={operator:"to be arguments"},this.have["class"]("Arguments")},!0),e.alias("arguments","Arguments"),e.add("type",function(e,r){this.params={operator:"to have type "+e,message:r},t(typeof this.obj).be.exactly(e)}),e.add("instanceof",function(t,e){this.params={operator:"to be an instance of "+n.functionName(t),message:e},this.assert(Object(this.obj)instanceof t)}),e.alias("instanceof","instanceOf"),e.add("Function",function(){this.params={operator:"to be a function"},this.have.type("function")},!0),e.add("Object",function(){this.params={operator:"to be an object"},this.is.not["null"].and.have.type("object")},!0),e.add("String",function(){this.params={operator:"to be a string"},this.have.type("string")},!0),e.add("Array",function(){this.params={operator:"to be an array"},this.have["class"]("Array")},!0),e.add("Boolean",function(){this.params={operator:"to be a boolean"},this.have.type("boolean")},!0),e.add("Error",function(){this.params={operator:"to be an error"},this.have.instanceOf(Error)},!0),e.add("null",function(){this.params={operator:"to be null"},this.assert(null===this.obj)},!0),e.alias("null","Null"),e.add("class",function(t){this.params={operator:"to have [[Class]] "+t},this.assert(Object.prototype.toString.call(this.obj)==="[object "+t+"]")}),e.alias("class","Class"),e.add("undefined",function(){this.params={operator:"to be undefined"},this.assert(void 0===this.obj)},!0),e.alias("undefined","Undefined")}},function(t){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed @@ -54,29 +75,27 @@ t.exports=function(t,e){e.add("startWith",function(e,r){this.params={operator:"t * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32),i=r(88),o=Array.prototype.slice;t.exports=function(t,e){var r=t.format;e.add("enumerable",function(t,e){t=String(t),this.params={operator:"to have enumerable property "+n.formatProp(t)},this.assert(this.obj.propertyIsEnumerable(t)),arguments.length>1&&(this.params.operator+=" equal to "+r(e),this.assert(i(e,this.obj[t]).result))}),e.add("property",function(t,e){if(t=String(t),arguments.length>1){var r={};r[t]=e,this.have.properties(r)}else this.have.properties(t);this.obj=this.obj[t]}),e.add("properties",function(t){var e={};arguments.length>1?t=o.call(arguments):n.isArray(t)||(n.isString(t)?t=[t]:(e=t,t=Object.keys(t)));var s=Object(this.obj),a=[];t.forEach(function(t){t in s||a.push(n.formatProp(t))});var u=a;0===u.length?u=t.map(n.formatProp):this.anyOne&&(u=t.filter(function(t){return a.indexOf(n.formatProp(t))<0}).map(n.formatProp));var c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", ");this.params={obj:this.obj,operator:c},this.assert(0===a.length||this.anyOne&&a.length!=t.length);var l=Object.keys(e);if(l.length){var f=[];u=[],l.forEach(function(t){var o=e[t];i(s[t],o).result?u.push(n.formatProp(t)+" of "+r(o)):f.push(n.formatProp(t)+" of "+r(o)+" (got "+r(s[t])+")")}),(0!==f.length&&!this.anyOne||this.anyOne&&0===u.length)&&(u=f),c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", "),this.params={obj:this.obj,operator:c},this.assert(0===f.length||this.anyOne&&f.length!=l.length)}}),e.add("length",function(t,e){this.have.property("length",t,e)}),e.alias("length","lengthOf");var s=Object.prototype.hasOwnProperty;e.add("ownProperty",function(t,e){t=String(t),this.params={obj:this.obj,operator:"to have own property "+n.formatProp(t),message:e},this.assert(s.call(this.obj,t)),this.obj=this.obj[t]}),e.alias("ownProperty","hasOwnProperty"),e.add("empty",function(){if(this.params={operator:"to be empty"},n.isString(this.obj)||n.isArray(this.obj)||n.isArguments(this.obj))this.obj.should.have.property("length",0);else{var t=Object(this.obj);for(var e in t)this.obj.should.not.ownProperty(e)}},!0),e.add("keys",function(t){arguments.length>1?t=o.call(arguments):1===arguments.length&&n.isString(t)?t=[t]:0===arguments.length&&(t=[]),t=t.map(String);var e=Object(this.obj),r=[];t.forEach(function(t){s.call(this.obj,t)||r.push(n.formatProp(t))},this);var i=[];Object.keys(e).forEach(function(e){t.indexOf(e)<0&&i.push(n.formatProp(e))});var a=0===t.length?"to be empty":"to have "+(1===t.length?"key ":"keys ");this.params={operator:a+t.map(n.formatProp).join(", ")},r.length>0&&(this.params.operator+="\n missing keys: "+r.join(", ")),i.length>0&&(this.params.operator+="\n extra keys: "+i.join(", ")),this.assert(0===r.length&&0===i.length)}),e.alias("keys","key"),e.add("propertyByPath",function(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&n.isString(e)?e=[e]:0===arguments.length&&(e=[]);var r=e.map(n.formatProp);e=e.map(String);for(var i,s=t(Object(this.obj)),a=[];i=e.shift();)this.params={operator:"to have property by path "+r.join(", ")+" - failed on "+n.formatProp(i)},s=s.have.property(i),a.push(i);this.params={obj:this.obj,operator:"to have property by path "+r.join(", ")},this.obj=s.obj})}},function(t,e,r){/*! +var n=r(32),i=r(58),o=Array.prototype.slice;t.exports=function(t,e){function r(){var e={};if(arguments.length>1)e.names=o.call(arguments);else{var r=arguments[0],i=t.type(r);i==t.type.STRING?e.names=[r]:n.isIndexable(r)?e.names=r:(e.names=Object.keys(r),e.values=r)}return e}var s=t.format;e.add("propertyWithDescriptor",function(e,r){this.params={actual:this.obj,operator:"to have own property with descriptor "+s(r)};var n=this.obj;this.have.ownProperty(e),t(Object.getOwnPropertyDescriptor(Object(n),e)).have.properties(r)}),e.add("enumerable",function(t,e){t=String(t),this.params={operator:"to have enumerable property "+n.formatProp(t)+(arguments.length>1?" equal to "+s(e):"")};var r={enumerable:!0};arguments.length>1&&(r.value=e),this.have.propertyWithDescriptor(t,r)}),e.add("enumerables",function(){var t=r.apply(null,arguments);this.params={operator:"to have enumerables "+t.names.map(n.formatProp)};var e=this.obj;t.names.forEach(function(t){e.should.have.enumerable(t)})}),e.add("property",function(t,e){if(t=String(t),arguments.length>1){var r={};r[t]=e,this.have.properties(r)}else this.have.properties(t);this.obj=this.obj[t]}),e.add("properties",function(t){var e={};arguments.length>1?t=o.call(arguments):Array.isArray(t)||("string"==typeof t?t=[t]:(e=t,t=Object.keys(t)));var r=Object(this.obj),a=[];t.forEach(function(t){t in r||a.push(n.formatProp(t))});var u=a;0===u.length?u=t.map(n.formatProp):this.anyOne&&(u=t.filter(function(t){return a.indexOf(n.formatProp(t))<0}).map(n.formatProp));var c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", ");this.params={obj:this.obj,operator:c},this.assert(0===a.length||this.anyOne&&a.length!=t.length);var l=Object.keys(e);if(l.length){var f=[];u=[],l.forEach(function(t){var o=e[t];i(r[t],o).result?u.push(n.formatProp(t)+" of "+s(o)):f.push(n.formatProp(t)+" of "+s(o)+" (got "+s(r[t])+")")}),(0!==f.length&&!this.anyOne||this.anyOne&&0===u.length)&&(u=f),c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", "),this.params={obj:this.obj,operator:c},this.assert(0===f.length||this.anyOne&&f.length!=l.length)}}),e.add("length",function(t,e){this.have.property("length",t,e)}),e.alias("length","lengthOf");var a=Object.prototype.hasOwnProperty;e.add("ownProperty",function(t,e){t=String(t),this.params={actual:this.obj,operator:"to have own property "+n.formatProp(t),message:e},this.assert(a.call(this.obj,t)),this.obj=this.obj[t]}),e.alias("ownProperty","hasOwnProperty"),e.add("empty",function(){if(this.params={operator:"to be empty"},void 0!==n.length(this.obj))this.obj.should.have.property("length",0);else{var t=Object(this.obj);for(var e in t)this.obj.should.not.have.ownProperty(e)}},!0),e.add("keys",function(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&t.type(e)==t.type.STRING?e=[e]:0===arguments.length&&(e=[]),e=e.map(String);var r=Object(this.obj),i=[];e.forEach(function(t){a.call(this.obj,t)||i.push(n.formatProp(t))},this);var s=[];Object.keys(r).forEach(function(t){e.indexOf(t)<0&&s.push(n.formatProp(t))});var u=0===e.length?"to be empty":"to have "+(1===e.length?"key ":"keys ");this.params={operator:u+e.map(n.formatProp).join(", ")},i.length>0&&(this.params.operator+="\n missing keys: "+i.join(", ")),s.length>0&&(this.params.operator+="\n extra keys: "+s.join(", ")),this.assert(0===i.length&&0===s.length)}),e.alias("keys","key"),e.add("propertyByPath",function(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&n.isString(e)?e=[e]:0===arguments.length&&(e=[]);var r=e.map(n.formatProp);e=e.map(String);for(var i,s=t(Object(this.obj)),a=[];i=e.shift();)this.params={operator:"to have property by path "+r.join(", ")+" - failed on "+n.formatProp(i)},s=s.have.property(i),a.push(i);this.params={obj:this.obj,operator:"to have property by path "+r.join(", ")},this.obj=s.obj})}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32);t.exports=function(t,e){var r=t.format;e.add("throw",function(e,i){var o=this.obj,s={},a="",u=!1;this.is.a.Function;var c=!0;try{o()}catch(l){u=!0,s=l}if(u)if(e){if("string"==typeof e)c=e==s.message;else if(e instanceof RegExp)c=e.test(s.message);else if("function"==typeof e)c=s instanceof e;else if(n.isObject(e))try{s.should.match(e)}catch(l){if(!(l instanceof t.AssertionError))throw l;a=": "+l.message,c=!1}if(c){if("function"==typeof e&&i)try{s.should.match(i)}catch(l){if(!(l instanceof t.AssertionError))throw l;a=": "+l.message,c=!1}}else"string"==typeof e||e instanceof RegExp?a=" with a message matching "+r(e)+", but got '"+s.message+"'":"function"==typeof e&&(a=" of type "+n.functionName(e)+", but got "+n.functionName(s.constructor))}else a=" (got "+r(s)+")";this.params={operator:"to throw exception"+a},this.assert(u),this.assert(c)}),e.alias("throw","throwError")}},function(t,e,r){/*! +var n=r(32);t.exports=function(t,e){var r=t.format;e.add("throw",function(e,i){var o=this.obj,s={},a="",u=!1;this.is.a.Function;var c=!0;try{o()}catch(l){u=!0,s=l}if(u)if(e){if("string"==typeof e)c=e==s.message;else if(e instanceof RegExp)c=e.test(s.message);else if("function"==typeof e)c=s instanceof e;else if(null!=e)try{s.should.match(e)}catch(l){if(!(l instanceof t.AssertionError))throw l;a=": "+l.message,c=!1}if(c){if("function"==typeof e&&i)try{s.should.match(i)}catch(l){if(!(l instanceof t.AssertionError))throw l;a=": "+l.message,c=!1}}else"string"==typeof e||e instanceof RegExp?a=" with a message matching "+r(e)+", but got '"+s.message+"'":"function"==typeof e&&(a=" of type "+n.functionName(e)+", but got "+n.functionName(s.constructor))}else a=" (got "+r(s)+")";this.params={operator:"to throw exception"+a},this.assert(u),this.assert(c)}),e.alias("throw","throwError")}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32),i=r(88);t.exports=function(t,e){var r=t.format;e.add("match",function(o,s){if(this.params={operator:"to match "+r(o),message:s},!i(this.obj,o).result)if(n.isRegExp(o)){if(n.isString(this.obj))this.assert(o.exec(this.obj));else if(n.isArray(this.obj))this.obj.forEach(function(t){this.assert(o.exec(t))},this);else if(n.isObject(this.obj)){var a=[],u=[];n.forOwn(this.obj,function(t,e){o.exec(t)?u.push(n.formatProp(e)):a.push(n.formatProp(e)+" ("+r(t)+")")},this),a.length&&(this.params.operator+="\n not matched properties: "+a.join(", ")),u.length&&(this.params.operator+="\n matched properties: "+u.join(", ")),this.assert(0==a.length)}}else if(n.isFunction(o)){var c;c=o(this.obj),c instanceof e&&(this.params.operator+="\n "+c.getMessage()),n.isBoolean(c)&&this.assert(c)}else n.isObject(o)?(a=[],u=[],n.forOwn(o,function(e,i){try{t(this.obj[i]).match(e),u.push(n.formatProp(i))}catch(o){if(!(o instanceof t.AssertionError))throw o;a.push(n.formatProp(i)+" ("+r(this.obj[i])+")")}},this),a.length&&(this.params.operator+="\n not matched properties: "+a.join(", ")),u.length&&(this.params.operator+="\n matched properties: "+u.join(", ")),this.assert(0==a.length)):this.assert(!1)}),e.add("matchEach",function(t,e){this.params={operator:"to match each "+r(t),message:e};var o=t;n.isRegExp(t)?o=function(e){return!!t.exec(e)}:n.isFunction(t)||(o=function(e){return i(e,t).result}),n.forOwn(this.obj,function(t,e){var r=o(t,e);n.isBoolean(r)&&this.assert(r)},this)})}},function(t,e,r){/*! +var n=r(32),i=r(58);t.exports=function(t,e){var r=t.format;e.add("match",function(e,o){if(this.params={operator:"to match "+r(e),message:o},!i(this.obj,e).result)if(e instanceof RegExp){if("string"==typeof this.obj)this.assert(e.exec(this.obj));else if(n.isIndexable(this.obj))n.forEach(this.obj,function(t){this.assert(e.exec(t))},this);else if(null!=this.obj&&"object"==typeof this.obj){var s=[],a=[];n.forEach(this.obj,function(t,i){e.exec(t)?a.push(n.formatProp(i)):s.push(n.formatProp(i)+" ("+r(t)+")")},this),s.length&&(this.params.operator+="\n not matched properties: "+s.join(", ")),a.length&&(this.params.operator+="\n matched properties: "+a.join(", ")),this.assert(0==s.length)}}else if("function"==typeof e){var u;u=e(this.obj),"boolean"==typeof u&&this.assert(u)}else null!=e&&"object"==typeof e?(s=[],a=[],n.forEach(e,function(e,i){try{t(this.obj[i]).match(e),a.push(n.formatProp(i))}catch(o){if(!(o instanceof t.AssertionError))throw o;s.push(n.formatProp(i)+" ("+r(this.obj[i])+")")}},this),s.length&&(this.params.operator+="\n not matched properties: "+s.join(", ")),a.length&&(this.params.operator+="\n matched properties: "+a.join(", ")),this.assert(0==s.length)):this.assert(!1)}),e.add("matchEach",function(t,e){this.params={operator:"to match each "+r(t),message:e};var o=t;t instanceof RegExp?o=function(e){return!!t.exec(e)}:"function"!=typeof t&&(o=function(e){return i(e,t).result}),n.forEach(this.obj,function(t,e){var r=o(t,e);"boolean"==typeof r&&this.assert(r)},this)})}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32),i=r(88);t.exports=function(t,e){var r=t.format;e.add("containEql",function(t){this.params={operator:"to contain "+r(t)};var e=this.obj;n.isArray(e)?this.assert(e.some(function(e){return i(e,t).result})):n.isString(e)?this.assert(e.indexOf(String(t))>=0):n.isObject(e)?n.forOwn(t,function(t,r){e.should.have.property(r,t)}):this.assert(!1)}),e.add("containDeepOrdered",function(e){this.params={operator:"to contain "+r(e)};var i=this.obj;if(n.isArray(i))if(n.isArray(e)){var o=0;i.forEach(function(r){try{t(r).not.be.Null.and.containDeep(e[o]),o++}catch(n){if(n instanceof t.AssertionError)return;throw n}},this),this.assert(o==e.length)}else this.assert(!1);else n.isString(i)?this.assert(i.indexOf(String(e))>=0):n.isObject(i)?n.isObject(e)?n.forOwn(e,function(e,r){t(i[r]).not.be.Null.and.containDeep(e)}):this.assert(!1):this.eql(e)}),e.add("containDeep",function(e){this.params={operator:"to contain "+r(e)};var i=this.obj;if(n.isArray(i))if(n.isArray(e)){var o={};e.forEach(function(e){this.assert(i.some(function(r,n){if(n in o)return!1;try{return t(r).not.be.Null.and.containDeep(e),o[n]=!0,!0}catch(i){if(i instanceof t.AssertionError)return!1;throw i}}))},this)}else this.assert(!1);else n.isString(i)?this.assert(i.indexOf(String(e))>=0):n.isObject(i)?n.isObject(e)?n.forOwn(e,function(e,r){t(i[r]).not.be.Null.and.containDeep(e)}):this.assert(!1):this.eql(e)})}},function(t,e,r){function n(t){var e={};for(var r in t)e[r]=t[r];return e}var i=r(89);t.exports=function(t){var e=t;switch(i(t)){case"undefined":return"undefined";case"number":return t.toString();case"regexp":return t.toString();case"date":return t.toISOString();case"function":return t.toString();case"object":t=n(t);default:var r=[];return JSON.stringify(t,function(t,n){if(!r.length)return r.push(n),n;var i=r.indexOf(this);return~i?r.splice(i+1):r.push(this),n===e||~r.indexOf(n)?"[Circular]":void 0===n?"[Undefined]":n})}}},function(t,e,r){var n;(function(t,i){(function(){function o(t,e,r){for(var n=(r||0)-1,i=t?t.length:0;++n-1?0:-1:t?0:-1}function a(t){var e=this.cache,r=typeof t;if("boolean"==r||null==t)e[t]=!0;else{"number"!=r&&"string"!=r&&(r="object");var n="number"==r?t:x+t,i=e[r]||(e[r]={});"object"==r?(i[n]||(i[n]=[])).push(t):i[n]=!0}}function u(t){return t.charCodeAt(0)}function c(t,e){for(var r=t.criteria,n=e.criteria,i=-1,o=r.length;++ia||"undefined"==typeof s)return 1;if(a>s||"undefined"==typeof a)return-1}}return t.index-e.index}function l(t){var e=-1,r=t.length,n=t[0],i=t[r/2|0],o=t[r-1];if(n&&"object"==typeof n&&i&&"object"==typeof i&&o&&"object"==typeof o)return!1;var s=p();s["false"]=s["null"]=s["true"]=s.undefined=!1;var u=p();for(u.array=t,u.cache=s,u.push=a;++ei?0:i);++n=A&&n===o,u=[];if(a){var c=l(e);c?(n=s,e=c):a=!1}for(;++r-1:void 0});return i.pop(),o.pop(),_&&(y(i),y(o)),s}function ae(t,e,r,n,i){(fi(e)?nr:Ai)(e,function(e,o){var s,a,u=e,c=t[o];if(e&&((a=fi(e))||Oi(e))){for(var l=n.length;l--;)if(s=n[l]==e){c=i[l];break}if(!s){var f;r&&(u=r(c,e),(f="undefined"!=typeof u)&&(c=u)),f||(c=a?fi(c)?c:[]:Oi(c)?c:{}),n.push(e),i.push(c),f||ae(c,e,r,n,i)}}else r&&(u=r(c,e),"undefined"==typeof u&&(u=e)),"undefined"!=typeof u&&(c=u);t[o]=c})}function ue(t,e){return t+Mn(oi()*(e-t+1))}function le(t,e,r){var n=-1,i=ye(),a=t?t.length:0,u=[],c=!e&&a>=A&&i===o,f=r||c?h():u;if(c){var p=l(f);i=s,f=p}for(;++n3&&"function"==typeof e[r-2])var n=b(e[--r-1],e[r--],2);else r>2&&"function"==typeof e[r-1]&&(n=e[--r]);for(var i=v(arguments,1,r),o=-1,s=h(),a=h();++or?ri(0,o+r):r)||0,fi(t)?s=i(t,e,r)>-1:"number"==typeof o?s=(Ve(t)?t.indexOf(e,r):i(t,e,r))>-1:wi(t,function(t){return++n>=r?!(s=t===e):void 0}),s}function Xe(t,r,n){var i=!0;if(r=e.createCallback(r,n,3),fi(t))for(var o=-1,s=t.length;++oo&&(o=c)}else r=null==r&&Ve(t)?u:e.createCallback(r,n,3),wi(t,function(t,e,n){var s=r(t,e,n);s>i&&(i=s,o=t)});return o}function ur(t,r,n){var i=1/0,o=i;if("function"!=typeof r&&n&&n[r]===t&&(r=null),null==r&&fi(t))for(var s=-1,a=t.length;++sc&&(o=c)}else r=null==r&&Ve(t)?u:e.createCallback(r,n,3),wi(t,function(t,e,n){var s=r(t,e,n);i>s&&(i=s,o=t)});return o}function cr(t,r,n,i){var o=arguments.length<3;if(r=e.createCallback(r,i,4),fi(t)){var s=-1,a=t.length;for(o&&(n=t[++s]);++sr?ri(0,n+r):r||0}else if(r){var i=Rr(t,e);return t[i]===e?i:-1}return o(t,e,r)}function Ar(t,r,n){var i=0,o=t?t.length:0;if("number"!=typeof r&&null!=r){var s=o;for(r=e.createCallback(r,n,3);s--&&r(t[s],s,t);)i++}else i=null==r||n?1:r||i;return v(t,0,ni(ri(0,o-i),o))}function Or(){for(var t=[],e=-1,r=arguments.length,n=h(),i=ye(),a=i===o,u=h();++e=A&&l(e?t[e]:u)))}var f=t[0],p=-1,d=f?f.length:0,v=[];t:for(;++pr?ri(0,n+r):ni(r,n-1))+1);n--;)if(t[n]===e)return n;return-1}function Tr(t){for(var e=arguments,r=0,n=e.length,i=t?t.length:0;++ro;){var a=o+s>>>1;n(t[a])1?arguments:arguments[0],e=-1,r=t?ar(Si(t,"length")):0,n=wn(0>r?0:r);++e2?he(t,17,v(arguments,2),null,e):he(t,1,null,null,e)}function Vr(t){for(var e=arguments.length>1?ie(arguments,!0,!1,1):Pe(t),r=-1,n=e.length;++r2?he(e,19,v(arguments,2),null,t):he(e,3,null,null,t)}function qr(){for(var t=arguments,e=t.length;e--;)if(!Ue(t[e]))throw new Nn;return function(){for(var e=arguments,r=t.length;r--;)e=[t[r].apply(this,e)];return e[0]}}function zr(t,e){return e="number"==typeof e?e:+e||t.length,he(t,4,null,null,null,e)}function Wr(t,e,r){var n,i,o,s,a,u,c,l=0,f=!1,h=!0;if(!Ue(t))throw new Nn;if(e=ri(0,e)||0,r===!0){var p=!0;h=!1}else Le(r)&&(p=r.leading,f="maxWait"in r&&(ri(e,r.maxWait)||0),h="trailing"in r?r.trailing:h);var d=function(){var r=e-(Fi()-s);if(0>=r){i&&Hn(i);var f=c;i=u=c=_,f&&(l=Fi(),o=t.apply(a,n),u||i||(n=a=null))}else u=Yn(d,r)},y=function(){u&&Hn(u),i=u=c=_,(h||f!==e)&&(l=Fi(),o=t.apply(a,n),u||i||(n=a=null))};return function(){if(n=arguments,s=Fi(),a=this,c=h&&(u||!p),f===!1)var r=p&&!u;else{i||p||(l=s);var g=f-(s-l),v=0>=g;v?(i&&(i=Hn(i)),l=s,o=t.apply(a,n)):i||(i=Yn(y,g))}return v&&u?u=Hn(u):u||e===f||(u=Yn(d,e)),r&&(v=!0,o=t.apply(a,n)),!v||u||i||(n=a=null),o}}function Yr(t){if(!Ue(t))throw new Nn;var e=v(arguments,1);return Yn(function(){t.apply(_,e)},1)}function Kr(t,e){if(!Ue(t))throw new Nn;var r=v(arguments,2);return Yn(function(){t.apply(_,r)},e)}function Gr(t,e){if(!Ue(t))throw new Nn;var r=function(){var n=r.cache,i=e?e.apply(this,arguments):x+arguments[0];return qn.call(n,i)?n[i]:n[i]=t.apply(this,arguments)};return r.cache={},r}function Jr(t){var e,r;if(!Ue(t))throw new Nn;return function(){return e?r:(e=!0,r=t.apply(this,arguments),t=null,r)}}function Qr(t){return he(t,16,v(arguments,1))}function Zr(t){return he(t,32,null,v(arguments,1))}function Xr(t,e,r){var n=!0,i=!0;if(!Ue(t))throw new Nn;return r===!1?n=!1:Le(r)&&(n="leading"in r?r.leading:n,i="trailing"in r?r.trailing:i),te.leading=n,te.maxWait=e,te.trailing=i,Wr(t,e,te)}function tn(t,e){return he(e,16,[t])}function en(t){return function(){return t}}function rn(t,e,r){var n=typeof t;if(null==t||"function"==n)return b(t,e,r);if("object"!=n)return cn(t);var i=pi(t),o=i[0],s=t[o];return 1!=i.length||s!==s||Le(s)?function(e){for(var r=i.length,n=!1;r--&&(n=se(e[i[r]],t[i[r]],null,!0)););return n}:function(t){var e=t[o];return s===e&&(0!==s||1/s==1/e)}}function nn(t){return null==t?"":Sn(t).replace(bi,de)}function on(t){return t}function sn(t,n,i){var o=!0,s=n&&Pe(n);n&&(i||s.length)||(null==i&&(i=n),a=r,n=t,t=e,s=Pe(n)),i===!1?o=!1:Le(i)&&"chain"in i&&(o=i.chain);var a=t,u=Ue(a);nr(s,function(e){var r=t[e]=n[e];u&&(a.prototype[e]=function(){var e=this.__chain__,n=this.__wrapped__,i=[n];zn.apply(i,arguments);var s=r.apply(t,i);if(o||e){if(n===s&&Le(s))return this;s=new a(s),s.__chain__=e}return s})})}function an(){return t._=Un,this}function un(){}function cn(t){return function(e){return e[t]}}function ln(t,e,r){var n=null==t,i=null==e;if(null==r&&("boolean"==typeof t&&i?(r=t,t=1):i||"boolean"!=typeof e||(r=e,i=!0)),n&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0,r||t%1||e%1){var o=oi();return ni(t+o*(e-t+parseFloat("1e-"+((o+"").length-1))),e)}return ue(t,e)}function fn(t,e){if(t){var r=t[e];return Ue(r)?t[e]():r}}function hn(t,r,n){var i=e.templateSettings;t=Sn(t||""),n=Ei({},n,i);var o,s=Ei({},n.imports,i.imports),a=pi(s),u=Je(s),c=0,l=n.interpolate||L,h="__p += '",p=Tn((n.escape||L).source+"|"+l.source+"|"+(l===I?F:L).source+"|"+(n.evaluate||L).source+"|$","g");t.replace(p,function(e,r,n,i,s,a){return n||(n=i),h+=t.slice(c,a).replace(D,f),r&&(h+="' +\n__e("+r+") +\n'"),s&&(o=!0,h+="';\n"+s+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=a+e.length,e}),h+="';\n";var d=n.variable,y=d;y||(d="obj",h="with ("+d+") {\n"+h+"\n}\n"),h=(o?h.replace(T,""):h).replace(S,"$1").replace(N,"$1;"),h="function("+d+") {\n"+(y?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+V++ +"]")+"\n*/";try{var v=An(a,"return "+h+g).apply(_,u)}catch(m){throw m.source=h,m}return r?v(r):(v.source=h,v)}function pn(t,e,r){t=(t=+t)>-1?t:0;var n=-1,i=wn(t);for(e=b(e,r,1);++n/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:e}};var ci=function(t){var e="var index, iterable = "+t.firstArg+", result = "+t.init+";\nif (!iterable) return result;\n"+t.top+";";t.array?(e+="\nvar length = iterable.length; index = -1;\nif ("+t.array+") { ",ui.unindexedChars&&(e+="\n if (isString(iterable)) {\n iterable = iterable.split('')\n } "),e+="\n while (++index < length) {\n "+t.loop+";\n }\n}\nelse { "):ui.nonEnumArgs&&(e+="\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += '';\n "+t.loop+";\n }\n } else { "),ui.enumPrototypes&&(e+="\n var skipProto = typeof iterable == 'function';\n "),ui.enumErrorProps&&(e+="\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n ");var r=[];if(ui.enumPrototypes&&r.push('!(skipProto && index == "prototype")'),ui.enumErrorProps&&r.push('!(skipErrorProps && (index == "message" || index == "name"))'),t.useHas&&t.keys)e+="\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n",r.length&&(e+=" if ("+r.join(" && ")+") {\n "),e+=t.loop+"; ",r.length&&(e+="\n }"),e+="\n } ";else if(e+="\n for (index in iterable) {\n",t.useHas&&r.push("hasOwnProperty.call(iterable, index)"),r.length&&(e+=" if ("+r.join(" && ")+") {\n "),e+=t.loop+"; ",r.length&&(e+="\n }"),e+="\n } ",ui.nonEnumShadows){for(e+="\n\n if (iterable !== objectProto) {\n var ctor = iterable.constructor,\n isProto = iterable === (ctor && ctor.prototype),\n className = iterable === stringProto ? stringClass : iterable === errorProto ? errorClass : toString.call(iterable),\n nonEnum = nonEnumProps[className];\n ",k=0;k<7;k++)e+="\n index = '"+t.shadowedProps[k]+"';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))",t.useHas||(e+=" || (!nonEnum[index] && iterable[index] !== objectProto[index])"),e+=") {\n "+t.loop+";\n } ";e+="\n } "}return(t.array||ui.nonEnumArgs)&&(e+="\n}"),e+=t.bottom+";\nreturn result"};Qn||(a=function(){function e(){}return function(r){if(Le(r)){e.prototype=r;var n=new e;e.prototype=null}return n||t.Object()}}());var li=Jn?function(t,e){ee.value=e,Jn(t,"__bindData__",ee)}:un;ui.argsClass||(_e=function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&qn.call(t,"callee")&&!Wn.call(t,"callee")||!1});var fi=Zn||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Ln.call(t)==q||!1},hi=pe({args:"object",init:"[]",top:"if (!(objectTypes[typeof object])) return result",loop:"result.push(index)"}),pi=ei?function(t){return Le(t)?ui.enumPrototypes&&"function"==typeof t||ui.nonEnumArgs&&t.length&&_e(t)?hi(t):ei(t):[]}:hi,di={args:"collection, callback, thisArg",top:"callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)",array:"typeof length == 'number'",keys:pi,loop:"if (callback(iterable[index], index, collection) === false) return result"},yi={args:"object, source, guard",top:"var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard == 'number' ? 2 : args.length;\nwhile (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {",keys:pi,loop:"if (typeof result[index] == 'undefined') result[index] = iterable[index]",bottom:" }\n}"},gi={top:"if (!objectTypes[typeof iterable]) return result;\n"+di.top,array:!1},vi={"&":"&","<":"<",">":">",'"':""","'":"'"},mi=Te(vi),_i=Tn("("+pi(mi).join("|")+")","g"),bi=Tn("["+pi(vi).join("")+"]","g"),wi=pe(di),ji=pe(yi,{top:yi.top.replace(";",";\nif (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n callback = args[--argsLength];\n}"),loop:"result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]"}),Ei=pe(yi),xi=pe(di,gi,{useHas:!1}),Ai=pe(di,gi);Ue(/x/)&&(Ue=function(t){return"function"==typeof t&&Ln.call(t)==K});var Oi=$n?function(t){if(!t||Ln.call(t)!=J||!ui.argsClass&&_e(t))return!1;var e=t.valueOf,r=ge(e)&&(r=$n(e))&&$n(r);return r?t==r||$n(t)==r:ve(t)}:ve,Pi=fe(function(t,e,r){qn.call(t,r)?t[r]++:t[r]=1}),ki=fe(function(t,e,r){(qn.call(t,r)?t[r]:t[r]=[]).push(e)}),Ti=fe(function(t,e,r){t[r]=e}),Si=sr,Ni=tr,Fi=ge(Fi=En.now)&&Fi||function(){return(new En).getTime()},Ri=8==ii(P+"08")?ii:function(t,e){return ii(Ve(t)?t.replace(U,""):t,e||0)};return e.after=Hr,e.assign=ji,e.at=Qe,e.bind=Mr,e.bindAll=Vr,e.bindKey=$r,e.chain=gn,e.compact=mr,e.compose=qr,e.constant=en,e.countBy=Pi,e.create=je,e.createCallback=rn,e.curry=zr,e.debounce=Wr,e.defaults=Ei,e.defer=Yr,e.delay=Kr,e.difference=_r,e.filter=tr,e.flatten=Er,e.forEach=nr,e.forEachRight=ir,e.forIn=xi,e.forInRight=Ae,e.forOwn=Ai,e.forOwnRight=Oe,e.functions=Pe,e.groupBy=ki,e.indexBy=Ti,e.initial=Ar,e.intersection=Or,e.invert=Te,e.invoke=or,e.keys=pi,e.map=sr,e.mapValues=qe,e.max=ar,e.memoize=Gr,e.merge=ze,e.min=ur,e.omit=We,e.once=Jr,e.pairs=Ye,e.partial=Qr,e.partialRight=Zr,e.pick=Ke,e.pluck=Si,e.property=cn,e.pull=Tr,e.range=Sr,e.reject=fr,e.remove=Nr,e.rest=Fr,e.shuffle=pr,e.sortBy=gr,e.tap=vn,e.throttle=Xr,e.times=pn,e.toArray=vr,e.transform=Ge,e.union=Cr,e.uniq=Ir,e.values=Je,e.where=Ni,e.without=Ur,e.wrap=tn,e.xor=Lr,e.zip=Br,e.zipObject=Dr,e.collect=sr,e.drop=Fr,e.each=nr,e.eachRight=ir,e.extend=ji,e.methods=Pe,e.object=Dr,e.select=tr,e.tail=Fr,e.unique=Ir,e.unzip=Br,sn(e),e.clone=be,e.cloneDeep=we,e.contains=Ze,e.escape=nn,e.every=Xe,e.find=er,e.findIndex=br,e.findKey=Ee,e.findLast=rr,e.findLastIndex=wr,e.findLastKey=xe,e.has=ke,e.identity=on,e.indexOf=xr,e.isArguments=_e,e.isArray=fi,e.isBoolean=Se,e.isDate=Ne,e.isElement=Fe,e.isEmpty=Re,e.isEqual=Ce,e.isFinite=Ie,e.isFunction=Ue,e.isNaN=Be,e.isNull=De,e.isNumber=He,e.isObject=Le,e.isPlainObject=Oi,e.isRegExp=Me,e.isString=Ve,e.isUndefined=$e,e.lastIndexOf=kr,e.mixin=sn,e.noConflict=an,e.noop=un,e.now=Fi,e.parseInt=Ri,e.random=ln,e.reduce=cr,e.reduceRight=lr,e.result=fn,e.runInContext=m,e.size=dr,e.some=yr,e.sortedIndex=Rr,e.template=hn,e.unescape=dn,e.uniqueId=yn,e.all=Xe,e.any=yr,e.detect=er,e.findWhere=er,e.foldl=cr,e.foldr=lr,e.include=Ze,e.inject=cr,sn(function(){var t={}; -return Ai(e,function(r,n){e.prototype[n]||(t[n]=r)}),t}(),!1),e.first=jr,e.last=Pr,e.sample=hr,e.take=jr,e.head=jr,Ai(e,function(t,n){var i="sample"!==n;e.prototype[n]||(e.prototype[n]=function(e,n){var o=this.__chain__,s=t(this.__wrapped__,e,n);return o||null!=e&&(!n||i&&"function"==typeof e)?new r(s,o):s})}),e.VERSION="2.4.1",e.prototype.chain=mn,e.prototype.toString=_n,e.prototype.value=bn,e.prototype.valueOf=bn,wi(["join","pop","shift"],function(t){var n=Fn[t];e.prototype[t]=function(){var t=this.__chain__,e=n.apply(this.__wrapped__,arguments);return t?new r(e,t):e}}),wi(["push","reverse","sort","unshift"],function(t){var r=Fn[t];e.prototype[t]=function(){return r.apply(this.__wrapped__,arguments),this}}),wi(["concat","slice","splice"],function(t){var n=Fn[t];e.prototype[t]=function(){return new r(n.apply(this.__wrapped__,arguments),this.__chain__)}}),ui.spliceObjects||wi(["pop","shift","splice"],function(t){var n=Fn[t],i="splice"==t;e.prototype[t]=function(){var t=this.__chain__,e=this.__wrapped__,o=n.apply(e,arguments);return 0===e.length&&delete e[0],t||i?new r(o,t):o}}),e}var _,b=[],w=[],j=0,E={},x=+new Date+"",A=75,O=40,P=" \f \n\r\u2028\u2029 ᠎              ",T=/\b__p \+= '';/g,S=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,F=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,R=/\w*$/,C=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,U=RegExp("^["+P+"]*0+(?=.$)"),L=/($^)/,B=/\bthis\b/,D=/['\n\r\t\u2028\u2029\\]/g,H=["Array","Boolean","Date","Error","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],M=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],V=0,$="[object Arguments]",q="[object Array]",z="[object Boolean]",W="[object Date]",Y="[object Error]",K="[object Function]",G="[object Number]",J="[object Object]",Q="[object RegExp]",Z="[object String]",X={};X[K]=!1,X[$]=X[q]=X[z]=X[W]=X[G]=X[J]=X[Q]=X[Z]=!0;var te={leading:!1,maxWait:0,trailing:!1},ee={configurable:!1,enumerable:!1,value:null,writable:!1},re={args:"",array:null,bottom:"",firstArg:"",init:"",keys:null,loop:"",shadowedProps:null,support:null,top:"",useHas:!1},ne={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},ie={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},oe=ne[typeof window]&&window||this,se=ne[typeof e]&&e&&!e.nodeType&&e,ae=ne[typeof t]&&t&&!t.nodeType&&t,ue=(ae&&ae.exports===se&&se,ne[typeof i]&&i);!ue||ue.global!==ue&&ue.window!==ue||(oe=ue);var ce=m();oe._=ce,n=function(){return ce}.call(e,r,e,t),!(n!==_&&(t.exports=n))}).call(this)}).call(e,r(91)(t),function(){return this}())},function(t,e,r){"use strict";function n(t){if(this._container=t||{},t&&"object"!=typeof t)throw new TypeError("Argument #1 passed to Collection must be an object")}var i=r(55);n.prototype.keys=function(){return Object.keys(this._container)},n.prototype.has=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.has() must be a string identifier, "+Object.prototype.toString(t)+" given");return t in this._container==!0},n.prototype.remove=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.remove() must be a string identifier");return delete this._container[t],this},n.prototype.set=function(t,e){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.set() must be a string identifier");return this._container[t]=e,this},n.prototype.setAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.setAll() must be an object");return this._container=t,this},n.prototype.addAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addAll() must be an object");for(var e in t)this.set(e,t[e]);return this},n.prototype.addOnce=function(t,e,r){if(this.has(t)){if(r)return this;throw new Error("Identifier "+t+" passed to Collection.addOnce() is already defined")}return this.set(t,e)},n.prototype.addOnceAll=function(t,e){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addOnceAll() must be an object");for(var r in t)this.addOnce(r,t[r],e);return this},n.prototype.merge=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.merge() must be an object");var e=Array.prototype.concat.apply([this._container],arguments);return this._container=i.mergeRecursive.apply(i,e),this},n.prototype.getAll=function(){return this._container},n.prototype.get=function(t,e,r){return"function"==typeof this._container[t]?this._container[t]():this.has(t)?this._container[t]:"function"==typeof e?this.raw(t,e,r)():this.raw(t,e,r)},n.prototype.raw=function(t,e,r){if(this.has(t))return this._container[t];if(r)throw new Error("Identifier "+t+" is not defined");return e},n.prototype.inject=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.raw(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.raw(t))},n.prototype.invoke=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.get(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.get(t))},n.prototype.apply=function(t){if(arguments.length>1){var e=Array.prototype.slice.call(arguments,1);return t.apply(this._container,e)}return t.call(this._container)},n.prototype.wrap=function(t){return function(){return t}},n.prototype.singleton=function(t,e){var r,n;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.singleton() must be a string identifier");if("function"!=typeof e)throw new TypeError("Argument #2 passed to Collection.singleton() must be a function");return this._container[t]=function(){return r||(r=!0,n=arguments.length?e.apply(null,arguments):e()),n},this},n.prototype.provider=function(t,e,r){var n,i,o=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.provider() must be a string identifier");return this._container[t]=function(){return n||(n=!0,i=o.inject(e,r)),i},this},n.prototype.factory=function(t,e,r){var n,i,o=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.factory() must be a string identifier");return this._container[t]=function(){return n||(n=!0,i=o.invoke(e,r)),i},this},t.exports=n},function(t,e,r){function n(t){return r(i(t))}function i(t){return o[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var o={"./browser":54,"./browser.js":54,"./collection":49,"./collection.js":49,"./index":28,"./index.js":28,"./utils":55,"./utils.js":55};n.keys=function(){return Object.keys(o)},n.resolve=i,t.exports=n,n.id=50},function(t){function e(){}var r=t.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,r="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var n=[];if(e){var i=document.createElement("div"),o=new MutationObserver(function(){var t=n.slice();n.length=0,t.forEach(function(t){t()})});return o.observe(i,{attributes:!0}),function(t){n.length||i.setAttribute("yes","no"),n.push(t)}}return r?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=e,r.addListener=e,r.once=e,r.off=e,r.removeListener=e,r.removeAllListeners=e,r.emit=e,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},function(t,e,r){(function(e){"use strict";function n(t){try{Promise===t&&(Promise=i)}catch(e){}return t}var i;"undefined"!=typeof Promise&&(i=Promise),t.exports=function(){function t(e){if("function"!=typeof e)throw new E("the promise constructor requires a resolver function");if(this.constructor!==t)throw new E("the promise constructor cannot be invoked directly");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,this._boundTo=void 0,e!==c&&this._resolveFromResolver(e)}function i(t){return t[0]}function o(){return new t.PromiseInspection(this)}var s=r(58),a=r(59),u=r(60),c=function(){},l={},f={e:null},h=r(61)(t,c),p=r(62)(t,c,h),d=r(63)(),y=r(64)(f),g=r(65),v=s.isArray,m=s.errorObj,_=s.tryCatch1,b=s.tryCatch2,w=s.tryCatchApply,j=u.RangeError,E=u.TypeError,x=u.CancellationError,A=u.TimeoutError,O=u.OperationalError,P=u.originatesFromRejection,k=u.markAsOriginatingFromRejection,T=u.canAttach,S=s.thrower,N=r(66)(t),F=function(){return new E("circular promise resolution chain")};t.prototype.bind=function(e){var r=h(e,void 0),n=new t(c);if(r instanceof t){var o=r.then(function(t){n._setBoundTo(t)}),s=t.all([this,o]).then(i);n._follow(s)}else n._follow(this),n._setBoundTo(e);return n._propagateFrom(this,3),n},t.prototype.toString=function(){return"[object Promise]"},t.prototype.caught=t.prototype["catch"]=function(e){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s){var a=new E("A catch filter must be an error constructor or a filter function");return this._attachExtraTrace(a),t.reject(a)}i[o++]=s}i.length=o,e=arguments[n],this._resetTrace();var u=new y(i,e,this);return this._then(void 0,u.doFilter,void 0,u,void 0)}return this._then(void 0,e,void 0,void 0,void 0)},t.prototype.reflect=function(){return this._then(o,o,void 0,this,void 0)},t.prototype.then=function(t,e,r){return this._then(t,e,r,void 0,void 0)},t.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},t.prototype.spread=function(t,e){return this._then(t,e,void 0,l,void 0)},t.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},t.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this._settledValue,t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this._settledValue,t.isRejected=!0),t},t.prototype.all=function(){return new p(this).promise()},t.is=function(e){return e instanceof t},t.all=function(t){return new p(t).promise()},t.prototype.error=function(t){return this.caught(P,t)},t.prototype._resolveFromSyncValue=function(e){if(e===m){this._cleanValues(),this._setRejected();var r=e.e;this._settledValue=r,this._tryAttachExtraTrace(r),this._ensurePossibleRejectionHandled()}else{var n=h(e,void 0);n instanceof t?this._follow(n):(this._cleanValues(),this._setFulfilled(),this._settledValue=e)}},t.method=function(e){if("function"!=typeof e)throw new E("fn must be a function");return function(){var r;switch(arguments.length){case 0:r=_(e,this,void 0);break;case 1:r=_(e,this,arguments[0]);break;case 2:r=b(e,this,arguments[0],arguments[1]);break;default:for(var n=arguments.length,i=new Array(n),o=0;n>o;++o)i[o]=arguments[o];r=w(e,i,this)}var s=new t(c);return s._setTrace(void 0),s._resolveFromSyncValue(r),s}},t.attempt=t["try"]=function(e,r,n){if("function"!=typeof e)return N("fn must be a function");var i=v(r)?w(e,r,n):_(e,n,r),o=new t(c);return o._setTrace(void 0),o._resolveFromSyncValue(i),o},t.defer=t.pending=function(){var e=new t(c);return e._setTrace(void 0),new g(e)},t.bind=function(e){var r=h(e,void 0),n=new t(c);if(n._setTrace(void 0),r instanceof t){var i=r.then(function(t){n._setBoundTo(t)});n._follow(i)}else n._setBoundTo(e),n._setFulfilled();return n},t.cast=function(e){var r=h(e,void 0);if(!(r instanceof t)){var n=r;r=new t(c),r._setTrace(void 0),r._setFulfilled(),r._cleanValues(),r._settledValue=n}return r},t.resolve=t.fulfilled=t.cast,t.reject=t.rejected=function(e){var r=new t(c);if(r._setTrace(void 0),k(e),r._cleanValues(),r._setRejected(),r._settledValue=e,!T(e)){var n=new Error(e+"");r._setCarriedStackTrace(n)}return r._ensurePossibleRejectionHandled(),r},t.onPossiblyUnhandledRejection=function(t){d.possiblyUnhandledRejection="function"==typeof t?t:void 0};var R;t.onUnhandledRejectionHandled=function(t){R="function"==typeof t?t:void 0};var C=!1||!("undefined"==typeof e||"string"!=typeof e.execPath||!{NODE_ENV:"production"}.BLUEBIRD_DEBUG&&"development"!=={NODE_ENV:"production"}.NODE_ENV);t.longStackTraces=function(){if(a.haveItemsQueued()&&C===!1)throw new Error("cannot enable long stack traces after promises have been created");C=d.isSupported()},t.hasLongStackTraces=function(){return C&&d.isSupported()},t.prototype._then=function(e,r,n,i,o){var s=void 0!==o,u=s?o:new t(c);if(!s){if(C){var l=this._peekContext()===this._traceParent;u._traceParent=l?this._traceParent:this}u._propagateFrom(this,7)}var f=this._addCallbacks(e,r,n,u,i);return this.isResolved()&&a.invoke(this._queueSettleAt,this,f),u},t.prototype._length=function(){return 262143&this._bitField},t.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},t.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},t.prototype._setLength=function(t){this._bitField=-262144&this._bitField|262143&t},t.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},t.prototype._setRejected=function(){this._bitField=134217728|this._bitField},t.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},t.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},t.prototype._isFinal=function(){return(33554432&this._bitField)>0},t.prototype._cancellable=function(){return(67108864&this._bitField)>0},t.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},t.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},t.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},t.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},t.prototype._unsetCarriedStackTrace=function(){this._bitField=-1048577&this._bitField,this._fulfillmentHandler0=void 0},t.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},t.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},t.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[(t<<2)+t-5+4];return this._isBound()&&void 0===e?this._boundTo:e},t.prototype._promiseAt=function(t){return 0===t?this._promise0:this[(t<<2)+t-5+3]},t.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[(t<<2)+t-5+0]},t.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[(t<<2)+t-5+1]},t.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=262138&&(o=0,this._setLength(0)),0===o)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=t),"function"==typeof e&&(this._rejectionHandler0=e),"function"==typeof r&&(this._progressHandler0=r);else{var s=(o<<2)+o-5;this[s+3]=n,this[s+4]=i,this[s+0]="function"==typeof t?t:void 0,this[s+1]="function"==typeof e?e:void 0,this[s+2]="function"==typeof r?r:void 0}return this._setLength(o+1),o},t.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=262138&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=(r<<2)+r-5;this[n+3]=e,this[n+4]=t,this[n+0]=this[n+1]=this[n+2]=void 0}this._setLength(r+1)},t.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},t.prototype._proxyPromise=function(t){t._setProxied(),this._setProxyHandlers(t,-15)},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=8388608|this._bitField,this._boundTo=t):this._bitField=-8388609&this._bitField},t.prototype._isBound=function(){return 8388608===(8388608&this._bitField)},t.prototype._resolveFromResolver=function(t){function e(t){n._tryFollow(t)||n._fulfill(t)}function r(t){var e=T(t)?t:new Error(t+"");n._attachExtraTrace(e),k(t),n._reject(t,e===t?void 0:e)}var n=this;this._setTrace(void 0),this._pushContext();var i=b(t,void 0,e,r);if(this._popContext(),void 0!==i&&i===m){var o=i.e,s=T(o)?o:new Error(o+"");n._reject(o,s)}},t.prototype._spreadSlowCase=function(t,e,r,n){var i=new p(r).promise(),o=i._then(function(){return t.apply(n,arguments)},void 0,void 0,l,void 0);e._follow(o)},t.prototype._callSpread=function(e,r,n){var i=this._boundTo;if(v(n))for(var o=0,s=n.length;s>o;++o)if(h(n[o],void 0)instanceof t)return void this._spreadSlowCase(e,r,n,i);return r._pushContext(),w(e,n,i)},t.prototype._callHandler=function(t,e,r,n){var i;return e!==l||this.isRejected()?(r._pushContext(),i=_(t,e,n)):i=this._callSpread(t,r,n),r._popContext(),i},t.prototype._settlePromiseFromHandler=function(e,r,n,i){if(!(i instanceof t))return void e.call(r,n,i);if(!i.isResolved()){var o=this._callHandler(e,r,i,n);if(!i._isFollowing())if(o===m||o===i||o===f){var s=o===i?F():o.e,a=T(s)?s:new Error(s+"");o!==f&&i._attachExtraTrace(a),i._rejectUnchecked(s,a)}else{var u=h(o,i);if(u instanceof t){if(u.isRejected()&&!u._isCarryingStackTrace()&&!T(u._settledValue)){var a=new Error(u._settledValue+"");i._attachExtraTrace(a),u._setCarriedStackTrace(a)}i._follow(u),i._propagateFrom(u,1)}else i._fulfillUnchecked(o)}}},t.prototype._follow=function(t){this._setFollowing(),t.isPending()?(this._propagateFrom(t,1),t._proxyPromise(this)):t.isFulfilled()?this._fulfillUnchecked(t._settledValue):this._rejectUnchecked(t._settledValue,t._getCarriedStackTrace()),t._isRejectionUnhandled()&&t._unsetRejectionIsUnhandled(),C&&null==t._traceParent&&(t._traceParent=this)},t.prototype._tryFollow=function(e){if(this._isFollowingOrFulfilledOrRejected()||e===this)return!1;var r=h(e,void 0);return r instanceof t?(this._follow(r),!0):!1},t.prototype._resetTrace=function(){C&&(this._trace=new d(void 0===this._peekContext()))},t.prototype._setTrace=function(t){if(C){var e=this._peekContext();this._traceParent=e;var r=void 0===e;this._trace=void 0!==t&&t._traceParent===e?t._trace:new d(r)}return this},t.prototype._tryAttachExtraTrace=function(t){T(t)&&this._attachExtraTrace(t)},t.prototype._attachExtraTrace=function(t){if(C){var e=this,r=t.stack;r="string"==typeof r?r.split("\n"):[],d.protectErrorMessageNewlines(r);for(var n=1,i=1;null!=e&&null!=e._trace;)r=d.combine(r,e._trace.stack.split("\n")),e=e._traceParent,i++;var o=Error.stackTraceLimit||10,s=(o+n)*i,a=r.length;a>s&&(r.length=s),a>0&&(r[0]=r[0].split("\x00").join("\n")),t.stack=r.length<=n?"(No stack trace)":r.join("\n")}},t.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},t.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&this._setBoundTo(t._boundTo),(2&e)>0&&this._setTrace(t)},t.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},t.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},t.prototype._settlePromiseAt=function(e){var r=this.isFulfilled()?this._fulfillmentHandlerAt(e):this._rejectionHandlerAt(e),n=this._settledValue,i=this._receiverAt(e),o=this._promiseAt(e);if("function"==typeof r)this._settlePromiseFromHandler(r,i,n,o);else{var s=!1,a=this.isFulfilled();void 0!==i&&(i instanceof t&&i._isProxied()?(i._unsetProxied(),a?i._fulfillUnchecked(n):i._rejectUnchecked(n,this._getCarriedStackTrace()),s=!0):i instanceof p&&(a?i._promiseFulfilled(n,o):i._promiseRejected(n,o),s=!0)),s||(a?o._fulfill(n):o._reject(n,this._getCarriedStackTrace()))}e>=4&&this._queueGC()},t.prototype._isProxied=function(){return 4194304===(4194304&this._bitField)},t.prototype._setProxied=function(){this._bitField=4194304|this._bitField},t.prototype._unsetProxied=function(){this._bitField=-4194305&this._bitField},t.prototype._isGcQueued=function(){return-1073741824===(-1073741824&this._bitField)},t.prototype._setGcQueued=function(){this._bitField=-1073741824|this._bitField},t.prototype._unsetGcQueued=function(){this._bitField=1073741823&this._bitField},t.prototype._queueGC=function(){this._isGcQueued()||(this._setGcQueued(),a.invokeLater(this._gc,this,void 0))},t.prototype._gc=function(){for(var t=5*this._length()-5,e=0;t>e;e++)delete this[e];this._clearFirstHandlerData(),this._setLength(0),this._unsetGcQueued()},t.prototype._clearFirstHandlerData=function(){this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0},t.prototype._queueSettleAt=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),a.invoke(this._settlePromiseAt,this,t)},t.prototype._fulfillUnchecked=function(t){if(this.isPending()){if(t===this){var e=F();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._cleanValues(),this._setFulfilled(),this._settledValue=t;var r=this._length();r>0&&a.invoke(this._settlePromises,this,r)}},t.prototype._rejectUncheckedCheckError=function(t){var e=T(t)?t:new Error(t+"");this._rejectUnchecked(t,e===t?void 0:e)},t.prototype._rejectUnchecked=function(t,e){if(this.isPending()){if(t===this){var r=F();return this._attachExtraTrace(r),this._rejectUnchecked(r)}if(this._cleanValues(),this._setRejected(),this._settledValue=t,this._isFinal())return void a.invokeLater(S,void 0,void 0===e?t:e);var n=this._length();void 0!==e&&this._setCarriedStackTrace(e),n>0?a.invoke(this._rejectPromises,this,null):this._ensurePossibleRejectionHandled()}},t.prototype._rejectPromises=function(){this._settlePromises(),this._unsetCarriedStackTrace()},t.prototype._settlePromises=function(){for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},t.prototype._ensurePossibleRejectionHandled=function(){this._setRejectionIsUnhandled(),void 0!==d.possiblyUnhandledRejection&&a.invokeLater(this._notifyUnhandledRejection,this,void 0)},t.prototype._notifyUnhandledRejectionIsHandled=function(){"function"==typeof R&&a.invokeLater(R,void 0,this)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue,e=this._getCarriedStackTrace();this._setUnhandledRejectionIsNotified(),void 0!==e&&(this._unsetCarriedStackTrace(),t=e),"function"==typeof d.possiblyUnhandledRejection&&d.possiblyUnhandledRejection(t,this)}};var I=[];return t.prototype._peekContext=function(){var t=I.length-1;return t>=0?I[t]:void 0},t.prototype._pushContext=function(){C&&I.push(this)},t.prototype._popContext=function(){C&&I.pop()},t.noConflict=function(){return n(t)},t.setScheduler=function(t){if("function"!=typeof t)throw new E("fn must be a function");a._schedule=t},d.isSupported()||(t.longStackTraces=function(){},C=!1),t._makeSelfResolutionError=F,r(67)(t,f,h),r(68)(t),r(69)(t),r(70)(t,p,h,c),t.RangeError=j,t.CancellationError=x,t.TimeoutError=A,t.TypeError=E,t.OperationalError=O,t.RejectionError=O,t.AggregateError=u.AggregateError,s.toFastProperties(t),s.toFastProperties(t.prototype),t.Promise=t,r(71)(t,c,h),r(72)(t,c,h),r(73)(t),r(74)(t,N,c,h),r(75)(t,p,N,h,c),r(76)(t),r(77)(t,c),r(78)(t,p,h),r(79)(t,p,N,h,c),r(80)(t,p),r(81)(t,p,N),r(82)(t,p),r(83)(t,c),r(84)(t,c),r(85)(t,p),r(86)(t,c),r(87)(t,N,h),t.prototype=t.prototype,t}}).call(e,r(51))},function(t,e,r){function n(t){return function(e){var r=t(e);return r.sort(),r}}function i(t,e){y.formats[t]=e}function o(t){return" "+t}function s(t,e,r,n){n=n||e.keys(t);var i=0;return e.seen.push(t),n=n.map(function(r){var n=a(t,e,r);return i+=n.length,n}),e.seen.pop(),0===n.length?"{}":i<=e.maxLineLength?"{ "+(r?r+" ":"")+n.join(e.propSep+" ")+" }":"{\n"+(r?r+"\n":"")+n.map(o).join(e.propSep+"\n")+"\n}"}function a(t,e,r){var n;try{n=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(i){n={value:i}}var o=y.formatPropertyName(r,e),s=n.get&&n.set?"[Getter/Setter]":n.get?"[Getter]":n.set?"[Setter]":e.seen.indexOf(n.value)>=0?"[Circular]":y(n.value,e);return o+": "+s}function u(t){return 10>t?"0"+t:""+t}function c(t){return 100>t?"0"+u(t):""+t}function l(t){var e=t.getTimezoneOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r-60*n,o="GMT"+(0>e?"+":"-")+u(n)+u(i);return t.toLocaleDateString()+" "+t.toLocaleTimeString()+"."+c(t.getMilliseconds())+" "+o}function f(t){return function(e,r){var n=t(e),i=r.keys(e);return 0==i.length?n:s(e,r,n,i)}}function h(t){if(t.name)return t.name;var e=t.toString().match(g)[1];return e}function p(t,e){return function(r){var n="",i=50,o=r[t];if(o>0){for(var s=0;i>s&&o>s;s++){var a=r[s]||0;n+=" "+u(a.toString(16))}o>i&&(n+=" ... ")}return"["+(r.constructor.name||e)+(n?":"+n:"")+"]"}}var d=r(95),y=function(t,e){e=e||{},"seen"in e||(e.seen=[]),e.keys=n("keys"in e&&e.keys===!1?Object.getOwnPropertyNames:Object.keys),"maxLineLength"in e||(e.maxLineLength=60),"propSep"in e||(e.propSep=",");var r=d(t);return(y.formats[r]||y.formats.object)(t,e)};t.exports=y,y.formats={},["undefined","boolean","null"].forEach(function(t){i(t,String)}),["number","boolean"].forEach(function(t){var e=t.substring(0,1).toUpperCase()+t.substring(1);i("object-"+t,f(function(t){return"["+e+": "+y(t.valueOf())+"]"}))}),i("object-string",function(t,e){var r=t.valueOf(),n="[String: "+y(r)+"]",i=e.keys(t);return i=i.filter(function(t){return!(t.match(/\d+/)&&parseInt(t,10)1/t?"-0":String(t)}),i("string",function(t){return"'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'"}),i("object",s),i("array",function(t,e){var r=e.keys(t),n=0;e.seen.push(t);var i=r.map(function(r){var i;try{i=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(o){i={value:o}}var s;return s=r.match(/\d+/)?y(i.value,e):a(i.value,e,r),n+=s.length,s});return e.seen.pop(),0===i.length?"[]":n<=e.maxLineLength?"[ "+i.join(e.propSep+" ")+" ]":"[\n"+i.map(o).join(e.propSep+"\n")+"\n]"}),y.formatPropertyName=function(t,e){return t.match(/^[a-zA-Z_$][a-zA-Z_$0-9]*$/)?t:y(t,e)},i("date",f(l));var g=/^\s*function\s*(\S*)\s*\(/;i("function",f(function(t){var e=h(t);return"[Function"+(e?": "+e:"")+"]"})),i("error",f(function(t){var e=t.name,r=t.message;return"["+e+(r?": "+r:"")+"]"})),i("buffer",p("length","Buffer")),i("array-buffer",p("byteLength")),i("typed-array",p("byteLength")),i("promise",function(){return"[Promise]"}),i("xhr",function(){return"[XMLHttpRequest]"}),i("html-element",function(t){return t.outerHTML}),i("html-element-text",function(t){return t.nodeValue}),i("document",function(t){return t.documentElement.outerHTML}),i("window",function(){return"[Window]"})},function(t,e,r){"use strict";if(!Array.isArray){var n=Object.prototype.toString();Array.isArray=function(t){return"[object Array]"===n.call(t)?!0:"function"==typeof t.slice&&"number"==typeof t.length?!0:!1}}window.noder=r(28)},function(t){"use strict";function e(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t}function r(t){var e=arguments.length;if(2>e)throw new Error("There should be at least 2 arguments passed to utils.mergeRecursive()");for(var n=1;e>n;n++)for(var i in arguments[n])t[i]=t[i]&&"object"==typeof t[i]?r(t[i],arguments[n][i]):arguments[n][i];return t}t.exports.merge=e,t.exports.mergeRecursive=r},function(t,e,r){(function(t,n){function i(t,r){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),u(n,t,n.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function s(t){return t}function a(t){var e={};return t.forEach(function(t){e[t]=!0}),e}function u(t,r,n){if(t.customInspect&&r&&O(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return _(i)||(i=u(t,i,n)),i}var o=c(t,r);if(o)return o;var s=Object.keys(r),y=a(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(O(r)){var g=r.name?": "+r.name:"";return t.stylize("[Function"+g+"]","special")}if(j(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return l(r)}var v="",m=!1,b=["{","}"];if(d(r)&&(m=!0,b=["[","]"]),O(r)){var w=r.name?": "+r.name:"";v=" [Function"+w+"]"}if(j(r)&&(v=" "+RegExp.prototype.toString.call(r)),x(r)&&(v=" "+Date.prototype.toUTCString.call(r)),A(r)&&(v=" "+l(r)),0===s.length&&(!m||0==r.length))return b[0]+v+b[1];if(0>n)return j(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special");t.seen.push(r);var E;return E=m?f(t,r,n,y,s):s.map(function(e){return h(t,r,n,y,e,m)}),t.seen.pop(),p(E,v,b)}function c(t,e){if(w(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i){for(var o=[],s=0,a=e.length;a>s;++s)o.push(N(e,String(s))?h(t,e,r,n,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(t,e,r,n,i,!0))}),o}function h(t,e,r,n,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),N(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=g(r)?u(t,c.value,null):u(t,c.value,r-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return null==t}function m(t){return"number"==typeof t}function _(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function w(t){return void 0===t}function j(t){return E(t)&&"[object RegExp]"===k(t)}function E(t){return"object"==typeof t&&null!==t}function x(t){return E(t)&&"[object Date]"===k(t)}function A(t){return E(t)&&("[object Error]"===k(t)||t instanceof Error)}function O(t){return"function"==typeof t}function P(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function k(t){return Object.prototype.toString.call(t)}function T(t){return 10>t?"0"+t.toString(10):t.toString(10)}function S(){var t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"); -return[t.getDate(),I[t.getMonth()],e].join(" ")}function N(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var F=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),a=n[r];o>r;a=n[++r])s+=g(a)||!E(a)?" "+a:" "+i(a);return s},e.deprecate=function(r,i){function o(){if(!s){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),s=!0}return r.apply(this,arguments)}if(w(t.process))return function(){return e.deprecate(r,i).apply(this,arguments)};if(n.noDeprecation===!0)return r;var s=!1;return o};var R,C={};e.debuglog=function(t){if(w(R)&&(R={NODE_ENV:"production"}.NODE_DEBUG||""),t=t.toUpperCase(),!C[t])if(new RegExp("\\b"+t+"\\b","i").test(R)){var r=n.pid;C[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else C[t]=function(){};return C[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=y,e.isNull=g,e.isNullOrUndefined=v,e.isNumber=m,e.isString=_,e.isSymbol=b,e.isUndefined=w,e.isRegExp=j,e.isObject=E,e.isDate=x,e.isError=A,e.isFunction=O,e.isPrimitive=P,e.isBuffer=r(90);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){console.log("%s - %s",S(),e.format.apply(e,arguments))},e.inherits=r(96),e._extend=function(t,e){if(!e||!E(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(e,function(){return this}(),r(51))},function(t,e,r){(function(t){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);var i,o=typeof e;if("number"===o)i=e>0?e>>>0:0;else if("string"===o)"base64"===r&&(e=j(e)),i=t.byteLength(e,r);else{if("object"!==o||null===e)throw new TypeError("must start with number, buffer, array or string");"Buffer"===e.type&&C(e.data)&&(e=e.data),i=+e.length>0?Math.floor(+e.length):0}if(this.length>I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");var s;t.TYPED_ARRAY_SUPPORT?s=t._augment(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(t.TYPED_ARRAY_SUPPORT&&"number"==typeof e.byteLength)s._set(e);else if(x(e))if(t.isBuffer(e))for(a=0;i>a;a++)s[a]=e.readUInt8(a);else for(a=0;i>a;a++)s[a]=(e[a]%256+256)%256;else if("string"===o)s.write(e,0,r);else if("number"===o&&!t.TYPED_ARRAY_SUPPORT&&!n)for(a=0;i>a;a++)s[a]=0;return s}function n(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;n>s;s++){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[r+s]=a}return s}function i(t,e,r,n){var i=S(O(e),t,r,n);return i}function o(t,e,r,n){var i=S(P(e),t,r,n);return i}function s(t,e,r,n){return o(t,e,r,n)}function a(t,e,r,n){var i=S(T(e),t,r,n);return i}function u(t,e,r,n){var i=S(k(e),t,r,n,2);return i}function c(t,e,r){return F.fromByteArray(0===e&&r===t.length?t:t.slice(e,r))}function l(t,e,r){var n="",i="";r=Math.min(t.length,r);for(var o=e;r>o;o++)t[o]<=127?(n+=N(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return n+N(i)}function f(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function h(t,e,r){return f(t,e,r)}function p(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=e;r>o;o++)i+=A(t[o]);return i}function d(t,e,r){for(var n=t.slice(e,r),i="",o=0;ot)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function g(e,r,n,i,o,s){if(!t.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(r>o||s>r)throw new TypeError("value is out of bounds");if(n+i>e.length)throw new TypeError("index out of range")}function v(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);o>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function m(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);o>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function _(t,e,r,n,i,o){if(e>i||o>e)throw new TypeError("value is out of bounds");if(r+n>t.length)throw new TypeError("index out of range")}function b(t,e,r,n,i){return i||_(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),R.write(t,e,r,n,23,4),r+4}function w(t,e,r,n,i){return i||_(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),R.write(t,e,r,n,52,8),r+8}function j(t){for(t=E(t).replace(L,"");t.length%4!==0;)t+="=";return t}function E(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function x(e){return C(e)||t.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function A(t){return 16>t?"0"+t.toString(16):t.toString(16)}function O(t){for(var e=[],r=0;r=n)e.push(n);else{var i=r;n>=55296&&57343>=n&&r++;for(var o=encodeURIComponent(t.slice(i,r+1)).substr(1).split("%"),s=0;s>8,n=e%256,i.push(n),i.push(r);return i}function T(t){return F.toByteArray(t)}function S(t,e,r,n,i){i&&(n-=n%i);for(var o=0;n>o&&!(o+r>=e.length||o>=t.length);o++)e[o+r]=t[o];return o}function N(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}/*! +var n=r(32),i=r(58);t.exports=function(t,e){var r=t.format,o=t.type;e.add("containEql",function(e){this.params={operator:"to contain "+r(e)},this.is.not["null"].and.not.undefined;var o=this.obj,s=t.type(o);s==t.type.STRING?this.assert(o.indexOf(String(e))>=0):n.isIndexable(o)?this.assert(n.some(o,function(t){return i(t,e).result})):this.have.properties(e)}),e.add("containDeepOrdered",function(e){this.params={operator:"to contain "+r(e)};var i=this.obj;if(o(i)==o.STRING)this.assert(i.indexOf(String(e))>=0);else if(n.isIndexable(i)&&n.isIndexable(e)){for(var s=0,a=0,u=n.length(i),c=n.length(e);u>s&&c>a;s++)try{t(i[s]).containDeepOrdered(e[a]),a++}catch(l){if(l instanceof t.AssertionError)continue;throw l}this.assert(a==c)}else null!=i&&null!=e&&"object"==typeof i&&"object"==typeof e?(n.forEach(e,function(e,r){t(i[r]).containDeepOrdered(e)}),n.isEmptyObject(e)&&this.eql(e)):this.eql(e)}),e.add("containDeep",function(e){this.params={operator:"to contain "+r(e)};var i=this.obj;if("string"==typeof i)this.assert(i.indexOf(String(e))>=0);else if(n.isIndexable(i)&&n.isIndexable(e)){var o={};n.forEach(e,function(e){this.assert(n.some(i,function(r,n){if(n in o)return!1;try{return t(r).containDeep(e),o[n]=!0,!0}catch(i){if(i instanceof t.AssertionError)return!1;throw i}}))},this)}else null!=i&&null!=e&&"object"==typeof i&&"object"==typeof e?(n.forEach(e,function(e,r){t(i[r]).containDeep(e)}),n.isEmptyObject(e)&&this.eql(e)):this.eql(e)})}},function(t,e,r){var n;(function(t,i){(function(){function o(t,e){if(t!==e){var r=t===t,n=e===e;if(t>e||!r||"undefined"==typeof t&&n)return 1;if(e>t||!n||"undefined"==typeof e&&r)return-1}return 0}function s(t,e,r){if(e!==e)return v(t,r);for(var n=(r||0)-1,i=t.length;++n-1;);return r}function f(t,e){for(var r=t.length;r--&&e.indexOf(t.charAt(r))>-1;);return r}function h(t,e){return o(t.criteria,e.criteria)||t.index-e.index}function p(t,e){for(var r=-1,n=t.criteria,i=e.criteria,s=n.length;++r=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function b(t,e){for(var r=-1,n=t.length,i=-1,o=[];++re,n=_n(0,t.length,this.__views__),i=n.start,o=n.end,s=o-i,a=this.__dropCount__,u=Aa(s,this.__takeCount__),c=r?o:i-1,l=this.__iteratees__,f=l?l.length:0,h=0,p=[];t:for(;s--&&u>h;){c+=e;for(var d=-1,g=t[c];++dn&&(n=i)}return n}function ir(t){for(var e=-1,r=t.length,n=Sa;++ei&&(n=i)}return n}function or(t,e,r,n){var i=-1,o=t.length;for(n&&o&&(r=t[++i]);++i=200&&Ma(e),c=e.length;u&&(o=ze,a=!1,e=u);t:for(;++ir&&(r=-r>i?0:i+r),n="undefined"==typeof n||n>i?i:+n||0,0>n&&(n+=i),i=r>n?0:n>>>0,r>>>=0;i>r;)t[r++]=e;return t}function jr(t,e){var r=[];return _r(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r}function Er(t,e,r,n){var i;return r(t,function(t,r,o){return e(t,r,o)?(i=n?r:t,!1):void 0}),i}function Ar(t,e,r,n){for(var i=(n||0)-1,o=t.length,s=-1,a=[];++ie&&(e=-e>i?0:i+e),r="undefined"==typeof r||r>i?i:+r||0,0>r&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Ds(i);++n=200,u=a&&Ma(),c=[];u?(n=ze,o=!1):(a=!1,u=e?[]:c);t:for(;++r=i){for(;i>n;){var o=n+i>>>1,s=t[o];(r?e>=s:e>s)?n=o+1:i=o}return i}return Gr(t,e,Ps,r)}function Gr(t,e,r,n){e=r(e);for(var i=0,o=t?t.length:0,s=e!==e,a="undefined"==typeof e;o>i;){var u=ca((i+o)/2),c=r(t[u]),l=c===c;if(s)var f=l||n;else f=a?l&&(n||"undefined"!=typeof c):n?e>=c:e>c;f?i=u+1:o=u}return Aa(o,Na)}function Qr(t,e,r){if("function"!=typeof t)return Ps;if("undefined"==typeof e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,o){return t.call(e,r,n,i,o)};case 5:return function(r,n,i,o,s){return t.call(e,r,n,i,o,s)}}return function(){return t.apply(e,arguments)}}function Xr(t){return sa.call(t,0)}function Zr(t,e,r){for(var n=r.length,i=-1,o=Ea(t.length-n,0),s=-1,a=e.length,u=Ds(o+a);++se||null==r)return r;if(e>3&&An(arguments[1],arguments[2],arguments[3])&&(e=2),e>3&&"function"==typeof arguments[e-2])var n=Qr(arguments[--e-1],arguments[e--],5);else e>2&&"function"==typeof arguments[e-1]&&(n=arguments[--e]);for(var i=0;++im){var x=a?Ge(a):null,O=Ea(c-m,0),T=d?A:null,S=d?null:A,k=d?j:null,N=d?null:j;e|=d?F:I,e&=~(d?I:F),g||(e&=~(P|R));var C=un(t,e,r,k,T,N,S,x,u,O);return C.placeholder=E,C}}var U=h?r:this;return p&&(t=U[_]),a&&(j=Sn(j,a)),f&&u=e||!wa(e))return"";var i=e-n;return r=null==r?" ":r+"",ys(r,aa(i/r.length)).slice(0,i)}function ln(t,e,r,n){function i(){for(var e=-1,a=arguments.length,u=-1,c=n.length,l=Ds(a+c);++uu))return!1;for(;l&&++au:u>i)||u===n&&u===o)&&(i=u,o=t)}),o}function yn(t,r,n){var i=e.callback||Os;return i=i===Os?dr:i,n?i(t,r,n):i}function vn(t,r,n){var i=e.indexOf||Kn;return i=i===Kn?s:i,t?i(t,r,n):i}function _n(t,e,r){for(var n=-1,i=r?r.length:0;++n-1&&t%1==0&&e>t}function An(t,e,r){if(!Po(r))return!1;var n=typeof e;if("number"==n)var i=r.length,o=xn(i)&&En(e,i);else o="string"==n&&e in r;return o&&r[e]===t}function xn(t){return"number"==typeof t&&t>-1&&t%1==0&&Ca>=t}function On(t){return t===t&&(0===t?1/t>0:!Po(t))}function Tn(t,e){var r=t[1],n=e[1],i=r|n,o=U|C,s=P|R,a=o|s|S|N,u=r&U&&!(n&U),c=r&C&&!(n&C),l=(c?t:e)[7],f=(u?t:e)[8],h=!(r>=C&&n>s||r>s&&n>=C),p=i>=o&&a>=i&&(C>r||(c||u)&&l.length<=f);if(!h&&!p)return t;n&P&&(t[2]=e[2],i|=r&P?0:S);var d=e[3];if(d){var g=t[3];t[3]=g?Zr(g,d,e[4]):Ge(d),t[4]=g?b(t[3],Y):Ge(e[4])}return d=e[5],d&&(g=t[5],t[5]=g?tn(g,d,e[6]):Ge(d),t[6]=g?b(t[5],Y):Ge(e[6])),d=e[7],d&&(t[7]=Ge(d)),n&U&&(t[8]=null==t[8]?e[8]:Aa(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function Pn(t,e){t=In(t);for(var r=-1,n=e.length,i={};++rn;)s[++o]=Vr(t,n,n+=e);return s}function Ln(t){for(var e=-1,r=t?t.length:0,n=-1,i=[];++ee?0:e)):[]}function Mn(t,e,r){var n=t?t.length:0;return n?((r?An(t,e,r):null==e)&&(e=1),e=n-(+e||0),Vr(t,0,0>e?0:e)):[]}function Hn(t,e,r){var n=t?t.length:0;if(!n)return[];for(e=yn(e,r,3);n--&&e(t[n],n,t););return Vr(t,0,n+1)}function qn(t,e,r){var n=t?t.length:0;if(!n)return[];var i=-1;for(e=yn(e,r,3);++ir?Ea(n+r,0):r||0;else if(r){var i=Kr(t,e),o=t[i];return(e===e?e===o:o!==o)?i:-1}return s(t,e,r)}function Gn(t){return Mn(t,1)}function Qn(){for(var t=[],e=-1,r=arguments.length,n=[],i=vn(),o=i==s;++e=120&&Ma(e&&a)))}r=t.length;var u=t[0],c=-1,l=u?u.length:0,f=[],h=n[0];t:for(;++cr?Ea(n+r,0):Aa(r||0,n-1))+1;else if(r){i=Kr(t,e,!0)-1;var o=t[i];return(e===e?e===o:o!==o)?i:-1}if(e!==e)return v(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function ti(){var t=arguments[0];if(!t||!t.length)return t;for(var e=0,r=vn(),n=arguments.length;++e-1;)ga.call(t,i,1);return t}function ei(t){return Hr(t||[],Ar(arguments,!1,!1,1))}function ri(t,e,r){var n=-1,i=t?t.length:0,o=[];for(e=yn(e,r,3);++ne?0:e)):[]}function ui(t,e,r){var n=t?t.length:0;return n?((r?An(t,e,r):null==e)&&(e=1),e=n-(+e||0),Vr(t,0>e?0:e)):[]}function ci(t,e,r){var n=t?t.length:0;if(!n)return[];for(e=yn(e,r,3);n--&&e(t[n],n,t););return Vr(t,n+1)}function li(t,e,r){var n=t?t.length:0;if(!n)return[];var i=-1;for(e=yn(e,r,3);++i>>0,n=Ds(r);++er?Ea(n+r,0):r||0:0,"string"==typeof t||!Ga(t)&&Co(t)?n>r&&t.indexOf(e,r)>-1:vn(t,e,r)>-1):!1}function Ri(t,e,r){var n=Ga(t)?tr:br;return("function"!=typeof e||"undefined"!=typeof r)&&(e=yn(e,r,3)),n(t,e)}function Si(t,e,r){var n=Ga(t)?er:jr;return e=yn(e,r,3),n(t,e)}function ki(t,e,r){if(Ga(t)){var n=Vn(t,e,r);return n>-1?t[n]:O}return e=yn(e,r,3),Er(t,e,_r)}function Ni(t,e,r){return e=yn(e,r,3),Er(t,e,mr)}function Fi(t,e){return ki(t,Ur(e))}function Ii(t,e,r){return"function"==typeof e&&"undefined"==typeof r&&Ga(t)?Qe(t,e):_r(t,Qr(e,r,3))}function Ci(t,e,r){return"function"==typeof e&&"undefined"==typeof r&&Ga(t)?Ze(t,e):mr(t,Qr(e,r,3))}function Ui(t,e){return kr(t,e,Vr(arguments,2))}function Li(t,e,r){var n=Ga(t)?rr:Cr;return e=yn(e,r,3),n(t,e)}function Bi(t,e){return Li(t,Mr(e))}function Di(t,e,r,n){var i=Ga(t)?or:$r;return i(t,yn(e,n,4),r,arguments.length<3,_r)}function Mi(t,e,r,n){var i=Ga(t)?sr:$r;return i(t,yn(e,n,4),r,arguments.length<3,mr)}function Hi(t,e,r){var n=Ga(t)?er:jr;return e=yn(e,r,3),n(t,function(t,r,n){return!e(t,r,n)})}function qi(t,e,r){if(r?An(t,e,r):null==e){t=Fn(t);var n=t.length;return n>0?t[qr(0,n-1)]:O}var i=$i(t);return i.length=Aa(0>e?0:+e||0,i.length),i}function $i(t){t=Fn(t);for(var e=-1,r=t.length,n=Ds(r);++e3&&An(e[1],e[2],e[3])&&(e=[t,e[1]]);var r=-1,n=t?t.length:0,i=Ar(e,!1,!1,1),o=xn(n)?Ds(n):[];return _r(t,function(t){for(var e=i.length,n=Ds(e);e--;)n[e]=null==t?O:t[i[e]];o[++r]={criteria:n,index:r,value:t}}),a(o,p)}function Ji(t,e){return Si(t,Ur(e))}function Ki(t,e){if("function"!=typeof e){if("function"!=typeof t)throw new Js(V);var r=t;t=e,e=r}return t=wa(t=+t)?t:0,function(){return--t<1?e.apply(this,arguments):void 0}}function Gi(t,e,r){return r&&An(t,e,r)&&(e=null),e=t&&null==e?t.length:Ea(+e||0,0),fn(t,U,null,null,null,null,e)}function Qi(t,e){var r;if("function"!=typeof e){if("function"!=typeof t)throw new Js(V);var n=t;t=e,e=n}return function(){return--t>0?r=e.apply(this,arguments):e=null,r}}function Xi(t,e){var r=P;if(arguments.length>2){var n=Vr(arguments,2),i=b(n,Xi.placeholder);r|=F}return fn(t,r,e,n,i)}function Zi(t){return pr(t,arguments.length>1?Ar(arguments,!1,!1,1):Jo(t))}function to(t,e){var r=P|R;if(arguments.length>2){var n=Vr(arguments,2),i=b(n,to.placeholder);r|=F}return fn(e,r,t,n,i)}function eo(t,e,r){r&&An(t,e,r)&&(e=null);var n=fn(t,k,null,null,null,null,null,e);return n.placeholder=eo.placeholder,n}function ro(t,e,r){r&&An(t,e,r)&&(e=null);var n=fn(t,N,null,null,null,null,null,e);return n.placeholder=ro.placeholder,n}function no(t,e,r){function n(){h&&ua(h),u&&ua(u),u=h=p=O}function i(){var r=e-(Ka()-l);if(0>=r||r>e){u&&ua(u);var n=p;u=h=p=O,n&&(d=Ka(),c=t.apply(f,a),h||u||(a=f=null))}else h=da(i,r)}function o(){h&&ua(h),u=h=p=O,(y||g!==e)&&(d=Ka(),c=t.apply(f,a),h||u||(a=f=null))}function s(){if(a=arguments,l=Ka(),f=this,p=y&&(h||!v),g===!1)var r=v&&!h;else{u||v||(d=l);var n=g-(l-d),s=0>=n||n>g;s?(u&&(u=ua(u)),d=l,c=t.apply(f,a)):u||(u=da(o,n))}return s&&h?h=ua(h):h||e===g||(h=da(i,e)),r&&(s=!0,c=t.apply(f,a)),!s||h||u||(a=f=null),c}var a,u,c,l,f,h,p,d=0,g=!1,y=!0;if("function"!=typeof t)throw new Js(V);if(e=0>e?0:e,r===!0){var v=!0;y=!1}else Po(r)&&(v=r.leading,g="maxWait"in r&&Ea(+r.maxWait||0,e),y="trailing"in r?r.trailing:y);return s.cancel=n,s}function io(t){return yr(t,1,arguments,1)}function oo(t,e){return yr(t,e,arguments,2)}function so(){var t=arguments,e=t.length;if(!e)return function(){return arguments[0]};if(!tr(t,To))throw new Js(V);return function(){for(var r=0,n=t[r].apply(this,arguments);++re)return function(){return arguments[0]};if(!tr(t,To))throw new Js(V);return function(){for(var r=e,n=t[r].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function uo(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Js(V);var r=function(){var n=r.cache,i=e?e.apply(this,arguments):arguments[0];if(n.has(i))return n.get(i);var o=t.apply(this,arguments);return n.set(i,o),o};return r.cache=new uo.Cache,r}function co(t){if("function"!=typeof t)throw new Js(V);return function(){return!t.apply(this,arguments)}}function lo(t){return Qi(t,2)}function fo(t){var e=Vr(arguments,1),r=b(e,fo.placeholder);return fn(t,F,null,e,r)}function ho(t){var e=Vr(arguments,1),r=b(e,ho.placeholder);return fn(t,I,null,e,r)}function po(t){var e=Ar(arguments,!1,!1,1);return fn(t,C,null,null,null,e)}function go(t){if("function"!=typeof t)throw new Js(V);return function(e){return t.apply(this,e)}}function yo(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new Js(V);return r===!1?n=!1:Po(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),qe.leading=n,qe.maxWait=+e,qe.trailing=i,no(t,e,qe)}function vo(t,e){return e=null==e?Ps:e,fn(e,F,null,[t],[])}function _o(t,e,r,n){return"boolean"!=typeof e&&null!=e&&(n=r,r=An(t,e,n)?null:e,e=!1),r="function"==typeof r&&Qr(r,n,1),gr(t,e,r)}function mo(t,e,r){return e="function"==typeof e&&Qr(e,r,1),gr(t,!0,e)}function bo(t){var e=_(t)?t.length:O;return xn(e)&&ra.call(t)==W||!1}function wo(t){return t===!0||t===!1||_(t)&&ra.call(t)==J||!1}function jo(t){return _(t)&&ra.call(t)==K||!1}function Eo(t){return t&&1===t.nodeType&&_(t)&&ra.call(t).indexOf("Element")>-1||!1}function Ao(t){if(null==t)return!0;var e=t.length;return xn(e)&&(Ga(t)||Co(t)||bo(t)||_(t)&&To(t.splice))?!e:!tu(t).length}function xo(t,e,r,n){if(r="function"==typeof r&&Qr(r,n,3),!r&&On(t)&&On(e))return t===e;var i=r?r(t,e):O;return"undefined"==typeof i?Nr(t,e,r):!!i}function Oo(t){return _(t)&&"string"==typeof t.message&&ra.call(t)==G||!1}function To(t){return"function"==typeof t||!1}function Po(t){var e=typeof t;return"function"==e||t&&"object"==e||!1}function Ro(t,e,r,n){var i=tu(e),o=i.length;if(r="function"==typeof r&&Qr(r,n,3),!r&&1==o){var s=i[0],a=e[s];if(On(a))return null!=t&&a===t[s]&&ta.call(t,s)}for(var u=Ds(o),c=Ds(o);o--;)a=u[o]=e[i[o]],c[o]=On(a);return Ir(t,i,u,c,r)}function So(t){return Fo(t)&&t!=+t}function ko(t){return null==t?!1:ra.call(t)==Q?ia.test(Xs.call(t)):_(t)&&Re.test(t)||!1}function No(t){return null===t}function Fo(t){return"number"==typeof t||_(t)&&ra.call(t)==Z||!1}function Io(t){return _(t)&&ra.call(t)==ee||!1}function Co(t){return"string"==typeof t||_(t)&&ra.call(t)==ne||!1}function Uo(t){return _(t)&&xn(t.length)&&Me[ra.call(t)]||!1}function Lo(t){return"undefined"==typeof t}function Bo(t){var e=t?t.length:0;return xn(e)?e?Ge(t):[]:is(t)}function Do(t){return hr(t,Qo(t))}function Mo(t,e,r){var n=Ba(t);return r&&An(t,e,r)&&(e=null),e?hr(e,n,tu(e)):n}function Ho(t){if(null==t)return t;var e=Ge(arguments);return e.push(ur),Za.apply(O,e)}function qo(t,e,r){return e=yn(e,r,3),Er(t,e,Pr,!0)}function $o(t,e,r){return e=yn(e,r,3),Er(t,e,Rr,!0)}function Vo(t,e,r){return("function"!=typeof e||"undefined"!=typeof r)&&(e=Qr(e,r,3)),xr(t,e,Qo)}function Yo(t,e,r){return e=Qr(e,r,3),Or(t,e,Qo)}function Wo(t,e,r){return("function"!=typeof e||"undefined"!=typeof r)&&(e=Qr(e,r,3)),Pr(t,e)}function zo(t,e,r){return e=Qr(e,r,3),Or(t,e,tu)}function Jo(t){return Sr(t,Qo(t))}function Ko(t,e){return t?ta.call(t,e):!1}function Go(t,e,r){r&&An(t,e,r)&&(e=null);for(var n=-1,i=tu(t),o=i.length,s={};++n0;++nr?0:+r||0,n))-e.length,r>=0&&t.indexOf(e,r)==r}function ls(t){return t=u(t),t&&we.test(t)?t.replace(me,g):t}function fs(t){return t=u(t),t&&Fe.test(t)?t.replace(Ne,"\\$&"):t}function hs(t,e,r){t=u(t),e=+e;var n=t.length;if(n>=e||!wa(e))return t;var i=(e-n)/2,o=ca(i),s=aa(i);return r=cn("",s,r),r.slice(0,o)+t+r}function ps(t,e,r){return t=u(t),t&&cn(t,e,r)+t}function ds(t,e,r){return t=u(t),t&&t+cn(t,e,r)}function gs(t,e,r){return r&&An(t,e,r)&&(e=0),Ta(t,e)}function ys(t,e){var r="";if(t=u(t),e=+e,1>e||!t||!wa(e))return r;do e%2&&(r+=t),e=ca(e/2),t+=t;while(e);return r}function vs(t,e,r){return t=u(t),r=null==r?0:Aa(0>r?0:+r||0,t.length),t.lastIndexOf(e,r)==r}function _s(t,r,n){var i=e.templateSettings;n&&An(t,r,n)&&(r=n=null),t=u(t),r=lr(lr({},n||r),i,cr);var o,s,a=lr(lr({},r.imports),i.imports,cr),c=tu(a),l=zr(a,c),f=0,h=r.interpolate||ke,p="__p += '",d=Ws((r.escape||ke).source+"|"+h.source+"|"+(h===Ae?xe:ke).source+"|"+(r.evaluate||ke).source+"|$","g"),g="//# sourceURL="+("sourceURL"in r?r.sourceURL:"lodash.templateSources["+ ++De+"]")+"\n";t.replace(d,function(e,r,n,i,a,u){return n||(n=i),p+=t.slice(f,u).replace(Ce,y),r&&(o=!0,p+="' +\n__e("+r+") +\n'"),a&&(s=!0,p+="';\n"+a+";\n__p += '"),n&&(p+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),f=u+e.length,e}),p+="';\n";var v=r.variable;v||(p="with (obj) {\n"+p+"\n}\n"),p=(s?p.replace(ge,""):p).replace(ye,"$1").replace(ve,"$1;"),p="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var _=xs(function(){return qs(c,g+"return "+p).apply(O,l)});if(_.source=p,Oo(_))throw _;return _}function ms(t,e,r){var n=t;return(t=u(t))?(r?An(n,e,r):null==e)?t.slice(j(t),E(t)+1):(e+="",t.slice(l(t,e),f(t,e)+1)):t}function bs(t,e,r){var n=t;return t=u(t),t?t.slice((r?An(n,e,r):null==e)?j(t):l(t,e+"")):t}function ws(t,e,r){var n=t;return t=u(t),t?(r?An(n,e,r):null==e)?t.slice(0,E(t)+1):t.slice(0,f(t,e+"")+1):t}function js(t,e,r){r&&An(t,e,r)&&(e=null);var n=L,i=B;if(null!=e)if(Po(e)){var o="separator"in e?e.separator:o;n="length"in e?+e.length||0:n,i="omission"in e?u(e.omission):i}else n=+e||0;if(t=u(t),n>=t.length)return t;var s=n-i.length;if(1>s)return i;var a=t.slice(0,s);if(null==o)return a+i;if(Io(o)){if(t.slice(s).search(o)){var c,l,f=t.slice(0,s);for(o.global||(o=Ws(o.source,(Oe.exec(o)||"")+"g")),o.lastIndex=0;c=o.exec(f);)l=c.index;a=a.slice(0,null==l?s:l)}}else if(t.indexOf(o,s)!=s){var h=a.lastIndexOf(o);h>-1&&(a=a.slice(0,h))}return a+i}function Es(t){return t=u(t),t&&be.test(t)?t.replace(_e,A):t}function As(t,e,r){return r&&An(t,e,r)&&(e=null),t=u(t),t.match(e||Ue)||[]}function xs(t){try{return t.apply(O,Vr(arguments,1))}catch(e){return Oo(e)?e:new Hs(e)}}function Os(t,e,r){return r&&An(t,e,r)&&(e=null),_(t)?Rs(t):dr(t,e)}function Ts(t){return function(){return t}}function Ps(t){return t}function Rs(t){return Ur(gr(t,!0))}function Ss(t,e){return Lr(t+"",gr(e,!0))}function ks(t,e,r){if(null==r){var n=Po(e),i=n&&tu(e),o=i&&i.length&&Sr(e,i);(o?o.length:n)||(o=!1,r=e,e=t,t=this)}o||(o=Sr(e,tu(e)));var s=!0,a=-1,u=To(t),c=o.length;r===!1?s=!1:Po(r)&&"chain"in r&&(s=r.chain);for(;++at||!wa(t))return[];var n=-1,i=Ds(Aa(t,ka));for(e=Qr(e,r,1);++nn?i[n]=e(n):e(n);return i}function Bs(t){var e=++ea;return u(t)+e}t=t?Xe.defaults(Je.Object(),t,Xe.pick(Je,Be)):Je;var Ds=t.Array,Ms=t.Date,Hs=t.Error,qs=t.Function,$s=t.Math,Vs=t.Number,Ys=t.Object,Ws=t.RegExp,zs=t.String,Js=t.TypeError,Ks=Ds.prototype,Gs=Ys.prototype,Qs=(Qs=t.window)&&Qs.document,Xs=qs.prototype.toString,Zs=Mr("length"),ta=Gs.hasOwnProperty,ea=0,ra=Gs.toString,na=t._,ia=Ws("^"+fs(ra).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oa=ko(oa=t.ArrayBuffer)&&oa,sa=ko(sa=oa&&new oa(0).slice)&&sa,aa=$s.ceil,ua=t.clearTimeout,ca=$s.floor,la=ko(la=Ys.getPrototypeOf)&&la,fa=Ks.push,ha=Gs.propertyIsEnumerable,pa=ko(pa=t.Set)&&pa,da=t.setTimeout,ga=Ks.splice,ya=ko(ya=t.Uint8Array)&&ya,va=ko(va=t.WeakMap)&&va,_a=function(){try{var e=ko(e=t.Float64Array)&&e,r=new e(new oa(10),0,1)&&e}catch(n){}return r}(),ma=ko(ma=Ds.isArray)&&ma,ba=ko(ba=Ys.create)&&ba,wa=t.isFinite,ja=ko(ja=Ys.keys)&&ja,Ea=$s.max,Aa=$s.min,xa=ko(xa=Ms.now)&&xa,Oa=ko(Oa=Vs.isFinite)&&Oa,Ta=t.parseInt,Pa=$s.random,Ra=Vs.NEGATIVE_INFINITY,Sa=Vs.POSITIVE_INFINITY,ka=$s.pow(2,32)-1,Na=ka-1,Fa=ka>>>1,Ia=_a?_a.BYTES_PER_ELEMENT:0,Ca=$s.pow(2,53)-1,Ua=va&&new va,La=e.support={};!function(){La.funcDecomp=!ko(t.WinRTError)&&Ie.test(x),La.funcNames="string"==typeof qs.name;try{La.dom=11===Qs.createDocumentFragment().nodeType}catch(e){La.dom=!1}try{La.nonEnumArgs=!ha.call(arguments,1)}catch(e){La.nonEnumArgs=!0}}(0,0),e.templateSettings={escape:je,evaluate:Ee,interpolate:Ae,variable:"",imports:{_:e}};var Ba=function(){function e(){}return function(r){if(Po(r)){e.prototype=r;var n=new e;e.prototype=null}return n||t.Object()}}(),Da=Ua?function(t,e){return Ua.set(t,e),t}:Ps;sa||(Xr=oa&&ya?function(t){var e=t.byteLength,r=_a?ca(e/Ia):0,n=r*Ia,i=new oa(e);if(r){var o=new _a(i,0,r);o.set(new _a(t,0,r))}return e!=n&&(o=new ya(i,n),o.set(new ya(t,n))),i}:Ts(null));var Ma=ba&&pa?function(t){return new We(t)}:Ts(null),Ha=Ua?function(t){return Ua.get(t)}:Fs,qa=function(){var t=0,e=0;return function(r,n){var i=Ka(),o=M-(i-e);if(e=i,o>0){if(++t>=D)return r}else t=0;return Da(r,n)}}(),$a=en(function(t,e,r){ta.call(t,r)?++t[r]:t[r]=1}),Va=en(function(t,e,r){ta.call(t,r)?t[r].push(e):t[r]=[e]}),Ya=en(function(t,e,r){t[r]=e}),Wa=an(nr),za=an(ir,!0),Ja=en(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]}),Ka=xa||function(){return(new Ms).getTime()},Ga=ma||function(t){return _(t)&&xn(t.length)&&ra.call(t)==z||!1};La.dom||(Eo=function(t){return t&&1===t.nodeType&&_(t)&&!Xa(t)||!1});var Qa=Oa||function(t){return"number"==typeof t&&wa(t)};(To(/x/)||ya&&!To(ya))&&(To=function(t){return ra.call(t)==Q});var Xa=la?function(t){if(!t||ra.call(t)!=te)return!1;var e=t.valueOf,r=ko(e)&&(r=la(e))&&la(r);return r?t==r||la(t)==r:kn(t)}:kn,Za=rn(lr),tu=ja?function(t){if(t)var e=t.constructor,r=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&r&&xn(r)?Nn(t):Po(t)?ja(t):[]}:Nn,eu=rn(Br),ru=on(function(t,e,r){return e=e.toLowerCase(),t+(r?e.charAt(0).toUpperCase()+e.slice(1):e)}),nu=on(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()});8!=Ta(Le+"08")&&(gs=function(t,e,r){return(r?An(t,e,r):null==e)?e=0:e&&(e=+e),t=ms(t),Ta(t,e||(Pe.test(t)?16:10))});var iu=on(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}),ou=on(function(t,e,r){return t+(r?" ":"")+(e.charAt(0).toUpperCase()+e.slice(1))});return r.prototype=Ba(e.prototype),n.prototype=Ba(r.prototype),n.prototype.constructor=n,re.prototype["delete"]=ie,re.prototype.get=$e,re.prototype.has=Ve,re.prototype.set=Ye,We.prototype.push=Ke,uo.Cache=re,e.after=Ki,e.ary=Gi,e.assign=Za,e.at=Ti,e.before=Qi,e.bind=Xi,e.bindAll=Zi,e.bindKey=to,e.callback=Os,e.chain=_i,e.chunk=Un,e.compact=Ln,e.constant=Ts,e.countBy=$a,e.create=Mo,e.curry=eo,e.curryRight=ro,e.debounce=no,e.defaults=Ho,e.defer=io,e.delay=oo,e.difference=Bn,e.drop=Dn,e.dropRight=Mn,e.dropRightWhile=Hn,e.dropWhile=qn,e.fill=$n,e.filter=Si,e.flatten=zn,e.flattenDeep=Jn,e.flow=so,e.flowRight=ao,e.forEach=Ii,e.forEachRight=Ci,e.forIn=Vo,e.forInRight=Yo,e.forOwn=Wo,e.forOwnRight=zo,e.functions=Jo,e.groupBy=Va,e.indexBy=Ya,e.initial=Gn,e.intersection=Qn,e.invert=Go,e.invoke=Ui,e.keys=tu,e.keysIn=Qo,e.map=Li,e.mapValues=Xo,e.matches=Rs,e.matchesProperty=Ss,e.memoize=uo,e.merge=eu,e.mixin=ks,e.negate=co,e.omit=Zo,e.once=lo,e.pairs=ts,e.partial=fo,e.partialRight=ho,e.partition=Ja,e.pick=es,e.pluck=Bi,e.property=Is,e.propertyOf=Cs,e.pull=ti,e.pullAt=ei,e.range=Us,e.rearg=po,e.reject=Hi,e.remove=ri,e.rest=ni,e.shuffle=$i,e.slice=ii,e.sortBy=Wi,e.sortByAll=zi,e.spread=go,e.take=ai,e.takeRight=ui,e.takeRightWhile=ci,e.takeWhile=li,e.tap=mi,e.throttle=yo,e.thru=bi,e.times=Ls,e.toArray=Bo,e.toPlainObject=Do,e.transform=ns,e.union=fi,e.uniq=hi,e.unzip=pi,e.values=is,e.valuesIn=os,e.where=Ji,e.without=di,e.wrap=vo,e.xor=gi,e.zip=yi,e.zipObject=vi,e.backflow=ao,e.collect=Li,e.compose=ao,e.each=Ii,e.eachRight=Ci,e.extend=Za,e.iteratee=Os,e.methods=Jo,e.object=vi,e.select=Si,e.tail=ni,e.unique=hi,ks(e,e),e.attempt=xs,e.camelCase=ru,e.capitalize=as,e.clone=_o,e.cloneDeep=mo,e.deburr=us,e.endsWith=cs,e.escape=ls,e.escapeRegExp=fs,e.every=Ri,e.find=ki,e.findIndex=Vn,e.findKey=qo,e.findLast=Ni,e.findLastIndex=Yn,e.findLastKey=$o,e.findWhere=Fi,e.first=Wn,e.has=Ko,e.identity=Ps,e.includes=Pi,e.indexOf=Kn,e.isArguments=bo,e.isArray=Ga,e.isBoolean=wo,e.isDate=jo,e.isElement=Eo,e.isEmpty=Ao,e.isEqual=xo,e.isError=Oo,e.isFinite=Qa,e.isFunction=To,e.isMatch=Ro,e.isNaN=So,e.isNative=ko,e.isNull=No,e.isNumber=Fo,e.isObject=Po,e.isPlainObject=Xa,e.isRegExp=Io,e.isString=Co,e.isTypedArray=Uo,e.isUndefined=Lo,e.kebabCase=nu,e.last=Xn,e.lastIndexOf=Zn,e.max=Wa,e.min=za,e.noConflict=Ns,e.noop=Fs,e.now=Ka,e.pad=hs,e.padLeft=ps,e.padRight=ds,e.parseInt=gs,e.random=ss,e.reduce=Di,e.reduceRight=Mi,e.repeat=ys,e.result=rs,e.runInContext=x,e.size=Vi,e.snakeCase=iu,e.some=Yi,e.sortedIndex=oi,e.sortedLastIndex=si,e.startCase=ou,e.startsWith=vs,e.template=_s,e.trim=ms,e.trimLeft=bs,e.trimRight=ws,e.trunc=js,e.unescape=Es,e.uniqueId=Bs,e.words=As,e.all=Ri,e.any=Yi,e.contains=Pi,e.detect=ki,e.foldl=Di,e.foldr=Mi,e.head=Wn,e.include=Pi,e.inject=Di,ks(e,function(){var t={};return Pr(e,function(r,n){e.prototype[n]||(t[n]=r)}),t}(),!1),e.sample=qi,e.prototype.sample=function(t){return this.__chain__||null!=t?this.thru(function(e){return qi(e,t)}):qi(this.value())},e.VERSION=T,Qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){e[t].placeholder=e}),Qe(["filter","map","takeWhile"],function(t,e){var r=e==H,i=e==$;n.prototype[t]=function(t,n){var o=this.clone(),s=o.__filtered__,a=o.__iteratees__||(o.__iteratees__=[]);return o.__filtered__=s||r||i&&o.__dir__<0,a.push({iteratee:yn(t,n,3),type:e}),o}}),Qe(["drop","take"],function(t,e){var r="__"+t+"Count__",i=t+"While";n.prototype[t]=function(n){n=null==n?1:Ea(ca(n)||0,0);var i=this.clone();if(i.__filtered__){var o=i[r];i[r]=e?Aa(o,n):o+n}else{var s=i.__views__||(i.__views__=[]);s.push({size:n,type:t+(i.__dir__<0?"Right":"")})}return i},n.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()},n.prototype[t+"RightWhile"]=function(t,e){return this.reverse()[i](t,e).reverse()}}),Qe(["first","last"],function(t,e){var r="take"+(e?"Right":"");n.prototype[t]=function(){return this[r](1).value()[0]}}),Qe(["initial","rest"],function(t,e){var r="drop"+(e?"":"Right");n.prototype[t]=function(){return this[r](1)}}),Qe(["pluck","where"],function(t,e){var r=e?"filter":"map",i=e?Ur:Mr;n.prototype[t]=function(t){return this[r](i(t))}}),n.prototype.compact=function(){return this.filter(Ps)},n.prototype.dropWhile=function(t,e){var r;return t=yn(t,e,3),this.filter(function(e,n,i){return r||(r=!t(e,n,i))})},n.prototype.reject=function(t,e){return t=yn(t,e,3),this.filter(function(e,r,n){return!t(e,r,n)})},n.prototype.slice=function(t,e){t=null==t?0:+t||0;var r=0>t?this.takeRight(-t):this.drop(t);return"undefined"!=typeof e&&(e=+e||0,r=0>e?r.dropRight(-e):r.take(e-t)),r},n.prototype.toArray=function(){return this.drop(0)},Pr(n.prototype,function(t,i){var o=e[i],s=/^(?:first|last)$/.test(i);e.prototype[i]=function(){var i=this.__wrapped__,a=arguments,u=this.__chain__,c=!!this.__actions__.length,l=i instanceof n,f=l&&!c;if(s&&!u)return f?t.call(i):o.call(e,this.value());var h=function(t){var r=[t];return fa.apply(r,a),o.apply(e,r)};if(l||Ga(i)){var p=f?i:new n(this),d=t.apply(p,a);if(!s&&(c||d.__actions__)){var g=d.__actions__||(d.__actions__=[]);g.push({func:bi,args:[h],thisArg:e})}return new r(d,u)}return this.thru(h)}}),Qe(["concat","join","pop","push","shift","sort","splice","unshift"],function(t){var r=Ks[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?r.apply(this.value(),t):this[n](function(e){return r.apply(e,t)})}}),n.prototype.clone=i,n.prototype.reverse=m,n.prototype.value=X,e.prototype.chain=wi,e.prototype.commit=ji,e.prototype.plant=Ei,e.prototype.reverse=Ai,e.prototype.toString=xi,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Oi,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var O,T="3.2.0",P=1,R=2,S=4,k=8,N=16,F=32,I=64,C=128,U=256,L=30,B="...",D=150,M=16,H=0,q=1,$=2,V="Expected a function",Y="__lodash_placeholder__",W="[object Arguments]",z="[object Array]",J="[object Boolean]",K="[object Date]",G="[object Error]",Q="[object Function]",X="[object Map]",Z="[object Number]",te="[object Object]",ee="[object RegExp]",re="[object Set]",ne="[object String]",ie="[object WeakMap]",oe="[object ArrayBuffer]",se="[object Float32Array]",ae="[object Float64Array]",ue="[object Int8Array]",ce="[object Int16Array]",le="[object Int32Array]",fe="[object Uint8Array]",he="[object Uint8ClampedArray]",pe="[object Uint16Array]",de="[object Uint32Array]",ge=/\b__p \+= '';/g,ye=/\b(__p \+=) '' \+/g,ve=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_e=/&(?:amp|lt|gt|quot|#39|#96);/g,me=/[&<>"'`]/g,be=RegExp(_e.source),we=RegExp(me.source),je=/<%-([\s\S]+?)%>/g,Ee=/<%([\s\S]+?)%>/g,Ae=/<%=([\s\S]+?)%>/g,xe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oe=/\w*$/,Te=/^\s*function[ \n\r\t]+\w/,Pe=/^0[xX]/,Re=/^\[object .+?Constructor\]$/,Se=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,ke=/($^)/,Ne=/[.*+?^${}()|[\]\/\\]/g,Fe=RegExp(Ne.source),Ie=/\bthis\b/,Ce=/['\n\r\u2028\u2029\\]/g,Ue=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"{2,}(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),Le=" \f \n\r\u2028\u2029 ᠎              ",Be=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","document","isFinite","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","window","WinRTError"],De=-1,Me={};Me[se]=Me[ae]=Me[ue]=Me[ce]=Me[le]=Me[fe]=Me[he]=Me[pe]=Me[de]=!0,Me[W]=Me[z]=Me[oe]=Me[J]=Me[K]=Me[G]=Me[Q]=Me[X]=Me[Z]=Me[te]=Me[ee]=Me[re]=Me[ne]=Me[ie]=!1;var He={};He[W]=He[z]=He[oe]=He[J]=He[K]=He[se]=He[ae]=He[ue]=He[ce]=He[le]=He[Z]=He[te]=He[ee]=He[ne]=He[fe]=He[he]=He[pe]=He[de]=!0,He[G]=He[Q]=He[X]=He[re]=He[ie]=!1;var qe={leading:!1,maxWait:0,trailing:!1},$e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Ve={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ye={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},We={"function":!0,object:!0},ze={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Je=We[typeof window]&&window!==(this&&this.window)?window:this,Ke=We[typeof e]&&e&&!e.nodeType&&e,Ge=We[typeof t]&&t&&!t.nodeType&&t,Qe=Ke&&Ge&&"object"==typeof i&&i;!Qe||Qe.global!==Qe&&Qe.window!==Qe&&Qe.self!==Qe||(Je=Qe);var Xe=(Ge&&Ge.exports===Ke&&Ke,x());Je._=Xe,n=function(){return Xe}.call(e,r,e,t),!(n!==O&&(t.exports=n))}).call(this)}).call(e,r(60)(t),function(){return this}())},function(t,e,r){function n(t){return r(i(t))}function i(t){return o[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var o={"./browser":55,"./browser.js":55,"./collection":52,"./collection.js":52,"./index":27,"./index.js":27,"./utils":56,"./utils.js":56};n.keys=function(){return Object.keys(o)},n.resolve=i,t.exports=n,n.id=48},function(t,e,r){function n(t){return function(e){var r=t(e);return r.sort(),r}}function i(t,e){g.formats[t]=e}function o(t){return t.split("\n").map(function(t){return" "+t}).join("\n")}function s(t,e,r,n){n=n||e.keys(t);var i=0;return e.seen.push(t),n=n.map(function(r){var n=a(t,e,r);return i+=n.length,n}),e.seen.pop(),0===n.length?"{}":i<=e.maxLineLength?"{ "+(r?r+" ":"")+n.join(e.propSep+" ")+" }":"{\n"+(r?r+"\n":"")+n.map(o).join(e.propSep+"\n")+"\n}"}function a(t,e,r){var n;try{n=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(i){n={value:i}}var o=g.formatPropertyName(r,e),s=n.get&&n.set?"[Getter/Setter]":n.get?"[Getter]":n.set?"[Setter]":e.seen.indexOf(n.value)>=0?"[Circular]":g(n.value,e);return o+": "+s}function u(t){return 10>t?"0"+t:""+t}function c(t){return 100>t?"0"+u(t):""+t}function l(t){var e=t.getTimezoneOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r-60*n,o="GMT"+(0>e?"+":"-")+u(n)+u(i);return t.toLocaleDateString()+" "+t.toLocaleTimeString()+"."+c(t.getMilliseconds())+" "+o}function f(t){return function(e,r){var n=t(e),i=r.keys(e);return 0==i.length?n:s(e,r,n,i)}}function h(t){if(t.name)return t.name;var e=t.toString().match(y)[1];return e}function p(t,e){return function(r){var n="",i=50,o=r[t];if(o>0){for(var s=0;i>s&&o>s;s++){var a=r[s]||0;n+=" "+u(a.toString(16))}o>i&&(n+=" ... ")}return"["+(r.constructor.name||e)+(n?":"+n:"")+"]"}}var d=r(50),g=function(t,e){e=e||{},"seen"in e||(e.seen=[]),e.keys=n("keys"in e&&e.keys===!1?Object.getOwnPropertyNames:Object.keys),"maxLineLength"in e||(e.maxLineLength=60),"propSep"in e||(e.propSep=",");var r=d(t);return(g.formats[r]||g.formats.object)(t,e)};t.exports=g,g.formats={},["undefined","boolean","null"].forEach(function(t){i(t,String)}),["number","boolean"].forEach(function(t){var e=t.substring(0,1).toUpperCase()+t.substring(1);i("object-"+t,f(function(t){return"["+e+": "+g(t.valueOf())+"]"}))}),i("object-string",function(t,e){var r=t.valueOf(),n="[String: "+g(r)+"]",i=e.keys(t);return i=i.filter(function(t){return!(t.match(/\d+/)&&parseInt(t,10)1/t?"-0":String(t)}),i("string",function(t){return"'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'"}),i("object",s),i("array",function(t,e){var r=e.keys(t),n=0;e.seen.push(t);var i=r.map(function(r){var i;try{i=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(o){i={value:o}}var s;return s=r.match(/\d+/)?g(i.value,e):a(i.value,e,r),n+=s.length,s});return e.seen.pop(),0===i.length?"[]":n<=e.maxLineLength?"[ "+i.join(e.propSep+" ")+" ]":"[\n"+i.map(o).join(e.propSep+"\n")+"\n]"}),g.formatPropertyName=function(t,e){return t.match(/^[a-zA-Z_$][a-zA-Z_$0-9]*$/)?t:g(t,e)},i("date",f(l));var y=/^\s*function\s*(\S*)\s*\(/;i("function",f(function(t){var e=h(t);return"[Function"+(e?": "+e:"")+"]"})),i("error",f(function(t){var e=t.name,r=t.message;return"["+e+(r?": "+r:"")+"]"})),i("buffer",p("length","Buffer")),i("array-buffer",p("byteLength")),i("typed-array",p("byteLength")),i("promise",function(){return"[Promise]"}),i("xhr",function(){return"[XMLHttpRequest]"}),i("html-element",function(t){return t.outerHTML}),i("html-element-text",function(t){return t.nodeValue}),i("document",function(t){return t.documentElement.outerHTML}),i("window",function(){return"[Window]"})},function(t,e,r){(function(e){var r=Object.prototype.toString,n={NUMBER:"number",UNDEFINED:"undefined",STRING:"string",BOOLEAN:"boolean",OBJECT:"object",FUNCTION:"function",NULL:"null",ARRAY:"array",REGEXP:"regexp",DATE:"date",ERROR:"error",ARGUMENTS:"arguments",SYMBOL:"symbol",ARRAY_BUFFER:"array-buffer",TYPED_ARRAY:"typed-array",DATA_VIEW:"data-view",MAP:"map",SET:"set",WEAK_SET:"weak-set",WEAK_MAP:"weak-map",PROMISE:"promise",WRAPPER_NUMBER:"object-number",WRAPPER_BOOLEAN:"object-boolean",WRAPPER_STRING:"object-string",BUFFER:"buffer",HTML_ELEMENT:"html-element",HTML_ELEMENT_TEXT:"html-element-text",DOCUMENT:"document",WINDOW:"window",FILE:"file",FILE_LIST:"file-list",BLOB:"blob",XHR:"xhr"};t.exports=function i(t){var o=typeof t;switch(o){case n.NUMBER:return n.NUMBER;case n.UNDEFINED:return n.UNDEFINED;case n.STRING:return n.STRING;case n.BOOLEAN:return n.BOOLEAN;case n.FUNCTION:return n.FUNCTION;case n.SYMBOL:return n.SYMBOL;case n.OBJECT:if(null===t)return n.NULL;var s=r.call(t);switch(s){case"[object String]":return n.WRAPPER_STRING;case"[object Boolean]":return n.WRAPPER_BOOLEAN;case"[object Number]":return n.WRAPPER_NUMBER;case"[object Array]":return n.ARRAY;case"[object RegExp]":return n.REGEXP;case"[object Error]":return n.ERROR;case"[object Date]":return n.DATE;case"[object Arguments]":return n.ARGUMENTS;case"[object Math]":return n.OBJECT;case"[object JSON]":return n.OBJECT;case"[object ArrayBuffer]":return n.ARRAY_BUFFER;case"[object Int8Array]":return n.TYPED_ARRAY;case"[object Uint8Array]":return n.TYPED_ARRAY;case"[object Uint8ClampedArray]":return n.TYPED_ARRAY;case"[object Int16Array]":return n.TYPED_ARRAY;case"[object Uint16Array]":return n.TYPED_ARRAY;case"[object Int32Array]":return n.TYPED_ARRAY;case"[object Uint32Array]":return n.TYPED_ARRAY;case"[object Float32Array]":return n.TYPED_ARRAY;case"[object Float64Array]":return n.TYPED_ARRAY;case"[object DataView]":return n.DATA_VIEW;case"[object Map]":return n.MAP;case"[object WeakMap]":return n.WEAK_MAP;case"[object Set]":return n.SET;case"[object WeakSet]":return n.WEAK_SET;case"[object Promise]":return n.PROMISE;case"[object Window]":return n.WINDOW;case"[object HTMLDocument]":return n.DOCUMENT;case"[object Blob]":return n.BLOB;case"[object File]":return n.FILE;case"[object FileList]":return n.FILE_LIST;case"[object XMLHttpRequest]":return n.XHR;case"[object Text]":return n.HTML_ELEMENT_TEXT;default:if(typeof Promise===n.FUNCTION&&t instanceof Promise||i(t.then)===n.FUNCTION&&t.then.length>=2)return n.PROMISE;if("undefined"!=typeof e&&t instanceof e)return n.BUFFER;if(/^\[object HTML\w+Element\]$/.test(s))return n.HTML_ELEMENT;if("[object Object]"===s)return n.OBJECT}}},Object.keys(n).forEach(function(e){t.exports[e]=n[e]})}).call(e,r(61).Buffer)},function(t,e,r){function n(t){var e={};for(var r in t)e[r]=t[r];return e}var i=r(59);t.exports=function(t){var e=t;switch(i(t)){case"undefined":return"undefined";case"number":return t.toString();case"regexp":return t.toString();case"date":return t.toISOString();case"function":return t.toString();case"object":t=n(t);default:var r=[];return JSON.stringify(t,function(t,n){if(!r.length)return r.push(n),n;var i=r.indexOf(this);return~i?r.splice(i+1):r.push(this),n===e||~r.indexOf(n)?"[Circular]":void 0===n?"[Undefined]":n})}}},function(t,e,r){"use strict";function n(t){if(this._container=t||{},t&&"object"!=typeof t)throw new TypeError("Argument #1 passed to Collection must be an object")}var i=r(56);n.prototype.keys=function(){return Object.keys(this._container)},n.prototype.has=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.has() must be a string identifier, "+Object.prototype.toString(t)+" given");return t in this._container==!0},n.prototype.remove=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.remove() must be a string identifier");return delete this._container[t],this},n.prototype.set=function(t,e){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.set() must be a string identifier");return this._container[t]=e,this},n.prototype.setAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.setAll() must be an object");return this._container=t,this},n.prototype.addAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addAll() must be an object");for(var e in t)this.set(e,t[e]);return this},n.prototype.addOnce=function(t,e,r){if(this.has(t)){if(r)return this;throw new Error("Identifier "+t+" passed to Collection.addOnce() is already defined")}return this.set(t,e)},n.prototype.addOnceAll=function(t,e){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addOnceAll() must be an object");for(var r in t)this.addOnce(r,t[r],e);return this},n.prototype.merge=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.merge() must be an object");var e=Array.prototype.concat.apply([this._container],arguments);return this._container=i.mergeRecursive.apply(i,e),this},n.prototype.getAll=function(){return this._container},n.prototype.get=function(t,e,r){return"function"==typeof this._container[t]?this._container[t]():this.has(t)?this._container[t]:"function"==typeof e?this.raw(t,e,r)():this.raw(t,e,r)},n.prototype.raw=function(t,e,r){if(this.has(t))return this._container[t];if(r)throw new Error("Identifier "+t+" is not defined");return e},n.prototype.inject=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.raw(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.raw(t))},n.prototype.invoke=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.get(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.get(t))},n.prototype.apply=function(t){if(arguments.length>1){var e=Array.prototype.slice.call(arguments,1);return t.apply(this._container,e)}return t.call(this._container)},n.prototype.wrap=function(t){return function(){return t}},n.prototype.singleton=function(t,e){var r,n;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.singleton() must be a string identifier");if("function"!=typeof e)throw new TypeError("Argument #2 passed to Collection.singleton() must be a function");return this._container[t]=function(){return r||(r=!0,n=arguments.length?e.apply(null,arguments):e()),n},this},n.prototype.provider=function(t,e,r){var n,i,o=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.provider() must be a string identifier");return this._container[t]=function(){return n||(n=!0,i=o.inject(e,r)),i},this},n.prototype.factory=function(t,e,r){var n,i,o=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.factory() must be a string identifier");return this._container[t]=function(){return n||(n=!0,i=o.invoke(e,r)),i},this},t.exports=n},function(t,e,r){function n(t,e,r,i,o){var s=new a(t);s.params={operator:i,expected:e,message:r,stackStartFunction:o||n},s.fail()}function i(t,e){t||n(t,!0,e,"==",l.ok)}function o(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function s(t,e,r,i){var s;"string"==typeof r&&(i=r,r=null);try{e()}catch(a){s=a}if(i=(r&&r.name?" ("+r.name+")":".")+(i?" "+i:"."),t&&!s&&n(s,r,"Missing expected exception"+i),!t&&o(s,r)&&n(s,r,"Got unwanted exception"+i),t&&s&&r&&!o(s,r)||!t&&s)throw s}var a=(r(32),r(34)),u=r(58),c=Array.prototype.slice,l=t.exports=i;l.fail=n,l.ok=i,l.equal=function(t,e,r){t!=e&&n(t,e,r,"==",l.equal)},l.notEqual=function(t,e,r){t==e&&n(t,e,r,"!=",l.notEqual)},l.deepEqual=function(t,e,r){u(t,e).result||n(t,e,r,"deepEqual",l.deepEqual)},l.notDeepEqual=function(t,e,r){u(t,e).result&&n(t,e,r,"notDeepEqual",l.notDeepEqual)},l.strictEqual=function(t,e,r){t!==e&&n(t,e,r,"===",l.strictEqual)},l.notStrictEqual=function(t,e,r){t===e&&n(t,e,r,"!==",l.notStrictEqual)},l["throws"]=function(){s.apply(this,[!0].concat(c.call(arguments)))},l.doesNotThrow=function(){s.apply(this,[!1].concat(c.call(arguments)))},l.ifError=function(t){if(t)throw t}},function(t,e,r){(function(t,n){function i(t,r){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),u(n,t,n.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function s(t){return t}function a(t){var e={};return t.forEach(function(t){e[t]=!0}),e}function u(t,r,n){if(t.customInspect&&r&&O(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return m(i)||(i=u(t,i,n)),i}var o=c(t,r);if(o)return o;var s=Object.keys(r),g=a(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),x(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(O(r)){var y=r.name?": "+r.name:"";return t.stylize("[Function"+y+"]","special")}if(j(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(A(r))return t.stylize(Date.prototype.toString.call(r),"date");if(x(r))return l(r)}var v="",_=!1,b=["{","}"];if(d(r)&&(_=!0,b=["[","]"]),O(r)){var w=r.name?": "+r.name:"";v=" [Function"+w+"]"}if(j(r)&&(v=" "+RegExp.prototype.toString.call(r)),A(r)&&(v=" "+Date.prototype.toUTCString.call(r)),x(r)&&(v=" "+l(r)),0===s.length&&(!_||0==r.length))return b[0]+v+b[1];if(0>n)return j(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special");t.seen.push(r);var E;return E=_?f(t,r,n,g,s):s.map(function(e){return h(t,r,n,g,e,_)}),t.seen.pop(),p(E,v,b)}function c(t,e){if(w(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return _(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i){for(var o=[],s=0,a=e.length;a>s;++s)o.push(k(e,String(s))?h(t,e,r,n,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(t,e,r,n,i,!0))}),o}function h(t,e,r,n,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=y(r)?u(t,c.value,null):u(t,c.value,r-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t +}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return null==t}function _(t){return"number"==typeof t}function m(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function w(t){return void 0===t}function j(t){return E(t)&&"[object RegExp]"===P(t)}function E(t){return"object"==typeof t&&null!==t}function A(t){return E(t)&&"[object Date]"===P(t)}function x(t){return E(t)&&("[object Error]"===P(t)||t instanceof Error)}function O(t){return"function"==typeof t}function T(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function P(t){return Object.prototype.toString.call(t)}function R(t){return 10>t?"0"+t.toString(10):t.toString(10)}function S(){var t=new Date,e=[R(t.getHours()),R(t.getMinutes()),R(t.getSeconds())].join(":");return[t.getDate(),C[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var N=/%[sdj%]/g;e.format=function(t){if(!m(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),a=n[r];o>r;a=n[++r])s+=y(a)||!E(a)?" "+a:" "+i(a);return s},e.deprecate=function(r,i){function o(){if(!s){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),s=!0}return r.apply(this,arguments)}if(w(t.process))return function(){return e.deprecate(r,i).apply(this,arguments)};if(n.noDeprecation===!0)return r;var s=!1;return o};var F,I={};e.debuglog=function(t){if(w(F)&&(F={NODE_ENV:"production"}.NODE_DEBUG||""),t=t.toUpperCase(),!I[t])if(new RegExp("\\b"+t+"\\b","i").test(F)){var r=n.pid;I[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else I[t]=function(){};return I[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=g,e.isNull=y,e.isNullOrUndefined=v,e.isNumber=_,e.isString=m,e.isSymbol=b,e.isUndefined=w,e.isRegExp=j,e.isObject=E,e.isDate=A,e.isError=x,e.isFunction=O,e.isPrimitive=T,e.isBuffer=r(62);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){console.log("%s - %s",S(),e.format.apply(e,arguments))},e.inherits=r(63),e._extend=function(t,e){if(!e||!E(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(e,function(){return this}(),r(57))},function(t,e,r){"use strict";if(!Array.isArray){var n=Object.prototype.toString();Array.isArray=function(t){return"[object Array]"===n.call(t)?!0:"function"==typeof t.slice&&"number"==typeof t.length?!0:!1}}window.noder=r(27)},function(t){"use strict";function e(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t}function r(t){var e=arguments.length;if(2>e)throw new Error("There should be at least 2 arguments passed to utils.mergeRecursive()");for(var n=1;e>n;n++)for(var i in arguments[n])t[i]=t[i]&&"object"==typeof t[i]?r(t[i],arguments[n][i]):arguments[n][i];return t}t.exports.merge=e,t.exports.mergeRecursive=r},function(t){function e(){}var r=t.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,r="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var n=[];if(e){var i=document.createElement("div"),o=new MutationObserver(function(){var t=n.slice();n.length=0,t.forEach(function(t){t()})});return o.observe(i,{attributes:!0}),function(t){n.length||i.setAttribute("yes","no"),n.push(t)}}return r?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=e,r.addListener=e,r.once=e,r.off=e,r.removeListener=e,r.removeAllListeners=e,r.emit=e,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},function(t,e,r){function n(t,e,r,n,i){var o={result:t};return t||(o.path=e,o.reason=r,o.a=n,o.b=i),o}function i(t){for(var e=arguments,r=1,n=e.length;n>r;r++)t=t.replace(/%s/,e[r]);return t}function o(t,e,r,s,f,h,p){function d(i,o){var s=n(i,h,o,t,e);return!i&&r.collectAllFails&&p.push(s),s}function g(n){return o(t[n],e[n],r,s,f,h.concat([n]),p)}var y=c;if(t===e)return d(0!==t||1/t==1/e,l.PLUS_0_AND_MINUS_0);var v,_,m=a(t),b=a(e);if(m!==b)return d(!1,i(l.DIFFERENT_TYPES,m,b));switch(m){case"number":return t!==t?d(e!==e,l.NAN_NUMBER):0===t?d(1/t===1/e,l.PLUS_0_AND_MINUS_0):d(t===e,l.EQUALITY);case"regexp":for(_=["source","global","multiline","lastIndex","ignoreCase"];_.length;)if(y=g(_.shift()),!r.collectAllFails&&!y.result)return y;break;case"boolean":case"string":return d(t===e,l.EQUALITY);case"date":if(+t!==+e&&!r.collectAllFails)return d(!1,l.EQUALITY);break;case"object-number":case"object-boolean":case"object-string":if(y=o(t.valueOf(),e.valueOf(),r,s,f,h,p),!y.result&&!r.collectAllFails)return y.reason=l.WRAPPED_VALUE,y;break;case"buffer":if(y=g("length"),!r.collectAllFails&&!y.result)return y;for(v=t.length;v--;)if(y=g(v),!r.collectAllFails&&!y.result)return y;return c;case"error":for(_=["name","message"];_.length;)if(y=g(_.shift()),!r.collectAllFails&&!y.result)return y}for(s||(s=[]),f||(f=[]),v=s.length;v--;)if(s[v]==t)return d(f[v]==e,l.CIRCULAR_VALUES);s.push(t),f.push(e);var w;if(!("array"!==m&&"arguments"!==m&&"typed-array"!==m||(y=g("length"),r.collectAllFails||y.result)))return y;if(!("array-buffer"!==m&&"typed-array"!==m||(y=g("byteLength"),r.collectAllFails||y.result)))return y;if("function"===b){var j=t.toString(),E=e.toString();if(y=o(j,E,r,s,f,h,p),y.reason=l.FUNCTION_SOURCES,!r.collectAllFails&&!y.result)return y}for(w in e)if(u.call(e,w)){if(y=d(u.call(t,w),i(l.MISSING_KEY,"A",w)),!y.result&&!r.collectAllFails)return y;if(y.result&&(y=g(w),!y.result&&!r.collectAllFails))return y}for(w in t)if(u.call(t,w)&&(y=d(u.call(e,w),i(l.MISSING_KEY,"B",w)),!y.result&&!r.collectAllFails))return y;s.pop(),f.pop();var A=!1,x=!1;return(!r.checkProtoEql||(Object.getPrototypeOf?(A=Object.getPrototypeOf(t)===Object.getPrototypeOf(e),x=!0):t.__proto__&&e.__proto__&&(A=t.__proto__===e.__proto__,x=!0),!x||A||r.collectAllFails||(y=d(A,l.EQUALITY_PROTOTYPE),y.showReason=!0,y.result||r.collectAllFails)))&&("function"!==b||(y=g("prototype"),y.result||r.collectAllFails))?c:y}function s(t,e,r){r=r||f;var n=[],i=o(t,e,r||f,[],[],[],n);return r.collectAllFails?n:i}var a=r(50),u=Object.prototype.hasOwnProperty,c=n(!0),l={PLUS_0_AND_MINUS_0:"+0 is not equal to -0",DIFFERENT_TYPES:"A has type %s and B has type %s",NAN_NUMBER:"NaN is not equal to any number",EQUALITY:"A is not equal to B",EQUALITY_PROTOTYPE:"A and B have different prototypes",WRAPPED_VALUE:"A wrapped value is not equal to B wrapped value",FUNCTION_SOURCES:"function A is not equal to B by source code value (via .toString call)",MISSING_KEY:"%s has no key %s",CIRCULAR_VALUES:"A has circular reference that was visited not in the same time as B"},f={checkProtoEql:!0,collectAllFails:!1};t.exports=s,s.r=l},function(t){function e(t){if(void 0===t)return"undefined";if(null===t)return"null";switch(Object.prototype.toString.call(t)){case"[object Boolean]":return"boolean";case"[object Number]":return"number";case"[object String]":return"string";case"[object RegExp]":return"regexp";case"[object Date]":return"date";case"[object Array]":return"array";default:return typeof t}}t.exports=e},function(t){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,r){(function(t){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);var i,o=typeof e;if("number"===o)i=e>0?e>>>0:0;else if("string"===o)"base64"===r&&(e=j(e)),i=t.byteLength(e,r);else{if("object"!==o||null===e)throw new TypeError("must start with number, buffer, array or string");"Buffer"===e.type&&I(e.data)&&(e=e.data),i=+e.length>0?Math.floor(+e.length):0}if(this.length>C)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C.toString(16)+" bytes");var s;t.TYPED_ARRAY_SUPPORT?s=t._augment(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(t.TYPED_ARRAY_SUPPORT&&"number"==typeof e.byteLength)s._set(e);else if(A(e))if(t.isBuffer(e))for(a=0;i>a;a++)s[a]=e.readUInt8(a);else for(a=0;i>a;a++)s[a]=(e[a]%256+256)%256;else if("string"===o)s.write(e,0,r);else if("number"===o&&!t.TYPED_ARRAY_SUPPORT&&!n)for(a=0;i>a;a++)s[a]=0;return s}function n(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;n>s;s++){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[r+s]=a}return s}function i(t,e,r,n){var i=S(O(e),t,r,n);return i}function o(t,e,r,n){var i=S(T(e),t,r,n);return i}function s(t,e,r,n){return o(t,e,r,n)}function a(t,e,r,n){var i=S(R(e),t,r,n);return i}function u(t,e,r,n){var i=S(P(e),t,r,n,2);return i}function c(t,e,r){return N.fromByteArray(0===e&&r===t.length?t:t.slice(e,r))}function l(t,e,r){var n="",i="";r=Math.min(t.length,r);for(var o=e;r>o;o++)t[o]<=127?(n+=k(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return n+k(i)}function f(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function h(t,e,r){return f(t,e,r)}function p(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=e;r>o;o++)i+=x(t[o]);return i}function d(t,e,r){for(var n=t.slice(e,r),i="",o=0;ot)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function y(e,r,n,i,o,s){if(!t.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(r>o||s>r)throw new TypeError("value is out of bounds");if(n+i>e.length)throw new TypeError("index out of range")}function v(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);o>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function _(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);o>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function m(t,e,r,n,i,o){if(e>i||o>e)throw new TypeError("value is out of bounds");if(r+n>t.length)throw new TypeError("index out of range")}function b(t,e,r,n,i){return i||m(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),F.write(t,e,r,n,23,4),r+4}function w(t,e,r,n,i){return i||m(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),F.write(t,e,r,n,52,8),r+8}function j(t){for(t=E(t).replace(L,"");t.length%4!==0;)t+="=";return t}function E(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function A(e){return I(e)||t.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function x(t){return 16>t?"0"+t.toString(16):t.toString(16)}function O(t){for(var e=[],r=0;r=n)e.push(n);else{var i=r;n>=55296&&57343>=n&&r++;for(var o=encodeURIComponent(t.slice(i,r+1)).substr(1).split("%"),s=0;s>8,n=e%256,i.push(n),i.push(r);return i}function R(t){return N.toByteArray(t)}function S(t,e,r,n,i){i&&(n-=n%i);for(var o=0;n>o&&!(o+r>=e.length||o>=t.length);o++)e[o+r]=t[o];return o}function k(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -var F=r(100),R=r(97),C=r(98);e.Buffer=t,e.SlowBuffer=t,e.INSPECT_MAX_BYTES=50,t.poolSize=8192;var I=1073741823;t.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(r){return!1}}(),t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);s>o&&e[o]===r[o];o++);return o!==s&&(n=e[o],i=r[o]),i>n?-1:n>i?1:0},t.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,r){if(!C(e))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===e.length)return new t(0);if(1===e.length)return e[0];var n;if(void 0===r)for(r=0,n=0;n>>1;break;case"utf8":case"utf-8":r=O(t).length;break;case"base64":r=T(t).length;break;default:r=t.length}return r},t.prototype.length=void 0,t.prototype.parent=void 0,t.prototype.toString=function(t,e,r){var n=!1;if(e>>>=0,r=void 0===r||1/0===r?this.length:r>>>0,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return p(this,e,r);case"utf8":case"utf-8":return l(this,e,r);case"ascii":return f(this,e,r);case"binary":return h(this,e,r);case"base64":return c(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return 0===t.compare(this,e)},t.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return t.compare(this,e)},t.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},t.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},t.prototype.write=function(t,e,r,c){if(isFinite(e))isFinite(r)||(c=r,r=void 0);else{var l=c;c=e,e=r,r=l}e=Number(e)||0;var f=this.length-e;r?(r=Number(r),r>f&&(r=f)):r=f,c=String(c||"utf8").toLowerCase();var h;switch(c){case"hex":h=n(this,t,e,r);break;case"utf8":case"utf-8":h=i(this,t,e,r);break;case"ascii":h=o(this,t,e,r);break;case"binary":h=s(this,t,e,r);break;case"base64":h=a(this,t,e,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=u(this,t,e,r);break;default:throw new TypeError("Unknown encoding: "+c)}return h},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,r){var n=this.length;if(e=~~e,r=void 0===r?n:~~r,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>r?(r+=n,0>r&&(r=0)):r>n&&(r=n),e>r&&(r=e),t.TYPED_ARRAY_SUPPORT)return t._augment(this.subarray(e,r));for(var i=r-e,o=new t(i,void 0,!0),s=0;i>s;s++)o[s]=this[s+e];return o},t.prototype.readUInt8=function(t,e){return e||y(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||y(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||y(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||y(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||y(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readInt8=function(t,e){return e||y(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},t.prototype.readInt16LE=function(t,e){e||y(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||y(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||y(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||y(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||y(t,4,this.length),R.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||y(t,4,this.length),R.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||y(t,8,this.length),R.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||y(t,8,this.length),R.read(this,t,!1,52,8)},t.prototype.writeUInt8=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):v(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):v(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e):m(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):m(this,e,r,!1),r+4},t.prototype.writeInt8=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[r]=e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):v(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):v(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):m(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):m(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return b(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return b(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return w(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return w(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),r||(r=0),i!==n&&0!==e.length&&0!==o.length){if(n>i)throw new TypeError("sourceEnd < sourceStart");if(0>r||r>=e.length)throw new TypeError("targetStart out of bounds");if(0>n||n>=o.length)throw new TypeError("sourceStart out of bounds");if(0>i||i>o.length)throw new TypeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-rs||!t.TYPED_ARRAY_SUPPORT)for(var a=0;s>a;a++)e[a+r]=this[a+n];else e._set(this.subarray(n,n+s),r)}},t.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new TypeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new TypeError("start out of bounds");if(0>r||r>this.length)throw new TypeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=O(t.toString()),o=i.length;for(n=e;r>n;n++)this[n]=i[n%o]}return this}},t.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(t.TYPED_ARRAY_SUPPORT)return new t(this).buffer;for(var e=new Uint8Array(this.length),r=0,n=e.length;n>r;r+=1)e[r]=this[r];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var U=t.prototype;t._augment=function(e){return e.constructor=t,e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=U.get,e.set=U.set,e.write=U.write,e.toString=U.toString,e.toLocaleString=U.toString,e.toJSON=U.toJSON,e.equals=U.equals,e.compare=U.compare,e.copy=U.copy,e.slice=U.slice,e.readUInt8=U.readUInt8,e.readUInt16LE=U.readUInt16LE,e.readUInt16BE=U.readUInt16BE,e.readUInt32LE=U.readUInt32LE,e.readUInt32BE=U.readUInt32BE,e.readInt8=U.readInt8,e.readInt16LE=U.readInt16LE,e.readInt16BE=U.readInt16BE,e.readInt32LE=U.readInt32LE,e.readInt32BE=U.readInt32BE,e.readFloatLE=U.readFloatLE,e.readFloatBE=U.readFloatBE,e.readDoubleLE=U.readDoubleLE,e.readDoubleBE=U.readDoubleBE,e.writeUInt8=U.writeUInt8,e.writeUInt16LE=U.writeUInt16LE,e.writeUInt16BE=U.writeUInt16BE,e.writeUInt32LE=U.writeUInt32LE,e.writeUInt32BE=U.writeUInt32BE,e.writeInt8=U.writeInt8,e.writeInt16LE=U.writeInt16LE,e.writeInt16BE=U.writeInt16BE,e.writeInt32LE=U.writeInt32LE,e.writeInt32BE=U.writeInt32BE,e.writeFloatLE=U.writeFloatLE,e.writeFloatBE=U.writeFloatBE,e.writeDoubleLE=U.writeDoubleLE,e.writeDoubleBE=U.writeDoubleBE,e.fill=U.fill,e.inspect=U.inspect,e.toArrayBuffer=U.toArrayBuffer,e};var L=/[^+\/0-9A-z]/g}).call(e,r(57).Buffer)},function(t,e,r){"use strict";function n(t,e,r){try{return t.call(e,r)}catch(n){return E.e=n,E}}function i(t,e,r,n){try{return t.call(e,r,n)}catch(i){return E.e=i,E}}function o(t,e,r,n,i){try{return t.call(e,r,n,i)}catch(o){return E.e=o,E}}function s(t,e,r,n,i,o){try{return t.call(e,r,n,i,o)}catch(s){return E.e=s,E}}function a(t,e,r){try{return t.apply(r,e)}catch(n){return E.e=n,E}}function u(t){return"string"==typeof t?t:""+t}function c(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function l(t){return!c(t)}function f(t){return c(t)?new Error(u(t)):t}function h(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function p(t,e,r){if(!b.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function d(t,e,r){if(c(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return b.defineProperty(t,e,n),t}function y(t){throw t}function g(t){try{if("function"==typeof t){var e=b.keys(t.prototype);return e.length>0&&!(1===e.length&&"constructor"===e[0])}return!1}catch(r){return!1}}function v(t){function e(){}return e.prototype=t,e}function m(t){return P.test(t)}function _(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}var b=r(92),w=function(){try{var t={};return b.defineProperty(t,"f",{get:function(){return 3}}),3===t.f}catch(e){return!1}}(),j="undefined"==typeof navigator,E={e:{}},x=function(t,e){function r(){this.constructor=t,this.constructor$=e;for(var r in e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}var n={}.hasOwnProperty;return r.prototype=e.prototype,t.prototype=new r,t.prototype},A=function(){return"string"!==this}.call("string"),O=function(){return b.isES5?function(t,e){for(var r=[],n=Object.create(null),i=Object(e).includeHidden?Object.getOwnPropertyNames:Object.keys;null!=t;){var o;try{o=i(t)}catch(s){return r}for(var a=0;a0},n.prototype.invokeLater=function(t,e,r){void 0===u||null==u.domain||t.domain||(t=u.domain.bind(t)),this._lateBuffer.push(t,e,r),this._queueTick()},n.prototype.invoke=function(t,e,r){void 0===u||null==u.domain||t.domain||(t=u.domain.bind(t));var n=this._functionBuffer;n.push(t,e,r),this._length=n.length(),this._queueTick()},n.prototype._consumeFunctionBuffer=function(){for(var t=this._functionBuffer;t.length()>0;){var e=t.shift(),r=t.shift(),n=t.shift();e.call(r,n)}this._reset(),this._consumeLateBuffer()},n.prototype._consumeLateBuffer=function(){for(var t=this._lateBuffer;t.length()>0;){var e=t.shift(),r=t.shift(),n=t.shift(),i=a(e,r,n);if(i===s){if(this._queueTick(),null==e.domain)throw i.e;e.domain.emit("error",i.e)}}},n.prototype._queueTick=function(){this._isTickUsed||(this._schedule(this.consumeFunctionBuffer),this._isTickUsed=!0)},n.prototype._reset=function(){this._isTickUsed=!1,this._length=0},t.exports=new n}).call(e,r(51))},function(t,e,r){"use strict";function n(t){try{d(t,"isOperational",!0)}catch(e){}}function i(t){return null==t?!1:t instanceof u||t.isOperational===!0}function o(t){return t instanceof Error}function s(t){return o(t)}function a(t,e){function r(n){return this instanceof r?(this.message="string"==typeof n?n:e,this.name=t,void(Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new r(n)}return p(r,Error),r}function u(t){this.name="OperationalError",this.message=t,this.cause=t,this.isOperational=!0,t instanceof Error?(this.message=t.message,this.stack=t.stack):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}var c,l,f=r(92).freeze,h=r(58),p=h.inherits,d=h.notEnumerableProp,y=a("CancellationError","cancellation error"),g=a("TimeoutError","timeout error"),v=a("AggregateError","aggregate error");try{c=TypeError,l=RangeError}catch(m){c=a("TypeError","type error"),l=a("RangeError","range error")}for(var _="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),b=0;b<_.length;++b)"function"==typeof Array.prototype[_[b]]&&(v.prototype[_[b]]=Array.prototype[_[b]]);v.prototype.length=0,v.prototype.isOperational=!0;var w=0;v.prototype.toString=function(){var t=Array(4*w+1).join(" "),e="\n"+t+"AggregateError of:\n";w++,t=Array(4*w+1).join(" ");for(var r=0;rp;++p){var d=n(o[p],void 0);d instanceof t?d.isPending()?d._proxyPromiseArray(this,p):(d._unsetRejectionIsUnhandled(),h=!0):h=!0,f[p]=d}this._values=f,this._length=l,h&&this._scanDirectValues(a)},o.prototype._settlePromiseAt=function(e){var r=this._values[e];r instanceof t?r.isFulfilled()?this._promiseFulfilled(r._settledValue,e):r.isRejected()&&this._promiseRejected(r._settledValue,e):this._promiseFulfilled(r,e)},o.prototype._scanDirectValues=function(t){for(var e=0;t>e&&!this._isResolved();++e)this._settlePromiseAt(e)},o.prototype._isResolved=function(){return null===this._values},o.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},o.prototype.__hardReject__=o.prototype._reject=function(t){this._values=null;var e=s(t)?t:new Error(t+"");this._promise._attachExtraTrace(e),this._promise._reject(t,e)},o.prototype._promiseProgressed=function(t,e){this._isResolved()||this._promise._progress({index:e,value:t})},o.prototype._promiseFulfilled=function(t,e){if(!this._isResolved()){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)}},o.prototype._promiseRejected=function(t){this._isResolved()||(this._totalResolved++,this._reject(t))},o.prototype.shouldCopyValues=function(){return!0},o.prototype.getActualLength=function(t){return t},o}},function(t,e,r){"use strict";t.exports=function(){function t(t){var r;if("function"==typeof t)r="[function "+(t.name||"anonymous")+"]";else{r=t.toString();var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(r))try{var i=JSON.stringify(t);r=i}catch(o){}0===r.length&&(r="(empty array)")}return"(<"+e(r)+">, no stack trace)"}function e(t){var e=41;return t.length=0;--o)if(e[o]===n){i=o;break}for(var o=i;o>=0;--o){var u=e[o];if(t[r]!==u)break;t.pop(),r--}t.push("From previous event:");for(var c=t.concat(e),l=[],o=0,f=c.length;f>o;++o)s.test(c[o])&&a.test(c[o])||o>0&&!a.test(c[o])&&"From previous event:"!==c[o]||l.push(c[o]);return l},n.protectErrorMessageNewlines=function(t){for(var e=0;e=e)){for(var r=[],n=0;e>n;++n)r.push(t.shift());t.unshift(r.join("\x00"))}},n.isSupported=function(){return"function"==typeof c};var c=function l(){if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){a=/^\s*at\s*/,u=function(e,r){return"string"==typeof e?e:void 0!==r.name&&void 0!==r.message?r.name+". "+r.message:t(r)};var e=Error.captureStackTrace;return function(t,r){e(t,r)}}var r=new Error;if("string"==typeof r.stack&&"function"==typeof"".startsWith&&r.stack.startsWith("stackDetection@")&&"stackDetection"===l.name){o(Error,"stackTraceLimit",{writable:!0,enumerable:!1,configurable:!1,value:25}),a=/@/;var n=/[@\n]/;return u=function(e,r){return"string"==typeof e?r.name+". "+r.message+"\n"+e:void 0!==r.name&&void 0!==r.message?r.name+". "+r.message:t(r)},function(t){for(var e=(new Error).stack,r=e.split(n),i=r.length,o="",s=0;i>s;s+=2)o+=r[s],o+="@",o+=r[s+1],o+="\n";t.stack=o}}return u=function(e,r){return"string"==typeof e?e:"object"!=typeof r&&"function"!=typeof r||void 0===r.name||void 0===r.message?t(r):r.name+". "+r.message},null}();return n}},function(t,e,r){"use strict";t.exports=function(t){function e(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t,r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function"),a):n}var i=r(58),o=r(60),s=i.tryCatch1,a=i.errorObj,u=r(92).keys,c=o.TypeError;return e.prototype.doFilter=function(e){for(var r=this._callback,i=this._promise,u=i._boundTo,c=0,l=this._instances.length;l>c;++c){var f=this._instances[c],h=f===Error||null!=f&&f.prototype instanceof Error;if(h&&e instanceof f){var p=s(r,u,e);return p===a?(t.e=p.e,t):p}if("function"==typeof f&&!h){var d=n(f,e);if(d===a){var y=o.canAttach(a.e)?a.e:new Error(a.e+"");this._promise._attachExtraTrace(y),e=a.e;break}if(d){var p=s(r,u,e);return p===a?(t.e=p.e,t):p}}}return t.e=e,t},e}},function(t,e,r){"use strict";function n(t){return t instanceof Error&&d.getPrototypeOf(t)===Error.prototype}function i(t){var e;return e=n(t)?new f(t):t,c.markAsOriginatingFromRejection(e),e}function o(t){function e(e,r){if(null!==t){if(e){var n=i(u(e));t._attachExtraTrace(n),t._reject(n)}else if(arguments.length>2){for(var o=arguments.length,s=new Array(o-1),a=1;o>a;++a)s[a-1]=arguments[a];t._fulfill(s)}else t._fulfill(r);t=null}}return e}var s,a=r(58),u=a.maybeWrapAsError,c=r(60),l=c.TimeoutError,f=c.OperationalError,h=r(59),p=a.haveGetters,d=r(92);if(s=p?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=o(t),this.callback=this.asCallback},p){var y={get:function(){return o(this.promise)}};d.defineProperty(s.prototype,"asCallback",y),d.defineProperty(s.prototype,"callback",y)}s._nodebackForPromise=o,s.prototype.toString=function(){return"[object PromiseResolver]"},s.prototype.resolve=s.prototype.fulfill=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.");var e=this.promise;e._tryFollow(t)||h.invoke(e._fulfill,e,t)},s.prototype.reject=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.");var e=this.promise;c.markAsOriginatingFromRejection(t);var r=c.canAttach(t)?t:new Error(t+"");e._attachExtraTrace(r),h.invoke(e._reject,e,t),r!==t&&h.invoke(this._setCarriedStackTrace,this,r)},s.prototype.progress=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.");h.invoke(this.promise._progress,this.promise,t)},s.prototype.cancel=function(){h.invoke(this.promise.cancel,this.promise,void 0)},s.prototype.timeout=function(){this.reject(new l("timeout"))},s.prototype.isResolved=function(){return this.promise.isResolved()},s.prototype.toJSON=function(){return this.promise.toJSON()},s.prototype._setCarriedStackTrace=function(t){this.promise.isRejected()&&this.promise._setCarriedStackTrace(t)},t.exports=s},function(t,e,r){"use strict";t.exports=function(t){function e(e){var r=new n(e),i=t.rejected(r),o=i._peekContext();return null!=o&&o._attachExtraTrace(r),i}var n=r(60).TypeError;return e}},function(t,e,r){"use strict";t.exports=function(t,e,n){function i(){return this}function o(){throw this}function s(t){return function(){return t}}function a(t){return function(){throw t}}function u(t,e,r){var n;return n=h&&p(e)?r?s(e):a(e):r?i:o,t._then(n,d,void 0,e,void 0)}function c(r){var i=this.promise,o=this.handler,s=i._isBound()?o.call(i._boundTo):o();if(void 0!==s){var a=n(s,void 0);if(a instanceof t)return u(a,r,i.isFulfilled())}return i.isRejected()?(e.e=r,e):r}function l(e){var r=this.promise,i=this.handler,o=r._isBound()?i.call(r._boundTo,e):i(e);if(void 0!==o){var s=n(o,void 0);if(s instanceof t)return u(s,e,!0)}return e}var f=r(58),h=f.wrapsPrimitiveReceiver,p=f.isPrimitive,d=f.thrower;t.prototype._passThroughHandler=function(t,e){if("function"!=typeof t)return this.then();var r={promise:this,handler:t};return this._then(e?c:l,e?c:void 0,void 0,r,void 0)},t.prototype.lastly=t.prototype["finally"]=function(t){return this._passThroughHandler(t,!0)},t.prototype.tap=function(t){return this._passThroughHandler(t,!1)}}},function(t,e,r){"use strict";var n=r(58),i=n.isPrimitive,o=n.wrapsPrimitiveReceiver;t.exports=function(t){var e=function(){return this},r=function(){throw this},n=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(t){return o&&i(t)?this._then(n(t,2),void 0,void 0,void 0,void 0):this._then(e,void 0,void 0,t,void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return o&&i(t)?this._then(n(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},function(t){"use strict";t.exports=function(t){function e(t){void 0!==t?(this._bitField=t._bitField,this._settledValue=t.isResolved()?t._settledValue:void 0):(this._bitField=0,this._settledValue=void 0)}e.prototype.isFulfilled=t.prototype.isFulfilled=function(){return(268435456&this._bitField)>0},e.prototype.isRejected=t.prototype.isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype.isPending=function(){return 0===(402653184&this._bitField)},e.prototype.value=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise");return this._settledValue},e.prototype.error=e.prototype.reason=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise");return this._settledValue},e.prototype.isResolved=t.prototype.isResolved=function(){return(402653184&this._bitField)>0},t.PromiseInspection=e}},function(t,e,r){"use strict";t.exports=function(t,e,n,i){function o(t){this._reject(t)}var s=r(58),a=s.canEvaluate,u=s.tryCatch1,c=s.errorObj;if(a){for(var l=function(t){return new Function("value","holder"," \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g,t))},f=function(t){for(var e=[],r=1;t>=r;++r)e.push("holder.p"+r);return new Function("holder"," \n 'use strict'; \n var callback = holder.fn; \n return callback(values); \n ".replace(/values/g,e.join(", ")))},h=[],p=[void 0],d=1;5>=d;++d)h.push(l(d)),p.push(f(d));var y=function(t,e){this.p1=this.p2=this.p3=this.p4=this.p5=null,this.fn=e,this.total=t,this.now=0};y.prototype.callers=p,y.prototype.checkFulfillment=function(t){var e=this.now;e++;var r=this.total;if(e>=r){var n=this.callers[r],i=u(n,void 0,this);i===c?t._rejectUnchecked(i.e):t._tryFollow(i)||t._fulfillUnchecked(i)}else this.now=e}}t.join=function(){var r,s=arguments.length-1;if(s>0&&"function"==typeof arguments[s]&&(r=arguments[s],6>s&&a)){var u=new t(i);u._setTrace(void 0);for(var c=new y(s,r),l=h,f=0;s>f;++f){var p=n(arguments[f],void 0);p instanceof t?p.isPending()?p._then(l[f],o,void 0,u,c):p.isFulfilled()?l[f].call(u,p._settledValue,c):(u._reject(p._settledValue),p._unsetRejectionIsUnhandled()):l[f].call(u,p,c)}return u}for(var d=arguments.length,g=new Array(d),v=0;d>v;++v)g[v]=arguments[v];var u=new e(g).promise();return void 0!==r?u.spread(r):u}}},function(t,e,r){"use strict";var n=function(t,e){var r=arguments.length,n=arguments[2],i=arguments[3],o=r>=5?arguments[4]:void 0;return setTimeout(function(){t(n,i,o)},0|e)};t.exports=function(t,e,i){function o(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function s(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var a=(r(58),r(60)),u=(r(66)(t),t.TimeoutError),c=function(t,e,r){if(t.isPending()){"string"!=typeof e&&(e="operation timed out after "+r+" ms");var n=new u(e);a.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._cancel(n)}},l=function(t,e){e._fulfill(t)},f=t.delay=function(r,o){void 0===o&&(o=r,r=void 0),o=+o;var s=i(r,void 0),a=new t(e);return s instanceof t?(a._propagateFrom(s,7),a._follow(s),a.then(function(e){return t.delay(e,o)})):(a._setTrace(void 0),n(l,o,r,a),a)};t.prototype.delay=function(t){return f(this,t)},t.prototype.timeout=function(r,i){r=+r;var a=new t(e);a._propagateFrom(this,7),a._follow(this);var u=n(c,r,a,i,r);return a.cancellable()._then(o,s,void 0,u,void 0)}}},function(t,e,r){"use strict";t.exports=function(t,e,n){function i(r,i){var c=n(r,void 0);if(c instanceof t)return a(c);if(!s(r))return o("expecting an array, a promise or a thenable");var l=new t(e);void 0!==i?l._propagateFrom(i,7):l._setTrace(void 0);for(var f=l._fulfill,h=l._reject,p=0,d=r.length;d>p;++p){var y=r[p];(void 0!==y||u.call(r,p))&&t.cast(y)._then(f,h,void 0,l,null)}return l}var o=r(66)(t),s=r(58).isArray,a=function(t){return t.then(function(e){return i(e,t)})},u={}.hasOwnProperty;t.race=function(t){return i(t,void 0)},t.prototype.race=function(){return i(this,void 0)}}},function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}t.exports=function(t){function e(t){return new Function("obj"," \n 'use strict' \n var len = this.length; \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: return obj.methodName.apply(obj, this); \n } \n ".replace(/methodName/g,t)) -}function n(t){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",t))}function s(t,e,r){var n=r[t];if("function"!=typeof n){if(!d(t))return null;if(n=e(t),r[t]=n,r[" size"]++,r[" size"]>512){for(var i=Object.keys(r),o=0;256>o;++o)delete r[i[o]];r[" size"]=i.length-256}}return n}function a(t){return s(t,e,i)}function u(t){return s(t,n,o)}function c(t){return t[this.pop()].apply(t,this)}function l(t){return t[this]}function f(t){return t[this]}var h=r(58),p=h.canEvaluate,d=h.isIdentifier;t.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),n=1;e>n;++n)r[n-1]=arguments[n];if(p){var i=a(t);if(null!==i)return this._then(i,void 0,void 0,r,void 0)}return r.push(t),this._then(c,void 0,void 0,r,void 0)},t.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=f;else if(p){var n=u(t);e=null!==n?n:l}else e=l;return this._then(e,void 0,void 0,t,void 0)}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i){function o(e,r){for(var n=f,s=t,a=r.length,u=0;a>u;++u){var c=h(r[u],void 0,e);if(c===n)return s.reject(n.e);var l=i(c,o);if(l instanceof s)return l}return null}function s(e,r,i){var o=this._promise=new t(n);o._setTrace(void 0),this._generatorFunction=e,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(p):p}var a=r(60),u=a.TypeError,c=r(58).deprecated,l=r(58),f=l.errorObj,h=l.tryCatch1,p=[];s.prototype.promise=function(){return this._promise},s.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._next(void 0)},s.prototype._continue=function(e){if(e===f){this._generator=void 0;var r=a.canAttach(e.e)?e.e:new Error(e.e+"");return this._promise._attachExtraTrace(r),void this._promise._reject(e.e,r)}var n=e.value;if(e.done===!0)this._generator=void 0,this._promise._tryFollow(n)||this._promise._fulfill(n);else{var s=i(n,void 0);if(!(s instanceof t)&&(s=o(s,this._yieldHandlers),null===s))return void this._throw(new u("A value was yielded that could not be treated as a promise"));s._then(this._next,this._throw,void 0,this,null)}},s.prototype._throw=function(t){a.canAttach(t)&&this._promise._attachExtraTrace(t),this._continue(h(this._generator["throw"],this._generator,t))},s.prototype._next=function(t){this._continue(h(this._generator.next,this._generator,t))},t.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function");var r=Object(e).yieldHandler,n=s;return function(){var e=t.apply(this,arguments),i=new n(void 0,void 0,r);return i._generator=e,i._next(void 0),i.promise()}},t.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new u("fn must be a function");p.push(t)},t.spawn=function(r){if(c("Promise.spawn is deprecated. Use Promise.coroutine instead."),"function"!=typeof r)return e("generatorFunction must be a function");var n=new s(r,this),i=n.promise();return n._run(t.spawn),i}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i,o){function s(t,e,r,n){this.constructor$(t),this._callback=e,this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:h,this._init$(void 0,-2)}function a(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var u=r(58),c=u.tryCatch3,l=u.errorObj,f={},h=[];u.inherits(s,e),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(e,r){var n=this._values;if(null!==n){var o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===f){if(n[r]=e,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=e,void this._queue.push(r);null!==s&&(s[r]=e);var u=this._callback,h=this._promise._boundTo,p=c(u,h,e,r,o);if(p===l)return this._reject(p.e);var d=i(p,void 0);if(d instanceof t){if(d.isPending())return a>=1&&this._inFlight++,n[r]=f,d._proxyPromiseArray(this,r);if(!d.isFulfilled())return d._unsetRejectionIsUnhandled(),this._reject(d.reason());p=d.value()}n[r]=p}var y=++this._totalResolved;y>=o&&(null!==s?this._filter(n,s):this._resolve(n))}},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function"):a(this,t,e,null).promise()},t.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function"):a(t,e,r,i).promise()}}},function(t,e,r){"use strict";t.exports=function(t){function e(t){throw t}function n(t,r){if(!s.isArray(t))return i(t,r);var n=s.tryCatchApply(this,[null].concat(t),r);n===l&&a.invokeLater(e,void 0,n.e)}function i(t,r){var n=this,i=void 0===t?c(n,r,null):u(n,r,null,t);i===l&&a.invokeLater(e,void 0,i.e)}function o(t,r){var n=this,i=c(n,r,t);i===l&&a.invokeLater(e,void 0,i.e)}var s=r(58),a=r(59),u=s.tryCatch2,c=s.tryCatch1,l=s.errorObj;t.prototype.nodeify=function(t,e){if("function"==typeof t){var r=i;void 0!==e&&Object(e).spread&&(r=n),this._then(r,o,void 0,t,this._boundTo)}return this}}},function(t,e,r){"use strict";t.exports=function(t,e){function n(t){return t.replace(/([$])/,"\\$")}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=m.getDataPropertyOrDefault(t,e+r,O);return n?i(n):!1}function s(t,e,r){for(var n=0;n=r;--n)n!==t&&e.push(n);for(var n=t+1;5>=n;++n)e.push(n);return e}function c(t){return m.filledRange(t,"arguments[","]")}function l(t){return m.filledRange(t,"_arg","")}function f(t){return"number"==typeof t.length?Math.max(Math.min(t.length,1024),0):0}function h(t){return m.isIdentifier(t)?"."+t:"['"+t.replace(/(['\\])/g,"\\$1")+"']"}function p(r,n,i,o,s){function a(t){var e,i=c(t).join(", "),o=t>0?", ":"";return e="string"==typeof r?" \n this.method({{args}}, fn); \n break; \n ".replace(".method",h(r)):n===v?" \n callback.call(this, {{args}}, fn); \n break; \n ":void 0!==n?" \n callback.call(receiver, {{args}}, fn); \n break; \n ":" \n callback({{args}}, fn); \n break; \n ",e.replace("{{args}}",i).replace(", ",o)}function p(){for(var t="",e=0;eu;u+=2){var l=s[u],f=s[u+1],h=l+e;t[h]=i===P?P(l,v,l,f,e):i(f)}return m.toFastProperties(t),t}function g(t,e){return P(t,e,void 0,t)}var v={},m=r(58),_=r(65)._nodebackForPromise,b=m.withAppended,w=m.maybeWrapAsError,j=m.canEvaluate,E=r(60).TypeError,x="Async",A=function(t,e){return m.isIdentifier(t)&&"_"!==t.charAt(0)&&!m.isClass(e)},O={__isPromisified__:!0},P=j?p:d;t.promisify=function(t,e){if("function"!=typeof t)throw new E("fn must be a function");return i(t)?t:g(t,arguments.length<2?v:e)},t.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new E("the target of promisifyAll must be an object or a function");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=x);var n=e.filter;"function"!=typeof n&&(n=A);var i=e.promisifier;if("function"!=typeof i&&(i=P),!m.isIdentifier(r))throw new RangeError("suffix must be a valid identifier");for(var o=m.inheritedDataKeys(t,{includeHidden:!0}),s=0;si;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function o(e){var r,o=n(e,void 0);return u(o)?(r=o instanceof t?o._then(t.props,void 0,void 0,void 0,void 0):new i(o).promise(),o instanceof t&&r._propagateFrom(o,4),r):a("cannot await properties of a non-object")}var s=r(58),a=r(66)(t),u=s.isObject,c=r(92);s.inherits(i,e),i.prototype._init=function(){this._init$(void 0,-3)},i.prototype._promiseFulfilled=function(t,e){if(!this._isResolved()){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}}},i.prototype._promiseProgressed=function(t,e){this._isResolved()||this._promise._progress({key:this._values[e+this.length()],value:t})},i.prototype.shouldCopyValues=function(){return!1},i.prototype.getActualLength=function(t){return t>>1},t.prototype.props=function(){return o(this)},t.props=function(t){return o(t)}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i,o){function s(e,r,n,s){this.constructor$(e),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var a=i(n,void 0),u=!1,c=a instanceof t;c&&(a.isPending()?a._proxyPromiseArray(this,-1):a.isFulfilled()?(n=a.value(),this._gotAccum=!0):(a._unsetRejectionIsUnhandled(),this._reject(a.reason()),u=!0)),c||this._zerothIsAccum||(this._gotAccum=!0),this._callback=r,this._accum=n,u||this._init$(void 0,-5)}function a(t,e,r,i){if("function"!=typeof e)return n("fn must be a function");var o=new s(t,e,r,i);return o.promise()}var u=r(58),c=u.tryCatch4,l=u.tryCatch3,f=u.errorObj;u.inherits(s,e),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(e,r){var n=this._values;if(null!==n){var o,s=this.length(),a=this._preservedValues,u=null!==a,h=this._gotAccum,p=this._valuesPhase;if(!p)for(p=this._valuesPhase=Array(s),o=0;s>o;++o)p[o]=0;if(o=p[r],0===r&&this._zerothIsAccum?(h||(this._accum=e,this._gotAccum=h=!0),p[r]=0===o?1:2):-1===r?h||(this._accum=e,this._gotAccum=h=!0):0===o?p[r]=1:(p[r]=2,h&&(this._accum=e)),h){for(var d,y=this._callback,g=this._promise._boundTo,v=this._reducingIndex;s>v;++v)if(o=p[v],2!==o){if(1!==o)return;if(e=n[v],e instanceof t){if(!e.isFulfilled())return e.isPending()?void 0:(e._unsetRejectionIsUnhandled(),this._reject(e.reason()));e=e._settledValue}if(u?(a.push(e),d=l(y,g,e,v,s)):d=c(y,g,this._accum,e,v,s),d===f)return this._reject(d.e);var m=i(d,void 0);if(m instanceof t){if(m.isPending())return p[v]=4,m._proxyPromiseArray(this,v);if(!m.isFulfilled())return m._unsetRejectionIsUnhandled(),this._reject(m.reason());d=m.value()}this._reducingIndex=v+1,this._accum=d}else this._reducingIndex=v+1;this._reducingIndex=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){if(!this._isResolved()){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)}},n.prototype._promiseRejected=function(t,e){if(!this._isResolved()){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)}},t.settle=function(t){return new n(t).promise()},t.prototype.settle=function(){return new n(this).promise()}}},function(t,e,r){"use strict";t.exports=function(t,e,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer");var r=new i(t),o=r.promise();return o.isRejected()?o:(r.setHowMany(e),r.init(),o)}var s=r(58),a=r(60).RangeError,u=r(60).AggregateError,c=s.isArray;s.inherits(i,e),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._isResolved()||(this._howMany=t)},i.prototype._promiseFulfilled=function(t){this._isResolved()||(this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values)))},i.prototype._promiseRejected=function(t){if(!this._isResolved()&&(this._addRejected(t),this.howMany()>this._canPossiblyFulfill())){for(var e=new u,r=this.length();rs;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof t)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:r}):i.invoke(o,u,r);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,r,u):c instanceof t&&c._isProxied()?c._progressUnchecked(r):c instanceof e&&c._promiseProgressed(r,u)}}}}},function(t,e,r){"use strict";t.exports=function(t,e){var n=r(60),i=n.canAttach,o=r(59),s=n.CancellationError;t.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._attachExtraTrace(t),r._rejectUnchecked(t)},t.prototype.cancel=function(t){return this.isCancellable()?(t=void 0!==t?i(t)?t:new Error(t+""):new s,o.invokeLater(this._cancel,this,t),this):this},t.prototype.cancellable=function(){return this._cancellable()?this:(this._setCancellable(),this._cancellationParent=void 0,this)},t.prototype.uncancellable=function(){var r=new t(e);return r._propagateFrom(this,6),r._follow(this),r._unsetCancellable(),r},t.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},function(t){"use strict";t.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,i){return r(t,n,i,e)}}},function(t){"use strict";t.exports=function(t){function e(t){var e=new r(t),n=e.promise();return n.isRejected()?n:(e.setHowMany(1),e.setUnwrap(),e.init(),n)}var r=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},function(t){"use strict";t.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},function(t,e,r){"use strict";t.exports=function(t,e,n){function i(e){for(var r=e.length,n=0;r>n;++n){var i=e[n];if(i.isRejected())return t.reject(i.error());e[n]=i.value()}return e}function o(t){setTimeout(function(){throw t},0)}function s(t){var e=n(t,void 0);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function a(e,r){function i(){if(a>=u)return c.resolve();var l=s(e[a++]);if(l instanceof t&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),void 0)}catch(f){return o(f)}if(l instanceof t)return l._then(i,o,null,null,null)}i()}var a=0,u=e.length,c=t.defer();return i(),c.promise}function u(t){var e=new d;return e._settledValue=t,e._bitField=268435456,a(this,e).thenReturn(t)}function c(t){var e=new d;return e._settledValue=t,e._bitField=134217728,a(this,e).thenThrow(t)}function l(t,e){this._data=t,this._promise=e}function f(t,e){this.constructor$(t,e)}var h=r(60).TypeError,p=r(58).inherits,d=t.PromiseInspection;l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},l.prototype.tryDispose=function(t){var e=this.resource(),r=null!==e?this.doDispose(e,t):null;return this._promise._unsetDisposable(),this._data=this._promise=null,r},l.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},p(f,l),f.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},t.using=function(){var r=arguments.length;if(2>r)return e("you must pass at least 2 arguments to Promise.using");var n=arguments[r-1];if("function"!=typeof n)return e("fn must be a function");r--;for(var o=new Array(r),s=0;r>s;++s){var a=arguments[s];if(l.isDisposer(a)){var f=a;a=a.promise(),a._setDisposable(f)}o[s]=a}return t.settle(o).then(i).spread(n)._then(u,c,void 0,o,void 0)},t.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},t.prototype._isDisposable=function(){return(262144&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},t.prototype.disposer=function(t){if("function"==typeof t)return new f(t,this);throw new h}}},function(t,e,r){function n(t,e,r,n,i){var o={result:t};return t||(o.path=e,o.reason=r,o.a=n,o.b=i),o}function i(t){for(var e=arguments,r=1,n=e.length;n>r;r++)t=t.replace(/%s/,e[r]);return t}function o(t,e,r,y,g){if(g=g||[],t===e)return n(0!==t||1/t==1/e,g,c.PLUS_0_AND_MINUS_0,t,e);var v,m=s(t),_=s(e);if(m!==_)return n(!1,g,i(c.DIFFERENT_TYPES,m,_),t,e);switch(m){case"number":return t!==t?n(e!==e,g,c.NAN_NUMBER,t,e):0===t?n(1/t===1/e,g,c.PLUS_0_AND_MINUS_0,t,e):n(t===e,g,c.EQUALITY,t,e);case"regexp":return n(String(t)===String(e),g,c.EQUALITY,t,e);case"boolean":case"string":return n(t===e,g,c.EQUALITY,t,e);case"date":return n(+t===+e,g,c.EQUALITY,t,e);case"object-number":case"object-boolean":case"object-string":var b=t.valueOf()===e.valueOf();if(b)break;return n(!1,g,c.WRAPPED_VALUE,t.valueOf(),e.valueOf());case"buffer":if(t.length!==e.length)return n(!1,g.concat(l),c.EQUALITY,t.length,e.length);for(v=t.length;v--;)if(t[v]!==e[v])return n(!1,g.concat([v]),c.EQUALITY,t[v],e[v]);return u;case"error":if(t.name!==e.name)return n(!1,g.concat(f),c.EQUALITY,t.name,e.name);if(t.message!==e.message)return n(!1,g.concat(h),c.EQUALITY,t.message,e.message);break;case"array-buffer":if(t.byteLength!==e.byteLength)return n(!1,g.concat(p),c.EQUALITY,t.byteLength,e.byteLength);for(v=t.byteLength;v--;)if(t[v]!==e[v])return n(!1,g.concat([v]),c.EQUALITY,t[v],e[v]);return u}for(r||(r=[]),y||(y=[]),v=r.length;v--;)if(r[v]==t)return n(y[v]==e,g,c.CIRCULAR_VALUES,t,e);r.push(t),y.push(e);var w,j,E;if(("array"===m||"arguments"===m)&&t.length!==e.length)return n(!1,g.concat(l),c.EQUALITY,t.length,e.length);if("function"===_){var x=t.toString(),A=e.toString();if(x!==A)return n(!1,g,c.FUNCTION_SOURCES,x,A)}for(E in e)if(a.call(e,E)){if(w=a.call(t,E),!w)return n(!1,g,i(c.MISSING_KEY,"A",E),t,e);if(j=o(t[E],e[E],r,y,g.concat([E])),!j.result)return j}for(E in t)if(a.call(t,E)&&(w=a.call(e,E),!w))return n(!1,g,i(c.MISSING_KEY,"B",E),t,e);return r.pop(),y.pop(),"function"!==_||(j=o(t.prototype,e.prototype,r,y,g.concat(d)),j.result)?u:j}var s=r(99),a=Object.prototype.hasOwnProperty,u=n(!0),c={PLUS_0_AND_MINUS_0:"+0 is not equal to -0",DIFFERENT_TYPES:"A has type %s and B has type %s",NAN_NUMBER:"NaN is not equal to any number",EQUALITY:"A is not equal to B",WRAPPED_VALUE:"A wrapped value is not equal to B wrapped value",FUNCTION_SOURCES:"function A is not equal to B by source code value (via .toString call)",MISSING_KEY:"%s does not have key %s",CIRCULAR_VALUES:"A has circular reference that was visited not in the same time as B"},l=["length"],f=["name"],h=["message"],p=["byteLength"],d=["prototype"];t.exports=o},function(t){function e(t){if(void 0===t)return"undefined";if(null===t)return"null";switch(Object.prototype.toString.call(t)){case"[object Boolean]":return"boolean";case"[object Number]":return"number";case"[object String]":return"string";case"[object RegExp]":return"regexp";case"[object Date]":return"date";case"[object Array]":return"array";default:return typeof t}}t.exports=e},function(t){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t){var e=function(){"use strict";return void 0===this}();if(e)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,keys:Object.keys,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:e};else{var r={}.hasOwnProperty,n={}.toString,i={}.constructor.prototype,o=function(t){var e=[];for(var n in t)r.call(t,n)&&e.push(n);return e},s=function(t,e,r){return t[e]=r.value,t},a=function(t){return t},u=function(t){try{return Object(t).constructor.prototype}catch(e){return i}},c=function(t){try{return"[object Array]"===n.call(t)}catch(e){return!1}};t.exports={isArray:c,keys:o,defineProperty:s,freeze:a,getPrototypeOf:u,isES5:e}}},function(t,e,r){(function(e){"use strict";var r,n;if("object"==typeof e&&"string"==typeof e.version)r=function(t){e.nextTick(t)};else if("undefined"!=typeof MutationObserver&&(n=MutationObserver)||"undefined"!=typeof WebKitMutationObserver&&(n=WebKitMutationObserver))r=function(){var t=document.createElement("div"),e=void 0,r=new n(function(){var t=e;e=void 0,t()});return r.observe(t,{attributes:!0}),function(r){e=r,t.classList.toggle("foo")}}();else{if("undefined"==typeof setTimeout)throw new Error("no async scheduler available");r=function(t){setTimeout(t,0)}}t.exports=r}).call(e,r(51))},function(t){"use strict";function e(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e]}function r(t){this._capacity=t,this._length=0,this._front=0,this._makeCapacity()}r.prototype._willBeOverCapacity=function(t){return this._capacitye;++e)this[e]=void 0},r.prototype._checkCapacity=function(t){this._capacity=r+o)e(i,r,this,0,o);else{var s=o-(r+o&n-1);e(i,r,this,0,s),e(i,0,this,s,o-s)}},t.exports=r},function(t,e,r){(function(e){var r=Object.prototype.toString,n="undefined"!=typeof Promise,i="undefined"!=typeof e,o="number",s="undefined",a="string",u="boolean",c="object",l="function",f="null",h="array",p="regexp",d="date",y="error",g="arguments",v="symbol",m="array-buffer",_="typed-array",b="data-view",w="map",j="set",E="weak-set",x="weak-map",A="promise",O="object-number",P="object-boolean",k="object-string",T="buffer",S="html-element",N="html-element-text",F="document",R="window",C="file",I="file-list",U="blob",L="xhr";t.exports=function(t){var B=typeof t;switch(B){case o:return o;case s:return s;case a:return a;case u:return u;case l:return l;case v:return v;case c:if(null===t)return f;var D=r.call(t);switch(D){case"[object String]":return k;case"[object Boolean]":return P;case"[object Number]":return O;case"[object Array]":return h;case"[object RegExp]":return p;case"[object Error]":return y;case"[object Date]":return d;case"[object Arguments]":return g;case"[object Math]":return c;case"[object JSON]":return c;case"[object ArrayBuffer]":return m;case"[object Int8Array]":return _;case"[object Uint8Array]":return _;case"[object Uint8ClampedArray]":return _;case"[object Int16Array]":return _;case"[object Uint16Array]":return _;case"[object Int32Array]":return _;case"[object Uint32Array]":return _;case"[object Float32Array]":return _;case"[object Float64Array]":return _;case"[object DataView]":return b;case"[object Map]":return w;case"[object WeakMap]":return x;case"[object Set]":return j;case"[object WeakSet]":return E;case"[object Promise]":return A;case"[object Window]":return R;case"[object HTMLDocument]":return F;case"[object Blob]":return U;case"[object File]":return C;case"[object FileList]":return I;case"[object XMLHttpRequest]":return L;case"[object Text]":return N;default:if(n&&t instanceof Promise)return A;if(i&&t instanceof e)return T;if(/^\[object HTML\w+Element\]$/.test(D))return S;if("[object Object]"===D)return c}}}}).call(e,r(57).Buffer)},function(t){t.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?0/0:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=0>e||0===e&&0>1/e?1:0; -for(e=Math.abs(e),isNaN(e)||1/0===e?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+f>=1?h/u:h*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},function(t){var e=Array.isArray,r=Object.prototype.toString;t.exports=e||function(t){return!!t&&"[object Array]"==r.call(t)}},95,function(t,e){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===s?62:e===a?63:u>e?-1:u+10>e?e-u+26+26:l+26>e?e-l:c+26>e?e-c+26:void 0}function n(t){function r(t){c[f++]=t}var n,i,s,a,u,c;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new o(3*t.length/4-u),s=u>0?t.length-4:t.length;var f=0;for(n=0,i=0;s>n;n+=4,i+=3)a=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&a)>>16),r((65280&a)>>8),r(255&a);return 2===u?(a=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&a)):1===u&&(a=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(a>>8&255),r(255&a)),c}function i(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,s,a=t.length%3,u="";for(i=0,s=t.length-a;s>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=n(o);switch(a){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(o<<4&63),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(o>>4&63),u+=e(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i}(e)}])); \ No newline at end of file +var N=r(66),F=r(64),I=r(65);e.Buffer=t,e.SlowBuffer=t,e.INSPECT_MAX_BYTES=50,t.poolSize=8192;var C=1073741823;t.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(r){return!1}}(),t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);s>o&&e[o]===r[o];o++);return o!==s&&(n=e[o],i=r[o]),i>n?-1:n>i?1:0},t.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,r){if(!I(e))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===e.length)return new t(0);if(1===e.length)return e[0];var n;if(void 0===r)for(r=0,n=0;n>>1;break;case"utf8":case"utf-8":r=O(t).length;break;case"base64":r=R(t).length;break;default:r=t.length}return r},t.prototype.length=void 0,t.prototype.parent=void 0,t.prototype.toString=function(t,e,r){var n=!1;if(e>>>=0,r=void 0===r||1/0===r?this.length:r>>>0,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return p(this,e,r);case"utf8":case"utf-8":return l(this,e,r);case"ascii":return f(this,e,r);case"binary":return h(this,e,r);case"base64":return c(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return 0===t.compare(this,e)},t.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return t.compare(this,e)},t.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},t.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},t.prototype.write=function(t,e,r,c){if(isFinite(e))isFinite(r)||(c=r,r=void 0);else{var l=c;c=e,e=r,r=l}e=Number(e)||0;var f=this.length-e;r?(r=Number(r),r>f&&(r=f)):r=f,c=String(c||"utf8").toLowerCase();var h;switch(c){case"hex":h=n(this,t,e,r);break;case"utf8":case"utf-8":h=i(this,t,e,r);break;case"ascii":h=o(this,t,e,r);break;case"binary":h=s(this,t,e,r);break;case"base64":h=a(this,t,e,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=u(this,t,e,r);break;default:throw new TypeError("Unknown encoding: "+c)}return h},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,r){var n=this.length;if(e=~~e,r=void 0===r?n:~~r,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>r?(r+=n,0>r&&(r=0)):r>n&&(r=n),e>r&&(r=e),t.TYPED_ARRAY_SUPPORT)return t._augment(this.subarray(e,r));for(var i=r-e,o=new t(i,void 0,!0),s=0;i>s;s++)o[s]=this[s+e];return o},t.prototype.readUInt8=function(t,e){return e||g(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||g(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||g(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||g(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||g(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readInt8=function(t,e){return e||g(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},t.prototype.readInt16LE=function(t,e){e||g(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||g(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||g(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||g(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||g(t,4,this.length),F.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||g(t,4,this.length),F.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||g(t,8,this.length),F.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||g(t,8,this.length),F.read(this,t,!1,52,8)},t.prototype.writeUInt8=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):v(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):v(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e):_(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):_(this,e,r,!1),r+4},t.prototype.writeInt8=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[r]=e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):v(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):v(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):_(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):_(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return b(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return b(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return w(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return w(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),r||(r=0),i!==n&&0!==e.length&&0!==o.length){if(n>i)throw new TypeError("sourceEnd < sourceStart");if(0>r||r>=e.length)throw new TypeError("targetStart out of bounds");if(0>n||n>=o.length)throw new TypeError("sourceStart out of bounds");if(0>i||i>o.length)throw new TypeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-rs||!t.TYPED_ARRAY_SUPPORT)for(var a=0;s>a;a++)e[a+r]=this[a+n];else e._set(this.subarray(n,n+s),r)}},t.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new TypeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new TypeError("start out of bounds");if(0>r||r>this.length)throw new TypeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=O(t.toString()),o=i.length;for(n=e;r>n;n++)this[n]=i[n%o]}return this}},t.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(t.TYPED_ARRAY_SUPPORT)return new t(this).buffer;for(var e=new Uint8Array(this.length),r=0,n=e.length;n>r;r+=1)e[r]=this[r];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var U=t.prototype;t._augment=function(e){return e.constructor=t,e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=U.get,e.set=U.set,e.write=U.write,e.toString=U.toString,e.toLocaleString=U.toString,e.toJSON=U.toJSON,e.equals=U.equals,e.compare=U.compare,e.copy=U.copy,e.slice=U.slice,e.readUInt8=U.readUInt8,e.readUInt16LE=U.readUInt16LE,e.readUInt16BE=U.readUInt16BE,e.readUInt32LE=U.readUInt32LE,e.readUInt32BE=U.readUInt32BE,e.readInt8=U.readInt8,e.readInt16LE=U.readInt16LE,e.readInt16BE=U.readInt16BE,e.readInt32LE=U.readInt32LE,e.readInt32BE=U.readInt32BE,e.readFloatLE=U.readFloatLE,e.readFloatBE=U.readFloatBE,e.readDoubleLE=U.readDoubleLE,e.readDoubleBE=U.readDoubleBE,e.writeUInt8=U.writeUInt8,e.writeUInt16LE=U.writeUInt16LE,e.writeUInt16BE=U.writeUInt16BE,e.writeUInt32LE=U.writeUInt32LE,e.writeUInt32BE=U.writeUInt32BE,e.writeInt8=U.writeInt8,e.writeInt16LE=U.writeInt16LE,e.writeInt16BE=U.writeInt16BE,e.writeInt32LE=U.writeInt32LE,e.writeInt32BE=U.writeInt32BE,e.writeFloatLE=U.writeFloatLE,e.writeFloatBE=U.writeFloatBE,e.writeDoubleLE=U.writeDoubleLE,e.writeDoubleBE=U.writeDoubleBE,e.fill=U.fill,e.inspect=U.inspect,e.toArrayBuffer=U.toArrayBuffer,e};var L=/[^+\/0-9A-z]/g}).call(e,r(61).Buffer)},function(t){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t){t.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?0/0:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+f>=1?h/u:h*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*g}},function(t){var e=Array.isArray,r=Object.prototype.toString;t.exports=e||function(t){return!!t&&"[object Array]"==r.call(t)}},function(t,e){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===s?62:e===a?63:u>e?-1:u+10>e?e-u+26+26:l+26>e?e-l:c+26>e?e-c+26:void 0}function n(t){function r(t){c[f++]=t}var n,i,s,a,u,c;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new o(3*t.length/4-u),s=u>0?t.length-4:t.length;var f=0;for(n=0,i=0;s>n;n+=4,i+=3)a=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&a)>>16),r((65280&a)>>8),r(255&a);return 2===u?(a=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&a)):1===u&&(a=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(a>>8&255),r(255&a)),c}function i(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,s,a=t.length%3,u="";for(i=0,s=t.length-a;s>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=n(o);switch(a){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(o<<4&63),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(o>>4&63),u+=e(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i}(e)}]); \ No newline at end of file diff --git a/browser/test/tests-unit.js b/browser/test/tests-unit.js index 7b41ed2..3815405 100644 --- a/browser/test/tests-unit.js +++ b/browser/test/tests-unit.js @@ -1,4 +1,4 @@ -/*! Unit.js v1.1.1 | (c) 2014 Nicolas Tallefourtane | http://unitjs.com/license.html */ +/*! Unit.js v1.1.2 | (c) 2015 Nicolas Tallefourtane | http://unitjs.com/license.html */ !function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports,__webpack_require__){"use strict";function once(fn){var returnValue,called=!1;return function(){return called||(called=!0,returnValue=fn.apply(this,arguments)),returnValue}}function getTodos(listId,callback){jQuery.ajax({url:"/todo/"+listId+"/items",success:function(data){callback(null,data)}})}var test=unitjs;describe("Unit.js provides several API unified and several assertion styles",function(){it("Unit.js style",function(){test.string("foobar").isEqualTo("foobar").isIdenticalTo("foobar")}),it("Assert library of Node.js",function(){test.assert(!0),test.assert.equal("foobar","foobar"),test.assert.strictEqual("foobar","foobar");var assert=test.assert;assert(!0),assert.equal("foobar","foobar"),assert.strictEqual("foobar","foobar")}),it("Should.js library",function(){test.should("foobar").be.type("string"),test.should(!0).be.ok,test.should("foobar").be.equal("foobar");var should=test.should;"foobar".should.be.type("string"),(!0).should.be.ok,"foobar".should.be.equal("foobar"),should("foobar").be.type("string"),should(!0).be.ok,should("foobar").be.equal("foobar")}),it("Must.js library",function(){test.must("foobar").be.a.string(),test.must(!0).be["true"](),test.must("foobar").be.equal("foobar");var must=test.must;"foobar".must.be.a.string(),(!0).must.be["true"](),"foobar".must.be.equal("foobar"),must("foobar").be.a.string(),must(!0).be["true"](),must("foobar").be.equal("foobar")}),it("Unit.js is expressive and fluent",function(){var num,arr,obj={fluent:"is awesome"},copy_obj=obj;test.object(obj).isIdenticalTo(copy_obj).isNotIdenticalTo({fluent:"is awesome"}).isNotEqualTo({fluent:"is awesome"}).is({fluent:"is awesome"}).hasProperty("fluent","is awesome").given(num=10).number(num).isBetween(5,15).then().error(function(){test.number(num/1).isInfinite()})["if"](num=.4*num).number(num).isApprox(5,1.5).when(function(){arr=[],arr.push(num),arr.push("fluent")}).array(arr).hasLength(2).hasValue("fluent")["if"](arr.push("test flow")).and(arr.push("is expressive")).array(arr).hasLength(4).hasValues(["fluent","test flow","is expressive"])})}),describe("Control flow",function(){describe("Performs the tests without entangled with the flow of other series of tests",function(){it("Series launched with chaining",function(){test.exception(function(){throw test.string("serie1-1").isEqualTo("serie1-1").string("serie1-2").isEqualTo("serie1-2").string("serie1-3").isEqualTo("serie1-3"),new Error("Whoops1-1 !")}).hasMessage("Whoops1-1 !").hasMessage(/Whoop/).string("serie2-1").isEqualTo("serie2-1").exception(function(){throw test.string("serie2-1").isEqualTo("serie2-1").string("serie2-2").isEqualTo("serie2-2").string("serie2-3").isEqualTo("serie2-3"),new Error("Whoops2-1 !")}).hasMessage("Whoops2-1 !").hasMessage(/Whoop/).string("serie3-1").isEqualTo("serie3-1").exception(function(){throw new Error("Whoops3-1 !")}).hasMessage("Whoops3-1 !").string("serie4-1").isEqualTo("serie4-1").exception(function(){throw new Error("Whoops4-1 !")}).hasMessage("Whoops4-1 !").string("serie5-1").isEqualTo("serie5-1").string("serie5-2").isEqualTo("serie5-2").string("serie5-3").isEqualTo("serie5-3").then().string("serie5-4").isEqualTo("serie5-4")}),it("Series launched without chaining",function(){test.exception(function(){throw test.string("serie1-1").isEqualTo("serie1-1"),test.string("serie1-2").isEqualTo("serie1-2"),test.string("serie1-3").isEqualTo("serie1-3"),new Error("Whoops1-1 !")}).hasMessage("Whoops1-1 !").hasMessage(/Whoop/),test.string("serie2-1").isEqualTo("serie2-1"),test.exception(function(){throw test.string("serie2-1").isEqualTo("serie2-1"),test.string("serie2-2").isEqualTo("serie2-2"),test.string("serie2-3").isEqualTo("serie2-3"),new Error("Whoops2-1 !")}).hasMessage("Whoops2-1 !").hasMessage(/Whoop/),test.string("serie3-1").isEqualTo("serie3-1"),test.exception(function(){throw new Error("Whoops3-1 !")}).hasMessage("Whoops3-1 !"),test.string("serie4-1").isEqualTo("serie4-1"),test.exception(function(){throw new Error("Whoops4-1 !")}).hasMessage("Whoops4-1 !"),test.string("serie5-1").isEqualTo("serie5-1"),test.string("serie5-2").isEqualTo("serie5-2"),test.string("serie5-3").isEqualTo("serie5-3"),test.string("serie5-4").isEqualTo("serie5-4")}),it("Chaining with dependency injection",function(){test.$provider("getStrProvider",function(self){return test.object(self).isIdenticalTo(test.$di._container),self.fromSelf="ok from self",function(val){return test.string(val),val}})["case"]("Test the chain of provider",function(){var fn=test.$di.get("getStrProvider");test["function"](fn).string(fn("ok1")).isIdenticalTo("ok1").string(test.$di.get("fromSelf")).isIdenticalTo("ok from self")}).$invoke("getStrProvider",function(getStr){return test.string(getStr("ok2")).isIdenticalTo("ok2"),test})["case"]("Test the chain of a factorized function").$factory("chainStrTest","getStrProvider",function(getStr){return test["function"](getStr).string(getStr("from factory"))}).$di.get("chainStrTest").isIdenticalTo("from factory")}),it("Series with helpers",function(){var str,indicator,log=console.log;console.log=test.spy(),test.given(str="serie1-1").string(str).isEqualTo("serie1-1").when('change "str" value',function(){str="serie1-2"}).then(function(){indicator=!0,test.string(str).isEqualTo("serie1-2")})["case"]('Checks that "then" execute the function argument').bool(indicator).isTrue().string("1").dump("test.dump()").is("1").bool(console.log.called).isTrue().then(function(){console.log=log}).then("Check break of flow").exception(function(){test.string("1")["case"]().is("1")}).exception(function(){test.string("1")["if"]().is("1")}).exception(function(){test.string("1").and().is("1")}).exception(function(){test.string("1")["case"].is("1")}).exception(function(){test.string("1")["if"].is("1")}).exception(function(){test.string("1").and.is("1")}).exception(function(){test.string("1").given().is("1")}).exception(function(){test.string("1").when().is("1")}).exception(function(){test.string("1").then().is("1")}).then("The context of flow",function(){var flow=test.string("1").bool(!0).isTrue();test.object(flow).hasProperty("isTrue").hasProperty("isFalse").hasNotProperty("hasValue").object(test.string("1")).hasProperty("hasValue")})})})}),describe("Passes IOC container",function(){beforeEach(function(){test.$di.set("spy",test.spy()).provider("assertSpy","spy",function(spy){return function(num){return test.assert(spy.callCount===num),test}}).set("callSpy",function(){return test.$di.get("spy"),test})}),afterEach(function(){test.$di.remove("spy").remove("assertSpy").remove("callSpy")}),it("case()",function(){test["case"](function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({})["case"](function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("given()",function(){test.given(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).given(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("when()",function(){test.when(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).when(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("then()",function(){test.then(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).then(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("if()",function(){test["if"](function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({})["if"](function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("and()",function(){test.and(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).and(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("wait()",function(done){var calledAt,spy=test.spy(function(){calledAt=new Date,calledAt=calledAt.getTime()}),defAt=new Date;test.wait(20,spy),setTimeout(function(){test.assert(spy.calledOnce),defAt=defAt.getTime(),test.number(calledAt).isGreaterThan(defAt+18),done()},25)}),it("dump()",function(){var log=console.log;console.log=test.spy(),test.string("1").dump("test.dump()").is("1").bool(console.log.called).isTrue(),console.log=log}),it("stats",function(){var countAssert,countAssertOk,total;test.object(test.stats).object(test.stats.assertions).object(test.stats.total).number(test.stats.total.assertions).isGreaterThan(2).number(test.stats.assertions.isObject).isGreaterThan(1).number(test.stats.assertions.isNumber).isGreaterThan(1)["case"]("assert",function(){total=test.stats.total.assertions,countAssert=test.stats.assertions.assert||0,countAssertOk=test.stats.assertions["assert.ok"]||0,test.assert(!0),test.assert.ok(!0),test.number(test.stats.total.assertions).is(total+2).number(test.stats.assertions.assert).is(countAssert+1).number(test.stats.assertions["assert.ok"]).is(countAssertOk+1)})})});var jQuery={ajax:function(){}};describe("Unit.js provides sinon.js",function(){describe("Spies",function(){it("calls the original function",function(){var callback=test.spy(),proxy=once(callback);proxy(),test.assert(callback.called)}),it("calls the original function only once",function(){var callback=test.spy(),proxy=once(callback);proxy(),proxy(),test.assert(callback.calledOnce),test.assert.strictEqual(callback.callCount,1)}),it("calls original function with right this and args",function(){var callback=test.spy(),proxy=once(callback),obj={};proxy.call(obj,1,2,3),test.assert(callback.calledOn(obj)),test.assert(callback.calledWith(1,2,3))})}),describe("Stubs",function(){it("returns the return value from the original function",function(){var callback=test.stub().returns(42),proxy=once(callback);test.assert.strictEqual(proxy(),42)})}),describe("Testing Ajax",function(){after(function(){jQuery.ajax.restore()}),it("makes a GET request for todo items",function(){test.stub(jQuery,"ajax"),getTodos(42,test.spy()),test.assert(jQuery.ajax.calledWithMatch({url:"/todo/42/items"}))})}),describe("Mocks",function(){it("returns the return value from the original function",function(){var myAPI={method:function(){}},mock=test.mock(myAPI);mock.expects("method").once().returns(42);var proxy=once(myAPI.method);test.assert.equal(proxy(),42),mock.verify()}),it("test should call a method with exceptions",function(){var myAPI={method:function(){}},mock=test.mock(myAPI);mock.expects("method").once()["throws"](),test.exception(function(){myAPI.method()}).isInstanceOf(Error),mock.verify()})}),describe("Matchers",function(){it("test should assert fuzzy",function(){var book={pages:42,author:"cjno"},spy=test.spy();spy(book),test.sinon.assert.calledWith(spy,test.sinon.match({author:"cjno"})),test.sinon.assert.calledWith(spy,test.sinon.match.has("pages",42))}),it("test should stub method differently based on argument types",function(){var callback=test.stub();callback.withArgs(test.sinon.match.string).returns(!0),callback.withArgs(test.sinon.match.number)["throws"]("TypeError"),test.bool(callback("abc")).isTrue(),test.exception(function(){callback(123)}).isValid(function(err){return"TypeError"===err.name?!0:void 0})}),it("Combining matchers",function(){var stringOrNumber=test.sinon.match.string.or(test.sinon.match.number),bookWithPages=test.sinon.match.object.and(test.sinon.match.has("pages")),book={pages:42,author:"cjno"},spy=test.spy(),otherSpy=test.spy();spy(book),otherSpy(10),test.sinon.assert.calledWith(spy,bookWithPages),test.sinon.assert.calledWith(otherSpy,stringOrNumber)}),it("Custom matchers",function(){var equal10=test.sinon.match(function(value){return 10===value},"value is not equal to 10"),spy=test.spy(),otherSpy=test.spy();spy(10),otherSpy(42),test.sinon.assert.calledWith(spy,equal10),test.exception(function(){test.sinon.assert.calledWith(otherSpy,equal10)}).hasMessage(/value is not equal to 10/)})}),describe("Sandbox",function(){it("test using test.sinon.test sandbox",test.sinon.test(function(){var myAPI={method:function(){}},mockMyApi=this.mock(myAPI).expects("method").once().returns(42),proxy=once(myAPI.method);test.number(proxy()).isIdenticalTo(42),mockMyApi.verify()}))})}),describe("Asserter array()",function(){describe("array() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.array([]).hasHeader).isUndefined().value(test.array([]).isError).isUndefined().value(test.array([]).hasMessage).isUndefined().value(test.array([]).isInfinite).isUndefined()}),it("Assert that the tested value is an `array`",function(){var Foo=function(){};test.array([]).array(["a","b","c"]).array(new Array)["case"]("Test failure",function(){test.exception(function(){test.array({})}).exception(function(){test.array("Foo")}).exception(function(){test.array(Foo)}).exception(function(){test.array(1)}).exception(function(){test.array(void 0)}).exception(function(){test.array(!0)}).exception(function(){test.array(!1)}).exception(function(){test.array(null)}).exception(function(){test.array(function(){})})})})}),describe("Assertions of array()",function(){it("is(expected)",function(){test.array(["foo",[0,1]]).is(["foo",[0,1]])["case"]("Test failure",function(){test.exception(function(){test.array(["foo",[0,1]]).is(["foo",[0,"1"]])}).exception(function(){test.array(["foo",[0,1]]).is(["foo",[0,1,2]])}).exception(function(){test.array(["foo",[0,1]]).is(["foo",[0]])}).exception(function(){test.array(["foo",[0,1]]).is(["foobar",[0,1]])})})}),it("isNot(expected)",function(){test.array(["foo",[0,1]]).isNot(["foo",[0,"1"]]).exception(function(){test.array(["foo",[0,1]]).isNot(["foo",[0,1]])})}),it("isIdenticalTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isIdenticalTo(arr2).exception(function(){test.array(arr).isIdenticalTo([1])})}),it("isNotIdenticalTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isNotIdenticalTo([1]).exception(function(){test.array(arr).isNotIdenticalTo(arr2)})}),it("isEqualTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isEqualTo(arr2).exception(function(){test.array(arr).isEqualTo([1])})}),it("isNotEqualTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isNotEqualTo([1]).exception(function(){test.array(arr).isNotEqualTo(arr2)})}),it("match(expected)",function(){test.array(["a","b","c"]).match(/[a-z]/).array([42,10]).match(function(actual){return 10===actual[1]}).exception(function(){test.array([42,"10"]).match(function(actual){return 10===actual[1]})})}),it("notMatch(expected)",function(){test.array(["a","b","c"]).notMatch(/[d-z]/).array([42,10]).notMatch(function(actual){return"10"===actual[1]}).exception(function(){test.array([42,"10"]).notMatch(function(actual){return 42===actual[0]})})}),it("isValid(expected)",function(){test.array(["a","b","c"]).isValid(/[a-z]/).array([42,10]).isValid(function(actual){return 10===actual[1]}).exception(function(){test.array([42,"10"]).isValid(function(actual){return 10===actual[1]})})}),it("isNotValid(expected)",function(){test.array(["a","b","c"]).isNotValid(/[d-z]/).array([42,10]).isNotValid(function(actual){return"10"===actual[1]}).exception(function(){test.array([42,"10"]).isNotValid(function(actual){return 42===actual[0]})})}),it("matchEach(expected)",function(){test.array([10,11,12]).matchEach(function(it){return it>=10}).exception(function(){test.array([10,11,12]).matchEach(function(it){return it>=11})})}),it("notMatchEach(expected)",function(){test.array([10,11,12]).notMatchEach(function(it){return it>=13}).exception(function(){test.array([10,11,12]).notMatchEach(function(it){return it>=11})})}),it("isEmpty()",function(){test.array([]).isEmpty().exception(function(){test.array([0]).isEmpty()}).exception(function(){test.array([""]).isEmpty()})}),it("isNotEmpty()",function(){test.array(["a"]).isNotEmpty().exception(function(){test.array([]).isNotEmpty()})}),it("hasLength(expected)",function(){test.array([1,2]).hasLength(2).exception(function(){test.array([1,2]).hasLength(1)})}),it("hasNotLength(expected)",function(){test.array([1,2]).hasNotLength(1).exception(function(){test.array([1,2]).hasNotLength(2)})}),it("isEnumerable(property)",function(){var arr=["is enumerable"];test.array(arr).isEnumerable(0).array(arr).isNotEnumerable("length").exception(function(){test.array(arr).isEnumerable("length")})}),it("isNotEnumerable(property)",function(){var arr=["is enumerable"];test.array(arr).isNotEnumerable("length").array(arr).isEnumerable(0).exception(function(){test.array(arr).isNotEnumerable(0)})}),it("hasProperty(property [, value])",function(){test.array(["a","b"]).hasProperty(1).hasProperty(0,"a").exception(function(){test.array(["a","b"]).hasProperty(3)}).exception(function(){test.array(["a","b"]).hasProperty(0,"b")})}),it("hasNotProperty(property [, value])",function(){test.array(["a","b"]).hasNotProperty(2).hasNotProperty(0,"b").exception(function(){test.array(["a","b"]).hasNotProperty(0)}).exception(function(){test.array(["a","b"]).hasNotProperty(1,"b")})}),it("hasKey(key [, value])",function(){test.array(["a","b"]).hasKey(1).hasKey(0,"a").exception(function(){test.array(["a","b"]).hasKey(3)}).exception(function(){test.array(["a","b"]).hasKey(0,"b")})}),it("notHasKey(key [, value])",function(){test.array(["a","b"]).notHasKey(2).notHasKey(0,"b").exception(function(){test.array(["a","b"]).notHasKey(0)}).exception(function(){test.array(["a","b"]).notHasKey(1,"b")})}),it("hasValue(expected)",function(){test.array([1,42,3]).hasValue(42).exception(function(){test.array([1,42,3]).hasValue(0)})}),it("notHasValue(expected)",function(){test.array([1,42,3]).notHasValue(4).exception(function(){test.array([1,42,3]).notHasValue(42)})}),it("hasValues(expected)",function(){test.array([1,42,3]).hasValues([42,3]).exception(function(){test.array([1,42,3]).hasValues([42,3,10])})}),it("notHasValues(expected)",function(){test.array([1,42,3]).notHasValues([4,2]).exception(function(){test.array([1,42,3]).notHasValues([4,1])})}),it("contains(expected [, ...])",function(){test.array([1,2,3]).contains([3]).array([1,2,3]).contains([1,3]).array([1,2,3]).contains([3],[1,3]).array([1,2,3,{a:{b:{d:12}}}]).contains([2],[1,2],[{a:{b:{d:12}}}]).array([[1],[2],[3]]).contains([[3]]).array([[1],[2],[3,4]]).contains([[3]]).array([{a:"a"},{b:"b",c:"c"}]).contains([{a:"a"}],[{b:"b"}]).exception(function(){test.array([1,2,3]).contains([0])})}),it("notContains(expected [, ...])",function(){test.array([[1],[2],[3,4]]).notContains([[0]]).array([{a:"a"},{b:"b",c:"c"}]).notContains([{a:"b"}],[{c:"b"}]).exception(function(){test.array([{a:"a"},{b:"b",c:"c"}]).notContains([{a:"a"}],[{b:"b"}])})}),it("isReverseOf(expected)",function(){test.array([1,2,3]).isReverseOf([3,2,1]).exception(function(){test.array([1,2,3]).isReverseOf([1,2,3])}).exception(function(){test.array([1,2,3]).isReverseOf([3,2,2,1])})}),it("isNotReverseOf(expected)",function(){test.array([1,2,2,3]).isNotReverseOf([3,2,1]).exception(function(){test.array([3,2,1]).isNotReverseOf([3,2,1])})})})}),describe("Asserter bool()",function(){describe("bool() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.bool(!0).hasHeader).isUndefined().value(test.bool(!0).hasProperty).isUndefined().value(test.bool(!0).hasMessage).isUndefined()}),it("Assert that the tested value is a `boolean`",function(){test.bool(!0).bool(!1)["case"]("Test failure",function(){test.exception(function(){test.bool()}).exception(function(){test.bool(0)}).exception(function(){test.bool(1)}).exception(function(){test.bool(void 0)}).exception(function(){test.bool(null)}).exception(function(){test.bool("")}).exception(function(){test.bool("true")}).exception(function(){test.bool("false")}).exception(function(){test.bool("1")}).exception(function(){test.bool("0")}).exception(function(){test.bool([])}).exception(function(){test.bool({})}).exception(function(){test.bool(new Boolean("false")).isFalse()}).exception(function(){test.bool(Boolean("false")).isFalse()})})})}),describe("Assertions of bool()",function(){it("isTrue()",function(){test.bool(!0).isTrue().exception(function(){test.bool(!1).isTrue()})}),it("isNotTrue()",function(){test.bool(!1).isNotTrue().exception(function(){test.bool(!0).isNotTrue()})}),it("isFalse()",function(){test.bool(!1).isFalse().exception(function(){test.bool(!0).isFalse()})}),it("isNotFalse()",function(){test.bool(!0).isNotFalse().exception(function(){test.bool(!1).isNotFalse()})})})}),describe("Asserter date()",function(){describe("date() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.date(new Date).hasHeader).isUndefined().value(test.date(new Date).hasProperty).isUndefined().value(test.date(new Date).hasMessage).isUndefined().value(test.date(new Date).isInfinite).isUndefined()}),it("Assert that the tested value is an instance of `Date`",function(){test.date(new Date).date(new Date("2010, 5, 20"))["case"]("Test failure",function(){test.exception(function(){test.date("2010 5 20")}).exception(function(){test.date(2010)}).exception(function(){test.date(Date)})})})}),describe("Assertions of date()",function(){it("is(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).is(new Date("2010, 5, 20"))["case"]("Test failure",function(){test.exception(function(){test.date(date).is(/2010/)}).exception(function(){test.date(date).is(new Date("2011, 5, 20"))})})}),it("isNot(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNot(new Date("2012, 02, 28"))["case"]("Test failure",function(){test.exception(function(){test.date(date).isNot(new Date("2010, 5, 20"))}).exception(function(){test.date(date).isNot(date)})})}),it("isIdenticalTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isIdenticalTo(date).exception(function(){test.date(date).isIdenticalTo(new Date("2010, 5, 20"))})}),it("isNotIdenticalTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotIdenticalTo(new Date("2010, 5, 20")).exception(function(){test.date(date).isNotIdenticalTo(date)})}),it("isEqualTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isEqualTo(date).exception(function(){test.date(date).isEqualTo(new Date("2010, 5, 20"))})}),it("isNotEqualTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotEqualTo(new Date("2010, 5, 20")).exception(function(){test.date(date).isNotEqualTo(date)})}),it("match(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).match(/2010/).exception(function(){test.date(date).match(/03/)})}),it("notMatch(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).notMatch(/03/).exception(function(){test.date(date).notMatch(/02/)})}),it("isValid(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isValid(/2010/).exception(function(){test.date(date).isValid(/03/)})}),it("isNotValid(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotValid(/03/).exception(function(){test.date(date).isNotValid(/02/)})}),it("isBetween(begin, end)",function(){var date=new Date("2010, 5, 20");test.date(date).isBetween(new Date("1982, 02, 17"),new Date("2012, 02, 28")).exception(function(){test.date(date).isBetween(new Date("2012, 02, 28"),new Date("1982, 02, 17"))})}),it("isNotBetween(begin, end)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotBetween(new Date("2011, 02, 17"),new Date("2012, 02, 28")).exception(function(){test.date(date).isNotBetween(new Date("1982, 02, 17"),new Date("2012, 02, 28"))})}),it("isBefore(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isBefore(new Date("2012, 02, 28")).exception(function(){test.date(date).isBefore(new Date("1982, 02, 17"))})}),it("isAfter(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isAfter(new Date("1982, 02, 17")).exception(function(){test.date(date).isAfter(new Date("2012, 02, 28"))})})})}),describe("Asserter error()",function(){describe("error() behavior",function(){it("Does not contains inappropriate assertions from the assertions containers",function(){var indicator=0,trigger=function(){throw new Error("Whoops!")},deletedAssertions=["isType","isNotType","isObject","isArray","isString","isNumber","isBool","isBoolean","isNull","isUndefined","isRegExp","isNotRegExp","isDate","isNotDate","isArguments","isNotArguments","isEmpty","isNotEmpty","hasLength","hasNotLength","hasProperties","hasNotProperties","hasOwnProperties","hasKeys","notHasKeys","hasValue","notHasValue","hasValues","notHasValues","contains","notContains","startsWith","notStartsWith","endsWith","notEndsWith"];test.value(test.error(trigger).hasHeader).isUndefined().value(test.error(trigger).isInfinite).isUndefined(),deletedAssertions.map(function(method){test.value(test.error(trigger)[method]).isUndefined(),indicator++});var error=test.error(trigger);test.exception(function(){test.value(error.hasMessage).isUndefined()}),test.number(indicator).isIdenticalTo(deletedAssertions.length)}),it("Fails if the tested exception is not an instance of Error",function(){var allCatch={number:!0,string:!0,object:!0,array:!0},status={number:!1,string:!1,object:!1,array:!1},check=function(name,trigger){try{test.error(trigger)}catch(e){status[name]=!0}},error=function(){throw new Error("foo")},number=function(){throw 1},string=function(){throw"Error"},object=function(){throw{name:Error,message:"Whoops!"}},array=function(){throw[Error]};test.error(error).when(function(){check("number",number),check("string",string),check("object",object),check("array",array)}).object(status).is(allCatch);var allCatch={number:!0,string:!0,object:!0,array:!0},status={number:!1,string:!1,object:!1,array:!1},check=function(name,trigger){try{test.exception(trigger)}catch(e){status[name]=!0}};test.exception(error).isError().when(function(){check("number",number),check("string",string),check("object",object),check("array",array)}).object(status).isNot(allCatch).is({number:!1,string:!1,object:!1,array:!1})}),it("dependency injection",function(){var spy=test.spy();test.$di.set("spyException",spy),test.error(function(){throw this.spyException("arg1","arg2"),new Error("Whoops!")}).bool(spy.calledOnce&&spy.calledWithExactly("arg1","arg2")).isTrue()})}),describe("Assertions of error()",function(){it("is(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).is(error).is(new Error("Whoops !"))["case"]("Test failure",function(){test.value(function(){test.error(trigger).is({message:"Whoops !"})})["throws"]().value(function(){test.error(trigger).is(new TypeError("Whoops !"))})["throws"]()})}),it("isNot(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isNot({message:"Whoops !"}).value(function(){test.error(trigger).isNot(error)})["throws"]()}),it("isIdenticalTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isIdenticalTo(error).value(function(){test.error(trigger).isIdenticalTo(new Error("Whoops !"))})["throws"]()}),it("isNotIdenticalTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isNotIdenticalTo(new Error("Whoops !")).value(function(){test.error(trigger).isNotIdenticalTo(error)})["throws"]()}),it("isEqualTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isEqualTo(error).value(function(){test.error(trigger).isEqualTo(new Error("Whoops !"))})["throws"]()}),it("isNotEqualTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.error(trigger).isNotEqualTo(new Error("Whoops !")).value(function(){test.error(trigger).isNotEqualTo(error)})["throws"]()}),it("match(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.error(trigger).match("Whoops!").match(/Whoops/).match(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.error(trigger).match("Hey")})["throws"]().value(function(){test.error(trigger).match(/Hey/)})["throws"]().value(function(){test.error(trigger).match(function(error){return error instanceof RegExp})})["throws"]()})}),it("notMatch(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.error(trigger).notMatch("Yeah an error").notMatch(/Yeah/).notMatch(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.error(trigger).notMatch("Whoops!")})["throws"]().value(function(){test.error(trigger).notMatch(/Whoops/)})["throws"]()})}),it("isValid(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.error(trigger).isValid("Whoops!").isValid(/Whoops/).isValid(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.error(trigger).isValid("Hey")})["throws"]().value(function(){test.error(trigger).isValid(/Hey/)})["throws"]().value(function(){test.error(trigger).isValid(function(error){return error instanceof RegExp})})["throws"]()})}),it("isNotValid(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.error(trigger).isNotValid("Yeah an error").isNotValid(/Yeah/).isNotValid(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.error(trigger).isNotValid("Whoops!")})["throws"]().value(function(){test.error(trigger).isNotValid(/Whoops/)})["throws"]()})}),it("isEnumerable(property)",function(){var error=new Error("Whoops !");error.foo="bar",test.error(function(){throw error}).isEnumerable("foo").value(function(){test.error(function(){throw error}).isEnumerable("message")})["throws"]()}),it("isNotEnumerable(property)",function(){var error=new Error("Whoops !");error.foo="bar",test.error(function(){throw error}).isNotEnumerable("message").value(function(){test.error(function(){throw error}).isNotEnumerable("foo")})["throws"]()}),it("isFrozen()",function(){var error=new Error("Whoops !"),frozenError=new Error("Whoops !"); Object.freeze(frozenError),test.error(function(){throw frozenError}).isFrozen().value(function(){test.error(function(){throw error}).isFrozen()})["throws"]()}),it("isNotFrozen()",function(){var error=new Error("Whoops !"),frozenError=new Error("Whoops !");Object.freeze(frozenError),test.error(function(){throw error}).isNotFrozen().value(function(){test.error(function(){throw frozenError}).isNotFrozen()})["throws"]()}),it("isInstanceOf(expected)",function(){test.error(function(){throw new TypeError("Whoops !")}).isInstanceOf(TypeError).value(function(){test.error(function(){throw new Error("Bad type")}).isInstanceOf(TypeError)})["throws"]()}),it("isNotInstanceOf(expected)",function(){test.error(function(){throw new Error("Whoops !")}).isNotInstanceOf(TypeError).value(function(){test.error(function(){throw new TypeError("Bad type")}).isNotInstanceOf(TypeError)})["throws"]()}),it("hasProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasProperty("message").hasProperty("message","Whoops !").hasProperty("constructor")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasProperty("foo")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasProperty("message","whoops")})["throws"]()})}),it("hasNotProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("foo").hasNotProperty("message","whoops")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("message")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("message","Whoops !")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("constructor")})["throws"]()})}),it("hasOwnProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("message").hasOwnProperty("message","Whoops !")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("foo")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("message","Grrrr !")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("constructor")})["throws"]()})}),it("hasNotOwnProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasNotOwnProperty("foo").hasNotOwnProperty("message","Grrrr !").hasNotOwnProperty("constructor")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message","Whoops !")})["throws"]()})}),it("hasKey(key [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasKey("message").hasKey("message","Whoops !").hasKey("constructor")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasKey("foo")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).hasKey("message","whoops")})["throws"]()})}),it("notHasKey(key [, value])",function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("foo").notHasKey("message","whoops")["case"]("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("message")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("message","Whoops !")})["throws"]().value(function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("constructor")})["throws"]()})}),it("hasMessage(expected)",function(){var exception,indicator=test.createCollection(),trigger=function(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")},resetIndicator=function(){indicator.setAll({})};test.error(trigger).hasMessage("I'm a ninja !").bool(indicator.get("error constructor called")).isTrue().then(resetIndicator()).error(trigger).hasMessage(/ninja/).bool(indicator.get("error constructor called")).isTrue().then(resetIndicator())["case"](exception=test.error(trigger)).error(function(){indicator.set("ninjaa is not in error message",!0),exception.hasMessage(/ninjaa/)}).bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue().then(resetIndicator()).value(function(){indicator.set("ninjaa is not in error message",!0),test.error(trigger).hasMessage(/ninjaa/)})["throws"]().bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue()})})}),describe("Asserter exception()",function(){describe("exception() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.exception(function(){throw new Error("hu")}).hasHeader).isUndefined().value(test.exception(function(){throw new Error("hu")}).isBetween).isUndefined()}),it("Takes a function that will throws an exception",function(){var indicator,trigger=function(){throw indicator=!0,new Error("I'm a ninja !")};test.exception(trigger).bool(indicator).isTrue().given(indicator=!1).exception(function(){throw indicator=!0,new Error("Whoops!")}).bool(indicator).isTrue()}),it("Error if the trigger don't throws an exception",function(){var indicator;test.given(indicator=!1).value(function(){test.exception(function(){indicator=!0})})["throws"]().bool(indicator).isTrue()}),it("Assert that thrown with the Error class and a given message",function(){var exception,indicator=test.createCollection(),fn=function(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")},resetIndicator=function(){indicator.setAll({})};test.exception(fn).isError().hasMessage("I'm a ninja !").bool(indicator.get("error constructor called")).isTrue().when(exception=test.exception(fn)).exception(function(){exception.isError().hasMessage("I'm a not ninja !")}).given(resetIndicator()).exception(fn).isError().hasMessage(/ninja/).bool(indicator.get("error constructor called")).isTrue().when(exception=test.exception(fn)).exception(function(){exception.isError().hasMessage(/ninjaa/)}).given(resetIndicator()).exception(function(){throw indicator.set("Whoops error, is called",!0),new Error("Whoops!")}).hasMessage("Whoops!").isInstanceOf(Error).bool(indicator.get("Whoops error, is called")).isTrue()}),it("dependency injection",function(){var spy=test.spy();test.$di.set("spyException",spy),test.exception(function(){throw this.spyException("arg1","arg2"),new Error("Whoops!")}).bool(spy.calledOnce&&spy.calledWithExactly("arg1","arg2")).isTrue()})}),describe("Assertions of exception()",function(){it("is(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).is(error).is(new Error("Whoops !"))["case"]("Test failure",function(){test.value(function(){test.exception(trigger).is({message:"Whoops !"})})["throws"]().value(function(){test.exception(trigger).is(new String("Whoops !"))})["throws"]()})}),it("isNot(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isNot({message:"Whoops !"}).value(function(){test.exception(trigger).isNot(error)})["throws"]()}),it("isIdenticalTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isIdenticalTo(error).value(function(){test.exception(trigger).isIdenticalTo(new Error("Whoops !"))})["throws"]()}),it("isNotIdenticalTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isNotIdenticalTo(new Error("Whoops !")).value(function(){test.exception(trigger).isNotIdenticalTo(error)})["throws"]()}),it("isEqualTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isEqualTo(error).value(function(){test.exception(trigger).isEqualTo(new Error("Whoops !"))})["throws"]()}),it("isNotEqualTo(expected)",function(){var error=new Error("Whoops !"),trigger=function(){throw error};test.exception(trigger).isNotEqualTo(new Error("Whoops !")).value(function(){test.exception(trigger).isNotEqualTo(error)})["throws"]()}),it("match(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.exception(trigger).match("Whoops!").match(/Whoops/).match(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.exception(trigger).match("Hey")})["throws"]().value(function(){test.exception(trigger).match(/Hey/)})["throws"]().value(function(){test.exception(trigger).match(function(error){return error instanceof RegExp})})["throws"]()})}),it("notMatch(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.exception(trigger).notMatch("Yeah an error").notMatch(/Yeah/).notMatch(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.exception(trigger).notMatch("Whoops!")})["throws"]().value(function(){test.exception(trigger).notMatch(/Whoops/)})["throws"]()})}),it("isValid(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.exception(trigger).isValid("Whoops!").isValid(/Whoops/).isValid(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.exception(trigger).isValid("Hey")})["throws"]().value(function(){test.exception(trigger).isValid(/Hey/)})["throws"]().value(function(){test.exception(trigger).isValid(function(error){return error instanceof RegExp})})["throws"]()})}),it("isNotValid(expected)",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error trigger called",!0),new Error("Whoops!")};test.exception(trigger).isNotValid("Yeah an error").isNotValid(/Yeah/).isNotValid(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue()["case"]("Test failure",function(){test.value(function(){test.exception(trigger).isNotValid("Whoops!")})["throws"]().value(function(){test.exception(trigger).isNotValid(/Whoops/)})["throws"]()})}),it("isType(expected)",function(){var trigger=function(){throw new Error("Whoops !")};test.exception(trigger).isType("object").exception(function(){throw"Whoops !"}).isType("string").value(function(){test.exception(trigger).isType("function")})["throws"]()}),it("isNotType(expected)",function(){var trigger=function(){throw new Error("Whoops !")};test.exception(trigger).isNotType("string").exception(function(){throw"Whoops !"}).isNotType("object").value(function(){test.exception(trigger).isNotType("object")})["throws"]()}),it("isObject()",function(){test.exception(function(){throw new Error("Whoops !")}).isObject().value(function(){test.exception(function(){throw"error"}).isObject()})["throws"]()}),it("isArray()",function(){test.exception(function(){throw["error"]}).isArray().value(function(){test.exception(function(){throw new Error("Whoops !")}).isArray()})["throws"]()}),it("isString()",function(){test.exception(function(){throw"error"}).isString().value(function(){test.exception(function(){throw new Error("Whoops !")}).isString()})["throws"]()}),it("isNumber()",function(){test.exception(function(){throw 0}).isNumber().value(function(){test.exception(function(){throw"0"}).isNumber()})["throws"]()}),it("isBool()",function(){test.exception(function(){throw!1}).isBool().value(function(){test.exception(function(){throw 0}).isBool()})["throws"]()}),it("isBoolean()",function(){test.exception(function(){throw!0}).isBoolean().value(function(){test.exception(function(){throw 1}).isBoolean()})["throws"]()}),it("isNull()",function(){test.exception(function(){throw null}).isNull().value(function(){test.exception(function(){throw 0}).isNull()})["throws"]()}),it("isUndefined()",function(){test.exception(function(){throw void 0}).isUndefined().value(function(){test.exception(function(){throw 0}).isUndefined()})["throws"]()}),it("isRegExp()",function(){test.exception(function(){throw new RegExp("whoops")}).isRegExp().value(function(){test.exception(function(){throw new Error("Whoops !")}).isRegExp()})["throws"]()}),it("isNotRegExp()",function(){test.exception(function(){throw new Error("Whoops !")}).isNotRegExp().value(function(){test.exception(function(){throw new RegExp("whoops")}).isNotRegExp()})["throws"]()}),it("isDate()",function(){test.exception(function(){throw new Date}).isDate().value(function(){test.exception(function(){throw new Error("Whoops !")}).isDate()})["throws"]()}),it("isNotDate()",function(){test.exception(function(){throw new Error("Whoops !")}).isNotDate().value(function(){test.exception(function(){throw new Date}).isNotDate()})["throws"]()}),it("isArguments()",function(){var error=function(){return arguments};test.exception(function(){throw error(1,2,3)}).isArguments().value(function(){test.exception(function(){throw new Error("Whoops !")}).isArguments()})["throws"]()}),it("isNotArguments()",function(){var error=function(){return arguments};test.exception(function(){throw new Error("Whoops !")}).isNotArguments().value(function(){test.exception(function(){throw error(1,2,3)}).isNotArguments()})["throws"]()}),it("isEmpty()",function(){test.exception(function(){throw""}).isEmpty().exception(function(){throw[]}).isEmpty().exception(function(){throw{}}).isEmpty().exception(function(){throw new Error("Whoops !")}).isEmpty().value(function(){test.exception(function(){throw"Whoops !"}).isEmpty()})["throws"]()}),it("isNotEmpty()",function(){test.exception(function(){throw"Whoops !"}).isNotEmpty()["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw""}).isNotEmpty()})["throws"]().value(function(){test.exception(function(){throw[]}).isNotEmpty()})["throws"]().value(function(){test.exception(function(){throw{}}).isNotEmpty()})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).isNotEmpty()})["throws"]()})}),it("isError()",function(){var indicator=test.createCollection(),trigger=function(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")},resetIndicator=function(){indicator.setAll({})};test.exception(trigger).isInstanceOf(Error).bool(indicator.get("error constructor called")).isTrue().given(resetIndicator()).exception(trigger).isError().bool(indicator.get("error constructor called")).isTrue()}),it("hasLength(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasLength(2).value(function(){test.exception(function(){throw{message:"error",code:42}}).hasLength(1)})["throws"]()}),it("hasNotLength(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasNotLength(1).hasNotLength(3).value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotLength(2)})["throws"]()}),it("isEnumerable(property)",function(){test.exception(function(){throw{message:"error",code:42}}).isEnumerable("message").isEnumerable("code").value(function(){test.exception(function(){throw new Error("Whoops !")}).isEnumerable("message")})["throws"]()}),it("isNotEnumerable(property)",function(){test.exception(function(){throw new Error("Whoops !")}).isNotEnumerable("message").value(function(){test.exception(function(){throw{message:"error",code:42}}).isNotEnumerable("message")})["throws"]()}),it("isFrozen()",function(){var error={message:"error",code:42},frozenError={message:"error",code:42};Object.freeze(frozenError),test.exception(function(){throw frozenError}).isFrozen().value(function(){test.exception(function(){throw error}).isFrozen()})["throws"]()}),it("isNotFrozen()",function(){var error={message:"error",code:42},frozenError={message:"error",code:42};Object.freeze(frozenError),test.exception(function(){throw error}).isNotFrozen().value(function(){test.exception(function(){throw frozenError}).isNotFrozen()})["throws"]()}),it("isInstanceOf(expected)",function(){test.exception(function(){throw new TypeError("Whoops !")}).isInstanceOf(TypeError).value(function(){test.exception(function(){throw new Error("Bad type")}).isInstanceOf(TypeError)})["throws"]()}),it("isNotInstanceOf(expected)",function(){test.exception(function(){throw new Error("Whoops !")}).isNotInstanceOf(TypeError).value(function(){test.exception(function(){throw new TypeError("Bad type")}).isNotInstanceOf(TypeError)})["throws"]()}),it("hasProperty(property [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).hasProperty("message").hasProperty("code",42).exception(function(){throw new Error("Whoops !")}).hasProperty("message").hasProperty("message","Whoops !").hasProperty("constructor")["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperty("foo")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperty("code",1)})["throws"]()})}),it("hasNotProperty(property [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperty("foo").hasNotProperty("code",1)["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperty("message")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperty("code",42)})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasNotProperty("constructor")})["throws"]()})}),it("hasOwnProperty(property [, value])",function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("message").hasOwnProperty("message","Whoops !")["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("foo")})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("message","Grrrr !")})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("constructor")})["throws"]()})}),it("hasNotOwnProperty(property [, value])",function(){test.exception(function(){throw new Error("Whoops !")}).hasNotOwnProperty("foo").hasNotOwnProperty("message","Grrrr !").hasNotOwnProperty("constructor")["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message")})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message","Whoops !")})["throws"]()})}),it("hasProperties(properties)",function(){test.exception(function(){throw{message:"error",code:42}}).hasProperties(["message","code"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperties(["message","code","foo"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperties(["message"])})["throws"]()})}),it("hasNotProperties(properties)",function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperties(["foo","bar"]).hasNotProperties(["foo","code","bar"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperties(["message","code"])})["throws"]()})}),it("hasOwnProperties(properties)",function(){test.exception(function(){throw{message:"error",code:42}}).hasOwnProperties(["message","code"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasOwnProperties(["message","code","foo"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasOwnProperties(["message"])})["throws"]()})}),it("hasKey(key [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).hasKey("message").hasKey("code",42).exception(function(){throw new Error("Whoops !")}).hasKey("message").hasKey("message","Whoops !").hasKey("constructor")["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKey("foo")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKey("code",1)})["throws"]()})}),it("notHasKey(key [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).notHasKey("foo").notHasKey("code",1)["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasKey("message")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasKey("code",42)})["throws"]().value(function(){test.exception(function(){throw new Error("Whoops !")}).notHasKey("constructor")})["throws"]()})}),it("hasKeys(keys)",function(){test.exception(function(){throw{message:"error",code:42}}).hasKeys(["message","code"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKeys(["message","code","foo"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKeys(["message"])})["throws"]()})}),it("notHasKeys(keys)",function(){test.exception(function(){throw{message:"error",code:42}}).notHasKeys(["foo","bar"]).notHasKeys(["foo","code","bar"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasKeys(["message","code"])})["throws"]()})}),it("hasValue(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasValue("error").hasValue(42)["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValue("err")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValue(2)})["throws"]()})}),it("notHasValue(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).notHasValue("err").notHasValue(2)["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValue("error")})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValue(42)})["throws"]()})}),it("hasValues(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasValues(["error"]).hasValues(["error",42])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValues(["foo"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValues(["error",42,"foo"])})["throws"]()})}),it("notHasValues(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).notHasValues(["code"]).notHasValues(["message","code","foo"])["case"]("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValues(["error"])})["throws"]().value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValues(["foo","error"])})["throws"]()})}),it("contains(expected [, ...])",function(){test.exception(function(){throw new Error("Whoops")}).contains({message:"Whoops"}).value(function(){test.exception(function(){throw new Error("Whoops")}).contains({message:"foo"})})["throws"]()}),it("notContains(expected [, ...])",function(){test.exception(function(){throw new Error("Whoops")}).notContains({message:"foo"}).value(function(){test.exception(function(){throw new Error("Whoops")}).notContains({message:"Whoops"})})["throws"]()}),it("startsWith(str)",function(){test.exception(function(){throw"An error occured"}).startsWith("An error").value(function(){test.exception(function(){throw"An error occured"}).startsWith("error")})["throws"]()}),it("notStartsWith(str)",function(){test.exception(function(){throw"An error occured"}).notStartsWith("error").value(function(){test.exception(function(){throw"An error occured"}).notStartsWith("An error")})["throws"]()}),it("endsWith(str)",function(){test.exception(function(){throw"An error occured"}).endsWith("occured").value(function(){test.exception(function(){throw"An error occured"}).endsWith("error")})["throws"]()}),it("notEndsWith(str)",function(){test.exception(function(){throw"An error occured"}).notEndsWith("error").value(function(){test.exception(function(){throw"An error occured"}).notEndsWith("occured")})["throws"]()}),it("hasMessage(expected)",function(){var exception,indicator=test.createCollection(),trigger=function(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")},resetIndicator=function(){indicator.setAll({})};test.exception(trigger).hasMessage("I'm a ninja !").bool(indicator.get("error constructor called")).isTrue().then(resetIndicator()).exception(trigger).hasMessage(/ninja/).bool(indicator.get("error constructor called")).isTrue().then(resetIndicator())["case"](exception=test.exception(trigger)).exception(function(){indicator.set("ninjaa is not in error message",!0),exception.hasMessage(/ninjaa/)}).bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue().then(resetIndicator()).value(function(){indicator.set("ninjaa is not in error message",!0),test.exception(trigger).hasMessage(/ninjaa/)})["throws"]().bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue()})})}),describe("Asserter function()",function(){describe("function() behavior",function(){it("Does not contains assertions from the assertions containers",function(){var fn=function(){};test.value(test["function"](fn).hasHeader).isUndefined().value(test["function"](fn).isAfter).isUndefined().value(test["function"](fn).hasMessage).isUndefined()}),it("Assert that the tested value is a `function`",function(){var fn=function(){};test["function"](fn)["function"](Date)["case"]("Test failure",function(){test.exception(function(){test["function"](fn())}).exception(function(){test["function"]({})}).exception(function(){test["function"]([])}).exception(function(){test["function"](new Date)}).exception(function(){test["function"]("foobar")}).exception(function(){test["function"](1)}).exception(function(){test["function"](!0)}).exception(function(){test["function"](!1)}).exception(function(){test["function"](null)}).exception(function(){test["function"](void 0)}).exception(function(){test["function"]()})})})}),describe("Assertions of function()",function(){it("is(expected)",function(){var fn=function(){},ref=fn;test["function"](ref).is(fn).exception(function(){test["function"](fn).is(function(){})})}),it("isNot(expected)",function(){var fn=function(){},otherFunction=function(){};test["function"](fn).isNot(otherFunction).isNot(function(){}).exception(function(){test["function"](fn).isNot(fn)})}),it("isIdenticalTo(expected)",function(){var fn=function(){},ref=fn;test["function"](ref).isIdenticalTo(fn).exception(function(){test["function"](fn).isIdenticalTo(function(){})})}),it("isNotIdenticalTo(expected)",function(){var fn=function(){},otherFunction=function(){};test["function"](fn).isNotIdenticalTo(otherFunction).isNotIdenticalTo(function(){}).exception(function(){test["function"](fn).isNotIdenticalTo(fn)})}),it("isEqualTo(expected)",function(){var fn=function(){},ref=fn;test["function"](ref).isEqualTo(fn).exception(function(){test["function"](fn).isEqualTo(function(){})})}),it("isNotEqualTo(expected)",function(){var fn=function(){},otherFunction=function(){};test["function"](fn).isNotEqualTo(otherFunction).isNotEqualTo(function(){}).exception(function(){test["function"](fn).isNotEqualTo(fn)})}),it("match(expected)",function(){function myFunction(){}var fn=function(){return"hello"};test["function"](fn).match("function").match("func").match(function(it){return"hello"===it()})["function"](Date).match("Date")["function"](myFunction).match("myFunction").match(/my/).match(/[a-z]/i)["case"]("Test failure",function(){test.exception(function(){test["function"](fn).match(function(it){return"hey"===it()})}).exception(function(){test["function"](fn).match("someFunction")}).exception(function(){test["function"](myFunction).match(/someFunction/)})})}),it("notMatch(expected)",function(){function myFunction(){}var fn=function(){return"hello"};test["function"](fn).notMatch("foo").notMatch(/[A-Z]/).notMatch(function(it){return"hey"===it()})["function"](Date).notMatch("foo")["function"](myFunction).notMatch("someFunction").notMatch(/some/)["case"]("Test failure",function(){test.exception(function(){test["function"](fn).notMatch(function(it){return"hello"===it()})}).exception(function(){test["function"](fn).notMatch("function")}).exception(function(){test["function"](myFunction).notMatch(/myFunction/)}).exception(function(){test["function"](myFunction).notMatch(/my/)}).exception(function(){test["function"](myFunction).notMatch("myFunction")})})}),it("isValid(expected)",function(){function myFunction(){}var fn=function(){return"hello"};test["function"](fn).isValid("function").isValid("func").isValid(function(it){return"hello"===it()})["function"](Date).isValid("Date")["function"](myFunction).isValid("myFunction").isValid(/my/).isValid(/[a-z]/i)["case"]("Test failure",function(){test.exception(function(){test["function"](fn).isValid(function(it){return"hey"===it()})}).exception(function(){test["function"](fn).isValid("someFunction")}).exception(function(){test["function"](myFunction).isValid(/someFunction/)})})}),it("isNotValid(expected)",function(){function myFunction(){}var fn=function(){return"hello"};test["function"](fn).isNotValid("foo").isNotValid(/[A-Z]/).isNotValid(function(it){return"hey"===it()})["function"](Date).isNotValid("foo")["function"](myFunction).isNotValid("someFunction").isNotValid(/some/)["case"]("Test failure",function(){test.exception(function(){test["function"](fn).isNotValid(function(it){return"hello"===it()})}).exception(function(){test["function"](fn).isNotValid("function")}).exception(function(){test["function"](myFunction).isNotValid(/myFunction/)}).exception(function(){test["function"](myFunction).isNotValid(/my/)}).exception(function(){test["function"](myFunction).isNotValid("myFunction")})})}),it("throws([constructor|expected], [expected])",function(){var fn=function(){},trigger=function(){throw new Error("Whoops!")};test["function"](trigger)["throws"]()["throws"]("Whoops!")["throws"](/whoops/i)["throws"](Error)["throws"](Error,/whoops/i)["case"]("Test failure",function(){test.value(function(){test["function"](fn)["throws"]()})["throws"]().value(function(){test["function"](trigger)["throws"](TypeError)})["throws"]().value(function(){test["function"](trigger)["throws"]("gloops")})["throws"]().value(function(){test["function"](trigger)["throws"](/gloops/)})["throws"]().value(function(){test["function"](trigger)["throws"](TypeError,"gloops") })["throws"]().value(function(){test["function"](trigger)["throws"](Error,"whoops")})["throws"]()})}),it("isError()",function(){var trigger=function(){throw new Error("Whoops!")};test["function"](trigger).isError()["case"]("Test failure",function(){test.value(function(){test["function"](function(){}).isError()})["throws"]().value(function(){test["function"](function(){throw"error"}).isError()})["throws"]()})}),it("hasName(expected)",function(){function myFunction(){}test["function"](Date).hasName("Date")["function"](myFunction).hasName("myFunction")["case"]("Test failure",function(){test.exception(function(){test["function"](new Date).hasName("RegExp")}).exception(function(){test["function"](myFunction).hasName("function")})})})})}),describe("Asserter number()",function(){describe("number() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.number(1).hasHeader).isUndefined().value(test.number(1).hasProperty).isUndefined().value(test.number(1).hasMessage).isUndefined()}),it("Assert that the tested value is a `number`",function(){test.number(2).number(99.98)["case"]("Test failure",function(){test.exception(function(){test.number("0")}).exception(function(){test.number("1")}).exception(function(){test.number(/0/)}).exception(function(){test.number(/1/)}).exception(function(){test.number(!0)}).exception(function(){test.number(!1)}).exception(function(){test.number(null)}).exception(function(){test.number(void 0)})})})}),describe("Assertions of number()",function(){it("is(expected)",function(){test.number(2).is(2)["case"]("Test failure",function(){test.exception(function(){test.number(2).is(-2)}).exception(function(){test.number(2).is(2.02)})})}),it("isNot(expected)",function(){test.number(2).isNot(3).isNot("2").isNot(2.1).isNot(.2).isNot(.02).isNot(-2).exception(function(){test.number(2).isNot(2)})}),it("isIdenticalTo(expected)",function(){test.number(1).isIdenticalTo(1)["case"]("Test failure",function(){test.exception(function(){test.number(2).isIdenticalTo(-2)}).exception(function(){test.number(2).isIdenticalTo(2.02)})})}),it("isNotIdenticalTo(expected)",function(){test.number(2).isNotIdenticalTo(3).isNotIdenticalTo("2").isNotIdenticalTo(2.1).isNotIdenticalTo(.2).isNotIdenticalTo(-2).exception(function(){test.number(2).isNotIdenticalTo(2)})}),it("isEqualTo(expected)",function(){test.number(1).isEqualTo(1).isEqualTo("1")["case"]("Test failure",function(){test.exception(function(){test.number(2).isEqualTo(-2)}).exception(function(){test.number(2).isEqualTo(2.02)})})}),it("isNotEqualTo(expected)",function(){test.number(2).isNotEqualTo(3).isNotEqualTo(-2).isNotEqualTo(2.1).isNotEqualTo("2.1").exception(function(){test.number(2).isNotEqualTo(2)})}),it("match(expected)",function(){test.number(2014).match(/20+[1-4]/).number(2014).match(201).number(2014).match(function(it){return 2014===it}).exception(function(){test.number(2).match(/3/)})}),it("notMatch(expected)",function(){test.number(2014).notMatch(/20+[5-6]/).notMatch(/[a-z]/).number(10).notMatch(8).number(10).notMatch(function(it){return 42===it})["case"]("Test failure",function(){test.exception(function(){test.number(2).notMatch(/2/)}).exception(function(){test.number(2014).notMatch(function(it){return 2014===it})})})}),it("isValid(expected)",function(){test.number(2014).isValid(/20+[1-4]/).number(2014).isValid(201).number(2014).isValid(function(it){return 2014===it}).exception(function(){test.number(2).isValid(/3/)})}),it("isNotValid(expected)",function(){test.number(2014).isNotValid(/20+[5-6]/).isNotValid(/[a-z]/).number(10).isNotValid(8).number(10).isNotValid(function(it){return 42===it})["case"]("Test failure",function(){test.exception(function(){test.number(2).isNotValid(/2/)}).exception(function(){test.number(2014).isNotValid(function(it){return 2014===it})})})}),it("matchEach(expected)",function(){test.number(2014).matchEach([2,4,1,0]).matchEach([2014,function(it){return 2014===it}])["case"]("Test failure",function(){test.exception(function(){test.number(2014).matchEach([2014,function(it){return 2041===it}])}).exception(function(){test.number(2).matchEach([2,3])}).exception(function(){test.number(2014).matchEach([2041,function(it){return 2014===it}])})})}),it("notMatchEach(expected)",function(){test.number(2014).notMatchEach([3,200]).notMatchEach([2012,function(it){return 2014!==it}])["case"]("Test failure",function(){test.exception(function(){test.number(2).notMatchEach([2,3])}).exception(function(){test.number(2014).notMatchEach([2041,function(it){return 2014===it}])}).exception(function(){test.number(2014).notMatchEach([2012,function(it){return 2014===it}])})})}),it("isBetween(begin, end)",function(){test.number(2).isBetween(2,4).number(3).isBetween(2,4).number(4).isBetween(2,4).number(4).isBetween(3.99,4.01).number(1).isBetween(-1.00000001,1.0000000001)["case"]("Test failure",function(){test.exception(function(){test.number(2).isBetween(-3,-1)}).exception(function(){test.number(2).isBetween(3,1)})})}),it("isNotBetween(begin, end)",function(){test.number(1).isNotBetween(2,4).number(5).isNotBetween(2,4).exception(function(){test.number(2).isNotBetween(1,3)})}),it("isBefore(expected)",function(){test.number(1).isBefore(2).isBefore(1.01).exception(function(){test.number(1).isBefore(0)})}),it("isAfter(expected)",function(){test.number(2).isAfter(1).isAfter(1.99).isAfter(-3).exception(function(){test.number(-1).isAfter(0)})}),it("isLessThan(expected)",function(){test.number(1).isLessThan(2).isLessThan(1.01).exception(function(){test.number(1).isLessThan(0)})}),it("isGreaterThan(expected)",function(){test.number(2).isGreaterThan(1).isGreaterThan(1.99).isGreaterThan(-3).exception(function(){test.number(-1).isGreaterThan(0)})}),it("isApprox(num, delta)",function(){test.number(99.98).isApprox(100,.02).exception(function(){test.number(99.98).isApprox(100,.01)})}),it("isInfinite()",function(){test.number(1/0).isInfinite().exception(function(){test.number(1.3333333333333333).isInfinite()})}),it("isNotInfinite()",function(){test.number(1.3333333333333333).isNotInfinite().exception(function(){test.number(1/0).isNotInfinite()})})})}),describe("Asserter object()",function(){describe("object() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.object({}).hasHeader).isUndefined().value(test.object({}).isError).isUndefined().value(test.object({}).hasMessage).isUndefined().value(test.object({}).isInfinite).isUndefined()}),it("Assert that the tested value is an `object`",function(){var Foo=function(){};test.object({}).object([]).object(new Date).object(new RegExp).object(new Foo)["case"]("Test failure",function(){test.exception(function(){test.object("Foo")}).exception(function(){test.object(Foo)}).exception(function(){test.object(1)}).exception(function(){test.object(void 0)}).exception(function(){test.object(!0)}).exception(function(){test.object(!1)}).exception(function(){test.object(null)}).exception(function(){test.object(function(){})})})})}),describe("Assertions of object()",function(){it("is(expected)",function(){test.object({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,1]}).exception(function(){test.object({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,2]})})}),it("isNot(expected)",function(){test.object({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,"1"]}).exception(function(){test.object({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,1]})})}),it("isIdenticalTo(expected)",function(){var obj={},obj2=obj;test.object(obj).isIdenticalTo(obj2).exception(function(){test.object(obj).isIdenticalTo({})})}),it("isNotIdenticalTo(expected)",function(){var obj={},obj2=obj;test.object(obj).isNotIdenticalTo({}).exception(function(){test.object(obj).isNotIdenticalTo(obj2)})}),it("isEqualTo(expected)",function(){var obj={},obj2=obj;test.object(obj).isEqualTo(obj2).exception(function(){test.object(obj).isEqualTo({})})}),it("isNotEqualTo(expected)",function(){var obj={foo:"bar"},obj2=obj;test.object(obj).isNotEqualTo({foo:"bar",baz:"bar"}).exception(function(){test.object(obj).isNotEqualTo(obj2)})}),it("match(expected)",function(){test.object({hello:"world"}).match(function(obj){return"world"==obj.hello}).exception(function(){test.object({hello:"world"}).match(function(obj){return"foo"==obj.hello})})}),it("notMatch(expected)",function(){test.object({hello:"world"}).notMatch(function(obj){return"E.T"==obj.hello}).exception(function(){test.object({hello:"world"}).notMatch(function(obj){return"world"==obj.hello})})}),it("isValid(expected)",function(){test.object({hello:"world"}).isValid(function(obj){return"world"==obj.hello}).exception(function(){test.object({hello:"world"}).isValid(function(obj){return"foo"==obj.hello})})}),it("isNotValid(expected)",function(){test.object({hello:"world"}).isNotValid(function(obj){return"E.T"==obj.hello}).exception(function(){test.object({hello:"world"}).isNotValid(function(obj){return"world"==obj.hello})})}),it("matchEach(expected)",function(){test.object({foo:"bar",hey:"you",joker:1}).matchEach(function(it,key){return"joker"==key?"number"==typeof it:"string"==typeof it}).exception(function(){test.object({foo:"bar",hey:"you",joker:1}).matchEach(function(it){return"string"==typeof it})})}),it("notMatchEach(expected)",function(){test.object({foo:"bar",hey:"you",joker:1}).notMatchEach(function(it,key){return"other"==key?!0:void 0}).exception(function(){test.object({foo:"bar",hey:"you",joker:1}).notMatchEach(function(it,key){return"foo"==key?!0:void 0})}).exception(function(){test.object({foo:"bar",hey:"you",joker:1}).notMatchEach(function(it){return"string"==typeof it})})}),it("isArray()",function(){test.object([]).isArray().exception(function(){test.object({}).isArray()}).exception(function(){test.object(new Date).isArray()})}),it("isRegExp()",function(){test.object(/[0-9]+/).isRegExp().exception(function(){test.object({}).isRegExp()}).exception(function(){test.object(new Date).isRegExp()})}),it("isNotRegExp()",function(){test.object(new Date).isNotRegExp().exception(function(){test.object(/[0-9]+/).isNotRegExp()})}),it("isDate()",function(){test.object(new Date).isDate().exception(function(){test.object({}).isDate()}).exception(function(){test.object(/[0-9]+/).isDate()})}),it("isNotDate()",function(){test.object(/[0-9]+/).isNotDate().exception(function(){test.object(new Date).isNotDate()})}),it("isArguments()",function(){var fn=function(){var args=arguments;test.object(arguments).isArguments(),test.object(args).isArguments()};fn(1,2,3),test.exception(function(){test.object({0:"a"}).isArguments()})}),it("isNotArguments()",function(){var fn=function(){test.object(arguments).isArguments().object([1,2,3]).isNotArguments().object({0:1,1:2,2:3}).isNotArguments()};fn(1,2,3),test.exception(function(){test.object(arguments).isNotArguments()})}),it("isEmpty()",function(){test.object({}).isEmpty().exception(function(){test.object({0:"a"}).isEmpty()})}),it("isNotEmpty()",function(){test.object({hello:"Nico"}).isNotEmpty().exception(function(){test.object({}).isNotEmpty()})}),it("hasLength(expected)",function(){test.object({foo:"bar",other:"baz"}).hasLength(2).exception(function(){test.object({foo:"bar",other:"baz"}).hasLength(3)})}),it("hasNotLength(expected)",function(){test.object({foo:"bar",other:"baz"}).hasNotLength(4).exception(function(){test.object({foo:"bar",other:"baz"}).hasNotLength(2)})}),it("isEnumerable(property)",function(){test.object({prop:"foobar"}).isEnumerable("prop").exception(function(){test.object({prop:"foobar"}).isEnumerable("length")})}),it("isNotEnumerable(property)",function(){test.object(Object.create({},{prop:{enumerable:0}})).isNotEnumerable("prop").exception(function(){test.object({prop:"foobar"}).isNotEnumerable("prop")})}),it("isFrozen()",function(){test.object(Object.freeze({})).isFrozen().exception(function(){test.object({}).isFrozen()})}),it("isNotFrozen()",function(){test.object({}).isNotFrozen().exception(function(){test.object(Object.freeze({})).isNotFrozen()})}),it("isInstanceOf(expected)",function(){test.object(new Date).isInstanceOf(Date).exception(function(){test.object(new Date).isInstanceOf(Error)})}),it("isNotInstanceOf(expected)",function(){test.object(new Date).isNotInstanceOf(RegExp).exception(function(){test.object(new Date).isNotInstanceOf(Object)}).exception(function(){test.object(new Date).isNotInstanceOf(Date)})}),it("hasProperty(property [, value])",function(){test.object({foo:"bar"}).hasProperty("foo").object({foo:"bar"}).hasProperty("foo","bar").exception(function(){test.object({foo:"bar"}).hasProperty("bar")}).exception(function(){test.object({foo:"bar"}).hasProperty("foo","ba")})}),it("hasNotProperty(property [, value])",function(){test.object({foo:"bar"}).hasNotProperty("bar").object({foo:"bar"}).hasNotProperty("foo","baz").exception(function(){test.object({foo:"bar"}).hasNotProperty("foo")}).exception(function(){test.object({foo:"bar"}).hasNotProperty("foo","bar")})}),it("hasOwnProperty(property [, value])",function(){test.object({foo:"bar"}).hasOwnProperty("foo").object({foo:"bar"}).hasOwnProperty("foo","bar").exception(function(){test.object({foo:"bar"}).hasOwnProperty("bar")}).exception(function(){test.object({foo:"bar"}).hasOwnProperty("foo","ba")})}),it("hasNotOwnProperty(property [, value])",function(){test.object({foo:"bar"}).hasNotOwnProperty("bar").object({foo:"bar"}).hasNotOwnProperty("foo","baz").exception(function(){test.object({foo:"bar"}).hasNotOwnProperty("foo")}).exception(function(){test.object({foo:"bar"}).hasNotOwnProperty("foo","bar")})}),it("hasProperties(properties)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasProperties(["other","bar","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasProperties(["other","bar"])})}),it("hasNotProperties(properties)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasNotProperties(["other","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasNotProperties(["bar","other","foo"])})}),it("hasOwnProperties(properties)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasOwnProperties(["other","bar","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasOwnProperties(["other","bar"])})}),it("hasKey(key [, value])",function(){test.object({foo:"bar"}).hasKey("foo").object({foo:"bar"}).hasKey("foo","bar").exception(function(){test.object({foo:"bar"}).hasKey("bar")}).exception(function(){test.object({foo:"bar"}).hasKey("foo","ba")})}),it("notHasKey(key [, value])",function(){test.object({foo:"bar"}).notHasKey("bar").object({foo:"bar"}).notHasKey("foo","baz").exception(function(){test.object({foo:"bar"}).notHasKey("foo")}).exception(function(){test.object({foo:"bar"}).notHasKey("foo","bar")})}),it("hasKeys(keys)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasKeys(["other","bar","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasKeys(["other","bar"])})}),it("notHasKeys(keys)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).notHasKeys(["other","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).notHasKeys(["bar","other","foo"])})}),it("hasValue(expected)",function(){test.object({life:42,love:69}).hasValue(42).exception(function(){test.object({life:42,love:69}).hasValue("42")})}),it("notHasValue(expected)",function(){test.object({life:42,love:69}).notHasValue(4).exception(function(){test.object({life:42,love:69}).notHasValue(42)})}),it("hasValues(expected)",function(){test.object({life:42,love:69}).hasValues([42,69]).exception(function(){test.object([1,42,3]).hasValues([42,3.01])})}),it("notHasValues(expected)",function(){test.object({life:42,love:69}).notHasValues([43,68]).exception(function(){test.object([1,42,3]).notHasValues([1,42,3])})}),it("contains(expected [, ...])",function(){test.object({a:{b:10},b:{c:10,d:11,a:{b:10,c:11}}}).contains({a:{b:10},b:{c:10,a:{c:11}}}).object({a:"a",b:{c:"c"}}).contains({b:{c:"c"}}).contains({b:{c:"c"}},{a:"a"}).exception(function(){test.object({foo:{a:"a"},bar:{b:"b",c:"c"}}).contains({foo:{a:"a"}},{bar:{b:"c"}})})}),it("notContains(expected [, ...])",function(){test.object({a:"a"},{b:"b",c:"c"}).notContains({c:"b"}).exception(function(){test.object({foo:{a:"a"},bar:{b:"b",c:"c"}}).notContains({foo:{a:"a"},bar:{c:"c"}})})}),it("hasName(expected)",function(){test.object(new Date(2010,5,28)).hasName("Date").exception(function(){test.object(new Date(2010,5,28)).hasName("date")})})})}),describe("Asserter regexp()",function(){describe("regexp() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.regexp(new RegExp).hasHeader).isUndefined().value(test.regexp(new RegExp).hasMessage).isUndefined().value(test.regexp(new RegExp).isInfinite).isUndefined()}),it("Assert that the tested value is an instance of `RegExp`",function(){test.regexp(/foobar/).regexp(new RegExp("foo","i"))["case"]("Test failure",function(){test.exception(function(){test.regexp({})}).exception(function(){test.regexp([])}).exception(function(){test.regexp("")}).exception(function(){test.regexp()}).exception(function(){test.regexp(void 0)}).exception(function(){test.regexp(null)}).exception(function(){test.regexp(!0)}).exception(function(){test.regexp(!1)}).exception(function(){test.regexp(0)}).exception(function(){test.regexp(1)}).exception(function(){test.regexp("[a-z]")}).exception(function(){test.regexp("/foobar/")}).exception(function(){test.regexp(RegExp)}).exception(function(){test.regexp(new Date)})})})}),describe("Assertions of regexp()",function(){it("is(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).is(new RegExp(/[a-z]/)).exception(function(){test.regexp(regexp).is(/A-Z/)})}),it("isNot(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).isNot(new RegExp(/[A-Z]/)).exception(function(){test.regexp(regexp).isNot(/[a-z]/)})}),it("isIdenticalTo(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isIdenticalTo(ref).exception(function(){test.regexp(regexp).isIdenticalTo(/[a-z]/)})}),it("isNotIdenticalTo(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).isNotIdenticalTo(new RegExp(/[a-z]/)).exception(function(){test.regexp(regexp).isNotIdenticalTo(regexp)})}),it("isEqualTo(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isEqualTo(ref).exception(function(){test.regexp(regexp).isEqualTo(/[a-z]/)})}),it("isNotEqualTo(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).isNotEqualTo(new RegExp(/[a-z]/)).exception(function(){test.regexp(regexp).isNotEqualTo(regexp)})}),it("match(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).match(function(reg){return reg===ref}).exception(function(){test.regexp(regexp).match(function(actual){return"[A-Z]"==actual.source})})}),it("notMatch(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).notMatch(function(actual){var reg=new RegExp(/[a-z]/);return reg===ref||reg===actual}).exception(function(){test.regexp(regexp).notMatch(function(actual){return"[a-z]"==actual.source})})}),it("isValid(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isValid(function(reg){return reg===ref}).exception(function(){test.regexp(regexp).isValid(function(actual){return"[A-Z]"==actual.source})})}),it("isNotValid(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isNotValid(function(actual){var reg=new RegExp(/[a-z]/);return reg===ref||reg===actual}).exception(function(){test.regexp(regexp).isNotValid(function(actual){return"[a-z]"==actual.source})})}),it("isEnumerable(property)",function(){var regexp=new RegExp(/[a-z]/);Object.defineProperty(regexp,"myCustom",{enumerable:!0,value:"static"}),test.regexp(regexp).isEnumerable("myCustom").exception(function(){test.regexp(regexp).isEnumerable("ignoreCase")})}),it("isNotEnumerable(property)",function(){var regexp=new RegExp(/[a-z]/);Object.defineProperty(regexp,"myCustom",{enumerable:!0,value:"static"}),test.regexp(regexp).isNotEnumerable("lastIndex").isNotEnumerable("ignoreCase").isNotEnumerable("multiline").exception(function(){test.regexp(regexp).isNotEnumerable("myCustom")})}),it("isFrozen",function(){var regexp=new RegExp(/[a-z]/);Object.freeze(regexp),test.regexp(regexp).isFrozen().exception(function(){test.regexp(/[a-z]/).isFrozen()})}),it("isNotFrozen",function(){var regexp=new RegExp(/[a-z]/),regexpFrozen=new RegExp(/[a-z]/);Object.freeze(regexpFrozen),test.regexp(regexp).isNotFrozen().exception(function(){test.regexp(regexpFrozen).isNotFrozen()})}),it("hasProperty(property [, value])",function(){test.regexp(/[a-z]/).hasProperty("lastIndex").hasProperty("constructor").exception(function(){test.regexp(/[a-z]/).hasProperty("foo")})}),it("hasNotProperty(property [, value])",function(){test.regexp(/[a-z]/).hasNotProperty("foobar").exception(function(){test.regexp(/[a-z]/).hasNotProperty("lastIndex")})}),it("hasOwnProperty(property [, value])",function(){test.regexp(/[a-z]/).hasOwnProperty("lastIndex").exception(function(){test.regexp(/[a-z]/).hasOwnProperty("constructor")})}),it("hasNotOwnProperty(property [, value])",function(){test.regexp(/[a-z]/).hasNotOwnProperty("constructor").exception(function(){test.regexp(/[a-z]/).hasNotOwnProperty("lastIndex")})}),it("hasKey(key [,value ])",function(){test.regexp(/[a-z]/).hasKey("lastIndex").hasKey("constructor").exception(function(){test.regexp(/[a-z]/).hasKey("foo")})}),it("notHasKey(key [,value])",function(){test.regexp(/[a-z]/).notHasKey("foobar").exception(function(){test.regexp(/[a-z]/).notHasKey("lastIndex")})})})}),describe("Asserter string()",function(){describe("string() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.string("").hasHeader).isUndefined().value(test.string("").hasProperty).isUndefined().value(test.string("").hasMessage).isUndefined().value(test.string("").isInfinite).isUndefined()}),it("Assert that the tested value is a `string`",function(){test.string("").string("Hello")["case"]("Test failure",function(){test.exception(function(){test.string()}).exception(function(){test.string({})}).exception(function(){test.string([])}).exception(function(){test.string(1)}).exception(function(){test.string(/foobar/)}).exception(function(){test.string(!0)}).exception(function(){test.string(!1)}).exception(function(){test.string(null)}).exception(function(){test.string(void 0)})})})}),describe("Assertions of string()",function(){it("is(expected)",function(){var str="Hello world !";test.string(str).is("Hello world !").exception(function(){test.string(str).is("foo")})}),it("isNot(expected)",function(){var str="Hello world !";test.string(str).isNot("hello world !").exception(function(){test.string(str).isNot("Hello world !")})}),it("isIdenticalTo(expected)",function(){var str="Hello world !";test.string(str).isIdenticalTo("Hello world !").exception(function(){test.string(str).isIdenticalTo("Hello World !")})}),it("isNotIdenticalTo(expected)",function(){var str="Hello world !";test.string(str).isNotIdenticalTo("hello world !").exception(function(){test.string(str).isNotIdenticalTo("Hello world !")})}),it("isEqualTo(expected)",function(){var str="Hello world !";test.string(str).isEqualTo("Hello world !").exception(function(){test.string(str).isEqualTo("Hello World !")})}),it("isNotEqualTo(expected)",function(){var str="Hello world !";test.string(str).isNotEqualTo("hello world !").exception(function(){test.string(str).isNotEqualTo("Hello world !")})}),it("match(expected)",function(){test.string("Hello").match("Hello"),test.string("Hello world !").match(/world/i),test.string("hello").match(function(it){return"hello"===it}),test.exception(function(){test.string("hello").match(/foo/)})}),it("notMatch(expected)",function(){test.string("foobar").notMatch("some value").notMatch(/[foo]+bazzz$/).string("foo").notMatch(function(it){return"bar"===it}).exception(function(){test.string("Hello Nico!").notMatch(/nico/i)})}),it("isValid(expected)",function(){test.string("Hello").isValid("Hello"),test.string("Hello world !").isValid(/world/i),test.string("hello").isValid(function(it){return"hello"===it}),test.exception(function(){test.string("hello").isValid(/foo/)})}),it("isNotValid(expected)",function(){test.string("foobar").isNotValid("some value").isNotValid(/[foo]+bazzz$/).string("foo").isNotValid(function(it){return"bar"===it}).exception(function(){test.string("Hello Nico!").notMatch(/nico/i)})}),it("matchEach(expected)",function(){var str="Hello Nico!";test.string(str).matchEach([/hello/i,"Nico",function(it){return"Hello Nico!"===it}])["case"]("Test failure",function(){test.exception(function(){test.string(str).matchEach([/hello/i,"nico",function(it){return"Hello Nico!"===it}])}).exception(function(){test.string(str).matchEach([/hello/i,"Nico",function(it){return"Hello nico!"===it}])})})}),it("notMatchEach(expected)",function(){var str="Hello Nico!";test.string(str).notMatchEach([/foo/i,"bad word",function(it){return"Bye"===it}])["case"]("Test failure",function(){test.exception(function(){test.string(str).notMatchEach([/hello/,"Nico",function(it){return"Hello !"===it}])}).exception(function(){test.string(str).notMatchEach([/hello/,"nico",function(it){return"Hello Nico!"===it}])})})}),it("isEmpty()",function(){test.string("").isEmpty().exception(function(){test.string(str).isEmpty()})}),it("isNotEmpty()",function(){test.string("a").isNotEmpty().exception(function(){test.string("").isNotEmpty()})}),it("hasLength(expected)",function(){test.string("Hello Nico").hasLength(10).exception(function(){test.string("abc").hasLength(4)})}),it("hasNotLength(expected)",function(){test.string("Hello Nico").hasNotLength(11).exception(function(){test.string("abc").hasNotLength(3)})}),it("hasValue(expected)",function(){test.string("Hello, Nico!").hasValue("Nico").exception(function(){test.string("Hello").hasValue("hello")})}),it("notHasValue(expected)",function(){test.string("Hello, Nico!").notHasValue("Bye").exception(function(){test.string("Hello").notHasValue("Hello")})}),it("hasValues(expected)",function(){test.string("Hello Nico!").hasValues(["Hello","Nico"]).exception(function(){test.string("Hello Nico!").hasValues(["Hi","Nico"])})}),it("notHasValues(expected)",function(){test.string("Sarah Connor ?").notHasValues(["next","door"]).exception(function(){test.string("Hello Nico!").notHasValues(["Hi","Nico"])})}),it("contains(expected [, ...])",function(){test.string("hello boy").contains("boy").string("KISS principle : Keep it Simple, Stupid").contains(["Simple"],["principle"],[":"]).exception(function(){test.string("Hello").contains("hello")})}),it("notContains(expected [, ...])",function(){test.string("hello boy").notContains("bye").exception(function(){test.string("Hello").notContains("Hello")})}),it("startsWith(str)",function(){test.string("foobar").startsWith("foo").exception(function(){test.string("Hello the world").startsWith("world")})}),it("notStartsWith(str)",function(){test.string("foobar").notStartsWith("bar").exception(function(){test.string("Hello the world").notStartsWith("Hello")})}),it("endsWith(str)",function(){test.string("foobar").endsWith("bar").exception(function(){test.string("Hello the world").endsWith("Hello")})}),it("notEndsWith(str)",function(){test.string("foobar").notEndsWith("foo").exception(function(){test.string("Hello the world").notEndsWith("world")})})})});var rawAssertions=__webpack_require__(1);describe("Asserter undefined()",function(){describe("undefined() behavior",function(){it("Does not contains assertions from the assertions containers",function(){var assertions=rawAssertions.call(this,void 0);for(var method in assertions)("hasOwnProperty"!=method||test.undefined(void 0)[method]!==Object.hasOwnProperty)&&test.value(test.undefined(void 0)[method]).isUndefined();test.exception(function(){test.value(test.undefined(void 0).hasOwnProperty).isUndefined()})}),it("Assert that the tested value is `undefined`",function(){test.undefined(void 0).undefined()["case"]("Test failure",function(){test.exception(function(){test.undefined(0)}).exception(function(){test.undefined(1)}).exception(function(){test.undefined("undefined")}).exception(function(){test.undefined(null)}).exception(function(){test.undefined(!1)}).exception(function(){test.undefined(!0)}).exception(function(){test.undefined("")}).exception(function(){test.undefined([])}).exception(function(){test.undefined({})}).exception(function(){test.undefined(function(){})})})})})});var rawAssertions=__webpack_require__(1);describe("Asserter value()",function(){describe("value() behavior",function(){it("value() has all assertions",function(){var assertions=rawAssertions.call(this,void 0);for(var method in assertions)test.value(test.value(void 0)[method]).exists();test.exception(function(){test.value(test.value(void 0).foobar_not_exist).exists()})})}),describe("Assertions of value()",function(){it("is(expected)",function(){test.value({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,1]}).exception(function(){test.value({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,2]})})}),it("isNot(expected)",function(){test.value({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,"1"]}).exception(function(){test.value({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,1]})})}),it("isIdenticalTo(expected)",function(){test.value(1).isIdenticalTo(1).exception(function(){test.value(1).isIdenticalTo(2)})}),it("isNotIdenticalTo(expected)",function(){test.value("1").isNotIdenticalTo(1).exception(function(){test.value(1).isNotIdenticalTo(1)})}),it("isEqualTo(expected)",function(){test.value("1").isEqualTo(1).exception(function(){test.value(1).isEqualTo(1.1)})}),it("isNotEqualTo(expected)",function(){test.value("foobar").isNotEqualTo([]).exception(function(){test.value("foobar").isNotEqualTo("foobar")})}),it("match(expected)",function(){test.value("foobar").match(/[fo]+bar$/).value(["a","b","c"]).match(/[a-z]/).value(10).match(10).exception(function(){test.value("foobar").match("whoops")})}),it("notMatch(expected)",function(){test.value("foobar").notMatch(/[foo]+bazzz$/).value(["a","b","c"]).notMatch(/[d-z]/).value(10).notMatch(8).exception(function(){test.value("foobar").notMatch("foobar")})}),it("matchEach(expected)",function(){test.value([10,11,12]).matchEach(function(it){return it>=10}).exception(function(){test.value([10,11,12]).matchEach(function(it){return it>=11})})}),it("notMatchEach(expected)",function(){test.value([10,11,12]).notMatchEach(function(it){return it>=13}).exception(function(){test.value([10,11,12]).notMatchEach(function(it){return it>=11})})}),it("isValid(expected)",function(){test.value(42).isValid(function(actual){return 42===actual}).exception(function(){test.value(42).isValid(function(actual){return"expected value"===actual})})}),it("isNotValid(expected)",function(){test.value(42).isNotValid(function(actual){return 44===actual}).exception(function(){test.value(42).isNotValid(function(actual){return 42===actual})})}),it("isType(expected)",function(){test.value("foobar").isType("string").value(0).isType("number").value(1).isType("number").value(1.2).isType("number").value("1").isType("string").value({}).isType("object").value(void 0).isType("undefined").value(null).isType("object").value(!0).isType("boolean").value(!1).isType("boolean").exception(function(){test.value("1").isType("number")})}),it("isNotType(expected)",function(){test.value({}).isNotType("string").value("0").isNotType("number").value("1").isNotType("number").value("1.2").isNotType("number").value(1).isNotType("string").value(null).isNotType("undefined").value(void 0).isNotType("object").value("true").isNotType("boolean").value("false").isNotType("boolean").exception(function(){test.value("1").isNotType("string") diff --git a/browser/test/unit.js b/browser/test/unit.js index d875e08..1dbebb5 100644 --- a/browser/test/unit.js +++ b/browser/test/unit.js @@ -1,30 +1,51 @@ -/*! Unit.js v1.1.1 | (c) 2014 Nicolas Tallefourtane | http://unitjs.com/license.html */ -/*! Sinon.JS v1.12.1 | (c) 2014 Christian Johansen (christian@cjohansen.no) | https://github.com/cjohansen/Sinon.JS/blob/master/LICENSE */ -!function(e,t){"function"==typeof define&&define.amd?define([],function(){return e.sinon=t()}):"object"==typeof exports?module.exports=t():e.sinon=t()}(this,function(){var samsam,formatio;!function(){function define(e,t,n){"samsam"==e?samsam=t():"function"==typeof t&&0===e.length?lolex=t():"function"==typeof n&&(formatio=n(samsam))}define.amd={},("function"==typeof define&&define.amd&&function(e){define("samsam",e)}||"object"==typeof module&&function(e){module.exports=e()}||function(e){this.samsam=e()})(function(){function e(e){var t=e;return"number"==typeof e&&e!==t}function t(e){return f.toString.call(e).split(/[ \]]/)[1]}function n(e){if("Arguments"===t(e))return!0;if("object"!=typeof e||"number"!=typeof e.length||"Array"===t(e))return!1;if("function"==typeof e.callee)return!0;try{e[e.length]=6,delete e[e.length]}catch(n){return!0}return!1}function r(e){if(!e||1!==e.nodeType||!d)return!1;try{e.appendChild(d),e.removeChild(d)}catch(t){return!1}return!0}function i(e){var t,n=[];for(t in e)f.hasOwnProperty.call(e,t)&&n.push(t);return n}function o(e){return"function"==typeof e.getTime&&e.getTime()==e.valueOf()}function s(e){return 0===e&&1/e===-1/0}function a(t,n){return t===n||e(t)&&e(n)?0!==t||s(t)===s(n):void 0}function u(s,u){function l(e){return"object"!=typeof e||null===e||e instanceof Boolean||e instanceof Date||e instanceof Number||e instanceof RegExp||e instanceof String?!1:!0}function c(e,t){var n;for(n=0;nq;q++){if(j=k[q],!f.hasOwnProperty.call(u,j))return!1;if(R=s[j],D=u[j],N=l(R),I=l(D),P=N?c(d,R):-1,M=I?c(h,D):-1,L=-1!==P?p[P]:v+"["+JSON.stringify(j)+"]",F=-1!==M?m[M]:w+"["+JSON.stringify(j)+"]",y[L+F])return!0;if(-1===P&&N&&(d.push(R),p.push(L)),-1===M&&I&&(h.push(D),m.push(F)),N&&I&&(y[L+F]=!0),!g(R,D,L,F))return!1}return!0}(s,u,"$1","$2")}function l(e,t){if(0===t.length)return!0;var n,r,i,o;for(n=0,r=e.length;r>n;++n)if(c(e[n],t[0])){for(i=0,o=t.length;o>i;++i)if(!c(e[n+i],t[i]))return!1;return!0}return!1}var c,f=Object.prototype,d="undefined"!=typeof document&&document.createElement("div");return c=function h(e,n){if(n&&"function"==typeof n.test)return n.test(e);if("function"==typeof n)return n(e)===!0;if("string"==typeof n){n=n.toLowerCase();var r="string"==typeof e||!!e;return r&&String(e).toLowerCase().indexOf(n)>=0}if("number"==typeof n)return n===e;if("boolean"==typeof n)return n===e;if("Array"===t(e)&&"Array"===t(n))return l(e,n);if(n&&"object"==typeof n){var i;for(i in n){var o=e[i];if("undefined"==typeof o&&"function"==typeof e.getAttribute&&(o=e.getAttribute(i)),"undefined"==typeof o||!h(o,n[i]))return!1}return!0}throw new Error("Matcher was not a string, a number, a function, a boolean or an object")},{isArguments:n,isElement:r,isDate:o,isNegZero:s,identical:a,deepEqual:u,match:c,keys:i}}),("function"==typeof define&&define.amd&&function(e){define("formatio",["samsam"],e)}||"object"==typeof module&&function(e){module.exports=e(require("samsam"))}||function(e){this.formatio=e(this.samsam)})(function(e){function t(e){if(!e)return"";if(e.displayName)return e.displayName;if(e.name)return e.name;var t=e.toString().match(/function\s+([^\(]+)/m);return t&&t[1]||""}function n(e,n){var r,i,o=t(n&&n.constructor),a=e.excludeConstructors||s.excludeConstructors||[];for(r=0,i=a.length;i>r;++r){if("string"==typeof a[r]&&a[r]===o)return"";if(a[r].test&&a[r].test(o))return""}return o}function r(e,t){if("object"!=typeof e)return!1;var n,r;for(n=0,r=t.length;r>n;++n)if(t[n]===e)return!0;return!1}function i(t,n,o,s){if("string"==typeof n){var u=t.quoteStrings,l="boolean"!=typeof u||u;return o||l?'"'+n+'"':n}if("function"==typeof n&&!(n instanceof RegExp))return i.func(n);if(o=o||[],r(n,o))return"[Circular]";if("[object Array]"===Object.prototype.toString.call(n))return i.array.call(t,n,o);if(!n)return String(1/n===-1/0?"-0":n);if(e.isElement(n))return i.element(n);if("function"==typeof n.toString&&n.toString!==Object.prototype.toString)return n.toString();var c,f;for(c=0,f=a.length;f>c;c++)if(n===a[c].object)return a[c].value;return i.object.call(t,n,o,s)}function o(e){for(var t in e)this[t]=e[t]}var s={excludeConstructors:["Object",/^.$/],quoteStrings:!0,limitChildrenCount:0},a=(Object.prototype.hasOwnProperty,[]);return"undefined"!=typeof global&&a.push({object:global,value:"[object global]"}),"undefined"!=typeof document&&a.push({object:document,value:"[object HTMLDocument]"}),"undefined"!=typeof window&&a.push({object:window,value:"[object Window]"}),i.func=function(e){return"function "+t(e)+"() {}"},i.array=function(e,t){t=t||[],t.push(e);var n,r,o=[];for(r=this.limitChildrenCount>0?Math.min(this.limitChildrenCount,e.length):e.length,n=0;r>n;++n)o.push(i(this,e[n],t));return r0?Math.min(this.limitChildrenCount,p.length):p.length,c=0;d>c;++c)a=p[c],l=t[a],u=r(l,o)?"[Circular]":i(this,l,o,s+2),u=(/\s/.test(a)?'"'+a+'"':a)+": "+u,m+=u.length,h.push(u);var y=n(this,t),g=y?"["+y+"] ":"",v="";for(c=0,f=s;f>c;++c)v+=" ";return d80?g+"{\n "+v+h.join(",\n "+v)+"\n"+v+"}":g+"{ "+h.join(", ")+" }"},i.element=function(e){var t,n,r,i,o,s=e.tagName.toLowerCase(),a=e.attributes,u=[];for(r=0,i=a.length;i>r;++r)t=a.item(r),n=t.nodeName.toLowerCase().replace("html:",""),o=t.nodeValue,("contenteditable"!==n||"inherit"!==o)&&o&&u.push(n+'="'+o+'"');var l="<"+s+(u.length>0?" ":""),c=e.innerHTML;c.length>20&&(c=c.substr(0,20)+"[...]");var f=l+u.join(" ")+">"+c+"";return f.replace(/ contentEditable="inherit"/,"")},o.prototype={functionName:t,configure:function(e){return new o(e)},constructorName:function(e){return n(this,e)},ascii:function(e,t,n){return i(this,e,t,n)}},o.prototype}),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.lolex=e()}}(function(){var define,module,exports;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s3||!/^(\d\d:){0,2}\d\d?$/.test(e))throw new Error("tick only understands numbers and 'h:m:s'");for(;i--;){if(t=parseInt(n[i],10),t>=60)throw new Error("Invalid time "+e);o+=t*Math.pow(60,r-i-1)}return 1e3*o}function getEpoch(e){if(!e)return 0;if("function"==typeof e.getTime)return e.getTime();if("number"==typeof e)return e;throw new TypeError("now should be milliseconds since UNIX epoch")}function inRange(e,t,n){return n&&n.callAt>=e&&n.callAt<=t}function mirrorDateProperties(e,t){t.now?e.now=function(){return e.clock.now}:delete e.now,t.toSource?e.toSource=function(){return t.toSource()}:delete e.toSource,e.toString=function(){return t.toString()},e.prototype=t.prototype,e.parse=t.parse,e.UTC=t.UTC,e.prototype.toUTCString=t.prototype.toUTCString;for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function createDate(){function e(t,n,r,i,o,s,a){switch(arguments.length){case 0:return new NativeDate(e.clock.now);case 1:return new NativeDate(t);case 2:return new NativeDate(t,n);case 3:return new NativeDate(t,n,r);case 4:return new NativeDate(t,n,r,i);case 5:return new NativeDate(t,n,r,i,o);case 6:return new NativeDate(t,n,r,i,o,s);default:return new NativeDate(t,n,r,i,o,s,a)}}return mirrorDateProperties(e,NativeDate)}function addTimer(e,t){if("undefined"==typeof t.func)throw new Error("Callback must be provided to timer calls");return e.timers||(e.timers={}),t.id=id++,t.createdAt=e.now,t.callAt=e.now+(t.delay||0),e.timers[t.id]=t,addTimerReturnsObject?{id:t.id,ref:function(){},unref:function(){}}:t.id}function firstTimerInRange(e,t,n){var r=e.timers,i=null;for(var o in r)inRange(t,n,r[o])&&(!i||~compareTimers(i,r[o]))&&(i=r[o]);return i}function compareTimers(e,t){return e.callAtt.callAt?1:e.immediate&&!t.immediate?-1:!e.immediate&&t.immediate?1:e.createdAtt.createdAt?1:e.idt.id?1:void 0}function callTimer(clock,timer){"number"==typeof timer.interval?clock.timers[timer.id].callAt+=timer.interval:delete clock.timers[timer.id];try{"function"==typeof timer.func?timer.func.apply(null,timer.args):eval(timer.func)}catch(e){var exception=e}if(clock.timers[timer.id]){if(exception)throw exception}else if(exception)throw exception}function uninstall(e,t){for(var n,r=0,i=e.methods.length;i>r;r++)if(n=e.methods[r],t[n].hadOwnProperty)t[n]=e["_"+n];else try{delete t[n]}catch(o){}e.methods=[]}function hijackMethod(e,t,n){if(n[t].hadOwnProperty=Object.prototype.hasOwnProperty.call(e,t),n["_"+t]=e[t],"Date"==t){var r=mirrorDateProperties(n[t],e[t]);e[t]=r}else{e[t]=function(){return n[t].apply(n,arguments)};for(var i in n[t])n[t].hasOwnProperty(i)&&(e[t][i]=n[t][i])}e[t].clock=n}var timeoutResult=setTimeout(function(){},0),addTimerReturnsObject="object"==typeof timeoutResult;clearTimeout(timeoutResult);var NativeDate=Date,id=1,timers={setTimeout:setTimeout,clearTimeout:clearTimeout,setImmediate:"undefined"!=typeof setImmediate?setImmediate:void 0,clearImmediate:"undefined"!=typeof clearImmediate?clearImmediate:void 0,setInterval:setInterval,clearInterval:clearInterval,Date:Date},keys=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};exports.timers=timers;var createClock=exports.createClock=function(e){var t={now:getEpoch(e),timeouts:{},Date:createDate()};return t.Date.clock=t,t.setTimeout=function(e,n){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,2),delay:n})},t.clearTimeout=function(e){e&&(t.timers||(t.timers=[]),"object"==typeof e&&(e=e.id),e in t.timers&&delete t.timers[e])},t.setInterval=function(e,n){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,2),delay:n,interval:n})},t.clearInterval=function(e){t.clearTimeout(e)},t.setImmediate=function(e){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,1),immediate:!0})},t.clearImmediate=function(e){t.clearTimeout(e)},t.tick=function(e){e="number"==typeof e?e:parseTime(e);for(var n,r=t.now,i=t.now+e,o=t.now,s=firstTimerInRange(t,r,i);s&&i>=r;){if(t.timers[s.id]){r=t.now=s.callAt;try{callTimer(t,s)}catch(a){n=n||a}}s=firstTimerInRange(t,o,i),o=r}if(t.now=i,n)throw n;return t.now},t.reset=function(){t.timers={}},t};exports.install=function(e,t,n){"number"==typeof e&&(n=t,t=e,e=null),e||(e=global);var r=createClock(t);r.uninstall=function(){uninstall(r,e)},r.methods=n||[],0===r.methods.length&&(r.methods=keys(timers));for(var i=0,o=r.methods.length;o>i;i++)hijackMethod(e,r.methods[i],r);return r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})}();var define,sinon=function(){"use strict";function e(e,n,r){t=r.exports=e("./sinon/util/core"),e("./sinon/extend"),e("./sinon/typeOf"),e("./sinon/times_in_words"),e("./sinon/spy"),e("./sinon/call"),e("./sinon/behavior"),e("./sinon/stub"),e("./sinon/mock"),e("./sinon/collection"),e("./sinon/assert"),e("./sinon/sandbox"),e("./sinon/test"),e("./sinon/test_case"),e("./sinon/match"),e("./sinon/format"),e("./sinon/log_error")}var t,n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;return r?define(e):n?(e(require,module.exports,module),t=module.exports):t={},t}();if(function(e){function t(e){var t=!1;try{e.appendChild(l),t=l.parentNode==e}catch(n){return!1}finally{try{e.removeChild(l)}catch(n){}}return t}function n(e){return l&&e&&1===e.nodeType&&t(e)}function r(e){return"function"==typeof e||!!(e&&e.constructor&&e.call&&e.apply)}function i(e){return"number"==typeof e&&isNaN(e)}function o(e,t){for(var n in t)c.call(e,n)||(e[n]=t[n])}function s(e){return"function"==typeof e&&"function"==typeof e.restore&&e.restore.sinon}function a(e){return e.wrapMethod=function(e,t,n){if(!e)throw new TypeError("Should wrap property of object");if("function"!=typeof n)throw new TypeError("Method wrapper should be function");var i,s=e[t];if(r(s)){if(s.restore&&s.restore.sinon)i=new TypeError("Attempted to wrap "+t+" which is already wrapped");else if(s.calledBefore){var a=s.returns?"stubbed":"spied on";i=new TypeError("Attempted to wrap "+t+" which is already "+a)}}else i=new TypeError("Attempted to wrap "+typeof s+" property "+t+" as function");if(i)throw s&&s.stackTrace&&(i.stack+="\n--------------\n"+s.stackTrace),i;var u=e.hasOwnProperty?e.hasOwnProperty(t):c.call(e,t);return e[t]=n,n.displayName=t,n.stackTrace=new Error("Stack Trace for original").stack,n.restore=function(){u||delete e[t],e[t]===n&&(e[t]=s)},n.restore.sinon=!0,o(n,s),n},e.create=function(e){var t=function(){};return t.prototype=e,new t},e.deepEqual=function t(r,o){if(e.match&&e.match.isMatcher(r))return r.test(o);if("object"!=typeof r||"object"!=typeof o)return i(r)&&i(o)?!0:r===o;if(n(r)||n(o))return r===o;if(r===o)return!0;if(null===r&&null!==o||null!==r&&null===o)return!1;if(r instanceof RegExp&&o instanceof RegExp)return r.source===o.source&&r.global===o.global&&r.ignoreCase===o.ignoreCase&&r.multiline===o.multiline;var s=Object.prototype.toString.call(r);if(s!=Object.prototype.toString.call(o))return!1;if("[object Date]"==s)return r.valueOf()===o.valueOf();var a,u=0,l=0;if("[object Array]"==s&&r.length!==o.length)return!1;for(a in r){if(u+=1,!(a in o))return!1;if(!t(r[a],o[a]))return!1}for(a in o)l+=1;return u==l},e.functionName=function(e){var t=e.displayName||e.name;if(!t){var n=e.toString().match(/function ([^\s\(]+)/);t=n&&n[1]}return t},e.functionToString=function(){if(this.getCall&&this.callCount)for(var e,t,n=this.callCount;n--;){e=this.getCall(n).thisValue;for(t in e)if(e[t]===this)return t}return this.displayName||"sinon fake"},e.getConfig=function(t){var n={};t=t||{};var r=e.defaultConfig;for(var i in r)r.hasOwnProperty(i)&&(n[i]=t.hasOwnProperty(i)?t[i]:r[i]);return n},e.defaultConfig={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0},e.timesInWords=function(e){return 1==e&&"once"||2==e&&"twice"||3==e&&"thrice"||(e||0)+" times"},e.calledInOrder=function(e){for(var t=1,n=e.length;n>t;t++)if(!e[t-1].calledBefore(e[t])||!e[t].called)return!1;return!0},e.orderByFirstCall=function(e){return e.sort(function(e,t){var n=e.getCall(0),r=t.getCall(0),i=n&&n.callId||-1,o=r&&r.callId||-1;return o>i?-1:1})},e.createStubInstance=function(t){if("function"!=typeof t)throw new TypeError("The constructor should be a function.");return e.stub(e.create(t.prototype))},e.restore=function(e){if(null!==e&&"object"==typeof e)for(var t in e)s(e[t])&&e[t].restore();else s(e)&&e.restore()},e}function u(e,t){a(t)}var l="undefined"!=typeof document&&document.createElement("div"),c=Object.prototype.hasOwnProperty,f="undefined"!=typeof module&&module.exports&&"function"==typeof require,d="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(d)define(u);else if(f)u(require,module.exports);else{if(!e)return;a(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){function t(e){var t,r,i,o=Array.prototype.slice.call(arguments,1);for(r=0;rt;t+=1)if(!e.deepEqual(arguments[t],this.args[t]))return!1;return!0},calledWithMatch:function(){for(var t=0,n=arguments.length;n>t;t+=1){var r=this.args[t],i=arguments[t];if(!e.match||!e.match(i).test(r))return!1}return!0},calledWithExactly:function(){return arguments.length==this.args.length&&this.calledWith.apply(this,arguments)},notCalledWith:function(){return!this.calledWith.apply(this,arguments)},notCalledWithMatch:function(){return!this.calledWithMatch.apply(this,arguments)},returned:function(t){return e.deepEqual(t,this.returnValue)},threw:function(e){return"undefined"!=typeof e&&this.exception?this.exception===e||this.exception.name===e:!!this.exception},calledWithNew:function(){return this.proxy.prototype&&this.thisValue instanceof this.proxy},calledBefore:function(e){return this.callIde.callId},callArg:function(e){this.args[e]()},callArgOn:function(e,t){this.args[e].apply(t)},callArgWith:function(e){this.callArgOnWith.apply(this,[e,null].concat(r.call(arguments,1)))},callArgOnWith:function(e,t){var n=r.call(arguments,2);this.args[e].apply(t,n)},"yield":function(){this.yieldOn.apply(this,[null].concat(r.call(arguments,0)))},yieldOn:function(e){for(var n=this.args,i=0,o=n.length;o>i;++i)if("function"==typeof n[i])return void n[i].apply(e,r.call(arguments,1));t(this.proxy," cannot yield since no callback was passed.",n)},yieldTo:function(e){this.yieldToOn.apply(this,[e,null].concat(r.call(arguments,1)))},yieldToOn:function(e,n){for(var i=this.args,o=0,s=i.length;s>o;++o)if(i[o]&&"function"==typeof i[o][e])return void i[o][e].apply(n,r.call(arguments,2));t(this.proxy," cannot yield to '"+e+"' since no callback was passed.",i)},toString:function(){for(var t=this.proxy.toString()+"(",n=[],r=0,i=this.args.length;i>r;++r)n.push(e.format(this.args[r]));return t=t+n.join(", ")+")","undefined"!=typeof this.returnValue&&(t+=" => "+e.format(this.returnValue)),this.exception&&(t+=" !"+this.exception.name,this.exception.message&&(t+="("+this.exception.message+")")),t}};return i.invokeCallback=i.yield,n.toString=i.toString,e.spyCall=n,n}function n(e,n,r){var i=e("./util/core");e("./match"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(sinon){function makeApi(sinon){function spy(e,t){if(!t&&"function"==typeof e)return spy.create(e);if(!e&&!t)return spy.create(function(){});var n=e[t];return sinon.wrapMethod(e,t,spy.create(n))}function matchingFake(e,t,n){if(e)for(var r=0,i=e.length;i>r;r++)if(e[r].matches(t,n))return e[r]}function incrementCallCount(){this.called=!0,this.callCount+=1,this.notCalled=!1,this.calledOnce=1==this.callCount,this.calledTwice=2==this.callCount,this.calledThrice=3==this.callCount}function createCallProperties(){this.firstCall=this.getCall(0),this.secondCall=this.getCall(1),this.thirdCall=this.getCall(2),this.lastCall=this.getCall(this.callCount-1)}function createProxy(func){var p;return func.length?eval("p = (function proxy("+vars.substring(0,2*func.length-1)+") { return p.invoke(func, this, slice.call(arguments)); });"):p=function(){return p.invoke(func,this,slice.call(arguments))},p}function delegateToCalls(e,t,n,r){spyApi[e]=function(){if(!this.called)return r?r.apply(this,arguments):!1;for(var i,o=0,s=0,a=this.callCount;a>s;s+=1)if(i=this.getCall(s),i[n||e].apply(i,arguments)&&(o+=1,t))return!0;return o===this.callCount}}var push=Array.prototype.push,slice=Array.prototype.slice,callId=0,vars="a,b,c,d,e,f,g,h,i,j,k,l",uuid=0,spyApi={reset:function(){if(this.invoking){var e=new Error("Cannot reset Sinon function while invoking it. Move the call to .reset outside of the callback.");throw e.name="InvalidResetException",e}if(this.called=!1,this.notCalled=!0,this.calledOnce=!1,this.calledTwice=!1,this.calledThrice=!1,this.callCount=0,this.firstCall=null,this.secondCall=null,this.thirdCall=null,this.lastCall=null,this.args=[],this.returnValues=[],this.thisValues=[],this.exceptions=[],this.callIds=[],this.fakes)for(var t=0;te||e>=this.callCount?null:sinon.spyCall(this,this.thisValues[e],this.args[e],this.returnValues[e],this.exceptions[e],this.callIds[e])},getCalls:function(){var e,t=[];for(e=0;ee.callIds[e.callCount-1]:!1},withArgs:function(){var e=slice.call(arguments);if(this.fakes){var t=matchingFake(this.fakes,e,!0);if(t)return t}else this.fakes=[];var n=this,r=this.instantiateFake();r.matchingAguments=e,r.parent=this,push.call(this.fakes,r),r.withArgs=function(){return n.withArgs.apply(n,arguments)};for(var i=0;in;++n){var i=" "+e.getCall(n).toString();/\n/.test(t[n-1])&&(i="\n"+i),push.call(t,i)}return t.length>0?"\n"+t.join("\n"):""},t:function(e){for(var t=[],n=0,r=e.callCount;r>n;++n)push.call(t,sinon.format(e.thisValues[n]));return t.join(", ")},"*":function(e,t){for(var n=[],r=0,i=t.length;i>r;++r)push.call(n,sinon.format(t[r]));return n.join(", ")}},sinon.extend(spy,spyApi),spy.spyCall=sinon.spyCall,sinon.spy=spy,spy}function loadDependencies(e,t,n){var r=e("./util/core");e("./call"),n.exports=makeApi(r)}var isNode="undefined"!=typeof module&&module.exports&&"function"==typeof require,isAMD="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(isAMD)define(loadDependencies);else if(isNode)loadDependencies(require,module.exports,module); -else{if(!sinon)return;makeApi(sinon)}}("object"==typeof sinon&&sinon||null),function(e){function t(e,t){return"string"==typeof e?(this.exception=new Error(t||""),this.exception.name=e):this.exception=e?e:new Error("Error"),this}function n(e,t){var n=e.callArgAt;if(0>n){for(var r=e.callArgProp,i=0,o=t.length;o>i;++i){if(!r&&"function"==typeof t[i])return t[i];if(r&&t[i]&&"function"==typeof t[i][r])return t[i][r]}return null}return t[n]}function r(e){function r(t,n,r){if(t.callArgAt<0){var i;return i=t.callArgProp?e.functionName(t.stub)+" expected to yield to '"+t.callArgProp+"', but no object with such a property was passed.":e.functionName(t.stub)+" expected to yield, but no callback was passed.",r.length>0&&(i+=" Received ["+s.call(r,", ")+"]"),i}return"argument at index "+t.callArgAt+" is not a function: "+n}function i(e,t){if("number"==typeof e.callArgAt){var i=n(e,t);if("function"!=typeof i)throw new TypeError(r(e,i,t));e.callbackAsync?a(function(){i.apply(e.callbackContext,e.callbackArguments)}):i.apply(e.callbackContext,e.callbackArguments)}}var u={create:function(t){var n=e.extend({},e.behavior);return delete n.create,n.stub=t,n},isPresent:function(){return"number"==typeof this.callArgAt||this.exception||"number"==typeof this.returnArgAt||this.returnThis||this.returnValueDefined},invoke:function(e,t){if(i(this,t),this.exception)throw this.exception;return"number"==typeof this.returnArgAt?t[this.returnArgAt]:this.returnThis?e:this.returnValue},onCall:function(e){return this.stub.onCall(e)},onFirstCall:function(){return this.stub.onFirstCall()},onSecondCall:function(){return this.stub.onSecondCall()},onThirdCall:function(){return this.stub.onThirdCall()},withArgs:function(){throw new Error('Defining a stub by invoking "stub.onCall(...).withArgs(...)" is not supported. Use "stub.withArgs(...).onCall(...)" to define sequential behavior for calls with certain arguments.')},callsArg:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.callArgAt=e,this.callbackArguments=[],this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgOn:function(e,t){if("number"!=typeof e)throw new TypeError("argument index is not number");if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=e,this.callbackArguments=[],this.callbackContext=t,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgWith:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.callArgAt=e,this.callbackArguments=o.call(arguments,1),this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgOnWith:function(e,t){if("number"!=typeof e)throw new TypeError("argument index is not number");if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=e,this.callbackArguments=o.call(arguments,2),this.callbackContext=t,this.callArgProp=void 0,this.callbackAsync=!1,this},yields:function(){return this.callArgAt=-1,this.callbackArguments=o.call(arguments,0),this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},yieldsOn:function(e){if("object"!=typeof e)throw new TypeError("argument context is not an object");return this.callArgAt=-1,this.callbackArguments=o.call(arguments,1),this.callbackContext=e,this.callArgProp=void 0,this.callbackAsync=!1,this},yieldsTo:function(e){return this.callArgAt=-1,this.callbackArguments=o.call(arguments,1),this.callbackContext=void 0,this.callArgProp=e,this.callbackAsync=!1,this},yieldsToOn:function(e,t){if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=-1,this.callbackArguments=o.call(arguments,2),this.callbackContext=t,this.callArgProp=e,this.callbackAsync=!1,this},"throws":t,throwsException:t,returns:function(e){return this.returnValue=e,this.returnValueDefined=!0,this},returnsArg:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.returnArgAt=e,this},returnsThis:function(){return this.returnThis=!0,this}};for(var l in u)u.hasOwnProperty(l)&&l.match(/^(callsArg|yields)/)&&!l.match(/Async/)&&(u[l+"Async"]=function(e){return function(){var t=this[e].apply(this,arguments);return this.callbackAsync=!0,t}}(l));return e.behavior=u,u}function i(e,t,n){var i=e("./util/core");n.exports=r(i)}var o=Array.prototype.slice,s=Array.prototype.join,a=function(){return"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:"function"==typeof setImmediate?setImmediate:function(e){setTimeout(e,0)}}(),u="undefined"!=typeof module&&module.exports&&"function"==typeof require,l="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(l)define(i);else if(u)i(require,module.exports,module);else{if(!e)return;r(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){function t(n,r,i){if(i&&"function"!=typeof i)throw new TypeError("Custom stub should be function");var o;if(o=i?e.spy&&e.spy.create?e.spy.create(i):i:t.create(),!n&&"undefined"==typeof r)return e.stub.create();if("undefined"==typeof r&&"object"==typeof n){for(var s in n)"function"==typeof n[s]&&t(n,s);return n}return e.wrapMethod(n,r,o)}function n(t){return t.defaultBehavior||r(t)||e.behavior.create(t)}function r(e){return e.parent&&i(e.parent)}function i(e){var t=e.behaviors[e.callCount-1];return t&&t.isPresent()?t:n(e)}var o=0,s={create:function(){var n=function(){return i(n).invoke(this,arguments)};n.id="stub#"+o++;var r=n;return n=e.spy.create(n),n.func=r,e.extend(n,t),n.instantiateFake=e.stub.create,n.displayName="stub",n.toString=e.functionToString,n.defaultBehavior=null,n.behaviors=[],n},resetBehavior:function(){var e;if(this.defaultBehavior=null,this.behaviors=[],delete this.returnValue,delete this.returnArgAt,this.returnThis=!1,this.fakes)for(e=0;en;n+=1)t(e[n])}function r(e){return 0==e?"never called":"called "+c(e)}function i(e){var t=e.minCalls,n=e.maxCalls;if("number"==typeof t&&"number"==typeof n){var r=c(t);return t!=n&&(r="at least "+r+" and at most "+c(n)),r}return"number"==typeof t?"at least "+c(t):"at most "+c(n)}function o(e){var t="number"==typeof e.minCalls;return!t||e.callCount>=e.minCalls}function s(e){return"number"!=typeof e.maxCalls?!1:e.callCount==e.maxCalls}function a(e,t){return l&&l.isMatcher(e)?e.test(t):!0}var u=[].push,l=e.match;e.extend(t,{create:function(n){if(!n)throw new TypeError("object is null");var r=e.extend({},t);return r.object=n,delete r.create,r},expects:function(t){if(!t)throw new TypeError("method is falsy");if(this.expectations||(this.expectations={},this.proxies=[]),!this.expectations[t]){this.expectations[t]=[];var n=this;e.wrapMethod(this.object,t,function(){return n.invokeMethod(t,this,arguments)}),u.call(this.proxies,t)}var r=e.expectation.create(t);return u.call(this.expectations[t],r),r},restore:function(){var e=this.object;n(this.proxies,function(t){"function"==typeof e[t].restore&&e[t].restore()})},verify:function(){var t=this.expectations||{},r=[],i=[];return n(this.proxies,function(e){n(t[e],function(e){e.met()?u.call(i,e.toString()):u.call(r,e.toString())})}),this.restore(),r.length>0?e.expectation.fail(r.concat(i).join("\n")):i.length>0&&e.expectation.pass(r.concat(i).join("\n")),!0},invokeMethod:function(t,n,r){var i,o=this.expectations&&this.expectations[t],s=o&&o.length||0;for(i=0;s>i;i+=1)if(!o[i].met()&&o[i].allowsCall(n,r))return o[i].apply(n,r);var a,l=[],c=0;for(i=0;s>i;i+=1)o[i].allowsCall(n,r)?a=a||o[i]:c+=1,u.call(l," "+o[i].toString());return 0===c?a.apply(n,r):(l.unshift("Unexpected call: "+e.spyCall.toString.call({proxy:t,args:r})),void e.expectation.fail(l.join("\n")))}});var c=e.timesInWords,f=Array.prototype.slice;return e.expectation={minCalls:1,maxCalls:1,create:function(t){var n=e.extend(e.stub.create(),e.expectation);return delete n.create,n.method=t,n},invoke:function(t,n,r){return this.verifyCallAllowed(n,r),e.spy.invoke.apply(this,arguments)},atLeast:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not number");return this.limitsSet||(this.maxCalls=null,this.limitsSet=!0),this.minCalls=e,this},atMost:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not number");return this.limitsSet||(this.minCalls=null,this.limitsSet=!0),this.maxCalls=e,this},never:function(){return this.exactly(0)},once:function(){return this.exactly(1)},twice:function(){return this.exactly(2)},thrice:function(){return this.exactly(3)},exactly:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not a number");return this.atLeast(e),this.atMost(e)},met:function(){return!this.failed&&o(this)},verifyCallAllowed:function(t,n){if(s(this)&&(this.failed=!0,e.expectation.fail(this.method+" already called "+c(this.maxCalls))),"expectedThis"in this&&this.expectedThis!==t&&e.expectation.fail(this.method+" called with "+t+" as thisValue, expected "+this.expectedThis),"expectedArguments"in this){n||e.expectation.fail(this.method+" received no arguments, expected "+e.format(this.expectedArguments)),n.lengthr;r+=1)a(this.expectedArguments[r],n[r])||e.expectation.fail(this.method+" received wrong arguments "+e.format(n)+", didn't match "+this.expectedArguments.toString()),e.deepEqual(this.expectedArguments[r],n[r])||e.expectation.fail(this.method+" received wrong arguments "+e.format(n)+", expected "+e.format(this.expectedArguments))}},allowsCall:function(t,n){if(this.met()&&s(this))return!1;if("expectedThis"in this&&this.expectedThis!==t)return!1;if(!("expectedArguments"in this))return!0;if(n=n||[],n.lengthr;r+=1){if(!a(this.expectedArguments[r],n[r]))return!1;if(!e.deepEqual(this.expectedArguments[r],n[r]))return!1}return!0},withArgs:function(){return this.expectedArguments=f.call(arguments),this},withExactArgs:function(){return this.withArgs.apply(this,arguments),this.expectsExactArgCount=!0,this},on:function(e){return this.expectedThis=e,this},toString:function(){var t=(this.expectedArguments||[]).slice();this.expectsExactArgCount||u.call(t,"[...]");var n=e.spyCall.toString.call({proxy:this.method||"anonymous mock expectation",args:t}),o=n.replace(", [...","[, ...")+" "+i(this);return this.met()?"Expectation met: "+o:"Expected "+o+" ("+r(this.callCount)+")"},verify:function(){return this.met()?e.expectation.pass(this.toString()):e.expectation.fail(this.toString()),!0},pass:function(t){e.assert.pass(t)},fail:function(e){var t=new Error(e);throw t.name="ExpectationError",t}},e.mock=t,t}function n(e,n,r){var i=e("./util/core");e("./call"),e("./match"),e("./spy"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){return e.fakes||(e.fakes=[]),e.fakes}function n(e,n){for(var r=t(e),i=0,o=r.length;o>i;i+=1)"function"==typeof r[i][n]&&r[i][n]()}function r(e){for(var n=t(e),r=0;rr;++r)if(n[r]==t)return n.splice(r,1)},dispatchEvent:function(e){for(var t=e.type,n=this.eventListeners&&this.eventListeners[t]||[],r=0;r=0;o--)e(i[o]);"function"==typeof t.onCreate&&t.onCreate(this)}function n(){this.eventListeners={progress:[],load:[],abort:[],error:[]}}function r(e){if(e.readyState!==t.OPENED)throw new Error("INVALID_STATE_ERR");if(e.sendFlag)throw new Error("INVALID_STATE_ERR")}function i(e,t){t=t.toLowerCase();for(var n in e)if(n.toLowerCase()==t)return n;return null}function o(e,t){if(e)for(var n=0,r=e.length;r>n;n+=1)t(e[n])}function s(e,t){for(var n=0;nt.UNSENT&&this.sendFlag&&(this.readyStateChange(t.DONE),this.sendFlag=!1),this.readyState=t.UNSENT,this.dispatchEvent(new n.Event("abort",!1,!1,this)),this.upload.dispatchEvent(new n.Event("abort",!1,!1,this)),"function"==typeof this.onerror&&this.onerror()},getResponseHeader:function(e){return this.readyStater;++r)if(n[r]==t)return n.splice(r,1)},n.prototype.dispatchEvent=function(e){for(var t,n=this.eventListeners[e.type]||[],r=0;null!=(t=n[r]);r++)t(e)};var g=function(e,t,n){switch(n.length){case 0:return e[t]();case 1:return e[t](n[0]);case 2:return e[t](n[0],n[1]);case 3:return e[t](n[0],n[1],n[2]);case 4:return e[t](n[0],n[1],n[2],n[3]);case 5:return e[t](n[0],n[1],n[2],n[3],n[4])}};t.filters=[],t.addFilter=function(e){this.filters.push(e)};var v=/MSIE 6/;t.defake=function(e,n){var r=new m.workingXHR;o(["open","setRequestHeader","send","abort","getResponseHeader","getAllResponseHeaders","addEventListener","overrideMimeType","removeEventListener"],function(t){e[t]=function(){return g(r,t,arguments)}});var i=function(t){o(t,function(t){try{e[t]=r[t]}catch(n){if(!v.test(navigator.userAgent))throw n}})},s=function(){e.readyState=r.readyState,r.readyState>=t.HEADERS_RECEIVED&&i(["status","statusText"]),r.readyState>=t.LOADING&&i(["responseText","response"]),r.readyState===t.DONE&&i(["responseXML"]),e.onreadystatechange&&e.onreadystatechange.call(e,{target:e})};if(r.addEventListener){for(var a in e.eventListeners)e.eventListeners.hasOwnProperty(a)&&o(e.eventListeners[a],function(e){r.addEventListener(a,e)});r.addEventListener("readystatechange",s)}else r.onreadystatechange=s;g(r,"open",n)},t.useFilters=!1,t.parseXML=function(e){var t;if("undefined"!=typeof DOMParser){var n=new DOMParser;t=n.parseFromString(e,"text/xml")}else t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},t.statusCodes={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Multiple Choice",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};var w="undefined"!=typeof module&&module.exports&&"function"==typeof require,b="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(b)define(d);else if(w)d(require,module.exports,module);else{if("undefined"==typeof sinon)return;f(sinon)}}("undefined"!=typeof self?self:this),"undefined"==typeof sinon)var sinon={};return function(){function e(){}function t(t){return e.prototype=t,new e}function n(e){var t=e;if("[object Array]"!=Object.prototype.toString.call(e)&&(t=[200,{},e]),"string"!=typeof t[2])throw new TypeError("Fake server response body should be string, but was "+typeof t[2]);return t}function r(e,t,n){var r=e.method,i=!r||r.toLowerCase()==t.toLowerCase(),o=e.url,s=!o||o==n||"function"==typeof o.test&&o.test(n);return i&&s}function i(e,t){var n=t.url;if((!/^https?:\/\//.test(n)||l.test(n))&&(n=n.replace(l,"")),r(e,this.getHTTPMethod(t),n)){if("function"==typeof e.response){var i=e.url,o=[t].concat(i&&"function"==typeof i.exec?i.exec(n).slice(1):[]);return e.response.apply(e,o)}return!0}return!1}function o(e){e.fakeServer={create:function(){var n=t(this);return this.xhr=e.useFakeXMLHttpRequest(),n.requests=[],this.xhr.onCreate=function(e){n.addRequest(e)},n},addRequest:function(e){var t=this;a.call(this.requests,e),e.onSend=function(){t.handleRequest(this),t.autoRespond&&!t.responding&&(setTimeout(function(){t.responding=!1,t.respond()},t.autoRespondAfter||10),t.responding=!0)}},getHTTPMethod:function(e){if(this.fakeHTTPMethods&&/post/i.test(e.method)){var t=(e.requestBody||"").match(/_method=([^\b;]+)/);return t?t[1]:e.method}return e.method},handleRequest:function(e){e.async?(this.queue||(this.queue=[]),a.call(this.queue,e)):this.processRequest(e)},log:function(t,n){var r;r="Request:\n"+e.format(n)+"\n\n",r+="Response:\n"+e.format(t)+"\n\n",e.log(r)},respondWith:function(e,t,r){return 1==arguments.length&&"function"!=typeof e?void(this.response=n(e)):(this.responses||(this.responses=[]),1==arguments.length&&(r=e,t=e=null),2==arguments.length&&(r=t,t=e,e=null),void a.call(this.responses,{method:e,url:t,response:"function"==typeof r?r:n(r)}))},respond:function(){arguments.length>0&&this.respondWith.apply(this,arguments);for(var e,t=this.queue||[],n=t.splice(0,t.length);e=n.shift();)this.processRequest(e)},processRequest:function(t){try{if(t.aborted)return;var n=this.response||[404,{},""];if(this.responses)for(var r=this.responses.length,o=r-1;o>=0;o--)if(i.call(this,this.responses[o],t)){n=this.responses[o].response;break}4!=t.readyState&&(this.log(n,t),t.respond(n[0],n[1],n[2]))}catch(s){e.logError("Fake server request processing",s)}},restore:function(){return this.xhr.restore&&this.xhr.restore.apply(this.xhr,arguments)}}}function s(e,t,n){var r=e("./core");e("./fake_xml_http_request"),o(r),n.exports=r}var a=[].push,u="undefined"!=typeof window?window.location:{},l=new RegExp("^"+u.protocol+"//"+u.host),c="undefined"!=typeof module&&module.exports&&"function"==typeof require,f="function"==typeof define&&"object"==typeof define.amd&&define.amd;f?define(s):c?s(require,module.exports,module):o(sinon)}(),function(){function e(e){function t(){}t.prototype=e.fakeServer,e.fakeServerWithClock=new t,e.fakeServerWithClock.addRequest=function(t){if(t.async&&("object"==typeof setTimeout.clock?this.clock=setTimeout.clock:(this.clock=e.useFakeTimers(),this.resetClock=!0),!this.longestTimeout)){var n=this.clock.setTimeout,r=this.clock.setInterval,i=this;this.clock.setTimeout=function(e,t){return i.longestTimeout=Math.max(t,i.longestTimeout||0),n.apply(this,arguments)},this.clock.setInterval=function(e,t){return i.longestTimeout=Math.max(t,i.longestTimeout||0),r.apply(this,arguments)}}return e.fakeServer.addRequest.call(this,t)},e.fakeServerWithClock.respond=function(){var t=e.fakeServer.respond.apply(this,arguments);return this.clock&&(this.clock.tick(this.longestTimeout||0),this.longestTimeout=0,this.resetClock&&(this.clock.restore(),this.resetClock=!1)),t},e.fakeServerWithClock.restore=function(){return this.clock&&this.clock.restore(),e.fakeServer.restore.apply(this,arguments)}}function t(t){var n=t("./core");t("./fake_server"),t("./fake_timers"),e(n)}var n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;r?define(t):n?t(require):e(sinon)}(),function(){function e(e){function t(e,t,n,i){i&&(!t.injectInto||n in t.injectInto?r.call(e.args,i):(t.injectInto[n]=i,e.injectedKeys.push(n)))}function n(t){var n=e.create(e.sandbox);return t.useFakeServer&&("object"==typeof t.useFakeServer&&(n.serverPrototype=t.useFakeServer),n.useFakeServer()),t.useFakeTimers&&("object"==typeof t.useFakeTimers?n.useFakeTimers.apply(n,t.useFakeTimers):n.useFakeTimers()),n}var r=[].push;return e.sandbox=e.extend(e.create(e.collection),{useFakeTimers:function(){return this.clock=e.useFakeTimers.apply(e,arguments),this.add(this.clock)},serverPrototype:e.fakeServer,useFakeServer:function(){var t=this.serverPrototype||e.fakeServer;return t&&t.create?(this.server=t.create(),this.add(this.server)):null},inject:function(t){return e.collection.inject.call(this,t),this.clock&&(t.clock=this.clock),this.server&&(t.server=this.server,t.requests=this.server.requests),t.match=e.match,t},restore:function(){e.collection.restore.apply(this,arguments),this.restoreContext()},restoreContext:function(){if(this.injectedKeys){for(var e=0,t=this.injectedKeys.length;t>e;e++)delete this.injectInto[this.injectedKeys[e]];this.injectedKeys=[]}},create:function(r){if(!r)return e.create(e.sandbox);var i=n(r);i.args=i.args||[],i.injectedKeys=[],i.injectInto=r.injectInto;var o,s,a=i.inject({});if(r.properties)for(var u=0,l=r.properties.length;l>u;u++)o=r.properties[u],s=a[o]||"sandbox"==o&&i,t(i,r,o,s);else t(i,r,"sandbox",s);return i},match:e.match}),e.sandbox.useFakeXMLHttpRequest=e.sandbox.useFakeServer,e.sandbox}function t(t,n,r){var i=t("./util/core");t("./util/fake_server"),t("./util/fake_timers"),t("./collection"),r.exports=e(i)}var n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(r)define(t);else if(n)t(require,module.exports,module);else{if(!sinon)return; -e(sinon)}}(),function(e){function t(e){function t(t){function n(){var n=e.getConfig(e.config);n.injectInto=n.injectIntoThis&&this||n.injectInto;var r,i,o=e.sandbox.create(n),s=!1,a=Array.prototype.slice.call(arguments);if(a.length>0&&"function"==typeof a[arguments.length-1]){var u=a[arguments.length-1];a[arguments.length-1]=function(e){if(e)throw o.restore(),r;o.verifyAndRestore(),u(e)},s=!0}var l=a.concat(o.args);try{i=t.apply(this,l)}catch(c){r=c}if(!s){if("undefined"!=typeof r)throw o.restore(),r;o.verifyAndRestore()}return i}var r=typeof t;if("function"!=r)throw new TypeError("sinon.test needs to wrap a test function, got "+r);return t.length?function(){return n.apply(this,arguments)}:n}return t.config={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0},e.test=t,t}function n(e,n,r){var i=e("./util/core");e("./sandbox"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e,t,n){return function(){t&&t.apply(this,arguments);var r,i;try{i=e.apply(this,arguments)}catch(o){r=o}if(n&&n.apply(this,arguments),r)throw r;return i}}function n(e){function n(n,r){if(!n||"object"!=typeof n)throw new TypeError("sinon.testCase needs an object with test functions");r=r||"test";var i,o,s,a=new RegExp("^"+r),u={},l=n.setUp,c=n.tearDown;for(i in n)if(n.hasOwnProperty(i)){if(o=n[i],/^(setUp|tearDown)$/.test(i))continue;"function"==typeof o&&a.test(i)?(s=o,(l||c)&&(s=t(o,l,c)),u[i]=e.test(s)):u[i]=n[i]}return u}return e.testCase=n,n}function r(e,t,r){var i=e("./util/core");e("./test"),r.exports=n(i)}var i="undefined"!=typeof module&&module.exports&&"function"==typeof require,o="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(o)define(r);else if(i)r(require,module.exports,module);else{if(!e)return;n(e)}}("object"==typeof sinon&&sinon||null),function(e,t){function n(e){function n(){for(var e,t=0,n=arguments.length;n>t;++t)e=arguments[t],e||a.fail("fake is not a spy"),"function"!=typeof e&&a.fail(e+" is not a function"),"function"!=typeof e.getCall&&a.fail(e+" is not stubbed")}function r(e,n){e=e||t;var r=e.fail||a.fail;r.call(e,n)}function o(e,t,o){2==arguments.length&&(o=t,t=e),a[e]=function(s){n(s);var u=i.call(arguments,1),l=!1;l="function"==typeof t?!t(s):"function"==typeof s[t]?!s[t].apply(s,u):!s[t],l?r(this,s.printf.apply(s,[o].concat(u))):a.pass(e)}}function s(e,t){return!e||/^fail/.test(t)?t:e+t.slice(0,1).toUpperCase()+t.slice(1)}var a;return a={failException:"AssertError",fail:function(e){var t=new Error(e);throw t.name=this.failException||a.failException,t},pass:function(){},callOrder:function(){n.apply(null,arguments);var t="",o="";if(e.calledInOrder(arguments))a.pass("callOrder");else{try{t=[].join.call(arguments,", ");for(var s=i.call(arguments),u=s.length;u;)s[--u].called||s.splice(u,1);o=e.orderByFirstCall(s).join(", ")}catch(l){}r(this,"expected "+t+" to be called in order but were called as "+o)}},callCount:function(t,i){if(n(t),t.callCount!=i){var o="expected %n to be called "+e.timesInWords(i)+" but was called %c%C";r(this,t.printf(o))}else a.pass("callCount")},expose:function(e,t){if(!e)throw new TypeError("target is null or undefined");var n=t||{},r="undefined"==typeof n.prefix&&"assert"||n.prefix,i="undefined"==typeof n.includeFail||!!n.includeFail;for(var o in this)"expose"==o||!i&&/^(fail)/.test(o)||(e[s(r,o)]=this[o]);return e},match:function(t,n){var i=e.match(n);if(i.test(t))a.pass("match");else{var o=["expected value to match"," expected = "+e.format(n)," actual = "+e.format(t)];r(this,o.join("\n"))}}},o("called","expected %n to have been called at least once but was never called"),o("notCalled",function(e){return!e.called},"expected %n to not have been called but was called %c%C"),o("calledOnce","expected %n to be called once but was called %c%C"),o("calledTwice","expected %n to be called twice but was called %c%C"),o("calledThrice","expected %n to be called thrice but was called %c%C"),o("calledOn","expected %n to be called with %1 as this but was called with %t"),o("alwaysCalledOn","expected %n to always be called with %1 as this but was called with %t"),o("calledWithNew","expected %n to be called with new"),o("alwaysCalledWithNew","expected %n to always be called with new"),o("calledWith","expected %n to be called with arguments %*%C"),o("calledWithMatch","expected %n to be called with match %*%C"),o("alwaysCalledWith","expected %n to always be called with arguments %*%C"),o("alwaysCalledWithMatch","expected %n to always be called with match %*%C"),o("calledWithExactly","expected %n to be called with exact arguments %*%C"),o("alwaysCalledWithExactly","expected %n to always be called with exact arguments %*%C"),o("neverCalledWith","expected %n to never be called with arguments %*%C"),o("neverCalledWithMatch","expected %n to never be called with match %*%C"),o("threw","%n did not throw exception%C"),o("alwaysThrew","%n did not always throw exception%C"),e.assert=a,a}function r(e,t,r){var i=e("./util/core");e("./match"),r.exports=n(i)}var i=Array.prototype.slice,o="undefined"!=typeof module&&module.exports&&"function"==typeof require,s="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(s)define(r);else if(o)r(require,module.exports,module);else{if(!e)return;n(e)}}("object"==typeof sinon&&sinon||null,"undefined"!=typeof window?window:"undefined"!=typeof self?self:global),"undefined"==typeof sinon&&(this.sinon={}),function(e){function t(t){function n(){this.readyState=n.UNSENT,this.requestBody=null,this.requestHeaders={},this.status=0,this.timeout=null,"function"==typeof n.onCreate&&n.onCreate(this)}function i(e){if(e.readyState!==n.OPENED)throw new Error("INVALID_STATE_ERR");if(e.sendFlag)throw new Error("INVALID_STATE_ERR")}function o(e){if(e.readyState==n.UNSENT)throw new Error("Request not sent");if(e.readyState==n.DONE)throw new Error("Request done")}function s(e){if("string"!=typeof e){var t=new Error("Attempted to respond to fake XDomainRequest with "+e+", which is not a string.");throw t.name="InvalidBodyException",t}}t.xdr=r,t.extend(n.prototype,t.EventTarget,{open:function(e,t){this.method=e,this.url=t,this.responseText=null,this.sendFlag=!1,this.readyStateChange(n.OPENED)},readyStateChange:function(e){this.readyState=e;var r="";switch(this.readyState){case n.UNSENT:break;case n.OPENED:break;case n.LOADING:this.sendFlag&&(r="onprogress");break;case n.DONE:r=this.isTimeout?"ontimeout":this.errorFlag||this.status<200||this.status>299?"onerror":"onload"}if(r&&"function"==typeof this[r])try{this[r]()}catch(i){t.logError("Fake XHR "+r+" handler",i)}},send:function(e){i(this),/^(get|head)$/i.test(this.method)||(this.requestBody=e),this.requestHeaders["Content-Type"]="text/plain;charset=utf-8",this.errorFlag=!1,this.sendFlag=!0,this.readyStateChange(n.OPENED),"function"==typeof this.onSend&&this.onSend(this)},abort:function(){this.aborted=!0,this.responseText=null,this.errorFlag=!0,this.readyState>t.FakeXDomainRequest.UNSENT&&this.sendFlag&&(this.readyStateChange(t.FakeXDomainRequest.DONE),this.sendFlag=!1)},setResponseBody:function(e){o(this),s(e);var t=this.chunkSize||10,r=0;this.responseText="";do this.readyStateChange(n.LOADING),this.responseText+=e.substring(r,r+t),r+=t;while(r=3?e[2]:this.actual};e.length>=2&&(r.expected=e[1]),e.length>=4&&(r.inspect=e.slice(3)),i(t,r)},stats:{assertions:{},total:{assertions:0}}}},function(t,e,r){function n(t){return this instanceof n?void(this.actual=t):new n(t)}function i(t){return t instanceof Boolean||t instanceof String||t instanceof Number?t.valueOf():t}var o=r(29),s=r(30);t.exports=n,n.prototype=Object.create(o,{constructor:{value:n,writable:!0,configurable:!0}}),n.AssertionError=s,Object.defineProperty(Object.prototype,"must",{get:function(){return new n(i(this))},set:function(t){Object.defineProperty(this,"must",{value:t,configurable:!0,enumrable:!0,writable:!0})},configurable:!0})},function(t,e,r){(function(n){/*! +/*! Unit.js v1.1.2 | (c) 2015 Nicolas Tallefourtane | http://unitjs.com/license.html */ +/*! Sinon.JS v1.12.2 | (c) 2015 Christian Johansen (christian@cjohansen.no) | https://github.com/cjohansen/Sinon.JS/blob/master/LICENSE */ +!function(e,t){"function"==typeof define&&define.amd?define([],function(){return e.sinon=t()}):"object"==typeof exports?module.exports=t():e.sinon=t()}(this,function(){var samsam,formatio;!function(){function define(e,t,n){"samsam"==e?samsam=t():"function"==typeof t&&0===e.length?lolex=t():"function"==typeof n&&(formatio=n(samsam))}define.amd={},("function"==typeof define&&define.amd&&function(e){define("samsam",e)}||"object"==typeof module&&function(e){module.exports=e()}||function(e){this.samsam=e()})(function(){function e(e){var t=e;return"number"==typeof e&&e!==t}function t(e){return f.toString.call(e).split(/[ \]]/)[1]}function n(e){if("Arguments"===t(e))return!0;if("object"!=typeof e||"number"!=typeof e.length||"Array"===t(e))return!1;if("function"==typeof e.callee)return!0;try{e[e.length]=6,delete e[e.length]}catch(n){return!0}return!1}function r(e){if(!e||1!==e.nodeType||!d)return!1;try{e.appendChild(d),e.removeChild(d)}catch(t){return!1}return!0}function i(e){var t,n=[];for(t in e)f.hasOwnProperty.call(e,t)&&n.push(t);return n}function o(e){return"function"==typeof e.getTime&&e.getTime()==e.valueOf()}function s(e){return 0===e&&1/e===-1/0}function a(t,n){return t===n||e(t)&&e(n)?0!==t||s(t)===s(n):void 0}function u(s,u){function l(e){return"object"!=typeof e||null===e||e instanceof Boolean||e instanceof Date||e instanceof Number||e instanceof RegExp||e instanceof String?!1:!0}function c(e,t){var n;for(n=0;nq;q++){if(j=k[q],!f.hasOwnProperty.call(u,j))return!1;if(R=s[j],D=u[j],N=l(R),I=l(D),P=N?c(d,R):-1,M=I?c(h,D):-1,L=-1!==P?p[P]:v+"["+JSON.stringify(j)+"]",F=-1!==M?y[M]:w+"["+JSON.stringify(j)+"]",m[L+F])return!0;if(-1===P&&N&&(d.push(R),p.push(L)),-1===M&&I&&(h.push(D),y.push(F)),N&&I&&(m[L+F]=!0),!g(R,D,L,F))return!1}return!0}(s,u,"$1","$2")}function l(e,t){if(0===t.length)return!0;var n,r,i,o;for(n=0,r=e.length;r>n;++n)if(c(e[n],t[0])){for(i=0,o=t.length;o>i;++i)if(!c(e[n+i],t[i]))return!1;return!0}return!1}var c,f=Object.prototype,d="undefined"!=typeof document&&document.createElement("div");return c=function h(e,n){if(n&&"function"==typeof n.test)return n.test(e);if("function"==typeof n)return n(e)===!0;if("string"==typeof n){n=n.toLowerCase();var r="string"==typeof e||!!e;return r&&String(e).toLowerCase().indexOf(n)>=0}if("number"==typeof n)return n===e;if("boolean"==typeof n)return n===e;if("undefined"==typeof n)return"undefined"==typeof e;if(null===n)return null===e;if("Array"===t(e)&&"Array"===t(n))return l(e,n);if(n&&"object"==typeof n){if(n===e)return!0;var i;for(i in n){var o=e[i];if("undefined"==typeof o&&"function"==typeof e.getAttribute&&(o=e.getAttribute(i)),null===n[i]||"undefined"==typeof n[i]){if(o!==n[i])return!1}else if("undefined"==typeof o||!h(o,n[i]))return!1}return!0}throw new Error("Matcher was not a string, a number, a function, a boolean or an object")},{isArguments:n,isElement:r,isDate:o,isNegZero:s,identical:a,deepEqual:u,match:c,keys:i}}),("function"==typeof define&&define.amd&&function(e){define("formatio",["samsam"],e)}||"object"==typeof module&&function(e){module.exports=e(require("samsam"))}||function(e){this.formatio=e(this.samsam)})(function(e){function t(e){if(!e)return"";if(e.displayName)return e.displayName;if(e.name)return e.name;var t=e.toString().match(/function\s+([^\(]+)/m);return t&&t[1]||""}function n(e,n){var r,i,o=t(n&&n.constructor),a=e.excludeConstructors||s.excludeConstructors||[];for(r=0,i=a.length;i>r;++r){if("string"==typeof a[r]&&a[r]===o)return"";if(a[r].test&&a[r].test(o))return""}return o}function r(e,t){if("object"!=typeof e)return!1;var n,r;for(n=0,r=t.length;r>n;++n)if(t[n]===e)return!0;return!1}function i(t,n,o,s){if("string"==typeof n){var u=t.quoteStrings,l="boolean"!=typeof u||u;return o||l?'"'+n+'"':n}if("function"==typeof n&&!(n instanceof RegExp))return i.func(n);if(o=o||[],r(n,o))return"[Circular]";if("[object Array]"===Object.prototype.toString.call(n))return i.array.call(t,n,o);if(!n)return String(1/n===-1/0?"-0":n);if(e.isElement(n))return i.element(n);if("function"==typeof n.toString&&n.toString!==Object.prototype.toString)return n.toString();var c,f;for(c=0,f=a.length;f>c;c++)if(n===a[c].object)return a[c].value;return i.object.call(t,n,o,s)}function o(e){for(var t in e)this[t]=e[t]}var s={excludeConstructors:["Object",/^.$/],quoteStrings:!0,limitChildrenCount:0},a=(Object.prototype.hasOwnProperty,[]);return"undefined"!=typeof global&&a.push({object:global,value:"[object global]"}),"undefined"!=typeof document&&a.push({object:document,value:"[object HTMLDocument]"}),"undefined"!=typeof window&&a.push({object:window,value:"[object Window]"}),i.func=function(e){return"function "+t(e)+"() {}"},i.array=function(e,t){t=t||[],t.push(e);var n,r,o=[];for(r=this.limitChildrenCount>0?Math.min(this.limitChildrenCount,e.length):e.length,n=0;r>n;++n)o.push(i(this,e[n],t));return r0?Math.min(this.limitChildrenCount,p.length):p.length,c=0;d>c;++c)a=p[c],l=t[a],u=r(l,o)?"[Circular]":i(this,l,o,s+2),u=(/\s/.test(a)?'"'+a+'"':a)+": "+u,y+=u.length,h.push(u);var m=n(this,t),g=m?"["+m+"] ":"",v="";for(c=0,f=s;f>c;++c)v+=" ";return d80?g+"{\n "+v+h.join(",\n "+v)+"\n"+v+"}":g+"{ "+h.join(", ")+" }"},i.element=function(e){var t,n,r,i,o,s=e.tagName.toLowerCase(),a=e.attributes,u=[];for(r=0,i=a.length;i>r;++r)t=a.item(r),n=t.nodeName.toLowerCase().replace("html:",""),o=t.nodeValue,("contenteditable"!==n||"inherit"!==o)&&o&&u.push(n+'="'+o+'"');var l="<"+s+(u.length>0?" ":""),c=e.innerHTML;c.length>20&&(c=c.substr(0,20)+"[...]");var f=l+u.join(" ")+">"+c+"";return f.replace(/ contentEditable="inherit"/,"")},o.prototype={functionName:t,configure:function(e){return new o(e)},constructorName:function(e){return n(this,e)},ascii:function(e,t,n){return i(this,e,t,n)}},o.prototype}),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.lolex=e()}}(function(){var define,module,exports;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s3||!/^(\d\d:){0,2}\d\d?$/.test(e))throw new Error("tick only understands numbers and 'h:m:s'");for(;i--;){if(t=parseInt(n[i],10),t>=60)throw new Error("Invalid time "+e);o+=t*Math.pow(60,r-i-1)}return 1e3*o}function getEpoch(e){if(!e)return 0;if("function"==typeof e.getTime)return e.getTime();if("number"==typeof e)return e;throw new TypeError("now should be milliseconds since UNIX epoch")}function inRange(e,t,n){return n&&n.callAt>=e&&n.callAt<=t}function mirrorDateProperties(e,t){t.now?e.now=function(){return e.clock.now}:delete e.now,t.toSource?e.toSource=function(){return t.toSource()}:delete e.toSource,e.toString=function(){return t.toString()},e.prototype=t.prototype,e.parse=t.parse,e.UTC=t.UTC,e.prototype.toUTCString=t.prototype.toUTCString;for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function createDate(){function e(t,n,r,i,o,s,a){switch(arguments.length){case 0:return new NativeDate(e.clock.now);case 1:return new NativeDate(t);case 2:return new NativeDate(t,n);case 3:return new NativeDate(t,n,r);case 4:return new NativeDate(t,n,r,i);case 5:return new NativeDate(t,n,r,i,o);case 6:return new NativeDate(t,n,r,i,o,s);default:return new NativeDate(t,n,r,i,o,s,a)}}return mirrorDateProperties(e,NativeDate)}function addTimer(e,t){if("undefined"==typeof t.func)throw new Error("Callback must be provided to timer calls");return e.timers||(e.timers={}),t.id=id++,t.createdAt=e.now,t.callAt=e.now+(t.delay||0),e.timers[t.id]=t,addTimerReturnsObject?{id:t.id,ref:function(){},unref:function(){}}:t.id}function firstTimerInRange(e,t,n){var r=e.timers,i=null;for(var o in r)inRange(t,n,r[o])&&(!i||~compareTimers(i,r[o]))&&(i=r[o]);return i}function compareTimers(e,t){return e.callAtt.callAt?1:e.immediate&&!t.immediate?-1:!e.immediate&&t.immediate?1:e.createdAtt.createdAt?1:e.idt.id?1:void 0}function callTimer(clock,timer){"number"==typeof timer.interval?clock.timers[timer.id].callAt+=timer.interval:delete clock.timers[timer.id];try{"function"==typeof timer.func?timer.func.apply(null,timer.args):eval(timer.func)}catch(e){var exception=e}if(clock.timers[timer.id]){if(exception)throw exception}else if(exception)throw exception}function uninstall(e,t){for(var n,r=0,i=e.methods.length;i>r;r++)if(n=e.methods[r],t[n].hadOwnProperty)t[n]=e["_"+n];else try{delete t[n]}catch(o){}e.methods=[]}function hijackMethod(e,t,n){if(n[t].hadOwnProperty=Object.prototype.hasOwnProperty.call(e,t),n["_"+t]=e[t],"Date"==t){var r=mirrorDateProperties(n[t],e[t]);e[t]=r}else{e[t]=function(){return n[t].apply(n,arguments)};for(var i in n[t])n[t].hasOwnProperty(i)&&(e[t][i]=n[t][i])}e[t].clock=n}var timeoutResult=setTimeout(function(){},0),addTimerReturnsObject="object"==typeof timeoutResult;clearTimeout(timeoutResult);var NativeDate=Date,id=1,timers={setTimeout:setTimeout,clearTimeout:clearTimeout,setImmediate:"undefined"!=typeof setImmediate?setImmediate:void 0,clearImmediate:"undefined"!=typeof clearImmediate?clearImmediate:void 0,setInterval:setInterval,clearInterval:clearInterval,Date:Date},keys=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};exports.timers=timers;var createClock=exports.createClock=function(e){var t={now:getEpoch(e),timeouts:{},Date:createDate()};return t.Date.clock=t,t.setTimeout=function(e,n){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,2),delay:n})},t.clearTimeout=function(e){e&&(t.timers||(t.timers=[]),"object"==typeof e&&(e=e.id),e in t.timers&&delete t.timers[e])},t.setInterval=function(e,n){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,2),delay:n,interval:n})},t.clearInterval=function(e){t.clearTimeout(e)},t.setImmediate=function(e){return addTimer(t,{func:e,args:Array.prototype.slice.call(arguments,1),immediate:!0})},t.clearImmediate=function(e){t.clearTimeout(e)},t.tick=function(e){e="number"==typeof e?e:parseTime(e);for(var n,r=t.now,i=t.now+e,o=t.now,s=firstTimerInRange(t,r,i);s&&i>=r;){if(t.timers[s.id]){r=t.now=s.callAt;try{callTimer(t,s)}catch(a){n=n||a}}s=firstTimerInRange(t,o,i),o=r}if(t.now=i,n)throw n;return t.now},t.reset=function(){t.timers={}},t};exports.install=function(e,t,n){"number"==typeof e&&(n=t,t=e,e=null),e||(e=global);var r=createClock(t);r.uninstall=function(){uninstall(r,e)},r.methods=n||[],0===r.methods.length&&(r.methods=keys(timers));for(var i=0,o=r.methods.length;o>i;i++)hijackMethod(e,r.methods[i],r);return r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})}();var define,sinon=function(){"use strict";function e(e,n,r){t=r.exports=e("./sinon/util/core"),e("./sinon/extend"),e("./sinon/typeOf"),e("./sinon/times_in_words"),e("./sinon/spy"),e("./sinon/call"),e("./sinon/behavior"),e("./sinon/stub"),e("./sinon/mock"),e("./sinon/collection"),e("./sinon/assert"),e("./sinon/sandbox"),e("./sinon/test"),e("./sinon/test_case"),e("./sinon/match"),e("./sinon/format"),e("./sinon/log_error")}var t,n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;return r?define(e):n?(e(require,module.exports,module),t=module.exports):t={},t}();if(function(e){function t(e){var t=!1;try{e.appendChild(l),t=l.parentNode==e}catch(n){return!1}finally{try{e.removeChild(l)}catch(n){}}return t}function n(e){return l&&e&&1===e.nodeType&&t(e)}function r(e){return"function"==typeof e||!!(e&&e.constructor&&e.call&&e.apply)}function i(e){return"number"==typeof e&&isNaN(e)}function o(e,t){for(var n in t)c.call(e,n)||(e[n]=t[n])}function s(e){return"function"==typeof e&&"function"==typeof e.restore&&e.restore.sinon}function a(e){return e.wrapMethod=function(e,t,n){if(!e)throw new TypeError("Should wrap property of object");if("function"!=typeof n)throw new TypeError("Method wrapper should be function");var i,s=e[t];if(r(s)){if(s.restore&&s.restore.sinon)i=new TypeError("Attempted to wrap "+t+" which is already wrapped");else if(s.calledBefore){var a=s.returns?"stubbed":"spied on";i=new TypeError("Attempted to wrap "+t+" which is already "+a)}}else i=new TypeError("Attempted to wrap "+typeof s+" property "+t+" as function");if(i)throw s&&s.stackTrace&&(i.stack+="\n--------------\n"+s.stackTrace),i;var u=e.hasOwnProperty?e.hasOwnProperty(t):c.call(e,t);return e[t]=n,n.displayName=t,n.stackTrace=new Error("Stack Trace for original").stack,n.restore=function(){u||delete e[t],e[t]===n&&(e[t]=s)},n.restore.sinon=!0,o(n,s),n},e.create=function(e){var t=function(){};return t.prototype=e,new t},e.deepEqual=function t(r,o){if(e.match&&e.match.isMatcher(r))return r.test(o);if("object"!=typeof r||"object"!=typeof o)return i(r)&&i(o)?!0:r===o;if(n(r)||n(o))return r===o;if(r===o)return!0;if(null===r&&null!==o||null!==r&&null===o)return!1;if(r instanceof RegExp&&o instanceof RegExp)return r.source===o.source&&r.global===o.global&&r.ignoreCase===o.ignoreCase&&r.multiline===o.multiline;var s=Object.prototype.toString.call(r);if(s!=Object.prototype.toString.call(o))return!1;if("[object Date]"==s)return r.valueOf()===o.valueOf();var a,u=0,l=0;if("[object Array]"==s&&r.length!==o.length)return!1;for(a in r){if(u+=1,!(a in o))return!1;if(!t(r[a],o[a]))return!1}for(a in o)l+=1;return u==l},e.functionName=function(e){var t=e.displayName||e.name;if(!t){var n=e.toString().match(/function ([^\s\(]+)/);t=n&&n[1]}return t},e.functionToString=function(){if(this.getCall&&this.callCount)for(var e,t,n=this.callCount;n--;){e=this.getCall(n).thisValue;for(t in e)if(e[t]===this)return t}return this.displayName||"sinon fake"},e.getConfig=function(t){var n={};t=t||{};var r=e.defaultConfig;for(var i in r)r.hasOwnProperty(i)&&(n[i]=t.hasOwnProperty(i)?t[i]:r[i]);return n},e.defaultConfig={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0},e.timesInWords=function(e){return 1==e&&"once"||2==e&&"twice"||3==e&&"thrice"||(e||0)+" times"},e.calledInOrder=function(e){for(var t=1,n=e.length;n>t;t++)if(!e[t-1].calledBefore(e[t])||!e[t].called)return!1;return!0},e.orderByFirstCall=function(e){return e.sort(function(e,t){var n=e.getCall(0),r=t.getCall(0),i=n&&n.callId||-1,o=r&&r.callId||-1;return o>i?-1:1})},e.createStubInstance=function(t){if("function"!=typeof t)throw new TypeError("The constructor should be a function.");return e.stub(e.create(t.prototype))},e.restore=function(e){if(null!==e&&"object"==typeof e)for(var t in e)s(e[t])&&e[t].restore();else s(e)&&e.restore()},e}function u(e,t){a(t)}var l="undefined"!=typeof document&&document.createElement("div"),c=Object.prototype.hasOwnProperty,f="undefined"!=typeof module&&module.exports&&"function"==typeof require,d="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(d)define(u);else if(f)u(require,module.exports);else{if(!e)return;a(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){function t(e){var t,r,i,o=Array.prototype.slice.call(arguments,1);for(r=0;rt;t+=1)if(!e.deepEqual(arguments[t],this.args[t]))return!1;return!0},calledWithMatch:function(){for(var t=0,n=arguments.length;n>t;t+=1){var r=this.args[t],i=arguments[t];if(!e.match||!e.match(i).test(r))return!1}return!0},calledWithExactly:function(){return arguments.length==this.args.length&&this.calledWith.apply(this,arguments)},notCalledWith:function(){return!this.calledWith.apply(this,arguments)},notCalledWithMatch:function(){return!this.calledWithMatch.apply(this,arguments)},returned:function(t){return e.deepEqual(t,this.returnValue)},threw:function(e){return"undefined"!=typeof e&&this.exception?this.exception===e||this.exception.name===e:!!this.exception},calledWithNew:function(){return this.proxy.prototype&&this.thisValue instanceof this.proxy},calledBefore:function(e){return this.callIde.callId},callArg:function(e){this.args[e]()},callArgOn:function(e,t){this.args[e].apply(t)},callArgWith:function(e){this.callArgOnWith.apply(this,[e,null].concat(r.call(arguments,1)))},callArgOnWith:function(e,t){var n=r.call(arguments,2);this.args[e].apply(t,n)},"yield":function(){this.yieldOn.apply(this,[null].concat(r.call(arguments,0)))},yieldOn:function(e){for(var n=this.args,i=0,o=n.length;o>i;++i)if("function"==typeof n[i])return void n[i].apply(e,r.call(arguments,1));t(this.proxy," cannot yield since no callback was passed.",n)},yieldTo:function(e){this.yieldToOn.apply(this,[e,null].concat(r.call(arguments,1)))},yieldToOn:function(e,n){for(var i=this.args,o=0,s=i.length;s>o;++o)if(i[o]&&"function"==typeof i[o][e])return void i[o][e].apply(n,r.call(arguments,2));t(this.proxy," cannot yield to '"+e+"' since no callback was passed.",i)},toString:function(){for(var t=this.proxy.toString()+"(",n=[],r=0,i=this.args.length;i>r;++r)n.push(e.format(this.args[r]));return t=t+n.join(", ")+")","undefined"!=typeof this.returnValue&&(t+=" => "+e.format(this.returnValue)),this.exception&&(t+=" !"+this.exception.name,this.exception.message&&(t+="("+this.exception.message+")")),t}};return i.invokeCallback=i["yield"],n.toString=i.toString,e.spyCall=n,n}function n(e,n,r){var i=e("./util/core");e("./match"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(sinon){function makeApi(sinon){function spy(e,t){if(!t&&"function"==typeof e)return spy.create(e);if(!e&&!t)return spy.create(function(){});var n=e[t];return sinon.wrapMethod(e,t,spy.create(n))}function matchingFake(e,t,n){if(e)for(var r=0,i=e.length;i>r;r++)if(e[r].matches(t,n))return e[r]}function incrementCallCount(){this.called=!0,this.callCount+=1,this.notCalled=!1,this.calledOnce=1==this.callCount,this.calledTwice=2==this.callCount,this.calledThrice=3==this.callCount}function createCallProperties(){this.firstCall=this.getCall(0),this.secondCall=this.getCall(1),this.thirdCall=this.getCall(2),this.lastCall=this.getCall(this.callCount-1)}function createProxy(func){var p;return func.length?eval("p = (function proxy("+vars.substring(0,2*func.length-1)+") { return p.invoke(func, this, slice.call(arguments)); });"):p=function(){return p.invoke(func,this,slice.call(arguments))},p}function delegateToCalls(e,t,n,r){spyApi[e]=function(){if(!this.called)return r?r.apply(this,arguments):!1;for(var i,o=0,s=0,a=this.callCount;a>s;s+=1)if(i=this.getCall(s),i[n||e].apply(i,arguments)&&(o+=1,t))return!0;return o===this.callCount}}var push=Array.prototype.push,slice=Array.prototype.slice,callId=0,vars="a,b,c,d,e,f,g,h,i,j,k,l",uuid=0,spyApi={reset:function(){if(this.invoking){var e=new Error("Cannot reset Sinon function while invoking it. Move the call to .reset outside of the callback.");throw e.name="InvalidResetException",e}if(this.called=!1,this.notCalled=!0,this.calledOnce=!1,this.calledTwice=!1,this.calledThrice=!1,this.callCount=0,this.firstCall=null,this.secondCall=null,this.thirdCall=null,this.lastCall=null,this.args=[],this.returnValues=[],this.thisValues=[],this.exceptions=[],this.callIds=[],this.fakes)for(var t=0;te||e>=this.callCount?null:sinon.spyCall(this,this.thisValues[e],this.args[e],this.returnValues[e],this.exceptions[e],this.callIds[e])},getCalls:function(){var e,t=[];for(e=0;ee.callIds[e.callCount-1]:!1},withArgs:function(){var e=slice.call(arguments);if(this.fakes){var t=matchingFake(this.fakes,e,!0);if(t)return t}else this.fakes=[];var n=this,r=this.instantiateFake();r.matchingAguments=e,r.parent=this,push.call(this.fakes,r),r.withArgs=function(){return n.withArgs.apply(n,arguments)};for(var i=0;in;++n){var i=" "+e.getCall(n).toString();/\n/.test(t[n-1])&&(i="\n"+i),push.call(t,i)}return t.length>0?"\n"+t.join("\n"):""},t:function(e){for(var t=[],n=0,r=e.callCount;r>n;++n)push.call(t,sinon.format(e.thisValues[n]));return t.join(", ")},"*":function(e,t){for(var n=[],r=0,i=t.length;i>r;++r)push.call(n,sinon.format(t[r]));return n.join(", ")}},sinon.extend(spy,spyApi),spy.spyCall=sinon.spyCall,sinon.spy=spy,spy}function loadDependencies(e,t,n){var r=e("./util/core");e("./call"),n.exports=makeApi(r)}var isNode="undefined"!=typeof module&&module.exports&&"function"==typeof require,isAMD="function"==typeof define&&"object"==typeof define.amd&&define.amd; +if(isAMD)define(loadDependencies);else if(isNode)loadDependencies(require,module.exports,module);else{if(!sinon)return;makeApi(sinon)}}("object"==typeof sinon&&sinon||null),function(e){function t(e,t){return"string"==typeof e?(this.exception=new Error(t||""),this.exception.name=e):this.exception=e?e:new Error("Error"),this}function n(e,t){var n=e.callArgAt;if(0>n){for(var r=e.callArgProp,i=0,o=t.length;o>i;++i){if(!r&&"function"==typeof t[i])return t[i];if(r&&t[i]&&"function"==typeof t[i][r])return t[i][r]}return null}return t[n]}function r(e){function r(t,n,r){if(t.callArgAt<0){var i;return i=t.callArgProp?e.functionName(t.stub)+" expected to yield to '"+t.callArgProp+"', but no object with such a property was passed.":e.functionName(t.stub)+" expected to yield, but no callback was passed.",r.length>0&&(i+=" Received ["+s.call(r,", ")+"]"),i}return"argument at index "+t.callArgAt+" is not a function: "+n}function i(e,t){if("number"==typeof e.callArgAt){var i=n(e,t);if("function"!=typeof i)throw new TypeError(r(e,i,t));e.callbackAsync?a(function(){i.apply(e.callbackContext,e.callbackArguments)}):i.apply(e.callbackContext,e.callbackArguments)}}var u={create:function(t){var n=e.extend({},e.behavior);return delete n.create,n.stub=t,n},isPresent:function(){return"number"==typeof this.callArgAt||this.exception||"number"==typeof this.returnArgAt||this.returnThis||this.returnValueDefined},invoke:function(e,t){if(i(this,t),this.exception)throw this.exception;return"number"==typeof this.returnArgAt?t[this.returnArgAt]:this.returnThis?e:this.returnValue},onCall:function(e){return this.stub.onCall(e)},onFirstCall:function(){return this.stub.onFirstCall()},onSecondCall:function(){return this.stub.onSecondCall()},onThirdCall:function(){return this.stub.onThirdCall()},withArgs:function(){throw new Error('Defining a stub by invoking "stub.onCall(...).withArgs(...)" is not supported. Use "stub.withArgs(...).onCall(...)" to define sequential behavior for calls with certain arguments.')},callsArg:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.callArgAt=e,this.callbackArguments=[],this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgOn:function(e,t){if("number"!=typeof e)throw new TypeError("argument index is not number");if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=e,this.callbackArguments=[],this.callbackContext=t,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgWith:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.callArgAt=e,this.callbackArguments=o.call(arguments,1),this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},callsArgOnWith:function(e,t){if("number"!=typeof e)throw new TypeError("argument index is not number");if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=e,this.callbackArguments=o.call(arguments,2),this.callbackContext=t,this.callArgProp=void 0,this.callbackAsync=!1,this},yields:function(){return this.callArgAt=-1,this.callbackArguments=o.call(arguments,0),this.callbackContext=void 0,this.callArgProp=void 0,this.callbackAsync=!1,this},yieldsOn:function(e){if("object"!=typeof e)throw new TypeError("argument context is not an object");return this.callArgAt=-1,this.callbackArguments=o.call(arguments,1),this.callbackContext=e,this.callArgProp=void 0,this.callbackAsync=!1,this},yieldsTo:function(e){return this.callArgAt=-1,this.callbackArguments=o.call(arguments,1),this.callbackContext=void 0,this.callArgProp=e,this.callbackAsync=!1,this},yieldsToOn:function(e,t){if("object"!=typeof t)throw new TypeError("argument context is not an object");return this.callArgAt=-1,this.callbackArguments=o.call(arguments,2),this.callbackContext=t,this.callArgProp=e,this.callbackAsync=!1,this},"throws":t,throwsException:t,returns:function(e){return this.returnValue=e,this.returnValueDefined=!0,this},returnsArg:function(e){if("number"!=typeof e)throw new TypeError("argument index is not number");return this.returnArgAt=e,this},returnsThis:function(){return this.returnThis=!0,this}};for(var l in u)u.hasOwnProperty(l)&&l.match(/^(callsArg|yields)/)&&!l.match(/Async/)&&(u[l+"Async"]=function(e){return function(){var t=this[e].apply(this,arguments);return this.callbackAsync=!0,t}}(l));return e.behavior=u,u}function i(e,t,n){var i=e("./util/core");n.exports=r(i)}var o=Array.prototype.slice,s=Array.prototype.join,a=function(){return"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:"function"==typeof setImmediate?setImmediate:function(e){setTimeout(e,0)}}(),u="undefined"!=typeof module&&module.exports&&"function"==typeof require,l="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(l)define(i);else if(u)i(require,module.exports,module);else{if(!e)return;r(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){function t(n,r,i){if(i&&"function"!=typeof i)throw new TypeError("Custom stub should be function");var o;if(o=i?e.spy&&e.spy.create?e.spy.create(i):i:t.create(),!n&&"undefined"==typeof r)return e.stub.create();if("undefined"==typeof r&&"object"==typeof n){for(var s in n)"function"==typeof n[s]&&t(n,s);return n}return e.wrapMethod(n,r,o)}function n(t){return t.defaultBehavior||r(t)||e.behavior.create(t)}function r(e){return e.parent&&i(e.parent)}function i(e){var t=e.behaviors[e.callCount-1];return t&&t.isPresent()?t:n(e)}var o=0,s={create:function(){var n=function(){return i(n).invoke(this,arguments)};n.id="stub#"+o++;var r=n;return n=e.spy.create(n),n.func=r,e.extend(n,t),n.instantiateFake=e.stub.create,n.displayName="stub",n.toString=e.functionToString,n.defaultBehavior=null,n.behaviors=[],n},resetBehavior:function(){var e;if(this.defaultBehavior=null,this.behaviors=[],delete this.returnValue,delete this.returnArgAt,this.returnThis=!1,this.fakes)for(e=0;en;n+=1)t(e[n])}function r(e){return 0==e?"never called":"called "+c(e)}function i(e){var t=e.minCalls,n=e.maxCalls;if("number"==typeof t&&"number"==typeof n){var r=c(t);return t!=n&&(r="at least "+r+" and at most "+c(n)),r}return"number"==typeof t?"at least "+c(t):"at most "+c(n)}function o(e){var t="number"==typeof e.minCalls;return!t||e.callCount>=e.minCalls}function s(e){return"number"!=typeof e.maxCalls?!1:e.callCount==e.maxCalls}function a(e,t){return l&&l.isMatcher(e)?e.test(t):!0}var u=[].push,l=e.match;e.extend(t,{create:function(n){if(!n)throw new TypeError("object is null");var r=e.extend({},t);return r.object=n,delete r.create,r},expects:function(t){if(!t)throw new TypeError("method is falsy");if(this.expectations||(this.expectations={},this.proxies=[]),!this.expectations[t]){this.expectations[t]=[];var n=this;e.wrapMethod(this.object,t,function(){return n.invokeMethod(t,this,arguments)}),u.call(this.proxies,t)}var r=e.expectation.create(t);return u.call(this.expectations[t],r),r},restore:function(){var e=this.object;n(this.proxies,function(t){"function"==typeof e[t].restore&&e[t].restore()})},verify:function(){var t=this.expectations||{},r=[],i=[];return n(this.proxies,function(e){n(t[e],function(e){e.met()?u.call(i,e.toString()):u.call(r,e.toString())})}),this.restore(),r.length>0?e.expectation.fail(r.concat(i).join("\n")):i.length>0&&e.expectation.pass(r.concat(i).join("\n")),!0},invokeMethod:function(t,n,r){var i,o=this.expectations&&this.expectations[t],s=o&&o.length||0;for(i=0;s>i;i+=1)if(!o[i].met()&&o[i].allowsCall(n,r))return o[i].apply(n,r);var a,l=[],c=0;for(i=0;s>i;i+=1)o[i].allowsCall(n,r)?a=a||o[i]:c+=1,u.call(l," "+o[i].toString());return 0===c?a.apply(n,r):(l.unshift("Unexpected call: "+e.spyCall.toString.call({proxy:t,args:r})),void e.expectation.fail(l.join("\n")))}});var c=e.timesInWords,f=Array.prototype.slice;return e.expectation={minCalls:1,maxCalls:1,create:function(t){var n=e.extend(e.stub.create(),e.expectation);return delete n.create,n.method=t,n},invoke:function(t,n,r){return this.verifyCallAllowed(n,r),e.spy.invoke.apply(this,arguments)},atLeast:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not number");return this.limitsSet||(this.maxCalls=null,this.limitsSet=!0),this.minCalls=e,this},atMost:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not number");return this.limitsSet||(this.minCalls=null,this.limitsSet=!0),this.maxCalls=e,this},never:function(){return this.exactly(0)},once:function(){return this.exactly(1)},twice:function(){return this.exactly(2)},thrice:function(){return this.exactly(3)},exactly:function(e){if("number"!=typeof e)throw new TypeError("'"+e+"' is not a number");return this.atLeast(e),this.atMost(e)},met:function(){return!this.failed&&o(this)},verifyCallAllowed:function(t,n){if(s(this)&&(this.failed=!0,e.expectation.fail(this.method+" already called "+c(this.maxCalls))),"expectedThis"in this&&this.expectedThis!==t&&e.expectation.fail(this.method+" called with "+t+" as thisValue, expected "+this.expectedThis),"expectedArguments"in this){n||e.expectation.fail(this.method+" received no arguments, expected "+e.format(this.expectedArguments)),n.lengthr;r+=1)a(this.expectedArguments[r],n[r])||e.expectation.fail(this.method+" received wrong arguments "+e.format(n)+", didn't match "+this.expectedArguments.toString()),e.deepEqual(this.expectedArguments[r],n[r])||e.expectation.fail(this.method+" received wrong arguments "+e.format(n)+", expected "+e.format(this.expectedArguments))}},allowsCall:function(t,n){if(this.met()&&s(this))return!1;if("expectedThis"in this&&this.expectedThis!==t)return!1;if(!("expectedArguments"in this))return!0;if(n=n||[],n.lengthr;r+=1){if(!a(this.expectedArguments[r],n[r]))return!1;if(!e.deepEqual(this.expectedArguments[r],n[r]))return!1}return!0},withArgs:function(){return this.expectedArguments=f.call(arguments),this},withExactArgs:function(){return this.withArgs.apply(this,arguments),this.expectsExactArgCount=!0,this},on:function(e){return this.expectedThis=e,this},toString:function(){var t=(this.expectedArguments||[]).slice();this.expectsExactArgCount||u.call(t,"[...]");var n=e.spyCall.toString.call({proxy:this.method||"anonymous mock expectation",args:t}),o=n.replace(", [...","[, ...")+" "+i(this);return this.met()?"Expectation met: "+o:"Expected "+o+" ("+r(this.callCount)+")"},verify:function(){return this.met()?e.expectation.pass(this.toString()):e.expectation.fail(this.toString()),!0},pass:function(t){e.assert.pass(t)},fail:function(e){var t=new Error(e);throw t.name="ExpectationError",t}},e.mock=t,t}function n(e,n,r){var i=e("./util/core");e("./call"),e("./match"),e("./spy"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e){return e.fakes||(e.fakes=[]),e.fakes}function n(e,n){for(var r=t(e),i=0,o=r.length;o>i;i+=1)"function"==typeof r[i][n]&&r[i][n]()}function r(e){for(var n=t(e),r=0;rr;++r)if(n[r]==t)return n.splice(r,1)},dispatchEvent:function(e){for(var t=e.type,n=this.eventListeners&&this.eventListeners[t]||[],r=0;r=0;o--)e(i[o]);"function"==typeof t.onCreate&&t.onCreate(this)}function n(){this.eventListeners={progress:[],load:[],abort:[],error:[]}}function r(e){if(e.readyState!==t.OPENED)throw new Error("INVALID_STATE_ERR");if(e.sendFlag)throw new Error("INVALID_STATE_ERR")}function i(e,t){t=t.toLowerCase();for(var n in e)if(n.toLowerCase()==t)return n;return null}function o(e,t){if(e)for(var n=0,r=e.length;r>n;n+=1)t(e[n])}function s(e,t){for(var n=0;nt.UNSENT&&this.sendFlag&&(this.readyStateChange(t.DONE),this.sendFlag=!1),this.readyState=t.UNSENT,this.dispatchEvent(new n.Event("abort",!1,!1,this)),this.upload.dispatchEvent(new n.Event("abort",!1,!1,this)),"function"==typeof this.onerror&&this.onerror()},getResponseHeader:function(e){return this.readyStater;++r)if(n[r]==t)return n.splice(r,1)},n.prototype.dispatchEvent=function(e){for(var t,n=this.eventListeners[e.type]||[],r=0;null!=(t=n[r]);r++)t(e)};var g=function(e,t,n){switch(n.length){case 0:return e[t]();case 1:return e[t](n[0]);case 2:return e[t](n[0],n[1]);case 3:return e[t](n[0],n[1],n[2]);case 4:return e[t](n[0],n[1],n[2],n[3]);case 5:return e[t](n[0],n[1],n[2],n[3],n[4])}};t.filters=[],t.addFilter=function(e){this.filters.push(e)};var v=/MSIE 6/;t.defake=function(e,n){var r=new y.workingXHR;o(["open","setRequestHeader","send","abort","getResponseHeader","getAllResponseHeaders","addEventListener","overrideMimeType","removeEventListener"],function(t){e[t]=function(){return g(r,t,arguments)}});var i=function(t){o(t,function(t){try{e[t]=r[t]}catch(n){if(!v.test(navigator.userAgent))throw n}})},s=function(){e.readyState=r.readyState,r.readyState>=t.HEADERS_RECEIVED&&i(["status","statusText"]),r.readyState>=t.LOADING&&i(["responseText","response"]),r.readyState===t.DONE&&i(["responseXML"]),e.onreadystatechange&&e.onreadystatechange.call(e,{target:e})};if(r.addEventListener){for(var a in e.eventListeners)e.eventListeners.hasOwnProperty(a)&&o(e.eventListeners[a],function(e){r.addEventListener(a,e)});r.addEventListener("readystatechange",s)}else r.onreadystatechange=s;g(r,"open",n)},t.useFilters=!1,t.parseXML=function(e){var t;if("undefined"!=typeof DOMParser){var n=new DOMParser;t=n.parseFromString(e,"text/xml")}else t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},t.statusCodes={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choice",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};var w="undefined"!=typeof module&&module.exports&&"function"==typeof require,b="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(b)define(d);else if(w)d(require,module.exports,module);else{if("undefined"==typeof sinon)return;f(sinon)}}("undefined"!=typeof self?self:this),"undefined"==typeof sinon)var sinon={};return function(){function e(){}function t(t){return e.prototype=t,new e}function n(e){var t=e;if("[object Array]"!=Object.prototype.toString.call(e)&&(t=[200,{},e]),"string"!=typeof t[2])throw new TypeError("Fake server response body should be string, but was "+typeof t[2]);return t}function r(e,t,n){var r=e.method,i=!r||r.toLowerCase()==t.toLowerCase(),o=e.url,s=!o||o==n||"function"==typeof o.test&&o.test(n);return i&&s}function i(e,t){var n=t.url;if((!/^https?:\/\//.test(n)||l.test(n))&&(n=n.replace(l,"")),r(e,this.getHTTPMethod(t),n)){if("function"==typeof e.response){var i=e.url,o=[t].concat(i&&"function"==typeof i.exec?i.exec(n).slice(1):[]);return e.response.apply(e,o)}return!0}return!1}function o(e){e.fakeServer={create:function(){var n=t(this);return this.xhr=e.useFakeXMLHttpRequest(),n.requests=[],this.xhr.onCreate=function(e){n.addRequest(e)},n},addRequest:function(e){var t=this;a.call(this.requests,e),e.onSend=function(){t.handleRequest(this),t.autoRespond&&!t.responding&&(setTimeout(function(){t.responding=!1,t.respond()},t.autoRespondAfter||10),t.responding=!0)}},getHTTPMethod:function(e){if(this.fakeHTTPMethods&&/post/i.test(e.method)){var t=(e.requestBody||"").match(/_method=([^\b;]+)/);return t?t[1]:e.method}return e.method},handleRequest:function(e){e.async?(this.queue||(this.queue=[]),a.call(this.queue,e)):this.processRequest(e)},log:function(t,n){var r;r="Request:\n"+e.format(n)+"\n\n",r+="Response:\n"+e.format(t)+"\n\n",e.log(r)},respondWith:function(e,t,r){return 1==arguments.length&&"function"!=typeof e?void(this.response=n(e)):(this.responses||(this.responses=[]),1==arguments.length&&(r=e,t=e=null),2==arguments.length&&(r=t,t=e,e=null),void a.call(this.responses,{method:e,url:t,response:"function"==typeof r?r:n(r)}))},respond:function(){arguments.length>0&&this.respondWith.apply(this,arguments);for(var e,t=this.queue||[],n=t.splice(0,t.length);e=n.shift();)this.processRequest(e)},processRequest:function(t){try{if(t.aborted)return;var n=this.response||[404,{},""];if(this.responses)for(var r=this.responses.length,o=r-1;o>=0;o--)if(i.call(this,this.responses[o],t)){n=this.responses[o].response;break}4!=t.readyState&&(this.log(n,t),t.respond(n[0],n[1],n[2]))}catch(s){e.logError("Fake server request processing",s)}},restore:function(){return this.xhr.restore&&this.xhr.restore.apply(this.xhr,arguments)}}}function s(e,t,n){var r=e("./core");e("./fake_xml_http_request"),o(r),n.exports=r}var a=[].push,u="undefined"!=typeof window?window.location:{},l=new RegExp("^"+u.protocol+"//"+u.host),c="undefined"!=typeof module&&module.exports&&"function"==typeof require,f="function"==typeof define&&"object"==typeof define.amd&&define.amd;f?define(s):c?s(require,module.exports,module):o(sinon)}(),function(){function e(e){function t(){}t.prototype=e.fakeServer,e.fakeServerWithClock=new t,e.fakeServerWithClock.addRequest=function(t){if(t.async&&("object"==typeof setTimeout.clock?this.clock=setTimeout.clock:(this.clock=e.useFakeTimers(),this.resetClock=!0),!this.longestTimeout)){var n=this.clock.setTimeout,r=this.clock.setInterval,i=this;this.clock.setTimeout=function(e,t){return i.longestTimeout=Math.max(t,i.longestTimeout||0),n.apply(this,arguments)},this.clock.setInterval=function(e,t){return i.longestTimeout=Math.max(t,i.longestTimeout||0),r.apply(this,arguments)}}return e.fakeServer.addRequest.call(this,t)},e.fakeServerWithClock.respond=function(){var t=e.fakeServer.respond.apply(this,arguments);return this.clock&&(this.clock.tick(this.longestTimeout||0),this.longestTimeout=0,this.resetClock&&(this.clock.restore(),this.resetClock=!1)),t},e.fakeServerWithClock.restore=function(){return this.clock&&this.clock.restore(),e.fakeServer.restore.apply(this,arguments)}}function t(t){var n=t("./core");t("./fake_server"),t("./fake_timers"),e(n)}var n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd;r?define(t):n?t(require):e(sinon)}(),function(){function e(e){function t(e,t,n,i){i&&(!t.injectInto||n in t.injectInto?r.call(e.args,i):(t.injectInto[n]=i,e.injectedKeys.push(n)))}function n(t){var n=e.create(e.sandbox);return t.useFakeServer&&("object"==typeof t.useFakeServer&&(n.serverPrototype=t.useFakeServer),n.useFakeServer()),t.useFakeTimers&&("object"==typeof t.useFakeTimers?n.useFakeTimers.apply(n,t.useFakeTimers):n.useFakeTimers()),n}var r=[].push;return e.sandbox=e.extend(e.create(e.collection),{useFakeTimers:function(){return this.clock=e.useFakeTimers.apply(e,arguments),this.add(this.clock)},serverPrototype:e.fakeServer,useFakeServer:function(){var t=this.serverPrototype||e.fakeServer;return t&&t.create?(this.server=t.create(),this.add(this.server)):null},inject:function(t){return e.collection.inject.call(this,t),this.clock&&(t.clock=this.clock),this.server&&(t.server=this.server,t.requests=this.server.requests),t.match=e.match,t},restore:function(){e.collection.restore.apply(this,arguments),this.restoreContext()},restoreContext:function(){if(this.injectedKeys){for(var e=0,t=this.injectedKeys.length;t>e;e++)delete this.injectInto[this.injectedKeys[e]];this.injectedKeys=[]}},create:function(r){if(!r)return e.create(e.sandbox);var i=n(r);i.args=i.args||[],i.injectedKeys=[],i.injectInto=r.injectInto;var o,s,a=i.inject({});if(r.properties)for(var u=0,l=r.properties.length;l>u;u++)o=r.properties[u],s=a[o]||"sandbox"==o&&i,t(i,r,o,s);else t(i,r,"sandbox",s);return i},match:e.match}),e.sandbox.useFakeXMLHttpRequest=e.sandbox.useFakeServer,e.sandbox}function t(t,n,r){var i=t("./util/core");t("./util/fake_server"),t("./util/fake_timers"),t("./collection"),r.exports=e(i)}var n="undefined"!=typeof module&&module.exports&&"function"==typeof require,r="function"==typeof define&&"object"==typeof define.amd&&define.amd; +if(r)define(t);else if(n)t(require,module.exports,module);else{if(!sinon)return;e(sinon)}}(),function(e){function t(e){function t(t){function n(){var n=e.getConfig(e.config);n.injectInto=n.injectIntoThis&&this||n.injectInto;var r,i,o=e.sandbox.create(n),s=!1,a=Array.prototype.slice.call(arguments);if(a.length>0&&"function"==typeof a[arguments.length-1]){var u=a[arguments.length-1];a[arguments.length-1]=function(e){if(e)throw o.restore(),r;o.verifyAndRestore(),u(e)},s=!0}var l=a.concat(o.args);try{i=t.apply(this,l)}catch(c){r=c}if(!s){if("undefined"!=typeof r)throw o.restore(),r;o.verifyAndRestore()}return i}var r=typeof t;if("function"!=r)throw new TypeError("sinon.test needs to wrap a test function, got "+r);return t.length?function(){return n.apply(this,arguments)}:n}return t.config={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0},e.test=t,t}function n(e,n,r){var i=e("./util/core");e("./sandbox"),r.exports=t(i)}var r="undefined"!=typeof module&&module.exports&&"function"==typeof require,i="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(i)define(n);else if(r)n(require,module.exports,module);else{if(!e)return;t(e)}}("object"==typeof sinon&&sinon||null),function(e){function t(e,t,n){return function(){t&&t.apply(this,arguments);var r,i;try{i=e.apply(this,arguments)}catch(o){r=o}if(n&&n.apply(this,arguments),r)throw r;return i}}function n(e){function n(n,r){if(!n||"object"!=typeof n)throw new TypeError("sinon.testCase needs an object with test functions");r=r||"test";var i,o,s,a=new RegExp("^"+r),u={},l=n.setUp,c=n.tearDown;for(i in n)if(n.hasOwnProperty(i)){if(o=n[i],/^(setUp|tearDown)$/.test(i))continue;"function"==typeof o&&a.test(i)?(s=o,(l||c)&&(s=t(o,l,c)),u[i]=e.test(s)):u[i]=n[i]}return u}return e.testCase=n,n}function r(e,t,r){var i=e("./util/core");e("./test"),r.exports=n(i)}var i="undefined"!=typeof module&&module.exports&&"function"==typeof require,o="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(o)define(r);else if(i)r(require,module.exports,module);else{if(!e)return;n(e)}}("object"==typeof sinon&&sinon||null),function(e,t){function n(e){function n(){for(var e,t=0,n=arguments.length;n>t;++t)e=arguments[t],e||a.fail("fake is not a spy"),"function"!=typeof e&&a.fail(e+" is not a function"),"function"!=typeof e.getCall&&a.fail(e+" is not stubbed")}function r(e,n){e=e||t;var r=e.fail||a.fail;r.call(e,n)}function o(e,t,o){2==arguments.length&&(o=t,t=e),a[e]=function(s){n(s);var u=i.call(arguments,1),l=!1;l="function"==typeof t?!t(s):"function"==typeof s[t]?!s[t].apply(s,u):!s[t],l?r(this,s.printf.apply(s,[o].concat(u))):a.pass(e)}}function s(e,t){return!e||/^fail/.test(t)?t:e+t.slice(0,1).toUpperCase()+t.slice(1)}var a;return a={failException:"AssertError",fail:function(e){var t=new Error(e);throw t.name=this.failException||a.failException,t},pass:function(){},callOrder:function(){n.apply(null,arguments);var t="",o="";if(e.calledInOrder(arguments))a.pass("callOrder");else{try{t=[].join.call(arguments,", ");for(var s=i.call(arguments),u=s.length;u;)s[--u].called||s.splice(u,1);o=e.orderByFirstCall(s).join(", ")}catch(l){}r(this,"expected "+t+" to be called in order but were called as "+o)}},callCount:function(t,i){if(n(t),t.callCount!=i){var o="expected %n to be called "+e.timesInWords(i)+" but was called %c%C";r(this,t.printf(o))}else a.pass("callCount")},expose:function(e,t){if(!e)throw new TypeError("target is null or undefined");var n=t||{},r="undefined"==typeof n.prefix&&"assert"||n.prefix,i="undefined"==typeof n.includeFail||!!n.includeFail;for(var o in this)"expose"==o||!i&&/^(fail)/.test(o)||(e[s(r,o)]=this[o]);return e},match:function(t,n){var i=e.match(n);if(i.test(t))a.pass("match");else{var o=["expected value to match"," expected = "+e.format(n)," actual = "+e.format(t)];r(this,o.join("\n"))}}},o("called","expected %n to have been called at least once but was never called"),o("notCalled",function(e){return!e.called},"expected %n to not have been called but was called %c%C"),o("calledOnce","expected %n to be called once but was called %c%C"),o("calledTwice","expected %n to be called twice but was called %c%C"),o("calledThrice","expected %n to be called thrice but was called %c%C"),o("calledOn","expected %n to be called with %1 as this but was called with %t"),o("alwaysCalledOn","expected %n to always be called with %1 as this but was called with %t"),o("calledWithNew","expected %n to be called with new"),o("alwaysCalledWithNew","expected %n to always be called with new"),o("calledWith","expected %n to be called with arguments %*%C"),o("calledWithMatch","expected %n to be called with match %*%C"),o("alwaysCalledWith","expected %n to always be called with arguments %*%C"),o("alwaysCalledWithMatch","expected %n to always be called with match %*%C"),o("calledWithExactly","expected %n to be called with exact arguments %*%C"),o("alwaysCalledWithExactly","expected %n to always be called with exact arguments %*%C"),o("neverCalledWith","expected %n to never be called with arguments %*%C"),o("neverCalledWithMatch","expected %n to never be called with match %*%C"),o("threw","%n did not throw exception%C"),o("alwaysThrew","%n did not always throw exception%C"),e.assert=a,a}function r(e,t,r){var i=e("./util/core");e("./match"),r.exports=n(i)}var i=Array.prototype.slice,o="undefined"!=typeof module&&module.exports&&"function"==typeof require,s="function"==typeof define&&"object"==typeof define.amd&&define.amd;if(s)define(r);else if(o)r(require,module.exports,module);else{if(!e)return;n(e)}}("object"==typeof sinon&&sinon||null,"undefined"!=typeof window?window:"undefined"!=typeof self?self:global),"undefined"==typeof sinon&&(this.sinon={}),function(e){function t(t){function n(){this.readyState=n.UNSENT,this.requestBody=null,this.requestHeaders={},this.status=0,this.timeout=null,"function"==typeof n.onCreate&&n.onCreate(this)}function i(e){if(e.readyState!==n.OPENED)throw new Error("INVALID_STATE_ERR");if(e.sendFlag)throw new Error("INVALID_STATE_ERR")}function o(e){if(e.readyState==n.UNSENT)throw new Error("Request not sent");if(e.readyState==n.DONE)throw new Error("Request done")}function s(e){if("string"!=typeof e){var t=new Error("Attempted to respond to fake XDomainRequest with "+e+", which is not a string.");throw t.name="InvalidBodyException",t}}t.xdr=r,t.extend(n.prototype,t.EventTarget,{open:function(e,t){this.method=e,this.url=t,this.responseText=null,this.sendFlag=!1,this.readyStateChange(n.OPENED)},readyStateChange:function(e){this.readyState=e;var r="";switch(this.readyState){case n.UNSENT:break;case n.OPENED:break;case n.LOADING:this.sendFlag&&(r="onprogress");break;case n.DONE:r=this.isTimeout?"ontimeout":this.errorFlag||this.status<200||this.status>299?"onerror":"onload"}if(r&&"function"==typeof this[r])try{this[r]()}catch(i){t.logError("Fake XHR "+r+" handler",i)}},send:function(e){i(this),/^(get|head)$/i.test(this.method)||(this.requestBody=e),this.requestHeaders["Content-Type"]="text/plain;charset=utf-8",this.errorFlag=!1,this.sendFlag=!0,this.readyStateChange(n.OPENED),"function"==typeof this.onSend&&this.onSend(this)},abort:function(){this.aborted=!0,this.responseText=null,this.errorFlag=!0,this.readyState>t.FakeXDomainRequest.UNSENT&&this.sendFlag&&(this.readyStateChange(t.FakeXDomainRequest.DONE),this.sendFlag=!1)},setResponseBody:function(e){o(this),s(e);var t=this.chunkSize||10,r=0;this.responseText="";do this.readyStateChange(n.LOADING),this.responseText+=e.substring(r,r+t),r+=t;while(r=3?e[2]:this.actual};e.length>=2&&(r.expected=e[1]),e.length>=4&&(r.inspect=e.slice(3)),i(t,r)},stats:{assertions:{},total:{assertions:0}}}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var i=r(32),o=r(53),s=r(33),a=function l(t){s.staticShouldUnWrap(i.isWrapperType(t)&&l.warn);var e=i.isWrapperType(t)?t.valueOf():t;return new l.Assertion(e,l.format)},u="SHOULDJS_WARN",c="undefined"!=typeof n&&{NODE_ENV:"production"}[u]&&"true"==={NODE_ENV:"production"}[u];a.warn="undefined"==typeof c?!0:c,a.AssertionError=r(34),a.Assertion=r(35),a.format=o,e=t.exports=a,a.extend=function(t,e){t=t||"should",e=e||Object.prototype,Object.defineProperty(e,t,{set:function(){},get:function(){return a(i.isWrapperType(this)?this.valueOf():this)},configurable:!0})},a.extend("should",Object.prototype),a.use=function(t){return t(this,this.Assertion),this},a.use(r(36)).use(r(37)).use(r(38)).use(r(39)).use(r(40)).use(r(41)).use(r(42)).use(r(43)).use(r(44)).use(r(45)).use(r(46))}).call(e,r(51))},function(t,e,r){function n(t,e){return p.isUndefined(e)?""+e:!p.isNumber(e)||!isNaN(e)&&isFinite(e)?p.isFunction(e)||p.isRegExp(e)?e.toString():e:e.toString()}function i(t,e){return p.isString(t)?t.length=0;n--)if(i[n]!=o[n])return!1;for(n=i.length-1;n>=0;n--)if(r=i[n],!u(t[r],e[r]))return!1;return!0}function f(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function h(t,e,r,n){var i;p.isString(r)&&(n=r,r=null);try{e()}catch(o){i=o}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&s(i,r,"Missing expected exception"+n),!t&&f(i,r)&&s(i,r,"Got unwanted exception"+n),t&&i&&r&&!f(i,r)||!t&&i)throw i}var p=r(56),d=Array.prototype.slice,y=Object.prototype.hasOwnProperty,g=t.exports=a;g.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var e=t.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=e.name,a=n.indexOf("\n"+i);if(a>=0){var u=n.indexOf("\n",a+1);n=n.substring(u+1)}this.stack=n}}},p.inherits(g.AssertionError,Error),g.fail=s,g.ok=a,g.equal=function(t,e,r){t!=e&&s(t,e,r,"==",g.equal)},g.notEqual=function(t,e,r){t==e&&s(t,e,r,"!=",g.notEqual)},g.deepEqual=function(t,e,r){u(t,e)||s(t,e,r,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,r){u(t,e)&&s(t,e,r,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,r){t!==e&&s(t,e,r,"===",g.strictEqual)},g.notStrictEqual=function(t,e,r){t===e&&s(t,e,r,"!==",g.notStrictEqual)},g["throws"]=function(){h.apply(this,[!0].concat(d.call(arguments)))},g.doesNotThrow=function(){h.apply(this,[!1].concat(d.call(arguments)))},g.ifError=function(t){if(t)throw t};var v=Object.keys||function(t){var e=[];for(var r in t)y.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";function n(t,e){"undefined"==typeof a.assertions[t]&&(a.assertions[t]=0),a.assertions[t]++,e&&a.total.assertions++}var i=r(24),o=r(23),s=r(22),a=r(21).stats,u=r(21).fail;t.exports=function(t){return{is:function(e){return n("is",!0),s(t).eql(e),this},isNot:function(e){return n("isNot",!0),s(t).not.eql(e),this},isEqualTo:function(e){return n("isEqualTo",!0),i.equal(t,e,"(actual == expected), actual "+typeof t+" is not equal to expected "+typeof e),this},isNotEqualTo:function(e){return n("isNotEqualTo",!0),i.notEqual(t,e,"(actual != expected), actual "+typeof t+" is equal to expected"+typeof e),this},isStrictEqualTo:function(e){return n("isStrictEqualTo",!0),i.strictEqual(t,e,"(actual === expected), actual "+typeof t+" is not identical to expected "+typeof e),this},isNotStrictEqualTo:function(e){return n("isNotStrictEqualTo",!0),i.notStrictEqual(t,e,"(actual !== expected), actual "+typeof t+" is identical to expected "+typeof e),this},isIdenticalTo:function(t){return n("isIdenticalTo"),this.isStrictEqualTo(t)},isNotIdenticalTo:function(t){return n("isNotIdenticalTo"),this.isNotStrictEqualTo(t)},match:function(e){return n("match",!0),"function"==typeof e?(e(t)!==!0&&u("actual value tested must match."),this):(s(t).match(e),this)},notMatch:function(e){return n("notMatch",!0),"function"==typeof e?(e(t)&&u("actual value tested ("+t+") must not match ("+e+")"),this):(s(t).not.match(e),this)},matchEach:function(e){if(n("matchEach",!0),"function"==typeof e){if("object"==typeof t)for(var r in t)e(t[r],r)!==!0&&u("matchEach()",t[r],e);else e(t)!==!0&&u("matchEach()",t,e);return this}for(var i in e)if("function"!=typeof e[i])this.match(e[i]);else{if("object"==typeof t){for(var r in t)e[i](t[r],r)!==!0&&u("matchEach()",t[r],e[i]);continue}e[i](t)!==!0&&u("matchEach()",t,e[i])}return this},notMatchEach:function(e){if(n("notMatchEach",!0),"function"==typeof e){if("object"==typeof t)for(var r in t)e(t[r],r)&&u("notMatchEach()",t[r],e);else e(t)&&u("notMatchEach()",t,e);return this}for(var i in e)if("function"!=typeof e[i])this.notMatch(e[i]);else{if("object"==typeof t){for(var r in t)e[i](t[r],r)&&u("notMatchEach()",t[r],e[i]);continue}e[i](t)&&u("notMatchEach()",t,e[i])}return this},isValid:function(t){return n("isValid"),this.match(t)},isNotValid:function(t){return n("isNotValid"),this.notMatch(t)},isType:function(e){return n("isType",!0),o(t).type(e),this},isNotType:function(e){return n("isNotType",!0),o(t).not.type(e),this},isObject:function(){return n("isObject",!0),s(t).object(),this},isArray:function(){return n("isArray",!0),s(t).array(),this},isFunction:function(){return n("isFunction",!0),s(t)["function"](),this},isString:function(){return n("isString",!0),s(t).string(),this},isNumber:function(){return n("isNumber",!0),s(t).number(),this},isBool:function(){return n("isBool"),this.isBoolean()},isBoolean:function(){return n("isBoolean",!0),s(t)["boolean"](),this},isNull:function(){return n("isNull",!0),s(t)["null"](),this},isUndefined:function(){return n("isUndefined",!0),s(t).undefined(),this},isRegExp:function(){return n("isRegExp",!0),s(t).regexp(),this},isNotRegExp:function(){return n("isNotRegExp",!0),s(t).not.regexp(),this},isDate:function(){return n("isDate",!0),s(t).date(),this},isNotDate:function(){return n("isNotDate",!0),s(t).not.date(),this},isArguments:function(){return n("isArguments",!0),o(t).arguments,this},isNotArguments:function(){return n("isNotArguments",!0),o(t).not.arguments,this},isTrue:function(){return n("isTrue",!0),s(t)["true"](),this},isNotTrue:function(){return n("isNotTrue",!0),s(t).not["true"](),this},isTruthy:function(){return n("isTruthy",!0),s(t).truthy(),this},isNotTruthy:function(){return n("isNotTruthy",!0),s(t).not.truthy(),this},isFalse:function(){return n("isFalse",!0),s(t)["false"](),this},isNotFalse:function(){return n("isNotFalse",!0),s(t).not["false"](),this},isFalsy:function(){return n("isFalsy",!0),s(t).falsy(),this},isNotFalsy:function(){return n("isNotFalsy",!0),s(t).not.falsy(),this},isEmpty:function(){return n("isEmpty",!0),s(t).empty(),this},isNotEmpty:function(){return n("isNotEmpty",!0),s(t).not.empty(),this},exists:function(){return n("exists",!0),s(t).exist(),this},isError:function(){return n("isError"),this["throws"](Error)},"throws":function(e,r){if(n("throws",!0),arguments.length>2)throw new Error("throws() assertion, takes maximum 2 arguments (constructor and expected).");return 1==arguments.length?"function"==typeof e?i["throws"](t,e):s(t)["throw"](e):2==arguments.length?s(t)["throw"](e,r):s(t)["throw"](),this},hasLength:function(e){if(n("hasLength",!0),"object"==typeof t){var r=0;for(var i in t)r++;r!==e&&u(t+"must has length of "+e)}else s(t).length(e);return this},hasNotLength:function(e){if(n("hasNotLength",!0),"object"==typeof t){var r=0;for(var i in t)r++;r===e&&u(t+"must has not length of "+e)}else s(t).not.length(e);return this},isBetween:function(e,r){return n("isBetween",!0),s(t).between(e,r),this},isNotBetween:function(e,r){return n("isNotBetween",!0),s(t).not.between(e,r),this},isBefore:function(e){return n("isBefore",!0),s(t).before(e),this},isAfter:function(e){return n("isAfter",!0),s(t).after(e),this},isGreaterThan:function(e){return n("isGreaterThan",!0),s(t).above(e),this},isLessThan:function(e){return n("isLessThan",!0),s(t).below(e),this},isApprox:function(e,r){return n("isApprox",!0),o(t).approximately(e,r),this},isInfinite:function(){return n("isInfinite",!0),o(t).Infinity,this},isNotInfinite:function(){return n("isNotInfinite",!0),o(t).not.Infinity,this},isEnumerable:function(e){return n("isEnumerable",!0),s(t).enumerable(e),this},isNotEnumerable:function(e){return n("isNotEnumerable",!0),s(t).nonenumerable(e),this},isFrozen:function(){return n("isFrozen",!0),s(t).frozen(),this},isNotFrozen:function(){return n("isNotFrozen",!0),s(t).not.frozen(),this},isInstanceOf:function(e){return n("isInstanceOf",!0),s(t)["instanceof"](e),this},isNotInstanceOf:function(e){return n("isNotInstanceOf",!0),s(t).not["instanceof"](e),this},hasProperty:function(e,r){if(n("hasProperty",!0),!arguments.length)throw new Error('hasProperty() asserter require the argument "property" (the name of the property).');if(1==arguments.length)s(t).property(e);else{if(2!=arguments.length)throw new Error("hasProperty() asserter, takes maximum 2 arguments (property and value).");s(t).property(e,r)}return this},hasNotProperty:function(e,r){if(n("hasNotProperty",!0),0===arguments.length)throw new Error('hasNotProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).not.property(e);else{if(2!==arguments.length)throw new Error("hasNotProperty() asserter, takes maximum 2 arguments (property and value).");s(t).not.property(e,r)}return this},hasOwnProperty:function(e,r){if(n("hasOwnProperty ",!0),0===arguments.length)throw new Error('hasOwnProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).ownProperty(e);else{if(2!==arguments.length)throw new Error("hasOwnProperty() asserter, takes maximum 2 arguments (property and value).");s(t).ownProperty(e,r)}return this},hasNotOwnProperty:function(e,r){if(n("hasNotOwnProperty",!0),0===arguments.length)throw new Error('hasNotOwnProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).not.ownProperty(e);else{if(2!==arguments.length)throw new Error("hasNotOwnProperty() asserter, takes maximum 2 arguments (property and value).");s(t).not.ownProperty(e,r)}return this},hasProperties:function(e){return n("hasProperties",!0),s(t).keys(e),this},hasNotProperties:function(e){return n("hasNotProperties",!0),s(t).not.keys(e),this},hasOwnProperties:function(e){return n("hasOwnProperties",!0),s(t).ownKeys(e),this},hasKey:function(){return n("hasKey"),this.hasProperty.apply(this,arguments)},notHasKey:function(){return n("notHasKey"),this.hasNotProperty.apply(this,arguments)},hasKeys:function(t){return n("hasKeys"),this.hasProperties(t)},notHasKeys:function(t){return n("notHasKeys"),this.hasNotProperties(t)},hasValue:function(e){return n("hasValue",!0),s(t).include(e),this},notHasValue:function(e){return n("notHasValue",!0),s(t).not.include(e),this},hasValues:function(e){n("hasValues",!0);for(var r in e)s(t).include(e[r]);return this},notHasValues:function(e){n("notHasValues",!0);for(var r in e)s(t).not.include(e[r]);return this},contains:function(e){if(n("contains",!0),arguments.length>1)for(var r in arguments)o(t).containDeep(arguments[r]);else o(t).containDeep(e);return this},notContains:function(e){if(n("notContains",!0),arguments.length>1)for(var r in arguments)o(t).not.containDeep(arguments[r]);else o(t).not.containDeep(e);return this},isReverseOf:function(e){return n("isReverseOf"),this.is(e.reverse()),s(t).permutationOf(e),this},isNotReverseOf:function(e){return n("isNotReverseOf"),this.isNot(e.reverse()),s(t).not.permutationOf(e),this},startsWith:function(e){return n("startsWith",!0),o(t).startWith(e),this},notStartsWith:function(e){return n("notStartsWith",!0),o(t).not.startWith(e),this},endsWith:function(e){return n("endsWith",!0),o(t).endWith(e),this},notEndsWith:function(e){return n("notEndsWith",!0),o(t).not.endWith(e),this},hasHttpStatus:function(e){return n("hasHttpStatus",!0),s(t).property("statusCode",e),this},notHasHttpStatus:function(e){return n("notHasHttpStatus",!0),s(t).not.property("statusCode",e),this},hasHeader:function(e,r){if(n("hasHeader",!0),0===arguments.length||arguments.length>2)throw new Error('hasHeader() asserter, takes minimum the "field" argument, maximum 2 arguments (field and value).');return s(t).property("headers"),1===arguments.length?s(t.headers).property(e.toLowerCase()):s(t.headers).property(e.toLowerCase(),r),this},notHasHeader:function(e,r){if(n("notHasHeader",!0),0===arguments.length||arguments.length>2)throw new Error('notHasHeader() asserter, takes minimum the "field" argument, maximum 2 arguments (field and value).');return 1===arguments.length?s(t.headers).not.property(e.toLowerCase()):s(t.headers).not.property(e.toLowerCase(),r),this},hasHeaderJson:function(){return n("hasHeaderJson",!0),s(t).property("headers"),s(t.headers).property("content-type"),s(t.headers["content-type"]).match(/application\/json/i),this},notHasHeaderJson:function(){return n("notHasHeaderJson",!0),t&&t.headers&&"content-type"in t.headers&&s(t.headers["content-type"]).not.match(/application\/json/i),this},hasHeaderHtml:function(){return n("hasHeaderHtml",!0),s(t).property("headers"),s(t.headers).property("content-type"),s(t.headers["content-type"]).match(/text\/html/i),this},notHasHeaderHtml:function(){return n("notHasHeaderHtml",!0),t&&t.headers&&"content-type"in t.headers&&s(t.headers["content-type"]).not.match(/text\/html/i),this}}}},function(t){"use strict";t.exports=["is","isNot","isIdenticalTo","isNotIdenticalTo","isEqualTo","isNotEqualTo","isStrictEqualTo","isNotStrictEqualTo","match","notMatch","isValid","isNotValid"]},function(t,e,r){var n=r(22),i=r(47),o=r(4);t.exports=function(t,e){if(t=t||"test.fail()",e=e||{},"expected"in e&&(e.expected=i(e.expected),"undefined"==typeof e.actual&&(t+=" | expected: "+e.expected)),e.inspect){var r=[];for(var s in e.inspect)r.push(i(e.inspect[s]));o.dump.apply(o,r),delete e.inspect}throw new n.AssertionError(t,e)}},function(t,e,r){"use strict";function n(){this.$di=new n.prototype.$di,this.$di.addAll({$api:this,$di:this.$di,$container:this.$di._container,$invoke:this.$wrap(this.$invoke),$inject:this.$wrap(this.$inject),$provider:this.$wrap(this.$provider),$factory:this.$wrap(this.$factory),$singleton:this.$wrap(this.$singleton),$apply:this.$wrap(this.$apply),$wrap:this.$wrap(this.$wrap)})}var i=r(49),o={};n.prototype.Noder=n,n.prototype.$di=i,n.prototype.Collection=i,n.prototype.createCollection=function(t){return t?new this.Collection(t):new this.Collection},n.prototype.createNoder=function(){return new this.Noder},n.prototype.use=function(t){var e=function(t,e){if("function"!=typeof t.__noder)throw new TypeError("Argument #1 passed to Noder.use() is not a valid plugin for Noder.io.A plugin must implement a method named `__noder()` that is used for initialization. Example: `module.exports.__noder = function MyPlugin(noder) {\n // here, the bootstrap\n};`\n\nAPI doc: http://noder.io/api/noder.html#use");t=t.__noder,e.length>1?t.apply(null,Array.prototype.concat.apply([this],Array.prototype.slice.call(e,1))):t(this)}.bind(this);return"string"==typeof t?e(r(50)(t),arguments):e(t,arguments),this},n.prototype.$invoke=function(t,e){return this.$di.invoke(t,e)},n.prototype.$inject=function(t,e){return this.$di.inject(t,e)},n.prototype.$provider=function(t,e,r){return this.$di.provider(t,e,r),this},n.prototype.$factory=function(t,e,r){return this.$di.factory(t,e,r),this},n.prototype.$singleton=function(t,e){return this.$di.singleton(t,e),this},n.prototype.$apply=function(t){return this.$di.apply(t)},n.prototype.$wrap=function(t){return this.$di.wrap(t)},n.prototype.$require=function(t,e,n){var i,s=this;return n=n||this,Object.defineProperty(n,t,{enumerable:!0,configurable:!1,get:function(){return"undefined"!=typeof i?i:s.$require.isLoaded(t,n)?i:(e||(e=t),i="function"==typeof e?e.call(s.$di._container):r(50)(e),o[t]||(o[t]=[]),o[t].push(n),i)},set:function(){throw new Error('"'+t+'" property is not writable because is a placeholder of a property of a lazy loading module.')}}),this},n.prototype.$require.isLoaded=function(t,e){return e?o[t]?(e=e||this,-1!==o[t].indexOf(e)):!1:o[t]?!0:!1},t.exports=new n},function(t,e,r){function n(t){var e=t.displayName||t.name||g(t);return"be an instance of "+e}function i(t,e,r,n){if(t===e)return!0;var u=o(t)?"plain":y(t),c=o(e)?"plain":y(e);if(u!=c)return!1;if("object"==u||"plain"==u||"array"==u){var l=r&&r.indexOf(t),f=n&&n.indexOf(e);if(l!=f)return!1;if(null!=l&&~l)return!0;r=r?r.concat([t]):[t],n=n?n.concat([e]):[e]}switch(u){case"number":if(isNaN(t)&&isNaN(e))return!0;case"boolean":case"string":case"date":return t.valueOf()==e.valueOf();case"regexp":return t.toString()===e.toString();case"array":if(t.length!=e.length)return!1;if(0==t.length)return!0;for(var h=0,d=t.length;d>h;++h)if(!i(t[h],e[h],r,n))return!1;return!0;case"object":if(s(t)!==s(e))return!1;if(a(t)&&a(e))return t.valueOf()===e.valueOf();case"plain":var g=p(t),v=p(e);if(g.length!=v.length)return!1;if(0==g.length)return!0;for(var m in t)if(!i(t[m],e[m],r,n))return!1;return!0}return!1}function o(t){if(!t)return!1;if("object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return null===e?!0:"constructor"in e?e.constructor===Object:!0}function s(t){var e=t&&Object.getPrototypeOf(t);return e&&e.constructor}function a(t){var e="function"==typeof t.valueOf&&t.valueOf;return e&&e!==Object.prototype.valueOf?e:null}function u(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;t=t.slice().sort(),e=e.slice().sort();for(var r=0;r=3&&(o+=" "+g(r)),n=n?Object.create(n):{},n.actual=this.actual,n.caller=arguments.callee.caller,arguments.length>=3&&(n.expected=r),new d(o,n)}}function h(t){return t.apply=t.apply,t.bind=t.bind,t.call=t.call,t.name=t.name,t.toString=t.toString,t.__proto__=this,t}function p(t){var e=[];for(var r in t)e.push(r);return e}var d=r(30),y=r(89),g=r(47);e=t.exports={get a(){return h.call(this,this["instanceof"])},get an(){return h.call(this,this["instanceof"])},get at(){return this},get be(){return h.call(this,this.equal)},get have(){return this},get is(){return h.call(this,this.equal)},get not(){var t=new this.constructor(this.actual);return t.negative=!this.negative,t},get to(){return this}},e["true"]=function(){var t=y(this.actual);f.call(this,"boolean"==t&&1==this.actual,"be",!0)},e["false"]=function(){var t=y(this.actual);f.call(this,"boolean"==t&&0==this.actual,"be",!1)},e["null"]=function(){f.call(this,null===this.actual,"be",null)},e.undefined=function(){f.call(this,void 0===this.actual,"be",void 0)},e["boolean"]=function(){f.call(this,"boolean"==y(this.actual),"be a boolean")},e.number=function(){f.call(this,"number"==y(this.actual),"be a number")},e.string=function(){f.call(this,"string"==y(this.actual),"be a string")},e.date=function(){f.call(this,"date"==y(this.actual),"be a date")},e.regexp=function(){f.call(this,"regexp"==y(this.actual),"be a regular expression")},e.array=function(){f.call(this,Array.isArray(this.actual),"be an array")},e["function"]=function(){f.call(this,"function"==typeof this.actual,"be a function")},e.object=function(){var t=this.actual&&"object"==typeof this.actual;f.call(this,t,"be an object")},e.truthy=function(){f.call(this,this.actual,"be truthy")},e.falsy=function(){f.call(this,!this.actual,"be falsy")},e.exist=function(){f.call(this,null!=this.actual,"exist")},e["instanceof"]=function(t){var e=this.actual instanceof t;f.call(this,e,n,t)},e.instanceOf=e["instanceof"],e.empty=function(){var t;t=Array.isArray(this.actual)||"string"==y(this.actual)?this.actual.length:"object"==typeof this.actual||"function"==typeof this.actual?p(this.actual).length:1,f.call(this,0===t,"be empty")},e.equal=function(t){f.call(this,this.actual===t,"equal",t)},e.eql=function(t){var e=i(this.actual,t);f.call(this,e,"be equivalent to",t,{diffable:!0})},e.include=function(t){var e;if(Array.isArray(this.actual)||"string"==y(this.actual))e=~this.actual.indexOf(t);else for(var r in this.actual)if(this.actual[r]===t){e=!0;break}f.call(this,e,"include",t)},e.contain=e.include,e.permutationOf=function(t){var e=u(this.actual,t);f.call(this,e,"be a permutation of",t,{diffable:!0})},e.match=function(t){var e=t instanceof RegExp?t:new RegExp(t);f.call(this,e.exec(this.actual),"match",e)},e["throw"]=function(t,e){1==arguments.length&&(e=t,t=null);var r,n;try{this.actual.call(null)}catch(i){r=!0,n=i}r&&t&&(r=n instanceof t),r&&arguments.length&&(r=c(n,e));var o=[r,"throw"];arguments.length&&o.push(e),f.apply(this,o)},e.length=function(t){f.call(this,this.actual.length==t,"have length of",t)},e.frozen=function(){f.call(this,Object.isFrozen(this.actual),"be frozen")},e.property=function(t,e){var r=null!=this.actual;r=r&&t in Object(this.actual),r&&arguments.length>1&&(r=this.actual[t]===e);var n='have property "'+t+'"';arguments.length>1&&(n+=" equal to "+g(e)),f.call(this,r,n)},e.ownProperty=function(t,e){var r=null!=this.actual;r=r&&Object.prototype.hasOwnProperty.call(this.actual,t),r&&arguments.length>1&&(r=this.actual[t]===e);var n='have own property "'+t+'"';arguments.length>1&&(n+=" equal to "+g(e)),f.call(this,r,n)},e.own=e.ownProperty,e.keys=function(t){var e=null!=this.actual,r=e&&p(Object(this.actual));e=e&&i(r.sort(),t.sort()),f.call(this,e,"have keys",t)},e.ownKeys=function(t){var e=null!=this.actual,r=e&&Object.keys(Object(this.actual));e=e&&i(r.sort(),t.sort()),f.call(this,e,"have own keys",t)},e.enumerable=function(t){var e=null!=this.actual;e=e&&l(Object(this.actual),t);var r='have enumerable property "'+t+'"';f.call(this,e,r)},e.enumerableProperty=e.enumerable,e.nonenumerable=function(t){var e=null!=this.actual;e=e&&t in Object(this.actual),e=e&&!l(Object(this.actual),t);var r='have nonenumerable property "'+t+'"';f.call(this,e,r)},e.nonenumerableProperty=e.nonenumerable,e.below=function(t){f.call(this,this.actualt,"be above",t)},e.gt=e.above,e.after=e.above,e.least=function(t){f.call(this,this.actual>=t,"be at least",t)},e.gte=e.least,e.between=function(t,e){f.call(this,t<=this.actual&&this.actual<=e,function(){return"be between "+g(t)+" and "+g(e)})}},function(t){function e(t,e){this.message=t,e&&"actual"in e&&(this.actual=e.actual),e&&"expected"in e&&(this.expected=e.expected),e&&"diffable"in e&&(this.diffable=e.diffable);var r=e&&e.caller||arguments.callee.caller;Error.captureStackTrace&&Error.captureStackTrace(this,r)}t.exports=e,e.prototype=Object.create(Error.prototype,{constructor:{value:e,configurable:!0,writable:!0}}),e.prototype.name="AssertionError",e.prototype.__defineGetter__("showDiff",function(){return this.diffable})},function(t,e,r){"use strict";var n=r(52)();t.exports=n},function(t,e,r){(function(t){function n(t){return l(t)&&(t.__ArrayLike||Array.isArray(t))}function i(t){return"number"==typeof t}function o(t){return"string"==typeof t}function s(t){return"boolean"==typeof t}function a(e){return"undefined"!=typeof t&&e instanceof t}function u(t){return l(t)&&"[object Date]"===c(t)}function c(t){return Object.prototype.toString.call(t)}function l(t){return"object"==typeof t&&null!==t}function f(t){return l(t)&&"[object RegExp]"===c(t)}function h(t){return null==t}function p(t){return null===t}function d(t){return"[object Arguments]"===c(t)}function y(t){return l(t)&&"[object Error]"===c(t)||t instanceof Error}function g(t){return void 0===t}/*! - * Should - * Copyright(c) 2010-2014 TJ Holowaychuk - * MIT Licensed +var n=r(32),i=function u(t){return new u.Assertion(t).proxied()};i.AssertionError=r(33),i.Assertion=r(34),i.format=r(49),i.type=r(50),i.config=r(35),e=t.exports=i,i.extend=function(t,e){t=t||"should",e=e||Object.prototype;var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(){},get:function(){return i(n.isWrapperType(this)?this.valueOf():this)},configurable:!0}),{name:t,descriptor:r,proto:e}},i.noConflict=function(t){return t=t||a,t&&(delete t.proto[t.name],t.descriptor&&Object.defineProperty(t.proto,t.name,t.descriptor)),i},i.use=function(t){return t(i,i.Assertion),this},i.use(r(36)).use(r(37)).use(r(38)).use(r(39)).use(r(40)).use(r(41)).use(r(42)).use(r(43)).use(r(44)).use(r(45)).use(r(46));var o=Object.prototype,s="should",a=i.extend(s,o)},function(t,e,r){function n(t,e){return p.isUndefined(e)?""+e:p.isNumber(e)&&!isFinite(e)?e.toString():p.isFunction(e)||p.isRegExp(e)?e.toString():e}function i(t,e){return p.isString(t)?t.length=0;o--)if(s[o]!=a[o])return!1;for(o=s.length-1;o>=0;o--)if(i=s[o],!u(t[i],e[i]))return!1;return!0}function f(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function h(t,e,r,n){var i;p.isString(r)&&(n=r,r=null);try{e()}catch(o){i=o}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&s(i,r,"Missing expected exception"+n),!t&&f(i,r)&&s(i,r,"Got unwanted exception"+n),t&&i&&r&&!f(i,r)||!t&&i)throw i}var p=r(54),d=Array.prototype.slice,g=Object.prototype.hasOwnProperty,y=t.exports=a;y.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var e=t.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=e.name,a=n.indexOf("\n"+i);if(a>=0){var u=n.indexOf("\n",a+1);n=n.substring(u+1)}this.stack=n}}},p.inherits(y.AssertionError,Error),y.fail=s,y.ok=a,y.equal=function(t,e,r){t!=e&&s(t,e,r,"==",y.equal)},y.notEqual=function(t,e,r){t==e&&s(t,e,r,"!=",y.notEqual)},y.deepEqual=function(t,e,r){u(t,e)||s(t,e,r,"deepEqual",y.deepEqual)},y.notDeepEqual=function(t,e,r){u(t,e)&&s(t,e,r,"notDeepEqual",y.notDeepEqual)},y.strictEqual=function(t,e,r){t!==e&&s(t,e,r,"===",y.strictEqual)},y.notStrictEqual=function(t,e,r){t===e&&s(t,e,r,"!==",y.notStrictEqual)},y["throws"]=function(){h.apply(this,[!0].concat(d.call(arguments)))},y.doesNotThrow=function(){h.apply(this,[!1].concat(d.call(arguments)))},y.ifError=function(t){if(t)throw t};var v=Object.keys||function(t){var e=[];for(var r in t)g.call(t,r)&&e.push(r);return e}},function(t,e,r){function n(t){var e=t.displayName||t.name||y(t);return"be an instance of "+e}function i(t,e,r,n){if(t===e)return!0;var u=o(t)?"plain":g(t),c=o(e)?"plain":g(e);if(u!=c)return!1;if("object"==u||"plain"==u||"array"==u){var l=r&&r.indexOf(t),f=n&&n.indexOf(e);if(l!=f)return!1;if(null!=l&&~l)return!0;r=r?r.concat([t]):[t],n=n?n.concat([e]):[e]}switch(u){case"number":if(isNaN(t)&&isNaN(e))return!0;case"boolean":case"string":case"date":return t.valueOf()==e.valueOf();case"regexp":return t.toString()===e.toString();case"array":if(t.length!=e.length)return!1;if(0==t.length)return!0;for(var h=0,d=t.length;d>h;++h)if(!i(t[h],e[h],r,n))return!1;return!0;case"object":if(s(t)!==s(e))return!1;if(a(t)&&a(e))return t.valueOf()===e.valueOf();case"plain":var y=p(t),v=p(e);if(y.length!=v.length)return!1;if(0==y.length)return!0;for(var _ in t)if(!i(t[_],e[_],r,n))return!1;return!0}return!1}function o(t){if(!t)return!1;if("object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return null===e?!0:"constructor"in e?e.constructor===Object:!0}function s(t){var e=t&&Object.getPrototypeOf(t);return e&&e.constructor}function a(t){var e="function"==typeof t.valueOf&&t.valueOf;return e&&e!==Object.prototype.valueOf?e:null}function u(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;t=t.slice().sort(),e=e.slice().sort();for(var r=0;r=3&&(o+=" "+y(r)),n=n?Object.create(n):{},n.actual=this.actual,n.caller=arguments.callee.caller,arguments.length>=3&&(n.expected=r),new d(o,n)}}function h(t){return t.apply=t.apply,t.bind=t.bind,t.call=t.call,t.name=t.name,t.toString=t.toString,t.__proto__=this,t}function p(t){var e=[];for(var r in t)e.push(r);return e}var d=r(26),g=r(59),y=r(51);e=t.exports={get a(){return h.call(this,this["instanceof"])},get an(){return h.call(this,this["instanceof"])},get at(){return this},get be(){return h.call(this,this.equal)},get have(){return this},get is(){return h.call(this,this.equal)},get not(){var t=new this.constructor(this.actual);return t.negative=!this.negative,t},get to(){return this}},e["true"]=function(){var t=g(this.actual);f.call(this,"boolean"==t&&1==this.actual,"be",!0)},e["false"]=function(){var t=g(this.actual);f.call(this,"boolean"==t&&0==this.actual,"be",!1)},e["null"]=function(){f.call(this,null===this.actual,"be",null)},e.undefined=function(){f.call(this,void 0===this.actual,"be",void 0)},e["boolean"]=function(){f.call(this,"boolean"==g(this.actual),"be a boolean")},e.number=function(){f.call(this,"number"==g(this.actual),"be a number")},e.string=function(){f.call(this,"string"==g(this.actual),"be a string")},e.date=function(){f.call(this,"date"==g(this.actual),"be a date")},e.regexp=function(){f.call(this,"regexp"==g(this.actual),"be a regular expression")},e.array=function(){f.call(this,Array.isArray(this.actual),"be an array")},e["function"]=function(){f.call(this,"function"==typeof this.actual,"be a function")},e.object=function(){var t=this.actual&&"object"==typeof this.actual;f.call(this,t,"be an object")},e.truthy=function(){f.call(this,this.actual,"be truthy")},e.falsy=function(){f.call(this,!this.actual,"be falsy")},e.exist=function(){f.call(this,null!=this.actual,"exist")},e["instanceof"]=function(t){var e=this.actual instanceof t;f.call(this,e,n,t)},e.instanceOf=e["instanceof"],e.empty=function(){var t;t=Array.isArray(this.actual)||"string"==g(this.actual)?this.actual.length:"object"==typeof this.actual||"function"==typeof this.actual?p(this.actual).length:1,f.call(this,0===t,"be empty")},e.equal=function(t){f.call(this,this.actual===t,"equal",t)},e.eql=function(t){var e=i(this.actual,t);f.call(this,e,"be equivalent to",t,{diffable:!0})},e.include=function(t){var e;if(Array.isArray(this.actual)||"string"==g(this.actual))e=~this.actual.indexOf(t);else for(var r in this.actual)if(this.actual[r]===t){e=!0;break}f.call(this,e,"include",t)},e.contain=e.include,e.permutationOf=function(t){var e=u(this.actual,t);f.call(this,e,"be a permutation of",t,{diffable:!0})},e.match=function(t){var e=t instanceof RegExp?t:new RegExp(t);f.call(this,e.exec(this.actual),"match",e)},e["throw"]=function(t,e){1==arguments.length&&(e=t,t=null);var r,n;try{this.actual.call(null)}catch(i){r=!0,n=i}r&&t&&(r=n instanceof t),r&&arguments.length&&(r=c(n,e));var o=[r,"throw"];arguments.length&&o.push(e),f.apply(this,o)},e.length=function(t){f.call(this,this.actual.length==t,"have length of",t)},e.frozen=function(){f.call(this,Object.isFrozen(this.actual),"be frozen")},e.property=function(t,e){var r=null!=this.actual;r=r&&t in Object(this.actual),r&&arguments.length>1&&(r=this.actual[t]===e);var n='have property "'+t+'"';arguments.length>1&&(n+=" equal to "+y(e)),f.call(this,r,n)},e.ownProperty=function(t,e){var r=null!=this.actual;r=r&&Object.prototype.hasOwnProperty.call(this.actual,t),r&&arguments.length>1&&(r=this.actual[t]===e);var n='have own property "'+t+'"';arguments.length>1&&(n+=" equal to "+y(e)),f.call(this,r,n)},e.own=e.ownProperty,e.keys=function(t){var e=null!=this.actual,r=e&&p(Object(this.actual));e=e&&i(r.sort(),t.sort()),f.call(this,e,"have keys",t)},e.ownKeys=function(t){var e=null!=this.actual,r=e&&Object.keys(Object(this.actual));e=e&&i(r.sort(),t.sort()),f.call(this,e,"have own keys",t)},e.enumerable=function(t){var e=null!=this.actual;e=e&&l(Object(this.actual),t);var r='have enumerable property "'+t+'"';f.call(this,e,r)},e.enumerableProperty=e.enumerable,e.nonenumerable=function(t){var e=null!=this.actual;e=e&&t in Object(this.actual),e=e&&!l(Object(this.actual),t);var r='have nonenumerable property "'+t+'"';f.call(this,e,r)},e.nonenumerableProperty=e.nonenumerable,e.below=function(t){f.call(this,this.actualt,"be above",t)},e.gt=e.above,e.after=e.above,e.least=function(t){f.call(this,this.actual>=t,"be at least",t)},e.gte=e.least,e.between=function(t,e){f.call(this,t<=this.actual&&this.actual<=e,function(){return"be between "+y(t)+" and "+y(e)})}},function(t){function e(t,e){this.message=t,e&&"actual"in e&&(this.actual=e.actual),e&&"expected"in e&&(this.expected=e.expected),e&&"diffable"in e&&(this.diffable=e.diffable);var r=e&&e.caller||arguments.callee.caller;Error.captureStackTrace&&Error.captureStackTrace(this,r)}t.exports=e,e.prototype=Object.create(Error.prototype,{constructor:{value:e,configurable:!0,writable:!0}}),e.prototype.name="AssertionError",e.prototype.__defineGetter__("showDiff",function(){return this.diffable})},function(t,e,r){"use strict";function n(){this.$di=new n.prototype.$di,this.$di.addAll({$api:this,$di:this.$di,$container:this.$di._container,$invoke:this.$wrap(this.$invoke),$inject:this.$wrap(this.$inject),$provider:this.$wrap(this.$provider),$factory:this.$wrap(this.$factory),$singleton:this.$wrap(this.$singleton),$apply:this.$wrap(this.$apply),$wrap:this.$wrap(this.$wrap)})}var i=r(52),o={};n.prototype.Noder=n,n.prototype.$di=i,n.prototype.Collection=i,n.prototype.createCollection=function(t){return t?new this.Collection(t):new this.Collection},n.prototype.createNoder=function(){return new this.Noder},n.prototype.use=function(t){var e=function(t,e){if("function"!=typeof t.__noder)throw new TypeError("Argument #1 passed to Noder.use() is not a valid plugin for Noder.io.A plugin must implement a method named `__noder()` that is used for initialization. Example: `module.exports.__noder = function MyPlugin(noder) {\n // here, the bootstrap\n};`\n\nAPI doc: http://noder.io/api/noder.html#use");t=t.__noder,e.length>1?t.apply(null,Array.prototype.concat.apply([this],Array.prototype.slice.call(e,1))):t(this)}.bind(this);return"string"==typeof t?e(r(48)(t),arguments):e(t,arguments),this},n.prototype.$invoke=function(t,e){return this.$di.invoke(t,e)},n.prototype.$inject=function(t,e){return this.$di.inject(t,e)},n.prototype.$provider=function(t,e,r){return this.$di.provider(t,e,r),this},n.prototype.$factory=function(t,e,r){return this.$di.factory(t,e,r),this},n.prototype.$singleton=function(t,e){return this.$di.singleton(t,e),this},n.prototype.$apply=function(t){return this.$di.apply(t)},n.prototype.$wrap=function(t){return this.$di.wrap(t)},n.prototype.$require=function(t,e,n){var i,s=this;return n=n||this,Object.defineProperty(n,t,{enumerable:!0,configurable:!1,get:function(){return"undefined"!=typeof i?i:s.$require.isLoaded(t,n)?i:(e||(e=t),i="function"==typeof e?e.call(s.$di._container):r(48)(e),o[t]||(o[t]=[]),o[t].push(n),i)},set:function(){throw new Error('"'+t+'" property is not writable because is a placeholder of a property of a lazy loading module.')}}),this},n.prototype.$require.isLoaded=function(t,e){return e?o[t]?(e=e||this,-1!==o[t].indexOf(e)):!1:o[t]?!0:!1},t.exports=new n},function(t,e,r){"use strict";function n(t,e){"undefined"==typeof a.assertions[t]&&(a.assertions[t]=0),a.assertions[t]++,e&&a.total.assertions++}var i=r(24),o=r(23),s=r(9),a=r(22).stats,u=r(22).fail;t.exports=function(t){return{is:function(e){return n("is",!0),s(t).eql(e),this},isNot:function(e){return n("isNot",!0),s(t).not.eql(e),this},isEqualTo:function(e){return n("isEqualTo",!0),i.equal(t,e,"(actual == expected), actual "+typeof t+" is not equal to expected "+typeof e),this},isNotEqualTo:function(e){return n("isNotEqualTo",!0),i.notEqual(t,e,"(actual != expected), actual "+typeof t+" is equal to expected"+typeof e),this},isStrictEqualTo:function(e){return n("isStrictEqualTo",!0),i.strictEqual(t,e,"(actual === expected), actual "+typeof t+" is not identical to expected "+typeof e),this},isNotStrictEqualTo:function(e){return n("isNotStrictEqualTo",!0),i.notStrictEqual(t,e,"(actual !== expected), actual "+typeof t+" is identical to expected "+typeof e),this},isIdenticalTo:function(t){return n("isIdenticalTo"),this.isStrictEqualTo(t)},isNotIdenticalTo:function(t){return n("isNotIdenticalTo"),this.isNotStrictEqualTo(t)},match:function(e){return n("match",!0),"function"==typeof e?(e(t)!==!0&&u("actual value tested must match."),this):(s(t).match(e),this)},notMatch:function(e){return n("notMatch",!0),"function"==typeof e?(e(t)&&u("actual value tested ("+t+") must not match ("+e+")"),this):(s(t).not.match(e),this)},matchEach:function(e){if(n("matchEach",!0),"function"==typeof e){if("object"==typeof t)for(var r in t)e(t[r],r)!==!0&&u("matchEach()",t[r],e);else e(t)!==!0&&u("matchEach()",t,e);return this}for(var i in e)if("function"!=typeof e[i])this.match(e[i]);else{if("object"==typeof t){for(var r in t)e[i](t[r],r)!==!0&&u("matchEach()",t[r],e[i]);continue}e[i](t)!==!0&&u("matchEach()",t,e[i])}return this},notMatchEach:function(e){if(n("notMatchEach",!0),"function"==typeof e){if("object"==typeof t)for(var r in t)e(t[r],r)&&u("notMatchEach()",t[r],e);else e(t)&&u("notMatchEach()",t,e);return this}for(var i in e)if("function"!=typeof e[i])this.notMatch(e[i]);else{if("object"==typeof t){for(var r in t)e[i](t[r],r)&&u("notMatchEach()",t[r],e[i]);continue}e[i](t)&&u("notMatchEach()",t,e[i])}return this},isValid:function(t){return n("isValid"),this.match(t)},isNotValid:function(t){return n("isNotValid"),this.notMatch(t)},isType:function(e){return n("isType",!0),o(t).type(e),this},isNotType:function(e){return n("isNotType",!0),o(t).not.type(e),this},isObject:function(){return n("isObject",!0),s(t).object(),this},isArray:function(){return n("isArray",!0),s(t).array(),this},isFunction:function(){return n("isFunction",!0),s(t)["function"](),this},isString:function(){return n("isString",!0),s(t).string(),this},isNumber:function(){return n("isNumber",!0),s(t).number(),this},isBool:function(){return n("isBool"),this.isBoolean()},isBoolean:function(){return n("isBoolean",!0),s(t)["boolean"](),this},isNull:function(){return n("isNull",!0),s(t)["null"](),this},isUndefined:function(){return n("isUndefined",!0),s(t).undefined(),this},isRegExp:function(){return n("isRegExp",!0),s(t).regexp(),this},isNotRegExp:function(){return n("isNotRegExp",!0),s(t).not.regexp(),this},isDate:function(){return n("isDate",!0),s(t).date(),this},isNotDate:function(){return n("isNotDate",!0),s(t).not.date(),this},isArguments:function(){return n("isArguments",!0),o(t).arguments,this},isNotArguments:function(){return n("isNotArguments",!0),o(t).not.arguments,this},isTrue:function(){return n("isTrue",!0),s(t)["true"](),this},isNotTrue:function(){return n("isNotTrue",!0),s(t).not["true"](),this},isTruthy:function(){return n("isTruthy",!0),s(t).truthy(),this},isNotTruthy:function(){return n("isNotTruthy",!0),s(t).not.truthy(),this},isFalse:function(){return n("isFalse",!0),s(t)["false"](),this},isNotFalse:function(){return n("isNotFalse",!0),s(t).not["false"](),this},isFalsy:function(){return n("isFalsy",!0),s(t).falsy(),this},isNotFalsy:function(){return n("isNotFalsy",!0),s(t).not.falsy(),this},isEmpty:function(){return n("isEmpty",!0),s(t).empty(),this},isNotEmpty:function(){return n("isNotEmpty",!0),s(t).not.empty(),this},exists:function(){return n("exists",!0),s(t).exist(),this},isError:function(){return n("isError"),this["throws"](Error)},"throws":function(e,r){if(n("throws",!0),arguments.length>2)throw new Error("throws() assertion, takes maximum 2 arguments (constructor and expected).");return 1==arguments.length?"function"==typeof e?i["throws"](t,e):s(t)["throw"](e):2==arguments.length?s(t)["throw"](e,r):s(t)["throw"](),this},hasLength:function(e){if(n("hasLength",!0),"object"==typeof t){var r=0;for(var i in t)r++;r!==e&&u(t+"must has length of "+e)}else s(t).length(e);return this},hasNotLength:function(e){if(n("hasNotLength",!0),"object"==typeof t){var r=0;for(var i in t)r++;r===e&&u(t+"must has not length of "+e)}else s(t).not.length(e);return this},isBetween:function(e,r){return n("isBetween",!0),s(t).between(e,r),this},isNotBetween:function(e,r){return n("isNotBetween",!0),s(t).not.between(e,r),this},isBefore:function(e){return n("isBefore",!0),s(t).before(e),this},isAfter:function(e){return n("isAfter",!0),s(t).after(e),this},isGreaterThan:function(e){return n("isGreaterThan",!0),s(t).above(e),this},isLessThan:function(e){return n("isLessThan",!0),s(t).below(e),this},isApprox:function(e,r){return n("isApprox",!0),o(t).approximately(e,r),this},isInfinite:function(){return n("isInfinite",!0),o(t).Infinity,this},isNotInfinite:function(){return n("isNotInfinite",!0),o(t).not.Infinity,this},isEnumerable:function(e){return n("isEnumerable",!0),s(t).enumerable(e),this},isNotEnumerable:function(e){return n("isNotEnumerable",!0),s(t).nonenumerable(e),this},isFrozen:function(){return n("isFrozen",!0),s(t).frozen(),this},isNotFrozen:function(){return n("isNotFrozen",!0),s(t).not.frozen(),this},isInstanceOf:function(e){return n("isInstanceOf",!0),s(t)["instanceof"](e),this},isNotInstanceOf:function(e){return n("isNotInstanceOf",!0),s(t).not["instanceof"](e),this},hasProperty:function(e,r){if(n("hasProperty",!0),!arguments.length)throw new Error('hasProperty() asserter require the argument "property" (the name of the property).');if(1==arguments.length)s(t).property(e);else{if(2!=arguments.length)throw new Error("hasProperty() asserter, takes maximum 2 arguments (property and value).");s(t).property(e,r)}return this},hasNotProperty:function(e,r){if(n("hasNotProperty",!0),0===arguments.length)throw new Error('hasNotProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).not.property(e);else{if(2!==arguments.length)throw new Error("hasNotProperty() asserter, takes maximum 2 arguments (property and value).");s(t).not.property(e,r)}return this},hasOwnProperty:function(e,r){if(n("hasOwnProperty ",!0),0===arguments.length)throw new Error('hasOwnProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).ownProperty(e);else{if(2!==arguments.length)throw new Error("hasOwnProperty() asserter, takes maximum 2 arguments (property and value).");s(t).ownProperty(e,r)}return this},hasNotOwnProperty:function(e,r){if(n("hasNotOwnProperty",!0),0===arguments.length)throw new Error('hasNotOwnProperty() asserter require the argument "property" (the name of the property).');if(1===arguments.length)s(t).not.ownProperty(e);else{if(2!==arguments.length)throw new Error("hasNotOwnProperty() asserter, takes maximum 2 arguments (property and value).");s(t).not.ownProperty(e,r)}return this},hasProperties:function(e){return n("hasProperties",!0),s(t).keys(e),this},hasNotProperties:function(e){return n("hasNotProperties",!0),s(t).not.keys(e),this},hasOwnProperties:function(e){return n("hasOwnProperties",!0),s(t).ownKeys(e),this},hasKey:function(){return n("hasKey"),this.hasProperty.apply(this,arguments)},notHasKey:function(){return n("notHasKey"),this.hasNotProperty.apply(this,arguments)},hasKeys:function(t){return n("hasKeys"),this.hasProperties(t)},notHasKeys:function(t){return n("notHasKeys"),this.hasNotProperties(t)},hasValue:function(e){return n("hasValue",!0),s(t).include(e),this},notHasValue:function(e){return n("notHasValue",!0),s(t).not.include(e),this},hasValues:function(e){n("hasValues",!0);for(var r in e)s(t).include(e[r]);return this},notHasValues:function(e){n("notHasValues",!0);for(var r in e)s(t).not.include(e[r]);return this},contains:function(e){if(n("contains",!0),arguments.length>1)for(var r in arguments)o(t).containDeep(arguments[r]);else o(t).containDeep(e);return this},notContains:function(e){if(n("notContains",!0),arguments.length>1)for(var r in arguments)o(t).not.containDeep(arguments[r]);else o(t).not.containDeep(e);return this},isReverseOf:function(e){return n("isReverseOf"),this.is(e.reverse()),s(t).permutationOf(e),this},isNotReverseOf:function(e){return n("isNotReverseOf"),this.isNot(e.reverse()),s(t).not.permutationOf(e),this},startsWith:function(e){return n("startsWith",!0),o(t).startWith(e),this},notStartsWith:function(e){return n("notStartsWith",!0),o(t).not.startWith(e),this},endsWith:function(e){return n("endsWith",!0),o(t).endWith(e),this},notEndsWith:function(e){return n("notEndsWith",!0),o(t).not.endWith(e),this},hasHttpStatus:function(e){return n("hasHttpStatus",!0),s(t).property("statusCode",e),this},notHasHttpStatus:function(e){return n("notHasHttpStatus",!0),s(t).not.property("statusCode",e),this},hasHeader:function(e,r){if(n("hasHeader",!0),0===arguments.length||arguments.length>2)throw new Error('hasHeader() asserter, takes minimum the "field" argument, maximum 2 arguments (field and value).');return s(t).property("headers"),1===arguments.length?s(t.headers).property(e.toLowerCase()):s(t.headers).property(e.toLowerCase(),r),this},notHasHeader:function(e,r){if(n("notHasHeader",!0),0===arguments.length||arguments.length>2)throw new Error('notHasHeader() asserter, takes minimum the "field" argument, maximum 2 arguments (field and value).');return 1===arguments.length?s(t.headers).not.property(e.toLowerCase()):s(t.headers).not.property(e.toLowerCase(),r),this},hasHeaderJson:function(){return n("hasHeaderJson",!0),s(t).property("headers"),s(t.headers).property("content-type"),s(t.headers["content-type"]).match(/application\/json/i),this},notHasHeaderJson:function(){return n("notHasHeaderJson",!0),t&&t.headers&&"content-type"in t.headers&&s(t.headers["content-type"]).not.match(/application\/json/i),this},hasHeaderHtml:function(){return n("hasHeaderHtml",!0),s(t).property("headers"),s(t.headers).property("content-type"),s(t.headers["content-type"]).match(/text\/html/i),this},notHasHeaderHtml:function(){return n("notHasHeaderHtml",!0),t&&t.headers&&"content-type"in t.headers&&s(t.headers["content-type"]).not.match(/text\/html/i),this}}}},function(t){"use strict";t.exports=["is","isNot","isIdenticalTo","isNotIdenticalTo","isEqualTo","isNotEqualTo","isStrictEqualTo","isNotStrictEqualTo","match","notMatch","isValid","isNotValid"]},function(t,e,r){(function(e,r){/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2014 Petka Antonov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions:

+ * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * */ -e.isWrapperType=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean},e.merge=function(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t},e.isArray=n,e.isNumber=i,e.isBoolean=s,e.isString=o,e.isBuffer=a,e.isDate=u,e.isObject=l,e.isRegExp=f,e.isNullOrUndefined=h,e.isNull=p,e.isArguments=d,e.isFunction=function(t){return"function"==typeof t||t instanceof Function},e.isError=y,e.isUndefined=g,e.AssertionError=r(24).AssertionError;var v=Object.prototype.hasOwnProperty;e.forOwn=function(t,e,r){for(var n in t)v.call(t,n)&&e.call(r,t[n],n)};var m=/^\s*function\s*(\S*)\s*\(/;e.functionName=function(t){if(t.name)return t.name;var e=t.toString().match(m)[1];return e};var _=r(53).formatPropertyName;e.formatProp=function(t){return _(String(t))},e.formatEqlResult=function(t,r,n,i){return(t.path.length>0?"at "+t.path.map(e.formatProp).join(" -> "):"")+(t.a===r?"":", A has "+i(t.a))+(t.b===n?"":" and B has "+i(t.b))}}).call(e,r(57).Buffer)},function(t,e){function r(t){return function(e){e&&t.concat(i).forEach(function(t){console.warn(n,t)})}}var n="WARN",i=["To disable any warnings add should.warn = false","If you think that is not right, raise issue on github https://github.com/shouldjs/should.js/issues"];e.staticShouldUnWrap=r(["Static version of should was called with primitive type wrapper like should(new Number(10))","current version will unwrap it to assert on primitive value for you","but that will be changed in future versions, make sure you know what are you doing"])},function(t,e,r){t.exports=r(32).AssertionError},function(t,e,r){function n(t,e){this.obj=t,this.format=e}function i(t){return a+t}function o(t){return t.split("\n").map(i).join("\n")}{var s=r(34);r(32)}n.add=function(t,e,r){var i={enumerable:!0};i[r?"get":"value"]=function(){var t=new n(this.obj,this.format);t.anyOne=this.anyOne;try{e.apply(t,arguments)}catch(r){if(this.params=t.params,r instanceof s){if(this.negate)return this.obj=t.obj,this.negate=!1,this;this.nestedErrorMessage=r.message,this.fail()}throw r}return this.params=t.params,this.negate&&(t.negate=!0,this.nestedErrorMessage=t.params.message?t.params.message:t.getMessage(),this.fail()),this.obj=t.obj,this.negate=!1,this},Object.defineProperty(n.prototype,t,i)},n.alias=function(t,e){var r=Object.getOwnPropertyDescriptor(n.prototype,t);if(!r)throw new Error("Alias "+t+" -> "+e+" could not be created as "+t+" not defined");Object.defineProperty(n.prototype,e,r)};var a=" ";n.prototype={constructor:n,assert:function(t){if(t)return this;var e=this.params,r=e.message,n=!1;r||(r=this.getMessage(),n=!0),this.nestedErrorMessage&&r!=this.nestedErrorMessage&&(r=r+"\n"+o(this.nestedErrorMessage));var i=new s({message:r,actual:this.obj,expected:e.expected,stackStartFunction:this.assert});throw i.showDiff=e.showDiff,i.operator=e.operator,i.generatedMessage=n,i},fail:function(){return this.assert(!1)},getMessage:function(){var t=this.format("obj"in this.params?this.params.obj:this.obj),e="expected"in this.params?" "+this.format(this.params.expected):"",r="details"in this.params&&this.params.details?" ("+this.params.details+")":"";return"expected "+t+(this.negate?" not ":" ")+this.params.operator+e+r},get not(){return this.negate=!this.negate,this},get any(){return this.anyOne=!0,this}},t.exports=n},function(t,e,r){/*! +!function(e){t.exports=e()}(function(){var t,n,i;return function o(t,e,r){function n(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,o,t,e,r)}return e[s].exports}for(var i="function"==typeof _dereq_&&_dereq_,s=0;s0},n.prototype._withDomain=function(t){return void 0===u||null==u.domain||t.domain||(t=u.domain.bind(t)),t},n.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),t=this._withDomain(t),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(r){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},n.prototype.invokeLater=function(t,e,r){t=this._withDomain(t),this._lateQueue.push(t,e,r),this._queueTick()},n.prototype.invokeFirst=function(t,e,r){t=this._withDomain(t),this._normalQueue.unshift(t,e,r),this._queueTick()},n.prototype.invoke=function(t,e,r){t=this._withDomain(t),this._normalQueue.push(t,e,r),this._queueTick()},n.prototype.settlePromises=function(t){this._normalQueue._pushOne(t),this._queueTick()},n.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},n.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},n.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},n.prototype._reset=function(){this._isTickUsed=!1},r.exports=new n,r.exports.firstLineError=i},{"./queue.js":28,"./schedule.js":31}],3:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){return this.value}function i(){throw this.reason}function o(t){return this._then(n,null,null,{value:t},void 0)}function s(t){return this._then(i,i,null,{reason:t},void 0)}function a(t){this._setBoundTo(t)}t.prototype.bind=function(e){var n=r(e);if(n instanceof t){if(!n.isFulfilled()){if(n.isRejected())return t.reject(n.reason());var i=this.then(),u=i;return i=i._then(o,s,null,n,void 0),n._then(a,i._reject,null,i,null),i._cancellable()||i._setPendingCancellationParent(u),i}e=n.value()}var i=this.then();return i._setBoundTo(e),i},t.bind=function(e,r){return t.resolve(r).bind(e)},t.prototype._setPendingCancellationParent=function(t){this._settledValue=t},t.prototype._pendingCancellationParent=function(){if(this.isPending()&&void 0!==this._settledValue){var t=this._settledValue;return t.cancellable(),this._settledValue=void 0,t}},t.prototype._setIsBound=function(){this._bitField=131072|this._bitField},t.prototype._unsetIsBound=function(){this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.prototype._setIsMigratingBinding=function(){this._bitField=8388608|this._bitField},t.prototype._unsetIsMigratingBinding=function(){this._bitField=-8388609&this._bitField},t.prototype._isMigratingBinding=function(){return 8388608===(8388608&this._bitField)},t.prototype._setBoundTo=function(t){void 0===t?(this._isBound()&&(this._boundTo=void 0),this._unsetIsBound()):(this._setIsBound(),this._boundTo=t)}}},{}],4:[function(t,e){"use strict";function r(){try{Promise===i&&(Promise=n)}catch(t){}return i}var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise.js")();i.noConflict=r,e.exports=i},{"./promise.js":23}],5:[function(t,e){"use strict";var r=Object.create;if(r){var n=r(null),i=r(null);n[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}{var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier}e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(this._setCancellable(),this._cancellationParent=this._pendingCancellationParent(),this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,r){"use strict";r.exports=function(){function r(t){this._parent=t;var e=this._length=1+(void 0===t?0:t._length);w(this,r),e>32&&this.uncycle()}function n(t,e){for(var r=0;r=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function s(t){for(var e=[],r=0;r0&&(e=e.slice(r)),e}function u(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+c(e)+">, no stack trace)"}function c(t){var e=41;return t.lengtht)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},r.prototype.parent=function(){return this._parent},r.prototype.hasParent=function(){return void 0!==this._parent},r.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=r.parseStackAndMessage(t),a=e.message,u=[e.stack],c=this;void 0!==c;)u.push(s(c.stack.split("\n"))),c=c._parent;o(u),i(u),t.stack=n(a,u),t.__stackCleaned__=!0}},r.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?a(t):[" (No stack trace)"],{message:r,stack:s(e)}},r.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+y(n,t)}else r=e+String(t);"function"==typeof f?f(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},r.unhandledRejection=function(t){r.formatAndLogError(t,"^--- With additional stack trace: ")},r.isSupported=function(){return"function"==typeof w},r.fireRejectionEvent=function(t,e,n,i){var o=!1;try{"function"==typeof e&&(o=!0,"rejectionHandled"===t?e(i):e(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=j(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(b)try{u=b(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||r.formatAndLogError(n,"Unhandled rejection ")};var _=function(){return!1},m=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;r.setBounds=function(t,e){if(r.isSupported()){for(var n,i,o=t.stack.split("\n"),s=e.stack.split("\n"),a=-1,u=-1,c=0;ca||0>u||!n||!i||n!==i||a>=u||(_=function(t){if(d.test(t))return!0;var e=l(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var b,w=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():u(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,g=t,y=e;var r=Error.captureStackTrace;return _=function(t){return d.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return g=/@/,y=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i?(y=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?u(e):e.toString()},null):(g=t,y=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),j=function(){if(p.isNode)return function(t,r,n){return"rejectionHandled"===t?e.emit(t,n):e.emit(t,r,n)};var t=!1,r=!0;try{var n=new self.CustomEvent("test");t=n instanceof CustomEvent}catch(i){}if(!t)try{var o=document.createEvent("CustomEvent");o.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(o)}catch(i){r=!1}r&&(b=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var s={};return s.unhandledRejection="onunhandledRejection".toLowerCase(),s.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=s[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(f=function(t){console.warn(t)},p.isNode&&e.stderr.isTTY?f=function(t){e.stderr.write(""+t+"\n")}:p.isNode||"string"!=typeof(new Error).stack||(f=function(t){console.warn("%c"+t,"color: red")})),r}},{"./async.js":2,"./util.js":38}],8:[function(t,e){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundTo,u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],f=l===Error||null!=l&&l.prototype instanceof Error;if(f&&t instanceof l){var h=s(r).call(o,t);return h===a?(e.e=h.e,e):h}if("function"==typeof l&&!f){var p=n(l,t);if(p===a){t=a.e;break}if(p){var h=s(r).call(o,t);return h===a?(e.e=h.e,e):h}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e){"use strict";e.exports=function(e,r){var n,i,o=t("./async.js"),s=t("./errors.js").Warning,a=t("./util.js"),u=a.canAttachTrace,c=!1||a.isNode&&(!!{NODE_ENV:"production"}.BLUEBIRD_DEBUG||"development"==={NODE_ENV:"production"}.NODE_ENV);return e.prototype._ensurePossibleRejectionHandled=function(){this._setRejectionIsUnhandled(),o.invokeLater(this._notifyUnhandledRejection,this,void 0)},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return c&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(c&&u(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);t.stack=i.message+"\n"+i.stack.join("\n"),t.__stackCleaned__=!0}}},e.prototype._warn=function(t){var e=new s(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){i="function"==typeof t?t:void 0},e.onUnhandledRejectionHandled=function(t){n="function"==typeof t?t:void 0},e.longStackTraces=function(){if(o.haveItemsQueued()&&c===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");c=r.isSupported()},e.hasLongStackTraces=function(){return c&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},c=!1),function(){return c}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e){"use strict";var r=t("./util.js"),n=r.isPrimitive,i=r.wrapsPrimitiveReceiver;e.exports=function(t){var e=function(){return this},r=function(){throw this},o=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(t){return i&&n(t)?this._then(o(t,2),void 0,void 0,void 0,void 0):this._then(e,void 0,void 0,t,void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return i&&n(t)?this._then(o(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e){"use strict";function r(t,e){function r(n){return this instanceof r?(l(this,"message","string"==typeof n?n:e),l(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return c(r,Error),r}function n(t){return this instanceof n?(l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new n(t)}var i,o,s=t("./es5.js"),a=s.freeze,u=t("./util.js"),c=u.inherits,l=u.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),p=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{i=TypeError,o=RangeError}catch(g){i=r("TypeError","type error"),o=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace(),this._callback=e,this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:h,this._init$(void 0,-2)}function a(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var u=t("./util.js"),c=u.tryCatch,l=u.errorObj,f={},h=[];u.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===f){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,h=this._promise._boundTo;this._promise._pushContext();var p=c(u).call(h,t,r,o);if(this._promise._popContext(),p===l)return this._reject(p.e);var d=i(p,this._promise);if(d instanceof e){if(d=d._target(),d._isPending())return a>=1&&this._inFlight++,n[r]=f,d._proxyPromiseArray(this,r);if(!d._isFulfilled())return this._reject(d._reason());p=d._value()}n[r]=p}var g=++this._totalResolved;g>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):a(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):a(t,e,r,i).promise()}}},{"./util.js":38}],20:[function(t,e){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundTo,[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundTo,i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundTo,t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e){"use strict";e.exports=function(){function e(t){if("function"!=typeof t)throw new c("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==e)throw new c("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==l&&this._resolveFromResolver(t)}function r(t){var r=new e(l);r._fulfillmentHandler0=t,r._rejectionHandler0=t,r._progressHandler0=t,r._promise0=t,r._receiver0=t,r._settledValue=t}var n=function(){return new c("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},i=function(){return new e.PromiseInspection(this._target())},o=function(t){return e.reject(new c(t))},s=t("./util.js"),a=t("./async.js"),u=t("./errors.js"),c=e.TypeError=u.TypeError;e.RangeError=u.RangeError,e.CancellationError=u.CancellationError,e.TimeoutError=u.TimeoutError,e.OperationalError=u.OperationalError,e.RejectionError=u.OperationalError,e.AggregateError=u.AggregateError;var l=function(){},f={},h={e:null},p=t("./thenables.js")(e,l),d=t("./promise_array.js")(e,l,p,o),g=t("./captured_trace.js")(),y=t("./debuggability.js")(e,g),v=t("./context.js")(e,g,y),_=t("./catch_filter.js")(h),m=t("./promise_resolver.js"),b=m._nodebackForPromise,w=s.errorObj,j=s.tryCatch;return e.prototype.toString=function(){return"[object Promise]"},e.prototype.caught=e.prototype["catch"]=function(t){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s)return e.reject(new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new _(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},e.prototype.reflect=function(){return this._then(i,i,void 0,this,void 0)},e.prototype.then=function(t,e,r){if(y()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+s.classString(t);arguments.length>1&&(n+=", "+s.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0)},e.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},e.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,f,void 0)},e.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},e.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},e.prototype.all=function(){return new d(this).promise()},e.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},e.is=function(t){return t instanceof e},e.fromNode=function(t){var r=new e(l),n=j(t)(b(r));return n===w&&r._rejectCallback(n.e,!0,!0),r},e.all=function(t){return new d(t).promise()},e.defer=e.pending=function(){var t=new e(l);return new m(t)},e.cast=function(t){var r=p(t);if(!(r instanceof e)){var n=r;r=new e(l),r._fulfillUnchecked(n)}return r},e.resolve=e.fulfilled=e.cast,e.reject=e.rejected=function(t){var r=new e(l);return r._captureStackTrace(),r._rejectCallback(t,!0),r +},e.setScheduler=function(t){if("function"!=typeof t)throw new c("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=a._schedule;return a._schedule=t,e},e.prototype._then=function(t,r,n,i,o){var s=void 0!==o,u=s?o:new e(l);s||(u._propagateFrom(this,5),u._captureStackTrace());var c=this._target();c!==this&&(s||(u._setIsMigrated(),void 0===i&&(u._setIsMigratingBinding(),i=this)));var f=c._addCallbacks(t,r,n,u,i);return c._isResolved()&&!c._isSettlePromisesQueued()&&a.invoke(c._settlePromiseAtPostResolution,c,f),u},e.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},e.prototype._length=function(){return 131071&this._bitField},e.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},e.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},e.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},e.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},e.prototype._setRejected=function(){this._bitField=134217728|this._bitField},e.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},e.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},e.prototype._isFinal=function(){return(33554432&this._bitField)>0},e.prototype._cancellable=function(){return(67108864&this._bitField)>0},e.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},e.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},e.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},e.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},e.prototype._isMigrated=function(){return(4194304&this._bitField)>0},e.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return void 0===e&&this._isBound()?this._boundTo:e},e.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},e.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},e.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},e.prototype._migrateCallbacks=function(t,r){var n=t._fulfillmentHandlerAt(r),i=t._rejectionHandlerAt(r),o=t._progressHandlerAt(r),s=t._promiseAt(r),a=t._receiverAt(r);s instanceof e&&(s._setIsMigrated(),void 0===a&&(a=t,s._setIsMigratingBinding())),this._addCallbacks(n,i,o,s,a)},e.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=131066&&(o=0,this._setLength(0)),0===o)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=t),"function"==typeof e&&(this._rejectionHandler0=e),"function"==typeof r&&(this._progressHandler0=r);else{var s=5*o-5;this[s+3]=n,this[s+4]=i,"function"==typeof t&&(this[s+0]=t),"function"==typeof e&&(this[s+1]=e),"function"==typeof r&&(this[s+2]=r)}return this._setLength(o+1),o},e.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},e.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},e.prototype._resolveCallback=function(t,r){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(n(),!1,!0);var i=p(t,this);if(!(i instanceof e))return this._fulfill(t);var o=1|(r?4:0);this._propagateFrom(i,o);var s=i._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},e.prototype._rejectCallback=function(t,e,r){r||s.markAsOriginatingFromRejection(t);var n=s.ensureErrorObject(t),i=s.canAttachTrace(t)&&"string"==typeof n.stack&&n.stack.length>0;this._attachExtraTrace(n,e?i:!1),this._reject(t,n===t?void 0:n)},e.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=j(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===w&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},e.prototype._settlePromiseFromHandler=function(t,e,r,i){if(!i._isRejected()){i._pushContext();var o;if(o=e!==f||this._isRejected()?j(t).call(e,r):j(t).apply(this._boundTo,r),i._popContext(),o===w||o===i||o===h){var s=o===i?n():o.e;i._rejectCallback(s,!1,!0)}else i._resolveCallback(o)}},e.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},e.prototype._followee=function(){return this._rejectionHandler0},e.prototype._setFollowee=function(t){this._rejectionHandler0=t},e.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},e.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},e.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},e.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},e.prototype._settlePromiseAt=function(t){var r=this._promiseAt(t),n=r instanceof e;if(n&&r._isMigrated())return r._unsetIsMigrated(),a.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,u=this._receiverAt(t);n&&r._isMigratingBinding()&&(r._unsetIsMigratingBinding(),u=u._boundTo),this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,u,s,r):i.call(u,s,r):u instanceof d?u._isResolved()||(this._isFulfilled()?u._promiseFulfilled(s,r):u._promiseRejected(s,r)):n&&(this._isFulfilled()?r._fulfill(s):r._reject(s,o)),t>=4&&4===(31&t)&&a.invokeLater(this._setLength,this,0)},e.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},e.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},e.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},e.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},e.prototype._queueSettlePromises=function(){a.settlePromises(this),this._setSettlePromisesQueued()},e.prototype._fulfillUnchecked=function(t){if(t===this){var e=n();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},e.prototype._rejectUncheckedCheckError=function(t){var e=s.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},e.prototype._rejectUnchecked=function(t,e){if(t===this){var r=n();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void a.throwLater(function(t){throw"stack"in t&&a.invokeFirst(g.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},e.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},e._makeSelfResolutionError=n,t("./method.js")(e,l,p,o),t("./bind.js")(e,l,p),t("./finally.js")(e,h,p),t("./direct_resolve.js")(e),t("./synchronous_inspection.js")(e),t("./join.js")(e,d,p,l),e.Promise=e,t("./map.js")(e,d,o,p,l),t("./using.js")(e,o,p,v),t("./generators.js")(e,o,l,p),t("./nodeify.js")(e),t("./cancel.js")(e),t("./promisify.js")(e,l),t("./props.js")(e,d,p,o),t("./race.js")(e,l,p,o),t("./reduce.js")(e,d,o,p,l),t("./settle.js")(e,d),t("./call_get.js")(e),t("./some.js")(e,d,o),t("./progress.js")(e,d),t("./any.js")(e),t("./each.js")(e,l),t("./timers.js")(e,l),t("./filter.js")(e,l),s.toFastProperties(e),s.toFastProperties(e.prototype),r({a:1}),r({b:2}),r({c:3}),r(1),r(function(){}),r(void 0),r(!1),r(new e(l)),g.setBounds(a.firstLineError,s.lastLineError),e}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var f=this._promise,h=0;l>h;++h){var p=this._isResolved(),d=n(s[h],f);d instanceof e?(d=d._target(),p?d._unsetRejectionIsUnhandled():d._isPending()?d._proxyPromiseArray(this,h):d._isFulfilled()?this._promiseFulfilled(d._value(),h):this._promiseRejected(d._reason(),h)):p||this._promiseFulfilled(d,h)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e){"use strict";function r(t){return t instanceof Error&&h.getPrototypeOf(t)===Error.prototype}function n(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=h.keys(t),i=0;i2){for(var o=arguments.length,s=new Array(o-1),u=1;o>u;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(r);t=null}}}var o,s=t("./util.js"),a=s.maybeWrapAsError,u=t("./errors.js"),c=u.TimeoutError,l=u.OperationalError,f=s.haveGetters,h=t("./es5.js"),p=/^(?:name|message|stack|cause)$/;if(o=f?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=i(t),this.callback=this.asCallback},f){var d={get:function(){return i(this.promise)}};h.defineProperty(o.prototype,"asCallback",d),h.defineProperty(o.prototype,"callback",d)}o._nodebackForPromise=i,o.prototype.toString=function(){return"[object PromiseResolver]"},o.prototype.resolve=o.prototype.fulfill=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},o.prototype.reject=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},o.prototype.progress=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},o.prototype.cancel=function(t){this.promise.cancel(t)},o.prototype.timeout=function(){this.reject(new c("timeout"))},o.prototype.isResolved=function(){return this.promise.isResolved()},o.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=o},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e){"use strict";e.exports=function(e,r){function n(t){return!w.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=p.getDataPropertyOrDefault(t,e+r,b);return n?i(n):!1}function s(t,e,r){for(var n=0;ns;s+=2){var c=o[s],l=o[s+1],f=c+e;t[f]=n===A?A(c,h,c,l,e):n(l,function(){return A(c,h,c,l,e)})}return p.toFastProperties(t),t}function l(t,e){return A(t,e,void 0,t)}var f,h={},p=t("./util.js"),d=t("./promise_resolver.js")._nodebackForPromise,g=p.withAppended,y=p.maybeWrapAsError,v=p.canEvaluate,_=t("./errors").TypeError,m="Async",b={__isPromisified__:!0},w=/^(?:length|name|arguments|caller|prototype|__isPromisified__)$/,j=function(t,e){return p.isIdentifier(t)&&"_"!==t.charAt(0)&&!p.isClass(e)},E=function(t){return t.replace(/([$])/,"\\$")},A=v?f:u;e.promisify=function(t,e){if("function"!=typeof t)throw new _("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?h:e);return p.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new _("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=j);var i=e.promisifier;if("function"!=typeof i&&(i=A),!p.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=p.inheritedDataKeys(t),s=0;si;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e){"use strict";function r(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacityh;++h){var d=t[h];(void 0!==d||h in t)&&e.cast(d)._then(l,f,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var a=i(n,this._promise),u=!1,c=a instanceof e;c&&(a=a._target(),a._isPending()?a._proxyPromiseArray(this,-1):a._isFulfilled()?(n=a._value(),this._gotAccum=!0):(this._reject(a._reason()),u=!0)),c||this._zerothIsAccum||(this._gotAccum=!0),this._callback=r,this._accum=n,u||this._init$(void 0,-5)}function a(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var u=t("./util.js"),c=u.tryCatch,l=u.errorObj;u.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,f=this._gotAccum,h=this._valuesPhase;if(!h)for(h=this._valuesPhase=new Array(s),o=0;s>o;++o)h[o]=0;if(o=h[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=f=!0,h[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=f=!0):0===o?h[r]=1:(h[r]=2,this._accum=t),f){for(var p,d=this._callback,g=this._promise._boundTo,y=this._reducingIndex;s>y;++y)if(o=h[y],2!==o){if(1!==o)return;if(t=n[y],this._promise._pushContext(),u?(a.push(t),p=c(d).call(g,t,y,s)):p=c(d).call(g,this._accum,t,y,s),this._promise._popContext(),p===l)return this._reject(p.e);var v=i(p,this._promise);if(v instanceof e){if(v=v._target(),v._isPending())return h[y]=4,v._proxyPromiseArray(this,y);if(!v._isFulfilled())return this._reject(v._reason());p=v._value()}this._reducingIndex=y+1,this._accum=p}else this._reducingIndex=y+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return a(this,t,e,null)},e.reduce=function(t,e,r,n){return a(t,e,r,n)}}},{"./util.js":38}],31:[function(t,n){"use strict";var i;if(t("./util.js").isNode){var o=e.versions.node.split(".").map(Number);i=0===o[0]&&o[1]>10||o[0]>0?r.setImmediate:e.nextTick}else"undefined"!=typeof MutationObserver?(i=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},i.isStatic=!0):i="undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};n.exports=i},{"./util.js":38}],32:[function(t,e){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var f=a.tryCatch(i)(t);if(f===u){n&&n._pushContext();var l=e.reject(f.e);return n&&n._popContext(),l}if("function"==typeof f)return s(t,f,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(r){l&&(t===r?l._rejectCallback(e._makeSelfResolutionError(),!1,!0):l._resolveCallback(r),l=null)}function s(t){l&&(l._rejectCallback(t,h,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),f=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var h=!0,p=a.tryCatch(n).call(t,o,s,c);return h=!1,l&&p===u&&(l._rejectCallback(p.e,!0,!0),l=null),f}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){"string"!=typeof e&&(e="operation timed out");var r=new s(e);o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(f){return s(f)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new y;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new y;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function f(t,e,r){this._data=t,this._promise=e,this._context=r}function h(t,e,r){this.constructor$(t,e,r)}function p(t){return f.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var d=t("./errors.js").TypeError,g=t("./util.js").inherits,y=e.PromiseInspection;f.prototype.data=function(){return this._data},f.prototype.promise=function(){return this._promise},f.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},f.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},f.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},g(h,f),h.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");t--;for(var s=new Array(t),a=0;t>a;++a){var u=arguments[a];if(f.isDisposer(u)){var h=u;u=u.promise(),u._setDisposable(h)}else{var d=n(u);d instanceof e&&(u=d._then(p,null,null,{resources:s,index:a},void 0))}s[a]=u}var g=e.settle(s).then(o).then(function(t){g._pushContext();var e;try{e=i.apply(void 0,t)}finally{g._popContext()}return e})._then(c,l,void 0,s,void 0);return s.promise=g,g},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new h(t,this,i());throw new d}}},{"./errors.js":13,"./util.js":38}],38:[function(t,r,n){"use strict";function i(){try{return T.apply(this,arguments)}catch(t){return O.e=t,O}}function o(t){return T=t,i}function s(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function a(t){return!s(t)}function u(t){return s(t)?new Error(v(t)):t}function c(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function l(t,e,r){if(!E.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function f(t,e,r){if(s(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return E.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=E.names(t.prototype);return E.isES5?e.length>1:e.length>0&&!(1===e.length&&"constructor"===e[0])}return!1}catch(r){return!1}}function d(t){function e(){}return e.prototype=t,e}function g(t){return k.test(t)}function y(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r; +return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function _(t){try{f(t,"isOperational",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return t instanceof Error&&E.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function j(t,e,r){for(var n=E.names(t),i=0;i * MIT Licensed */ -var n=r(32),i=r(24),o=i.AssertionError;t.exports=function(t){var e=t.format;n.merge(t,i),t.exist=t.exists=function(r,n){if(null==r)throw new o({message:n||"expected "+e(r)+" to exist",stackStartFunction:t.exist})},t.not={},t.not.exist=t.not.exists=function(r,n){if(null!=r)throw new o({message:n||"expected "+e(r)+" to not exist",stackStartFunction:t.not.exist})}}},function(t){/*! +var n=r(50);e.isWrapperType=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean},e.merge=function(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t};var i=Object.prototype.hasOwnProperty;e.forEach=function(t,e,r){for(var n in t)if(i.call(t,n)&&e.call(r,t[n],n,t)===!1)return},e.some=function(t,r,n){var i=!1;return e.forEach(t,function(e,o){return r.call(n,e,o,t)?(i=!0,!1):void 0},n),i};var o=/^\s*function\s*(\S*)\s*\(/;e.functionName=function(t){if(t.name)return t.name;var e=t.toString().match(o)[1];return e};var s=r(49).formatPropertyName;e.formatProp=function(t){return s(String(t))},e.isEmptyObject=function(t){for(var e in t)if(i.call(t,e))return!1;return!0},e.isIndexable=function(t){var e=n(t);return e==n.ARRAY||e==n.BUFFER||e==n.ARGUMENTS||e==n.ARRAY_BUFFER||e==n.TYPED_ARRAY||e==n.DATA_VIEW||e==n.STRING},e.length=function(t){switch(n(t)){case n.ARRAY_BUFFER:case n.TYPED_ARRAY:case n.DATA_VIEW:return t.byteLength;case n.ARRAY:case n.BUFFER:case n.ARGUMENTS:case n.FUNCTION:case n.STRING:return t.length}}},function(t,e,r){function n(t){return u+t}function i(t){return t.split("\n").map(n).join("\n")}var o=r(32),s=r(49),a=function(t){if(o.merge(this,t),t.message||Object.defineProperty(this,"message",{get:function(){return this._message||(this._message=this.generateMessage(),this.generatedMessage=!0),this._message},configurable:!0,enumerable:!1}),Error.captureStackTrace)Error.captureStackTrace(this,this.stackStartFunction);else{var e=new Error;if(e.stack){var r=e.stack;if(this.stackStartFunction){var n=o.functionName(this.stackStartFunction),i=r.indexOf("\n"+n);if(i>=0){var s=r.indexOf("\n",i+1);r=r.substring(s+1)}}this.stack=r}}},u=" ";a.prototype=Object.create(Error.prototype,{name:{value:"AssertionError"},generateMessage:{value:function(){if(!this.operator&&this.previous)return this.previous.message;var t=s(this.actual),e="expected"in this?" "+s(this.expected):"",r="details"in this&&this.details?" ("+this.details+")":"",n=this.previous?"\n"+i(this.previous.message):"";return"expected "+t+(this.negate?" not ":" ")+this.operator+e+r+n}}}),t.exports=a},function(t,e,r){function n(t){this.obj=t,this.anyOne=!1,this.negate=!1,this.params={actual:t}}{var i=r(33),o=r(32);r(49)}n.add=function(t,e,r){var o={enumerable:!0,configurable:!0};r=!!r,o[r?"get":"value"]=function(){var r=new n(this.obj,this,t);r.anyOne=this.anyOne;try{e.apply(r,arguments)}catch(o){if(o instanceof i){if(this.negate)return this.obj=r.obj,this.negate=!1,this.proxied();r!=o.assertion&&(r.params.previous=o),r.negate=!1,r.fail()}throw o}return this.negate&&(r.negate=!0,r.params.details="false negative fail",r.fail()),this.params.operator||(this.params=r.params),this.obj=r.obj,this.negate=!1,this.proxied()},Object.defineProperty(n.prototype,t,o)},n.addChain=function(t,e){e=e||function(){},Object.defineProperty(n.prototype,t,{get:function(){return e(),this.proxied()},enumerable:!0})},n.alias=function(t,e){var r=Object.getOwnPropertyDescriptor(n.prototype,t);if(!r)throw new Error("Alias "+t+" -> "+e+" could not be created as "+t+" not defined");Object.defineProperty(n.prototype,e,r)},n.prototype={constructor:n,assert:function(t){if(t)return this.proxied();var e=this.params;throw"obj"in e&&!("actual"in e)?e.actual=e.obj:"obj"in e||"actual"in e||(e.actual=this.obj),e.stackStartFunction=e.stackStartFunction||this.assert,e.negate=this.negate,e.assertion=this,new i(e)},fail:function(){return this.assert(!1)},get not(){return this.negate=!this.negate,this.proxied()},get any(){return this.anyOne=!0,this.proxied()},proxied:function(){return"function"==typeof Proxy?new Proxy(this,{get:function(t,e){if(e in t)return t[e];throw new Error("Assertion has no property "+o.formatProp(e))}}):this}},t.exports=n},function(t){var e={checkProtoEql:!1};t.exports=e},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -t.exports=function(t,e){function r(t){Object.defineProperty(e.prototype,t,{get:function(){return this},enumerable:!0})}["an","of","a","and","be","have","with","is","which","the"].forEach(r)}},function(t){/*! +var n=r(32),i=r(53),o=r(33);t.exports=function(t){var e=t.format;n.merge(t,i),t.exist=t.exists=function(r,n){if(null==r)throw new o({message:n||"expected "+e(r)+" to exist",stackStartFunction:t.exist})},t.not={},t.not.exist=t.not.exists=function(r,n){if(null!=r)throw new o({message:n||"expected "+e(r)+" to not exist",stackStartFunction:t.not.exist})}}},function(t){t.exports=function(t,e){["an","of","a","and","be","have","with","is","which","the"].forEach(function(t){e.addChain(t)})}},function(t){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed @@ -34,17 +55,17 @@ t.exports=function(t,e){e.add("true",function(){this.is.exactly(!0)},!0),e.alias * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -t.exports=function(t,e){e.add("NaN",function(){this.params={operator:"to be NaN"},this.assert(this.obj!==this.obj)},!0),e.add("Infinity",function(){this.params={operator:"to be Infinity"},this.obj.should.be.a.Number.and.not.a.NaN.and.assert(!isFinite(this.obj))},!0),e.add("within",function(t,e,r){this.params={operator:"to be within "+t+".."+e,message:r},this.assert(this.obj>=t&&this.obj<=e)}),e.add("approximately",function(t,e,r){this.params={operator:"to be approximately "+t+" ±"+e,message:r},this.assert(Math.abs(this.obj-t)<=e)}),e.add("above",function(t,e){this.params={operator:"to be above "+t,message:e},this.assert(this.obj>t)}),e.add("below",function(t,e){this.params={operator:"to be below "+t,message:e},this.assert(this.obj=t&&this.obj<=e)}),e.add("approximately",function(t,e,r){this.params={operator:"to be approximately "+t+" ±"+e,message:r},this.assert(Math.abs(this.obj-t)<=e)}),e.add("above",function(t,e){this.params={operator:"to be above "+t,message:e},this.assert(this.obj>t)}),e.add("below",function(t,e){this.params={operator:"to be below "+t,message:e},this.assert(this.obj0?"at "+t.path.map(s.formatProp).join(" -> "):"")+(t.a===e?"":", A has "+n(t.a))+(t.b===r?"":" and B has "+n(t.b))+(t.showReason?" because "+t.reason:"")).trim()}/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(88),i=(r(33),r(32));t.exports=function(t,e){e.add("eql",function(e,r){this.params={operator:"to equal",expected:e,showDiff:!0,message:r};var o=n(this.obj,e);o.result||(this.params.details=i.formatEqlResult(o,this.obj,e,t.format)),this.assert(o.result)}),e.add("equal",function(t,e){this.params={operator:"to be",expected:t,showDiff:!0,message:e},this.assert(t===this.obj)}),e.alias("equal","exactly")}},function(t,e,r){/*! +var i=r(58),o=r(50),s=r(32);t.exports=function(t,e){e.add("eql",function(e,r){this.params={operator:"to equal",expected:e,message:r};var s=i(this.obj,e,t.config);this.params.details=s.result?"":n(s,this.obj,e,t.format),this.params.showDiff=o(this.obj)==o(e),this.assert(s.result)}),e.add("equal",function(t,e){this.params={operator:"to be",expected:t,message:e},this.params.showDiff=o(this.obj)==o(t),this.assert(t===this.obj)}),e.alias("equal","exactly")}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32);t.exports=function(t,e){e.add("Number",function(){this.params={operator:"to be a number"},this.assert(n.isNumber(this.obj))},!0),e.add("arguments",function(){this.params={operator:"to be arguments"},this.assert(n.isArguments(this.obj))},!0),e.add("type",function(t,e){this.params={operator:"to have type "+t,message:e},(typeof this.obj).should.be.exactly(t,e)}),e.add("instanceof",function(t,e){this.params={operator:"to be an instance of "+n.functionName(t),message:e},this.assert(Object(this.obj)instanceof t)}),e.add("Function",function(){this.params={operator:"to be a function"},this.assert(n.isFunction(this.obj))},!0),e.add("Object",function(){this.params={operator:"to be an object"},this.assert(n.isObject(this.obj))},!0),e.add("String",function(){this.params={operator:"to be a string"},this.assert(n.isString(this.obj))},!0),e.add("Array",function(){this.params={operator:"to be an array"},this.assert(n.isArray(this.obj))},!0),e.add("Boolean",function(){this.params={operator:"to be a boolean"},this.assert(n.isBoolean(this.obj))},!0),e.add("Error",function(){this.params={operator:"to be an error"},this.assert(n.isError(this.obj))},!0),e.add("null",function(){this.params={operator:"to be null"},this.assert(null===this.obj)},!0),e.alias("null","Null"),e.alias("instanceof","instanceOf")}},function(t){/*! +var n=r(32);t.exports=function(t,e){e.add("Number",function(){this.params={operator:"to be a number"},this.have.type("number")},!0),e.add("arguments",function(){this.params={operator:"to be arguments"},this.have["class"]("Arguments")},!0),e.alias("arguments","Arguments"),e.add("type",function(e,r){this.params={operator:"to have type "+e,message:r},t(typeof this.obj).be.exactly(e)}),e.add("instanceof",function(t,e){this.params={operator:"to be an instance of "+n.functionName(t),message:e},this.assert(Object(this.obj)instanceof t)}),e.alias("instanceof","instanceOf"),e.add("Function",function(){this.params={operator:"to be a function"},this.have.type("function")},!0),e.add("Object",function(){this.params={operator:"to be an object"},this.is.not["null"].and.have.type("object")},!0),e.add("String",function(){this.params={operator:"to be a string"},this.have.type("string")},!0),e.add("Array",function(){this.params={operator:"to be an array"},this.have["class"]("Array")},!0),e.add("Boolean",function(){this.params={operator:"to be a boolean"},this.have.type("boolean")},!0),e.add("Error",function(){this.params={operator:"to be an error"},this.have.instanceOf(Error)},!0),e.add("null",function(){this.params={operator:"to be null"},this.assert(null===this.obj)},!0),e.alias("null","Null"),e.add("class",function(t){this.params={operator:"to have [[Class]] "+t},this.assert(Object.prototype.toString.call(this.obj)==="[object "+t+"]")}),e.alias("class","Class"),e.add("undefined",function(){this.params={operator:"to be undefined"},this.assert(void 0===this.obj)},!0),e.alias("undefined","Undefined")}},function(t){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed @@ -54,29 +75,27 @@ t.exports=function(t,e){e.add("startWith",function(e,r){this.params={operator:"t * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32),i=r(88),o=Array.prototype.slice;t.exports=function(t,e){var r=t.format;e.add("enumerable",function(t,e){t=String(t),this.params={operator:"to have enumerable property "+n.formatProp(t)},this.assert(this.obj.propertyIsEnumerable(t)),arguments.length>1&&(this.params.operator+=" equal to "+r(e),this.assert(i(e,this.obj[t]).result))}),e.add("property",function(t,e){if(t=String(t),arguments.length>1){var r={};r[t]=e,this.have.properties(r)}else this.have.properties(t);this.obj=this.obj[t]}),e.add("properties",function(t){var e={};arguments.length>1?t=o.call(arguments):n.isArray(t)||(n.isString(t)?t=[t]:(e=t,t=Object.keys(t)));var s=Object(this.obj),a=[];t.forEach(function(t){t in s||a.push(n.formatProp(t))});var u=a;0===u.length?u=t.map(n.formatProp):this.anyOne&&(u=t.filter(function(t){return a.indexOf(n.formatProp(t))<0}).map(n.formatProp));var c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", ");this.params={obj:this.obj,operator:c},this.assert(0===a.length||this.anyOne&&a.length!=t.length);var l=Object.keys(e);if(l.length){var f=[];u=[],l.forEach(function(t){var o=e[t];i(s[t],o).result?u.push(n.formatProp(t)+" of "+r(o)):f.push(n.formatProp(t)+" of "+r(o)+" (got "+r(s[t])+")")}),(0!==f.length&&!this.anyOne||this.anyOne&&0===u.length)&&(u=f),c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", "),this.params={obj:this.obj,operator:c},this.assert(0===f.length||this.anyOne&&f.length!=l.length)}}),e.add("length",function(t,e){this.have.property("length",t,e)}),e.alias("length","lengthOf");var s=Object.prototype.hasOwnProperty;e.add("ownProperty",function(t,e){t=String(t),this.params={obj:this.obj,operator:"to have own property "+n.formatProp(t),message:e},this.assert(s.call(this.obj,t)),this.obj=this.obj[t]}),e.alias("ownProperty","hasOwnProperty"),e.add("empty",function(){if(this.params={operator:"to be empty"},n.isString(this.obj)||n.isArray(this.obj)||n.isArguments(this.obj))this.obj.should.have.property("length",0);else{var t=Object(this.obj);for(var e in t)this.obj.should.not.ownProperty(e)}},!0),e.add("keys",function(t){arguments.length>1?t=o.call(arguments):1===arguments.length&&n.isString(t)?t=[t]:0===arguments.length&&(t=[]),t=t.map(String);var e=Object(this.obj),r=[];t.forEach(function(t){s.call(this.obj,t)||r.push(n.formatProp(t))},this);var i=[];Object.keys(e).forEach(function(e){t.indexOf(e)<0&&i.push(n.formatProp(e))});var a=0===t.length?"to be empty":"to have "+(1===t.length?"key ":"keys ");this.params={operator:a+t.map(n.formatProp).join(", ")},r.length>0&&(this.params.operator+="\n missing keys: "+r.join(", ")),i.length>0&&(this.params.operator+="\n extra keys: "+i.join(", ")),this.assert(0===r.length&&0===i.length)}),e.alias("keys","key"),e.add("propertyByPath",function(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&n.isString(e)?e=[e]:0===arguments.length&&(e=[]);var r=e.map(n.formatProp);e=e.map(String);for(var i,s=t(Object(this.obj)),a=[];i=e.shift();)this.params={operator:"to have property by path "+r.join(", ")+" - failed on "+n.formatProp(i)},s=s.have.property(i),a.push(i);this.params={obj:this.obj,operator:"to have property by path "+r.join(", ")},this.obj=s.obj})}},function(t,e,r){/*! +var n=r(32),i=r(58),o=Array.prototype.slice;t.exports=function(t,e){function r(){var e={};if(arguments.length>1)e.names=o.call(arguments);else{var r=arguments[0],i=t.type(r);i==t.type.STRING?e.names=[r]:n.isIndexable(r)?e.names=r:(e.names=Object.keys(r),e.values=r)}return e}var s=t.format;e.add("propertyWithDescriptor",function(e,r){this.params={actual:this.obj,operator:"to have own property with descriptor "+s(r)};var n=this.obj;this.have.ownProperty(e),t(Object.getOwnPropertyDescriptor(Object(n),e)).have.properties(r)}),e.add("enumerable",function(t,e){t=String(t),this.params={operator:"to have enumerable property "+n.formatProp(t)+(arguments.length>1?" equal to "+s(e):"")};var r={enumerable:!0};arguments.length>1&&(r.value=e),this.have.propertyWithDescriptor(t,r)}),e.add("enumerables",function(){var t=r.apply(null,arguments);this.params={operator:"to have enumerables "+t.names.map(n.formatProp)};var e=this.obj;t.names.forEach(function(t){e.should.have.enumerable(t)})}),e.add("property",function(t,e){if(t=String(t),arguments.length>1){var r={};r[t]=e,this.have.properties(r)}else this.have.properties(t);this.obj=this.obj[t]}),e.add("properties",function(t){var e={};arguments.length>1?t=o.call(arguments):Array.isArray(t)||("string"==typeof t?t=[t]:(e=t,t=Object.keys(t)));var r=Object(this.obj),a=[];t.forEach(function(t){t in r||a.push(n.formatProp(t))});var u=a;0===u.length?u=t.map(n.formatProp):this.anyOne&&(u=t.filter(function(t){return a.indexOf(n.formatProp(t))<0}).map(n.formatProp));var c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", ");this.params={obj:this.obj,operator:c},this.assert(0===a.length||this.anyOne&&a.length!=t.length);var l=Object.keys(e);if(l.length){var f=[];u=[],l.forEach(function(t){var o=e[t];i(r[t],o).result?u.push(n.formatProp(t)+" of "+s(o)):f.push(n.formatProp(t)+" of "+s(o)+" (got "+s(r[t])+")")}),(0!==f.length&&!this.anyOne||this.anyOne&&0===u.length)&&(u=f),c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", "),this.params={obj:this.obj,operator:c},this.assert(0===f.length||this.anyOne&&f.length!=l.length)}}),e.add("length",function(t,e){this.have.property("length",t,e)}),e.alias("length","lengthOf");var a=Object.prototype.hasOwnProperty;e.add("ownProperty",function(t,e){t=String(t),this.params={actual:this.obj,operator:"to have own property "+n.formatProp(t),message:e},this.assert(a.call(this.obj,t)),this.obj=this.obj[t]}),e.alias("ownProperty","hasOwnProperty"),e.add("empty",function(){if(this.params={operator:"to be empty"},void 0!==n.length(this.obj))this.obj.should.have.property("length",0);else{var t=Object(this.obj);for(var e in t)this.obj.should.not.have.ownProperty(e)}},!0),e.add("keys",function(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&t.type(e)==t.type.STRING?e=[e]:0===arguments.length&&(e=[]),e=e.map(String);var r=Object(this.obj),i=[];e.forEach(function(t){a.call(this.obj,t)||i.push(n.formatProp(t))},this);var s=[];Object.keys(r).forEach(function(t){e.indexOf(t)<0&&s.push(n.formatProp(t))});var u=0===e.length?"to be empty":"to have "+(1===e.length?"key ":"keys ");this.params={operator:u+e.map(n.formatProp).join(", ")},i.length>0&&(this.params.operator+="\n missing keys: "+i.join(", ")),s.length>0&&(this.params.operator+="\n extra keys: "+s.join(", ")),this.assert(0===i.length&&0===s.length)}),e.alias("keys","key"),e.add("propertyByPath",function(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&n.isString(e)?e=[e]:0===arguments.length&&(e=[]);var r=e.map(n.formatProp);e=e.map(String);for(var i,s=t(Object(this.obj)),a=[];i=e.shift();)this.params={operator:"to have property by path "+r.join(", ")+" - failed on "+n.formatProp(i)},s=s.have.property(i),a.push(i);this.params={obj:this.obj,operator:"to have property by path "+r.join(", ")},this.obj=s.obj})}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32);t.exports=function(t,e){var r=t.format;e.add("throw",function(e,i){var o=this.obj,s={},a="",u=!1;this.is.a.Function;var c=!0;try{o()}catch(l){u=!0,s=l}if(u)if(e){if("string"==typeof e)c=e==s.message;else if(e instanceof RegExp)c=e.test(s.message);else if("function"==typeof e)c=s instanceof e;else if(n.isObject(e))try{s.should.match(e)}catch(l){if(!(l instanceof t.AssertionError))throw l;a=": "+l.message,c=!1}if(c){if("function"==typeof e&&i)try{s.should.match(i)}catch(l){if(!(l instanceof t.AssertionError))throw l;a=": "+l.message,c=!1}}else"string"==typeof e||e instanceof RegExp?a=" with a message matching "+r(e)+", but got '"+s.message+"'":"function"==typeof e&&(a=" of type "+n.functionName(e)+", but got "+n.functionName(s.constructor))}else a=" (got "+r(s)+")";this.params={operator:"to throw exception"+a},this.assert(u),this.assert(c)}),e.alias("throw","throwError")}},function(t,e,r){/*! +var n=r(32);t.exports=function(t,e){var r=t.format;e.add("throw",function(e,i){var o=this.obj,s={},a="",u=!1;this.is.a.Function;var c=!0;try{o()}catch(l){u=!0,s=l}if(u)if(e){if("string"==typeof e)c=e==s.message;else if(e instanceof RegExp)c=e.test(s.message);else if("function"==typeof e)c=s instanceof e;else if(null!=e)try{s.should.match(e)}catch(l){if(!(l instanceof t.AssertionError))throw l;a=": "+l.message,c=!1}if(c){if("function"==typeof e&&i)try{s.should.match(i)}catch(l){if(!(l instanceof t.AssertionError))throw l;a=": "+l.message,c=!1}}else"string"==typeof e||e instanceof RegExp?a=" with a message matching "+r(e)+", but got '"+s.message+"'":"function"==typeof e&&(a=" of type "+n.functionName(e)+", but got "+n.functionName(s.constructor))}else a=" (got "+r(s)+")";this.params={operator:"to throw exception"+a},this.assert(u),this.assert(c)}),e.alias("throw","throwError")}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32),i=r(88);t.exports=function(t,e){var r=t.format;e.add("match",function(o,s){if(this.params={operator:"to match "+r(o),message:s},!i(this.obj,o).result)if(n.isRegExp(o)){if(n.isString(this.obj))this.assert(o.exec(this.obj));else if(n.isArray(this.obj))this.obj.forEach(function(t){this.assert(o.exec(t))},this);else if(n.isObject(this.obj)){var a=[],u=[];n.forOwn(this.obj,function(t,e){o.exec(t)?u.push(n.formatProp(e)):a.push(n.formatProp(e)+" ("+r(t)+")")},this),a.length&&(this.params.operator+="\n not matched properties: "+a.join(", ")),u.length&&(this.params.operator+="\n matched properties: "+u.join(", ")),this.assert(0==a.length)}}else if(n.isFunction(o)){var c;c=o(this.obj),c instanceof e&&(this.params.operator+="\n "+c.getMessage()),n.isBoolean(c)&&this.assert(c)}else n.isObject(o)?(a=[],u=[],n.forOwn(o,function(e,i){try{t(this.obj[i]).match(e),u.push(n.formatProp(i))}catch(o){if(!(o instanceof t.AssertionError))throw o;a.push(n.formatProp(i)+" ("+r(this.obj[i])+")")}},this),a.length&&(this.params.operator+="\n not matched properties: "+a.join(", ")),u.length&&(this.params.operator+="\n matched properties: "+u.join(", ")),this.assert(0==a.length)):this.assert(!1)}),e.add("matchEach",function(t,e){this.params={operator:"to match each "+r(t),message:e};var o=t;n.isRegExp(t)?o=function(e){return!!t.exec(e)}:n.isFunction(t)||(o=function(e){return i(e,t).result}),n.forOwn(this.obj,function(t,e){var r=o(t,e);n.isBoolean(r)&&this.assert(r)},this)})}},function(t,e,r){/*! +var n=r(32),i=r(58);t.exports=function(t,e){var r=t.format;e.add("match",function(e,o){if(this.params={operator:"to match "+r(e),message:o},!i(this.obj,e).result)if(e instanceof RegExp){if("string"==typeof this.obj)this.assert(e.exec(this.obj));else if(n.isIndexable(this.obj))n.forEach(this.obj,function(t){this.assert(e.exec(t))},this);else if(null!=this.obj&&"object"==typeof this.obj){var s=[],a=[];n.forEach(this.obj,function(t,i){e.exec(t)?a.push(n.formatProp(i)):s.push(n.formatProp(i)+" ("+r(t)+")")},this),s.length&&(this.params.operator+="\n not matched properties: "+s.join(", ")),a.length&&(this.params.operator+="\n matched properties: "+a.join(", ")),this.assert(0==s.length)}}else if("function"==typeof e){var u;u=e(this.obj),"boolean"==typeof u&&this.assert(u)}else null!=e&&"object"==typeof e?(s=[],a=[],n.forEach(e,function(e,i){try{t(this.obj[i]).match(e),a.push(n.formatProp(i))}catch(o){if(!(o instanceof t.AssertionError))throw o;s.push(n.formatProp(i)+" ("+r(this.obj[i])+")")}},this),s.length&&(this.params.operator+="\n not matched properties: "+s.join(", ")),a.length&&(this.params.operator+="\n matched properties: "+a.join(", ")),this.assert(0==s.length)):this.assert(!1)}),e.add("matchEach",function(t,e){this.params={operator:"to match each "+r(t),message:e};var o=t;t instanceof RegExp?o=function(e){return!!t.exec(e)}:"function"!=typeof t&&(o=function(e){return i(e,t).result}),n.forEach(this.obj,function(t,e){var r=o(t,e);"boolean"==typeof r&&this.assert(r)},this)})}},function(t,e,r){/*! * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed */ -var n=r(32),i=r(88);t.exports=function(t,e){var r=t.format;e.add("containEql",function(t){this.params={operator:"to contain "+r(t)};var e=this.obj;n.isArray(e)?this.assert(e.some(function(e){return i(e,t).result})):n.isString(e)?this.assert(e.indexOf(String(t))>=0):n.isObject(e)?n.forOwn(t,function(t,r){e.should.have.property(r,t)}):this.assert(!1)}),e.add("containDeepOrdered",function(e){this.params={operator:"to contain "+r(e)};var i=this.obj;if(n.isArray(i))if(n.isArray(e)){var o=0;i.forEach(function(r){try{t(r).not.be.Null.and.containDeep(e[o]),o++}catch(n){if(n instanceof t.AssertionError)return;throw n}},this),this.assert(o==e.length)}else this.assert(!1);else n.isString(i)?this.assert(i.indexOf(String(e))>=0):n.isObject(i)?n.isObject(e)?n.forOwn(e,function(e,r){t(i[r]).not.be.Null.and.containDeep(e)}):this.assert(!1):this.eql(e)}),e.add("containDeep",function(e){this.params={operator:"to contain "+r(e)};var i=this.obj;if(n.isArray(i))if(n.isArray(e)){var o={};e.forEach(function(e){this.assert(i.some(function(r,n){if(n in o)return!1;try{return t(r).not.be.Null.and.containDeep(e),o[n]=!0,!0}catch(i){if(i instanceof t.AssertionError)return!1;throw i}}))},this)}else this.assert(!1);else n.isString(i)?this.assert(i.indexOf(String(e))>=0):n.isObject(i)?n.isObject(e)?n.forOwn(e,function(e,r){t(i[r]).not.be.Null.and.containDeep(e)}):this.assert(!1):this.eql(e)})}},function(t,e,r){function n(t){var e={};for(var r in t)e[r]=t[r];return e}var i=r(89);t.exports=function(t){var e=t;switch(i(t)){case"undefined":return"undefined";case"number":return t.toString();case"regexp":return t.toString();case"date":return t.toISOString();case"function":return t.toString();case"object":t=n(t);default:var r=[];return JSON.stringify(t,function(t,n){if(!r.length)return r.push(n),n;var i=r.indexOf(this);return~i?r.splice(i+1):r.push(this),n===e||~r.indexOf(n)?"[Circular]":void 0===n?"[Undefined]":n})}}},function(t,e,r){var n;(function(t,i){(function(){function o(t,e,r){for(var n=(r||0)-1,i=t?t.length:0;++n-1?0:-1:t?0:-1}function a(t){var e=this.cache,r=typeof t;if("boolean"==r||null==t)e[t]=!0;else{"number"!=r&&"string"!=r&&(r="object");var n="number"==r?t:x+t,i=e[r]||(e[r]={});"object"==r?(i[n]||(i[n]=[])).push(t):i[n]=!0}}function u(t){return t.charCodeAt(0)}function c(t,e){for(var r=t.criteria,n=e.criteria,i=-1,o=r.length;++ia||"undefined"==typeof s)return 1;if(a>s||"undefined"==typeof a)return-1}}return t.index-e.index}function l(t){var e=-1,r=t.length,n=t[0],i=t[r/2|0],o=t[r-1];if(n&&"object"==typeof n&&i&&"object"==typeof i&&o&&"object"==typeof o)return!1;var s=p();s["false"]=s["null"]=s["true"]=s.undefined=!1;var u=p();for(u.array=t,u.cache=s,u.push=a;++ei?0:i);++n=A&&n===o,u=[];if(a){var c=l(e);c?(n=s,e=c):a=!1}for(;++r-1:void 0});return i.pop(),o.pop(),_&&(y(i),y(o)),s}function ae(t,e,r,n,i){(fi(e)?nr:Ai)(e,function(e,o){var s,a,u=e,c=t[o];if(e&&((a=fi(e))||Oi(e))){for(var l=n.length;l--;)if(s=n[l]==e){c=i[l];break}if(!s){var f;r&&(u=r(c,e),(f="undefined"!=typeof u)&&(c=u)),f||(c=a?fi(c)?c:[]:Oi(c)?c:{}),n.push(e),i.push(c),f||ae(c,e,r,n,i)}}else r&&(u=r(c,e),"undefined"==typeof u&&(u=e)),"undefined"!=typeof u&&(c=u);t[o]=c})}function ue(t,e){return t+Mn(oi()*(e-t+1))}function le(t,e,r){var n=-1,i=ye(),a=t?t.length:0,u=[],c=!e&&a>=A&&i===o,f=r||c?h():u;if(c){var p=l(f);i=s,f=p}for(;++n3&&"function"==typeof e[r-2])var n=b(e[--r-1],e[r--],2);else r>2&&"function"==typeof e[r-1]&&(n=e[--r]);for(var i=v(arguments,1,r),o=-1,s=h(),a=h();++or?ri(0,o+r):r)||0,fi(t)?s=i(t,e,r)>-1:"number"==typeof o?s=(Ve(t)?t.indexOf(e,r):i(t,e,r))>-1:wi(t,function(t){return++n>=r?!(s=t===e):void 0}),s}function Xe(t,r,n){var i=!0;if(r=e.createCallback(r,n,3),fi(t))for(var o=-1,s=t.length;++oo&&(o=c)}else r=null==r&&Ve(t)?u:e.createCallback(r,n,3),wi(t,function(t,e,n){var s=r(t,e,n);s>i&&(i=s,o=t)});return o}function ur(t,r,n){var i=1/0,o=i;if("function"!=typeof r&&n&&n[r]===t&&(r=null),null==r&&fi(t))for(var s=-1,a=t.length;++sc&&(o=c)}else r=null==r&&Ve(t)?u:e.createCallback(r,n,3),wi(t,function(t,e,n){var s=r(t,e,n);i>s&&(i=s,o=t)});return o}function cr(t,r,n,i){var o=arguments.length<3;if(r=e.createCallback(r,i,4),fi(t)){var s=-1,a=t.length;for(o&&(n=t[++s]);++sr?ri(0,n+r):r||0}else if(r){var i=Rr(t,e);return t[i]===e?i:-1}return o(t,e,r)}function Ar(t,r,n){var i=0,o=t?t.length:0;if("number"!=typeof r&&null!=r){var s=o;for(r=e.createCallback(r,n,3);s--&&r(t[s],s,t);)i++}else i=null==r||n?1:r||i;return v(t,0,ni(ri(0,o-i),o))}function Or(){for(var t=[],e=-1,r=arguments.length,n=h(),i=ye(),a=i===o,u=h();++e=A&&l(e?t[e]:u)))}var f=t[0],p=-1,d=f?f.length:0,v=[];t:for(;++pr?ri(0,n+r):ni(r,n-1))+1);n--;)if(t[n]===e)return n;return-1}function Tr(t){for(var e=arguments,r=0,n=e.length,i=t?t.length:0;++ro;){var a=o+s>>>1;n(t[a])1?arguments:arguments[0],e=-1,r=t?ar(Si(t,"length")):0,n=wn(0>r?0:r);++e2?he(t,17,v(arguments,2),null,e):he(t,1,null,null,e)}function Vr(t){for(var e=arguments.length>1?ie(arguments,!0,!1,1):Pe(t),r=-1,n=e.length;++r2?he(e,19,v(arguments,2),null,t):he(e,3,null,null,t)}function qr(){for(var t=arguments,e=t.length;e--;)if(!Ue(t[e]))throw new Nn;return function(){for(var e=arguments,r=t.length;r--;)e=[t[r].apply(this,e)];return e[0]}}function zr(t,e){return e="number"==typeof e?e:+e||t.length,he(t,4,null,null,null,e)}function Wr(t,e,r){var n,i,o,s,a,u,c,l=0,f=!1,h=!0;if(!Ue(t))throw new Nn;if(e=ri(0,e)||0,r===!0){var p=!0;h=!1}else Le(r)&&(p=r.leading,f="maxWait"in r&&(ri(e,r.maxWait)||0),h="trailing"in r?r.trailing:h);var d=function(){var r=e-(Fi()-s);if(0>=r){i&&Hn(i);var f=c;i=u=c=_,f&&(l=Fi(),o=t.apply(a,n),u||i||(n=a=null))}else u=Yn(d,r)},y=function(){u&&Hn(u),i=u=c=_,(h||f!==e)&&(l=Fi(),o=t.apply(a,n),u||i||(n=a=null))};return function(){if(n=arguments,s=Fi(),a=this,c=h&&(u||!p),f===!1)var r=p&&!u;else{i||p||(l=s);var g=f-(s-l),v=0>=g;v?(i&&(i=Hn(i)),l=s,o=t.apply(a,n)):i||(i=Yn(y,g))}return v&&u?u=Hn(u):u||e===f||(u=Yn(d,e)),r&&(v=!0,o=t.apply(a,n)),!v||u||i||(n=a=null),o}}function Yr(t){if(!Ue(t))throw new Nn;var e=v(arguments,1);return Yn(function(){t.apply(_,e)},1)}function Kr(t,e){if(!Ue(t))throw new Nn;var r=v(arguments,2);return Yn(function(){t.apply(_,r)},e)}function Gr(t,e){if(!Ue(t))throw new Nn;var r=function(){var n=r.cache,i=e?e.apply(this,arguments):x+arguments[0];return qn.call(n,i)?n[i]:n[i]=t.apply(this,arguments)};return r.cache={},r}function Jr(t){var e,r;if(!Ue(t))throw new Nn;return function(){return e?r:(e=!0,r=t.apply(this,arguments),t=null,r)}}function Qr(t){return he(t,16,v(arguments,1))}function Zr(t){return he(t,32,null,v(arguments,1))}function Xr(t,e,r){var n=!0,i=!0;if(!Ue(t))throw new Nn;return r===!1?n=!1:Le(r)&&(n="leading"in r?r.leading:n,i="trailing"in r?r.trailing:i),te.leading=n,te.maxWait=e,te.trailing=i,Wr(t,e,te)}function tn(t,e){return he(e,16,[t])}function en(t){return function(){return t}}function rn(t,e,r){var n=typeof t;if(null==t||"function"==n)return b(t,e,r);if("object"!=n)return cn(t);var i=pi(t),o=i[0],s=t[o];return 1!=i.length||s!==s||Le(s)?function(e){for(var r=i.length,n=!1;r--&&(n=se(e[i[r]],t[i[r]],null,!0)););return n}:function(t){var e=t[o];return s===e&&(0!==s||1/s==1/e)}}function nn(t){return null==t?"":Sn(t).replace(bi,de)}function on(t){return t}function sn(t,n,i){var o=!0,s=n&&Pe(n);n&&(i||s.length)||(null==i&&(i=n),a=r,n=t,t=e,s=Pe(n)),i===!1?o=!1:Le(i)&&"chain"in i&&(o=i.chain);var a=t,u=Ue(a);nr(s,function(e){var r=t[e]=n[e];u&&(a.prototype[e]=function(){var e=this.__chain__,n=this.__wrapped__,i=[n];zn.apply(i,arguments);var s=r.apply(t,i);if(o||e){if(n===s&&Le(s))return this;s=new a(s),s.__chain__=e}return s})})}function an(){return t._=Un,this}function un(){}function cn(t){return function(e){return e[t]}}function ln(t,e,r){var n=null==t,i=null==e;if(null==r&&("boolean"==typeof t&&i?(r=t,t=1):i||"boolean"!=typeof e||(r=e,i=!0)),n&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0,r||t%1||e%1){var o=oi();return ni(t+o*(e-t+parseFloat("1e-"+((o+"").length-1))),e)}return ue(t,e)}function fn(t,e){if(t){var r=t[e];return Ue(r)?t[e]():r}}function hn(t,r,n){var i=e.templateSettings;t=Sn(t||""),n=Ei({},n,i);var o,s=Ei({},n.imports,i.imports),a=pi(s),u=Je(s),c=0,l=n.interpolate||L,h="__p += '",p=Tn((n.escape||L).source+"|"+l.source+"|"+(l===I?F:L).source+"|"+(n.evaluate||L).source+"|$","g");t.replace(p,function(e,r,n,i,s,a){return n||(n=i),h+=t.slice(c,a).replace(D,f),r&&(h+="' +\n__e("+r+") +\n'"),s&&(o=!0,h+="';\n"+s+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=a+e.length,e}),h+="';\n";var d=n.variable,y=d;y||(d="obj",h="with ("+d+") {\n"+h+"\n}\n"),h=(o?h.replace(T,""):h).replace(S,"$1").replace(N,"$1;"),h="function("+d+") {\n"+(y?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+V++ +"]")+"\n*/";try{var v=An(a,"return "+h+g).apply(_,u)}catch(m){throw m.source=h,m}return r?v(r):(v.source=h,v)}function pn(t,e,r){t=(t=+t)>-1?t:0;var n=-1,i=wn(t);for(e=b(e,r,1);++n/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:e}};var ci=function(t){var e="var index, iterable = "+t.firstArg+", result = "+t.init+";\nif (!iterable) return result;\n"+t.top+";";t.array?(e+="\nvar length = iterable.length; index = -1;\nif ("+t.array+") { ",ui.unindexedChars&&(e+="\n if (isString(iterable)) {\n iterable = iterable.split('')\n } "),e+="\n while (++index < length) {\n "+t.loop+";\n }\n}\nelse { "):ui.nonEnumArgs&&(e+="\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += '';\n "+t.loop+";\n }\n } else { "),ui.enumPrototypes&&(e+="\n var skipProto = typeof iterable == 'function';\n "),ui.enumErrorProps&&(e+="\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n ");var r=[];if(ui.enumPrototypes&&r.push('!(skipProto && index == "prototype")'),ui.enumErrorProps&&r.push('!(skipErrorProps && (index == "message" || index == "name"))'),t.useHas&&t.keys)e+="\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n",r.length&&(e+=" if ("+r.join(" && ")+") {\n "),e+=t.loop+"; ",r.length&&(e+="\n }"),e+="\n } ";else if(e+="\n for (index in iterable) {\n",t.useHas&&r.push("hasOwnProperty.call(iterable, index)"),r.length&&(e+=" if ("+r.join(" && ")+") {\n "),e+=t.loop+"; ",r.length&&(e+="\n }"),e+="\n } ",ui.nonEnumShadows){for(e+="\n\n if (iterable !== objectProto) {\n var ctor = iterable.constructor,\n isProto = iterable === (ctor && ctor.prototype),\n className = iterable === stringProto ? stringClass : iterable === errorProto ? errorClass : toString.call(iterable),\n nonEnum = nonEnumProps[className];\n ",k=0;k<7;k++)e+="\n index = '"+t.shadowedProps[k]+"';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))",t.useHas||(e+=" || (!nonEnum[index] && iterable[index] !== objectProto[index])"),e+=") {\n "+t.loop+";\n } ";e+="\n } "}return(t.array||ui.nonEnumArgs)&&(e+="\n}"),e+=t.bottom+";\nreturn result"};Qn||(a=function(){function e(){}return function(r){if(Le(r)){e.prototype=r;var n=new e;e.prototype=null}return n||t.Object()}}());var li=Jn?function(t,e){ee.value=e,Jn(t,"__bindData__",ee)}:un;ui.argsClass||(_e=function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&qn.call(t,"callee")&&!Wn.call(t,"callee")||!1});var fi=Zn||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Ln.call(t)==q||!1},hi=pe({args:"object",init:"[]",top:"if (!(objectTypes[typeof object])) return result",loop:"result.push(index)"}),pi=ei?function(t){return Le(t)?ui.enumPrototypes&&"function"==typeof t||ui.nonEnumArgs&&t.length&&_e(t)?hi(t):ei(t):[]}:hi,di={args:"collection, callback, thisArg",top:"callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)",array:"typeof length == 'number'",keys:pi,loop:"if (callback(iterable[index], index, collection) === false) return result"},yi={args:"object, source, guard",top:"var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard == 'number' ? 2 : args.length;\nwhile (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {",keys:pi,loop:"if (typeof result[index] == 'undefined') result[index] = iterable[index]",bottom:" }\n}"},gi={top:"if (!objectTypes[typeof iterable]) return result;\n"+di.top,array:!1},vi={"&":"&","<":"<",">":">",'"':""","'":"'"},mi=Te(vi),_i=Tn("("+pi(mi).join("|")+")","g"),bi=Tn("["+pi(vi).join("")+"]","g"),wi=pe(di),ji=pe(yi,{top:yi.top.replace(";",";\nif (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n callback = args[--argsLength];\n}"),loop:"result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]"}),Ei=pe(yi),xi=pe(di,gi,{useHas:!1}),Ai=pe(di,gi);Ue(/x/)&&(Ue=function(t){return"function"==typeof t&&Ln.call(t)==K});var Oi=$n?function(t){if(!t||Ln.call(t)!=J||!ui.argsClass&&_e(t))return!1;var e=t.valueOf,r=ge(e)&&(r=$n(e))&&$n(r);return r?t==r||$n(t)==r:ve(t)}:ve,Pi=fe(function(t,e,r){qn.call(t,r)?t[r]++:t[r]=1}),ki=fe(function(t,e,r){(qn.call(t,r)?t[r]:t[r]=[]).push(e)}),Ti=fe(function(t,e,r){t[r]=e}),Si=sr,Ni=tr,Fi=ge(Fi=En.now)&&Fi||function(){return(new En).getTime()},Ri=8==ii(P+"08")?ii:function(t,e){return ii(Ve(t)?t.replace(U,""):t,e||0)};return e.after=Hr,e.assign=ji,e.at=Qe,e.bind=Mr,e.bindAll=Vr,e.bindKey=$r,e.chain=gn,e.compact=mr,e.compose=qr,e.constant=en,e.countBy=Pi,e.create=je,e.createCallback=rn,e.curry=zr,e.debounce=Wr,e.defaults=Ei,e.defer=Yr,e.delay=Kr,e.difference=_r,e.filter=tr,e.flatten=Er,e.forEach=nr,e.forEachRight=ir,e.forIn=xi,e.forInRight=Ae,e.forOwn=Ai,e.forOwnRight=Oe,e.functions=Pe,e.groupBy=ki,e.indexBy=Ti,e.initial=Ar,e.intersection=Or,e.invert=Te,e.invoke=or,e.keys=pi,e.map=sr,e.mapValues=qe,e.max=ar,e.memoize=Gr,e.merge=ze,e.min=ur,e.omit=We,e.once=Jr,e.pairs=Ye,e.partial=Qr,e.partialRight=Zr,e.pick=Ke,e.pluck=Si,e.property=cn,e.pull=Tr,e.range=Sr,e.reject=fr,e.remove=Nr,e.rest=Fr,e.shuffle=pr,e.sortBy=gr,e.tap=vn,e.throttle=Xr,e.times=pn,e.toArray=vr,e.transform=Ge,e.union=Cr,e.uniq=Ir,e.values=Je,e.where=Ni,e.without=Ur,e.wrap=tn,e.xor=Lr,e.zip=Br,e.zipObject=Dr,e.collect=sr,e.drop=Fr,e.each=nr,e.eachRight=ir,e.extend=ji,e.methods=Pe,e.object=Dr,e.select=tr,e.tail=Fr,e.unique=Ir,e.unzip=Br,sn(e),e.clone=be,e.cloneDeep=we,e.contains=Ze,e.escape=nn,e.every=Xe,e.find=er,e.findIndex=br,e.findKey=Ee,e.findLast=rr,e.findLastIndex=wr,e.findLastKey=xe,e.has=ke,e.identity=on,e.indexOf=xr,e.isArguments=_e,e.isArray=fi,e.isBoolean=Se,e.isDate=Ne,e.isElement=Fe,e.isEmpty=Re,e.isEqual=Ce,e.isFinite=Ie,e.isFunction=Ue,e.isNaN=Be,e.isNull=De,e.isNumber=He,e.isObject=Le,e.isPlainObject=Oi,e.isRegExp=Me,e.isString=Ve,e.isUndefined=$e,e.lastIndexOf=kr,e.mixin=sn,e.noConflict=an,e.noop=un,e.now=Fi,e.parseInt=Ri,e.random=ln,e.reduce=cr,e.reduceRight=lr,e.result=fn,e.runInContext=m,e.size=dr,e.some=yr,e.sortedIndex=Rr,e.template=hn,e.unescape=dn,e.uniqueId=yn,e.all=Xe,e.any=yr,e.detect=er,e.findWhere=er,e.foldl=cr,e.foldr=lr,e.include=Ze,e.inject=cr,sn(function(){var t={}; -return Ai(e,function(r,n){e.prototype[n]||(t[n]=r)}),t}(),!1),e.first=jr,e.last=Pr,e.sample=hr,e.take=jr,e.head=jr,Ai(e,function(t,n){var i="sample"!==n;e.prototype[n]||(e.prototype[n]=function(e,n){var o=this.__chain__,s=t(this.__wrapped__,e,n);return o||null!=e&&(!n||i&&"function"==typeof e)?new r(s,o):s})}),e.VERSION="2.4.1",e.prototype.chain=mn,e.prototype.toString=_n,e.prototype.value=bn,e.prototype.valueOf=bn,wi(["join","pop","shift"],function(t){var n=Fn[t];e.prototype[t]=function(){var t=this.__chain__,e=n.apply(this.__wrapped__,arguments);return t?new r(e,t):e}}),wi(["push","reverse","sort","unshift"],function(t){var r=Fn[t];e.prototype[t]=function(){return r.apply(this.__wrapped__,arguments),this}}),wi(["concat","slice","splice"],function(t){var n=Fn[t];e.prototype[t]=function(){return new r(n.apply(this.__wrapped__,arguments),this.__chain__)}}),ui.spliceObjects||wi(["pop","shift","splice"],function(t){var n=Fn[t],i="splice"==t;e.prototype[t]=function(){var t=this.__chain__,e=this.__wrapped__,o=n.apply(e,arguments);return 0===e.length&&delete e[0],t||i?new r(o,t):o}}),e}var _,b=[],w=[],j=0,E={},x=+new Date+"",A=75,O=40,P=" \f \n\r\u2028\u2029 ᠎              ",T=/\b__p \+= '';/g,S=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,F=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,R=/\w*$/,C=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,U=RegExp("^["+P+"]*0+(?=.$)"),L=/($^)/,B=/\bthis\b/,D=/['\n\r\t\u2028\u2029\\]/g,H=["Array","Boolean","Date","Error","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],M=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],V=0,$="[object Arguments]",q="[object Array]",z="[object Boolean]",W="[object Date]",Y="[object Error]",K="[object Function]",G="[object Number]",J="[object Object]",Q="[object RegExp]",Z="[object String]",X={};X[K]=!1,X[$]=X[q]=X[z]=X[W]=X[G]=X[J]=X[Q]=X[Z]=!0;var te={leading:!1,maxWait:0,trailing:!1},ee={configurable:!1,enumerable:!1,value:null,writable:!1},re={args:"",array:null,bottom:"",firstArg:"",init:"",keys:null,loop:"",shadowedProps:null,support:null,top:"",useHas:!1},ne={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},ie={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},oe=ne[typeof window]&&window||this,se=ne[typeof e]&&e&&!e.nodeType&&e,ae=ne[typeof t]&&t&&!t.nodeType&&t,ue=(ae&&ae.exports===se&&se,ne[typeof i]&&i);!ue||ue.global!==ue&&ue.window!==ue||(oe=ue);var ce=m();oe._=ce,n=function(){return ce}.call(e,r,e,t),!(n!==_&&(t.exports=n))}).call(this)}).call(e,r(91)(t),function(){return this}())},function(t,e,r){"use strict";function n(t){if(this._container=t||{},t&&"object"!=typeof t)throw new TypeError("Argument #1 passed to Collection must be an object")}var i=r(55);n.prototype.keys=function(){return Object.keys(this._container)},n.prototype.has=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.has() must be a string identifier, "+Object.prototype.toString(t)+" given");return t in this._container==!0},n.prototype.remove=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.remove() must be a string identifier");return delete this._container[t],this},n.prototype.set=function(t,e){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.set() must be a string identifier");return this._container[t]=e,this},n.prototype.setAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.setAll() must be an object");return this._container=t,this},n.prototype.addAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addAll() must be an object");for(var e in t)this.set(e,t[e]);return this},n.prototype.addOnce=function(t,e,r){if(this.has(t)){if(r)return this;throw new Error("Identifier "+t+" passed to Collection.addOnce() is already defined")}return this.set(t,e)},n.prototype.addOnceAll=function(t,e){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addOnceAll() must be an object");for(var r in t)this.addOnce(r,t[r],e);return this},n.prototype.merge=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.merge() must be an object");var e=Array.prototype.concat.apply([this._container],arguments);return this._container=i.mergeRecursive.apply(i,e),this},n.prototype.getAll=function(){return this._container},n.prototype.get=function(t,e,r){return"function"==typeof this._container[t]?this._container[t]():this.has(t)?this._container[t]:"function"==typeof e?this.raw(t,e,r)():this.raw(t,e,r)},n.prototype.raw=function(t,e,r){if(this.has(t))return this._container[t];if(r)throw new Error("Identifier "+t+" is not defined");return e},n.prototype.inject=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.raw(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.raw(t))},n.prototype.invoke=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.get(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.get(t))},n.prototype.apply=function(t){if(arguments.length>1){var e=Array.prototype.slice.call(arguments,1);return t.apply(this._container,e)}return t.call(this._container)},n.prototype.wrap=function(t){return function(){return t}},n.prototype.singleton=function(t,e){var r,n;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.singleton() must be a string identifier");if("function"!=typeof e)throw new TypeError("Argument #2 passed to Collection.singleton() must be a function");return this._container[t]=function(){return r||(r=!0,n=arguments.length?e.apply(null,arguments):e()),n},this},n.prototype.provider=function(t,e,r){var n,i,o=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.provider() must be a string identifier");return this._container[t]=function(){return n||(n=!0,i=o.inject(e,r)),i},this},n.prototype.factory=function(t,e,r){var n,i,o=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.factory() must be a string identifier");return this._container[t]=function(){return n||(n=!0,i=o.invoke(e,r)),i},this},t.exports=n},function(t,e,r){function n(t){return r(i(t))}function i(t){return o[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var o={"./browser":54,"./browser.js":54,"./collection":49,"./collection.js":49,"./index":28,"./index.js":28,"./utils":55,"./utils.js":55};n.keys=function(){return Object.keys(o)},n.resolve=i,t.exports=n,n.id=50},function(t){function e(){}var r=t.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,r="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var n=[];if(e){var i=document.createElement("div"),o=new MutationObserver(function(){var t=n.slice();n.length=0,t.forEach(function(t){t()})});return o.observe(i,{attributes:!0}),function(t){n.length||i.setAttribute("yes","no"),n.push(t)}}return r?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=e,r.addListener=e,r.once=e,r.off=e,r.removeListener=e,r.removeAllListeners=e,r.emit=e,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},function(t,e,r){(function(e){"use strict";function n(t){try{Promise===t&&(Promise=i)}catch(e){}return t}var i;"undefined"!=typeof Promise&&(i=Promise),t.exports=function(){function t(e){if("function"!=typeof e)throw new E("the promise constructor requires a resolver function");if(this.constructor!==t)throw new E("the promise constructor cannot be invoked directly");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,this._boundTo=void 0,e!==c&&this._resolveFromResolver(e)}function i(t){return t[0]}function o(){return new t.PromiseInspection(this)}var s=r(58),a=r(59),u=r(60),c=function(){},l={},f={e:null},h=r(61)(t,c),p=r(62)(t,c,h),d=r(63)(),y=r(64)(f),g=r(65),v=s.isArray,m=s.errorObj,_=s.tryCatch1,b=s.tryCatch2,w=s.tryCatchApply,j=u.RangeError,E=u.TypeError,x=u.CancellationError,A=u.TimeoutError,O=u.OperationalError,P=u.originatesFromRejection,k=u.markAsOriginatingFromRejection,T=u.canAttach,S=s.thrower,N=r(66)(t),F=function(){return new E("circular promise resolution chain")};t.prototype.bind=function(e){var r=h(e,void 0),n=new t(c);if(r instanceof t){var o=r.then(function(t){n._setBoundTo(t)}),s=t.all([this,o]).then(i);n._follow(s)}else n._follow(this),n._setBoundTo(e);return n._propagateFrom(this,3),n},t.prototype.toString=function(){return"[object Promise]"},t.prototype.caught=t.prototype["catch"]=function(e){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s){var a=new E("A catch filter must be an error constructor or a filter function");return this._attachExtraTrace(a),t.reject(a)}i[o++]=s}i.length=o,e=arguments[n],this._resetTrace();var u=new y(i,e,this);return this._then(void 0,u.doFilter,void 0,u,void 0)}return this._then(void 0,e,void 0,void 0,void 0)},t.prototype.reflect=function(){return this._then(o,o,void 0,this,void 0)},t.prototype.then=function(t,e,r){return this._then(t,e,r,void 0,void 0)},t.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},t.prototype.spread=function(t,e){return this._then(t,e,void 0,l,void 0)},t.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},t.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this._settledValue,t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this._settledValue,t.isRejected=!0),t},t.prototype.all=function(){return new p(this).promise()},t.is=function(e){return e instanceof t},t.all=function(t){return new p(t).promise()},t.prototype.error=function(t){return this.caught(P,t)},t.prototype._resolveFromSyncValue=function(e){if(e===m){this._cleanValues(),this._setRejected();var r=e.e;this._settledValue=r,this._tryAttachExtraTrace(r),this._ensurePossibleRejectionHandled()}else{var n=h(e,void 0);n instanceof t?this._follow(n):(this._cleanValues(),this._setFulfilled(),this._settledValue=e)}},t.method=function(e){if("function"!=typeof e)throw new E("fn must be a function");return function(){var r;switch(arguments.length){case 0:r=_(e,this,void 0);break;case 1:r=_(e,this,arguments[0]);break;case 2:r=b(e,this,arguments[0],arguments[1]);break;default:for(var n=arguments.length,i=new Array(n),o=0;n>o;++o)i[o]=arguments[o];r=w(e,i,this)}var s=new t(c);return s._setTrace(void 0),s._resolveFromSyncValue(r),s}},t.attempt=t["try"]=function(e,r,n){if("function"!=typeof e)return N("fn must be a function");var i=v(r)?w(e,r,n):_(e,n,r),o=new t(c);return o._setTrace(void 0),o._resolveFromSyncValue(i),o},t.defer=t.pending=function(){var e=new t(c);return e._setTrace(void 0),new g(e)},t.bind=function(e){var r=h(e,void 0),n=new t(c);if(n._setTrace(void 0),r instanceof t){var i=r.then(function(t){n._setBoundTo(t)});n._follow(i)}else n._setBoundTo(e),n._setFulfilled();return n},t.cast=function(e){var r=h(e,void 0);if(!(r instanceof t)){var n=r;r=new t(c),r._setTrace(void 0),r._setFulfilled(),r._cleanValues(),r._settledValue=n}return r},t.resolve=t.fulfilled=t.cast,t.reject=t.rejected=function(e){var r=new t(c);if(r._setTrace(void 0),k(e),r._cleanValues(),r._setRejected(),r._settledValue=e,!T(e)){var n=new Error(e+"");r._setCarriedStackTrace(n)}return r._ensurePossibleRejectionHandled(),r},t.onPossiblyUnhandledRejection=function(t){d.possiblyUnhandledRejection="function"==typeof t?t:void 0};var R;t.onUnhandledRejectionHandled=function(t){R="function"==typeof t?t:void 0};var C=!1||!("undefined"==typeof e||"string"!=typeof e.execPath||!{NODE_ENV:"production"}.BLUEBIRD_DEBUG&&"development"!=={NODE_ENV:"production"}.NODE_ENV);t.longStackTraces=function(){if(a.haveItemsQueued()&&C===!1)throw new Error("cannot enable long stack traces after promises have been created");C=d.isSupported()},t.hasLongStackTraces=function(){return C&&d.isSupported()},t.prototype._then=function(e,r,n,i,o){var s=void 0!==o,u=s?o:new t(c);if(!s){if(C){var l=this._peekContext()===this._traceParent;u._traceParent=l?this._traceParent:this}u._propagateFrom(this,7)}var f=this._addCallbacks(e,r,n,u,i);return this.isResolved()&&a.invoke(this._queueSettleAt,this,f),u},t.prototype._length=function(){return 262143&this._bitField},t.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},t.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},t.prototype._setLength=function(t){this._bitField=-262144&this._bitField|262143&t},t.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},t.prototype._setRejected=function(){this._bitField=134217728|this._bitField},t.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},t.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},t.prototype._isFinal=function(){return(33554432&this._bitField)>0},t.prototype._cancellable=function(){return(67108864&this._bitField)>0},t.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},t.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},t.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},t.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},t.prototype._unsetCarriedStackTrace=function(){this._bitField=-1048577&this._bitField,this._fulfillmentHandler0=void 0},t.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},t.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},t.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[(t<<2)+t-5+4];return this._isBound()&&void 0===e?this._boundTo:e},t.prototype._promiseAt=function(t){return 0===t?this._promise0:this[(t<<2)+t-5+3]},t.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[(t<<2)+t-5+0]},t.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[(t<<2)+t-5+1]},t.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=262138&&(o=0,this._setLength(0)),0===o)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=t),"function"==typeof e&&(this._rejectionHandler0=e),"function"==typeof r&&(this._progressHandler0=r);else{var s=(o<<2)+o-5;this[s+3]=n,this[s+4]=i,this[s+0]="function"==typeof t?t:void 0,this[s+1]="function"==typeof e?e:void 0,this[s+2]="function"==typeof r?r:void 0}return this._setLength(o+1),o},t.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=262138&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=(r<<2)+r-5;this[n+3]=e,this[n+4]=t,this[n+0]=this[n+1]=this[n+2]=void 0}this._setLength(r+1)},t.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},t.prototype._proxyPromise=function(t){t._setProxied(),this._setProxyHandlers(t,-15)},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=8388608|this._bitField,this._boundTo=t):this._bitField=-8388609&this._bitField},t.prototype._isBound=function(){return 8388608===(8388608&this._bitField)},t.prototype._resolveFromResolver=function(t){function e(t){n._tryFollow(t)||n._fulfill(t)}function r(t){var e=T(t)?t:new Error(t+"");n._attachExtraTrace(e),k(t),n._reject(t,e===t?void 0:e)}var n=this;this._setTrace(void 0),this._pushContext();var i=b(t,void 0,e,r);if(this._popContext(),void 0!==i&&i===m){var o=i.e,s=T(o)?o:new Error(o+"");n._reject(o,s)}},t.prototype._spreadSlowCase=function(t,e,r,n){var i=new p(r).promise(),o=i._then(function(){return t.apply(n,arguments)},void 0,void 0,l,void 0);e._follow(o)},t.prototype._callSpread=function(e,r,n){var i=this._boundTo;if(v(n))for(var o=0,s=n.length;s>o;++o)if(h(n[o],void 0)instanceof t)return void this._spreadSlowCase(e,r,n,i);return r._pushContext(),w(e,n,i)},t.prototype._callHandler=function(t,e,r,n){var i;return e!==l||this.isRejected()?(r._pushContext(),i=_(t,e,n)):i=this._callSpread(t,r,n),r._popContext(),i},t.prototype._settlePromiseFromHandler=function(e,r,n,i){if(!(i instanceof t))return void e.call(r,n,i);if(!i.isResolved()){var o=this._callHandler(e,r,i,n);if(!i._isFollowing())if(o===m||o===i||o===f){var s=o===i?F():o.e,a=T(s)?s:new Error(s+"");o!==f&&i._attachExtraTrace(a),i._rejectUnchecked(s,a)}else{var u=h(o,i);if(u instanceof t){if(u.isRejected()&&!u._isCarryingStackTrace()&&!T(u._settledValue)){var a=new Error(u._settledValue+"");i._attachExtraTrace(a),u._setCarriedStackTrace(a)}i._follow(u),i._propagateFrom(u,1)}else i._fulfillUnchecked(o)}}},t.prototype._follow=function(t){this._setFollowing(),t.isPending()?(this._propagateFrom(t,1),t._proxyPromise(this)):t.isFulfilled()?this._fulfillUnchecked(t._settledValue):this._rejectUnchecked(t._settledValue,t._getCarriedStackTrace()),t._isRejectionUnhandled()&&t._unsetRejectionIsUnhandled(),C&&null==t._traceParent&&(t._traceParent=this)},t.prototype._tryFollow=function(e){if(this._isFollowingOrFulfilledOrRejected()||e===this)return!1;var r=h(e,void 0);return r instanceof t?(this._follow(r),!0):!1},t.prototype._resetTrace=function(){C&&(this._trace=new d(void 0===this._peekContext()))},t.prototype._setTrace=function(t){if(C){var e=this._peekContext();this._traceParent=e;var r=void 0===e;this._trace=void 0!==t&&t._traceParent===e?t._trace:new d(r)}return this},t.prototype._tryAttachExtraTrace=function(t){T(t)&&this._attachExtraTrace(t)},t.prototype._attachExtraTrace=function(t){if(C){var e=this,r=t.stack;r="string"==typeof r?r.split("\n"):[],d.protectErrorMessageNewlines(r);for(var n=1,i=1;null!=e&&null!=e._trace;)r=d.combine(r,e._trace.stack.split("\n")),e=e._traceParent,i++;var o=Error.stackTraceLimit||10,s=(o+n)*i,a=r.length;a>s&&(r.length=s),a>0&&(r[0]=r[0].split("\x00").join("\n")),t.stack=r.length<=n?"(No stack trace)":r.join("\n")}},t.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},t.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&this._setBoundTo(t._boundTo),(2&e)>0&&this._setTrace(t)},t.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},t.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},t.prototype._settlePromiseAt=function(e){var r=this.isFulfilled()?this._fulfillmentHandlerAt(e):this._rejectionHandlerAt(e),n=this._settledValue,i=this._receiverAt(e),o=this._promiseAt(e);if("function"==typeof r)this._settlePromiseFromHandler(r,i,n,o);else{var s=!1,a=this.isFulfilled();void 0!==i&&(i instanceof t&&i._isProxied()?(i._unsetProxied(),a?i._fulfillUnchecked(n):i._rejectUnchecked(n,this._getCarriedStackTrace()),s=!0):i instanceof p&&(a?i._promiseFulfilled(n,o):i._promiseRejected(n,o),s=!0)),s||(a?o._fulfill(n):o._reject(n,this._getCarriedStackTrace()))}e>=4&&this._queueGC()},t.prototype._isProxied=function(){return 4194304===(4194304&this._bitField)},t.prototype._setProxied=function(){this._bitField=4194304|this._bitField},t.prototype._unsetProxied=function(){this._bitField=-4194305&this._bitField},t.prototype._isGcQueued=function(){return-1073741824===(-1073741824&this._bitField)},t.prototype._setGcQueued=function(){this._bitField=-1073741824|this._bitField},t.prototype._unsetGcQueued=function(){this._bitField=1073741823&this._bitField},t.prototype._queueGC=function(){this._isGcQueued()||(this._setGcQueued(),a.invokeLater(this._gc,this,void 0))},t.prototype._gc=function(){for(var t=5*this._length()-5,e=0;t>e;e++)delete this[e];this._clearFirstHandlerData(),this._setLength(0),this._unsetGcQueued()},t.prototype._clearFirstHandlerData=function(){this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0},t.prototype._queueSettleAt=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),a.invoke(this._settlePromiseAt,this,t)},t.prototype._fulfillUnchecked=function(t){if(this.isPending()){if(t===this){var e=F();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._cleanValues(),this._setFulfilled(),this._settledValue=t;var r=this._length();r>0&&a.invoke(this._settlePromises,this,r)}},t.prototype._rejectUncheckedCheckError=function(t){var e=T(t)?t:new Error(t+"");this._rejectUnchecked(t,e===t?void 0:e)},t.prototype._rejectUnchecked=function(t,e){if(this.isPending()){if(t===this){var r=F();return this._attachExtraTrace(r),this._rejectUnchecked(r)}if(this._cleanValues(),this._setRejected(),this._settledValue=t,this._isFinal())return void a.invokeLater(S,void 0,void 0===e?t:e);var n=this._length();void 0!==e&&this._setCarriedStackTrace(e),n>0?a.invoke(this._rejectPromises,this,null):this._ensurePossibleRejectionHandled()}},t.prototype._rejectPromises=function(){this._settlePromises(),this._unsetCarriedStackTrace()},t.prototype._settlePromises=function(){for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},t.prototype._ensurePossibleRejectionHandled=function(){this._setRejectionIsUnhandled(),void 0!==d.possiblyUnhandledRejection&&a.invokeLater(this._notifyUnhandledRejection,this,void 0)},t.prototype._notifyUnhandledRejectionIsHandled=function(){"function"==typeof R&&a.invokeLater(R,void 0,this)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue,e=this._getCarriedStackTrace();this._setUnhandledRejectionIsNotified(),void 0!==e&&(this._unsetCarriedStackTrace(),t=e),"function"==typeof d.possiblyUnhandledRejection&&d.possiblyUnhandledRejection(t,this)}};var I=[];return t.prototype._peekContext=function(){var t=I.length-1;return t>=0?I[t]:void 0},t.prototype._pushContext=function(){C&&I.push(this)},t.prototype._popContext=function(){C&&I.pop()},t.noConflict=function(){return n(t)},t.setScheduler=function(t){if("function"!=typeof t)throw new E("fn must be a function");a._schedule=t},d.isSupported()||(t.longStackTraces=function(){},C=!1),t._makeSelfResolutionError=F,r(67)(t,f,h),r(68)(t),r(69)(t),r(70)(t,p,h,c),t.RangeError=j,t.CancellationError=x,t.TimeoutError=A,t.TypeError=E,t.OperationalError=O,t.RejectionError=O,t.AggregateError=u.AggregateError,s.toFastProperties(t),s.toFastProperties(t.prototype),t.Promise=t,r(71)(t,c,h),r(72)(t,c,h),r(73)(t),r(74)(t,N,c,h),r(75)(t,p,N,h,c),r(76)(t),r(77)(t,c),r(78)(t,p,h),r(79)(t,p,N,h,c),r(80)(t,p),r(81)(t,p,N),r(82)(t,p),r(83)(t,c),r(84)(t,c),r(85)(t,p),r(86)(t,c),r(87)(t,N,h),t.prototype=t.prototype,t}}).call(e,r(51))},function(t,e,r){function n(t){return function(e){var r=t(e);return r.sort(),r}}function i(t,e){y.formats[t]=e}function o(t){return" "+t}function s(t,e,r,n){n=n||e.keys(t);var i=0;return e.seen.push(t),n=n.map(function(r){var n=a(t,e,r);return i+=n.length,n}),e.seen.pop(),0===n.length?"{}":i<=e.maxLineLength?"{ "+(r?r+" ":"")+n.join(e.propSep+" ")+" }":"{\n"+(r?r+"\n":"")+n.map(o).join(e.propSep+"\n")+"\n}"}function a(t,e,r){var n;try{n=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(i){n={value:i}}var o=y.formatPropertyName(r,e),s=n.get&&n.set?"[Getter/Setter]":n.get?"[Getter]":n.set?"[Setter]":e.seen.indexOf(n.value)>=0?"[Circular]":y(n.value,e);return o+": "+s}function u(t){return 10>t?"0"+t:""+t}function c(t){return 100>t?"0"+u(t):""+t}function l(t){var e=t.getTimezoneOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r-60*n,o="GMT"+(0>e?"+":"-")+u(n)+u(i);return t.toLocaleDateString()+" "+t.toLocaleTimeString()+"."+c(t.getMilliseconds())+" "+o}function f(t){return function(e,r){var n=t(e),i=r.keys(e);return 0==i.length?n:s(e,r,n,i)}}function h(t){if(t.name)return t.name;var e=t.toString().match(g)[1];return e}function p(t,e){return function(r){var n="",i=50,o=r[t];if(o>0){for(var s=0;i>s&&o>s;s++){var a=r[s]||0;n+=" "+u(a.toString(16))}o>i&&(n+=" ... ")}return"["+(r.constructor.name||e)+(n?":"+n:"")+"]"}}var d=r(95),y=function(t,e){e=e||{},"seen"in e||(e.seen=[]),e.keys=n("keys"in e&&e.keys===!1?Object.getOwnPropertyNames:Object.keys),"maxLineLength"in e||(e.maxLineLength=60),"propSep"in e||(e.propSep=",");var r=d(t);return(y.formats[r]||y.formats.object)(t,e)};t.exports=y,y.formats={},["undefined","boolean","null"].forEach(function(t){i(t,String)}),["number","boolean"].forEach(function(t){var e=t.substring(0,1).toUpperCase()+t.substring(1);i("object-"+t,f(function(t){return"["+e+": "+y(t.valueOf())+"]"}))}),i("object-string",function(t,e){var r=t.valueOf(),n="[String: "+y(r)+"]",i=e.keys(t);return i=i.filter(function(t){return!(t.match(/\d+/)&&parseInt(t,10)1/t?"-0":String(t)}),i("string",function(t){return"'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'"}),i("object",s),i("array",function(t,e){var r=e.keys(t),n=0;e.seen.push(t);var i=r.map(function(r){var i;try{i=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(o){i={value:o}}var s;return s=r.match(/\d+/)?y(i.value,e):a(i.value,e,r),n+=s.length,s});return e.seen.pop(),0===i.length?"[]":n<=e.maxLineLength?"[ "+i.join(e.propSep+" ")+" ]":"[\n"+i.map(o).join(e.propSep+"\n")+"\n]"}),y.formatPropertyName=function(t,e){return t.match(/^[a-zA-Z_$][a-zA-Z_$0-9]*$/)?t:y(t,e)},i("date",f(l));var g=/^\s*function\s*(\S*)\s*\(/;i("function",f(function(t){var e=h(t);return"[Function"+(e?": "+e:"")+"]"})),i("error",f(function(t){var e=t.name,r=t.message;return"["+e+(r?": "+r:"")+"]"})),i("buffer",p("length","Buffer")),i("array-buffer",p("byteLength")),i("typed-array",p("byteLength")),i("promise",function(){return"[Promise]"}),i("xhr",function(){return"[XMLHttpRequest]"}),i("html-element",function(t){return t.outerHTML}),i("html-element-text",function(t){return t.nodeValue}),i("document",function(t){return t.documentElement.outerHTML}),i("window",function(){return"[Window]"})},function(t,e,r){"use strict";if(!Array.isArray){var n=Object.prototype.toString();Array.isArray=function(t){return"[object Array]"===n.call(t)?!0:"function"==typeof t.slice&&"number"==typeof t.length?!0:!1}}window.noder=r(28)},function(t){"use strict";function e(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t}function r(t){var e=arguments.length;if(2>e)throw new Error("There should be at least 2 arguments passed to utils.mergeRecursive()");for(var n=1;e>n;n++)for(var i in arguments[n])t[i]=t[i]&&"object"==typeof t[i]?r(t[i],arguments[n][i]):arguments[n][i];return t}t.exports.merge=e,t.exports.mergeRecursive=r},function(t,e,r){(function(t,n){function i(t,r){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),u(n,t,n.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function s(t){return t}function a(t){var e={};return t.forEach(function(t){e[t]=!0}),e}function u(t,r,n){if(t.customInspect&&r&&O(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return _(i)||(i=u(t,i,n)),i}var o=c(t,r);if(o)return o;var s=Object.keys(r),y=a(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(O(r)){var g=r.name?": "+r.name:"";return t.stylize("[Function"+g+"]","special")}if(j(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return l(r)}var v="",m=!1,b=["{","}"];if(d(r)&&(m=!0,b=["[","]"]),O(r)){var w=r.name?": "+r.name:"";v=" [Function"+w+"]"}if(j(r)&&(v=" "+RegExp.prototype.toString.call(r)),x(r)&&(v=" "+Date.prototype.toUTCString.call(r)),A(r)&&(v=" "+l(r)),0===s.length&&(!m||0==r.length))return b[0]+v+b[1];if(0>n)return j(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special");t.seen.push(r);var E;return E=m?f(t,r,n,y,s):s.map(function(e){return h(t,r,n,y,e,m)}),t.seen.pop(),p(E,v,b)}function c(t,e){if(w(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i){for(var o=[],s=0,a=e.length;a>s;++s)o.push(N(e,String(s))?h(t,e,r,n,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(t,e,r,n,i,!0))}),o}function h(t,e,r,n,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),N(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=g(r)?u(t,c.value,null):u(t,c.value,r-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return null==t}function m(t){return"number"==typeof t}function _(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function w(t){return void 0===t}function j(t){return E(t)&&"[object RegExp]"===k(t)}function E(t){return"object"==typeof t&&null!==t}function x(t){return E(t)&&"[object Date]"===k(t)}function A(t){return E(t)&&("[object Error]"===k(t)||t instanceof Error)}function O(t){return"function"==typeof t}function P(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function k(t){return Object.prototype.toString.call(t)}function T(t){return 10>t?"0"+t.toString(10):t.toString(10)}function S(){var t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"); -return[t.getDate(),I[t.getMonth()],e].join(" ")}function N(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var F=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),a=n[r];o>r;a=n[++r])s+=g(a)||!E(a)?" "+a:" "+i(a);return s},e.deprecate=function(r,i){function o(){if(!s){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),s=!0}return r.apply(this,arguments)}if(w(t.process))return function(){return e.deprecate(r,i).apply(this,arguments)};if(n.noDeprecation===!0)return r;var s=!1;return o};var R,C={};e.debuglog=function(t){if(w(R)&&(R={NODE_ENV:"production"}.NODE_DEBUG||""),t=t.toUpperCase(),!C[t])if(new RegExp("\\b"+t+"\\b","i").test(R)){var r=n.pid;C[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else C[t]=function(){};return C[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=y,e.isNull=g,e.isNullOrUndefined=v,e.isNumber=m,e.isString=_,e.isSymbol=b,e.isUndefined=w,e.isRegExp=j,e.isObject=E,e.isDate=x,e.isError=A,e.isFunction=O,e.isPrimitive=P,e.isBuffer=r(90);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){console.log("%s - %s",S(),e.format.apply(e,arguments))},e.inherits=r(96),e._extend=function(t,e){if(!e||!E(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(e,function(){return this}(),r(51))},function(t,e,r){(function(t){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);var i,o=typeof e;if("number"===o)i=e>0?e>>>0:0;else if("string"===o)"base64"===r&&(e=j(e)),i=t.byteLength(e,r);else{if("object"!==o||null===e)throw new TypeError("must start with number, buffer, array or string");"Buffer"===e.type&&C(e.data)&&(e=e.data),i=+e.length>0?Math.floor(+e.length):0}if(this.length>I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");var s;t.TYPED_ARRAY_SUPPORT?s=t._augment(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(t.TYPED_ARRAY_SUPPORT&&"number"==typeof e.byteLength)s._set(e);else if(x(e))if(t.isBuffer(e))for(a=0;i>a;a++)s[a]=e.readUInt8(a);else for(a=0;i>a;a++)s[a]=(e[a]%256+256)%256;else if("string"===o)s.write(e,0,r);else if("number"===o&&!t.TYPED_ARRAY_SUPPORT&&!n)for(a=0;i>a;a++)s[a]=0;return s}function n(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;n>s;s++){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[r+s]=a}return s}function i(t,e,r,n){var i=S(O(e),t,r,n);return i}function o(t,e,r,n){var i=S(P(e),t,r,n);return i}function s(t,e,r,n){return o(t,e,r,n)}function a(t,e,r,n){var i=S(T(e),t,r,n);return i}function u(t,e,r,n){var i=S(k(e),t,r,n,2);return i}function c(t,e,r){return F.fromByteArray(0===e&&r===t.length?t:t.slice(e,r))}function l(t,e,r){var n="",i="";r=Math.min(t.length,r);for(var o=e;r>o;o++)t[o]<=127?(n+=N(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return n+N(i)}function f(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function h(t,e,r){return f(t,e,r)}function p(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=e;r>o;o++)i+=A(t[o]);return i}function d(t,e,r){for(var n=t.slice(e,r),i="",o=0;ot)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function g(e,r,n,i,o,s){if(!t.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(r>o||s>r)throw new TypeError("value is out of bounds");if(n+i>e.length)throw new TypeError("index out of range")}function v(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);o>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function m(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);o>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function _(t,e,r,n,i,o){if(e>i||o>e)throw new TypeError("value is out of bounds");if(r+n>t.length)throw new TypeError("index out of range")}function b(t,e,r,n,i){return i||_(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),R.write(t,e,r,n,23,4),r+4}function w(t,e,r,n,i){return i||_(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),R.write(t,e,r,n,52,8),r+8}function j(t){for(t=E(t).replace(L,"");t.length%4!==0;)t+="=";return t}function E(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function x(e){return C(e)||t.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function A(t){return 16>t?"0"+t.toString(16):t.toString(16)}function O(t){for(var e=[],r=0;r=n)e.push(n);else{var i=r;n>=55296&&57343>=n&&r++;for(var o=encodeURIComponent(t.slice(i,r+1)).substr(1).split("%"),s=0;s>8,n=e%256,i.push(n),i.push(r);return i}function T(t){return F.toByteArray(t)}function S(t,e,r,n,i){i&&(n-=n%i);for(var o=0;n>o&&!(o+r>=e.length||o>=t.length);o++)e[o+r]=t[o];return o}function N(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}/*! +var n=r(32),i=r(58);t.exports=function(t,e){var r=t.format,o=t.type;e.add("containEql",function(e){this.params={operator:"to contain "+r(e)},this.is.not["null"].and.not.undefined;var o=this.obj,s=t.type(o);s==t.type.STRING?this.assert(o.indexOf(String(e))>=0):n.isIndexable(o)?this.assert(n.some(o,function(t){return i(t,e).result})):this.have.properties(e)}),e.add("containDeepOrdered",function(e){this.params={operator:"to contain "+r(e)};var i=this.obj;if(o(i)==o.STRING)this.assert(i.indexOf(String(e))>=0);else if(n.isIndexable(i)&&n.isIndexable(e)){for(var s=0,a=0,u=n.length(i),c=n.length(e);u>s&&c>a;s++)try{t(i[s]).containDeepOrdered(e[a]),a++}catch(l){if(l instanceof t.AssertionError)continue;throw l}this.assert(a==c)}else null!=i&&null!=e&&"object"==typeof i&&"object"==typeof e?(n.forEach(e,function(e,r){t(i[r]).containDeepOrdered(e)}),n.isEmptyObject(e)&&this.eql(e)):this.eql(e)}),e.add("containDeep",function(e){this.params={operator:"to contain "+r(e)};var i=this.obj;if("string"==typeof i)this.assert(i.indexOf(String(e))>=0);else if(n.isIndexable(i)&&n.isIndexable(e)){var o={};n.forEach(e,function(e){this.assert(n.some(i,function(r,n){if(n in o)return!1;try{return t(r).containDeep(e),o[n]=!0,!0}catch(i){if(i instanceof t.AssertionError)return!1;throw i}}))},this)}else null!=i&&null!=e&&"object"==typeof i&&"object"==typeof e?(n.forEach(e,function(e,r){t(i[r]).containDeep(e)}),n.isEmptyObject(e)&&this.eql(e)):this.eql(e)})}},function(t,e,r){var n;(function(t,i){(function(){function o(t,e){if(t!==e){var r=t===t,n=e===e;if(t>e||!r||"undefined"==typeof t&&n)return 1;if(e>t||!n||"undefined"==typeof e&&r)return-1}return 0}function s(t,e,r){if(e!==e)return v(t,r);for(var n=(r||0)-1,i=t.length;++n-1;);return r}function f(t,e){for(var r=t.length;r--&&e.indexOf(t.charAt(r))>-1;);return r}function h(t,e){return o(t.criteria,e.criteria)||t.index-e.index}function p(t,e){for(var r=-1,n=t.criteria,i=e.criteria,s=n.length;++r=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function b(t,e){for(var r=-1,n=t.length,i=-1,o=[];++re,n=_n(0,t.length,this.__views__),i=n.start,o=n.end,s=o-i,a=this.__dropCount__,u=Aa(s,this.__takeCount__),c=r?o:i-1,l=this.__iteratees__,f=l?l.length:0,h=0,p=[];t:for(;s--&&u>h;){c+=e;for(var d=-1,g=t[c];++dn&&(n=i)}return n}function ir(t){for(var e=-1,r=t.length,n=Sa;++ei&&(n=i)}return n}function or(t,e,r,n){var i=-1,o=t.length;for(n&&o&&(r=t[++i]);++i=200&&Ma(e),c=e.length;u&&(o=ze,a=!1,e=u);t:for(;++ir&&(r=-r>i?0:i+r),n="undefined"==typeof n||n>i?i:+n||0,0>n&&(n+=i),i=r>n?0:n>>>0,r>>>=0;i>r;)t[r++]=e;return t}function jr(t,e){var r=[];return _r(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r}function Er(t,e,r,n){var i;return r(t,function(t,r,o){return e(t,r,o)?(i=n?r:t,!1):void 0}),i}function Ar(t,e,r,n){for(var i=(n||0)-1,o=t.length,s=-1,a=[];++ie&&(e=-e>i?0:i+e),r="undefined"==typeof r||r>i?i:+r||0,0>r&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Ds(i);++n=200,u=a&&Ma(),c=[];u?(n=ze,o=!1):(a=!1,u=e?[]:c);t:for(;++r=i){for(;i>n;){var o=n+i>>>1,s=t[o];(r?e>=s:e>s)?n=o+1:i=o}return i}return Gr(t,e,Ps,r)}function Gr(t,e,r,n){e=r(e);for(var i=0,o=t?t.length:0,s=e!==e,a="undefined"==typeof e;o>i;){var u=ca((i+o)/2),c=r(t[u]),l=c===c;if(s)var f=l||n;else f=a?l&&(n||"undefined"!=typeof c):n?e>=c:e>c;f?i=u+1:o=u}return Aa(o,Na)}function Qr(t,e,r){if("function"!=typeof t)return Ps;if("undefined"==typeof e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,o){return t.call(e,r,n,i,o)};case 5:return function(r,n,i,o,s){return t.call(e,r,n,i,o,s)}}return function(){return t.apply(e,arguments)}}function Xr(t){return sa.call(t,0)}function Zr(t,e,r){for(var n=r.length,i=-1,o=Ea(t.length-n,0),s=-1,a=e.length,u=Ds(o+a);++se||null==r)return r;if(e>3&&An(arguments[1],arguments[2],arguments[3])&&(e=2),e>3&&"function"==typeof arguments[e-2])var n=Qr(arguments[--e-1],arguments[e--],5);else e>2&&"function"==typeof arguments[e-1]&&(n=arguments[--e]);for(var i=0;++im){var x=a?Ge(a):null,O=Ea(c-m,0),T=d?A:null,S=d?null:A,k=d?j:null,N=d?null:j;e|=d?F:I,e&=~(d?I:F),g||(e&=~(P|R));var C=un(t,e,r,k,T,N,S,x,u,O);return C.placeholder=E,C}}var U=h?r:this;return p&&(t=U[_]),a&&(j=Sn(j,a)),f&&u=e||!wa(e))return"";var i=e-n;return r=null==r?" ":r+"",ys(r,aa(i/r.length)).slice(0,i)}function ln(t,e,r,n){function i(){for(var e=-1,a=arguments.length,u=-1,c=n.length,l=Ds(a+c);++uu))return!1;for(;l&&++au:u>i)||u===n&&u===o)&&(i=u,o=t)}),o}function yn(t,r,n){var i=e.callback||Os;return i=i===Os?dr:i,n?i(t,r,n):i}function vn(t,r,n){var i=e.indexOf||Kn;return i=i===Kn?s:i,t?i(t,r,n):i}function _n(t,e,r){for(var n=-1,i=r?r.length:0;++n-1&&t%1==0&&e>t}function An(t,e,r){if(!Po(r))return!1;var n=typeof e;if("number"==n)var i=r.length,o=xn(i)&&En(e,i);else o="string"==n&&e in r;return o&&r[e]===t}function xn(t){return"number"==typeof t&&t>-1&&t%1==0&&Ca>=t}function On(t){return t===t&&(0===t?1/t>0:!Po(t))}function Tn(t,e){var r=t[1],n=e[1],i=r|n,o=U|C,s=P|R,a=o|s|S|N,u=r&U&&!(n&U),c=r&C&&!(n&C),l=(c?t:e)[7],f=(u?t:e)[8],h=!(r>=C&&n>s||r>s&&n>=C),p=i>=o&&a>=i&&(C>r||(c||u)&&l.length<=f);if(!h&&!p)return t;n&P&&(t[2]=e[2],i|=r&P?0:S);var d=e[3];if(d){var g=t[3];t[3]=g?Zr(g,d,e[4]):Ge(d),t[4]=g?b(t[3],Y):Ge(e[4])}return d=e[5],d&&(g=t[5],t[5]=g?tn(g,d,e[6]):Ge(d),t[6]=g?b(t[5],Y):Ge(e[6])),d=e[7],d&&(t[7]=Ge(d)),n&U&&(t[8]=null==t[8]?e[8]:Aa(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function Pn(t,e){t=In(t);for(var r=-1,n=e.length,i={};++rn;)s[++o]=Vr(t,n,n+=e);return s}function Ln(t){for(var e=-1,r=t?t.length:0,n=-1,i=[];++ee?0:e)):[]}function Mn(t,e,r){var n=t?t.length:0;return n?((r?An(t,e,r):null==e)&&(e=1),e=n-(+e||0),Vr(t,0,0>e?0:e)):[]}function Hn(t,e,r){var n=t?t.length:0;if(!n)return[];for(e=yn(e,r,3);n--&&e(t[n],n,t););return Vr(t,0,n+1)}function qn(t,e,r){var n=t?t.length:0;if(!n)return[];var i=-1;for(e=yn(e,r,3);++ir?Ea(n+r,0):r||0;else if(r){var i=Kr(t,e),o=t[i];return(e===e?e===o:o!==o)?i:-1}return s(t,e,r)}function Gn(t){return Mn(t,1)}function Qn(){for(var t=[],e=-1,r=arguments.length,n=[],i=vn(),o=i==s;++e=120&&Ma(e&&a)))}r=t.length;var u=t[0],c=-1,l=u?u.length:0,f=[],h=n[0];t:for(;++cr?Ea(n+r,0):Aa(r||0,n-1))+1;else if(r){i=Kr(t,e,!0)-1;var o=t[i];return(e===e?e===o:o!==o)?i:-1}if(e!==e)return v(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function ti(){var t=arguments[0];if(!t||!t.length)return t;for(var e=0,r=vn(),n=arguments.length;++e-1;)ga.call(t,i,1);return t}function ei(t){return Hr(t||[],Ar(arguments,!1,!1,1))}function ri(t,e,r){var n=-1,i=t?t.length:0,o=[];for(e=yn(e,r,3);++ne?0:e)):[]}function ui(t,e,r){var n=t?t.length:0;return n?((r?An(t,e,r):null==e)&&(e=1),e=n-(+e||0),Vr(t,0>e?0:e)):[]}function ci(t,e,r){var n=t?t.length:0;if(!n)return[];for(e=yn(e,r,3);n--&&e(t[n],n,t););return Vr(t,n+1)}function li(t,e,r){var n=t?t.length:0;if(!n)return[];var i=-1;for(e=yn(e,r,3);++i>>0,n=Ds(r);++er?Ea(n+r,0):r||0:0,"string"==typeof t||!Ga(t)&&Co(t)?n>r&&t.indexOf(e,r)>-1:vn(t,e,r)>-1):!1}function Ri(t,e,r){var n=Ga(t)?tr:br;return("function"!=typeof e||"undefined"!=typeof r)&&(e=yn(e,r,3)),n(t,e)}function Si(t,e,r){var n=Ga(t)?er:jr;return e=yn(e,r,3),n(t,e)}function ki(t,e,r){if(Ga(t)){var n=Vn(t,e,r);return n>-1?t[n]:O}return e=yn(e,r,3),Er(t,e,_r)}function Ni(t,e,r){return e=yn(e,r,3),Er(t,e,mr)}function Fi(t,e){return ki(t,Ur(e))}function Ii(t,e,r){return"function"==typeof e&&"undefined"==typeof r&&Ga(t)?Qe(t,e):_r(t,Qr(e,r,3))}function Ci(t,e,r){return"function"==typeof e&&"undefined"==typeof r&&Ga(t)?Ze(t,e):mr(t,Qr(e,r,3))}function Ui(t,e){return kr(t,e,Vr(arguments,2))}function Li(t,e,r){var n=Ga(t)?rr:Cr;return e=yn(e,r,3),n(t,e)}function Bi(t,e){return Li(t,Mr(e))}function Di(t,e,r,n){var i=Ga(t)?or:$r;return i(t,yn(e,n,4),r,arguments.length<3,_r)}function Mi(t,e,r,n){var i=Ga(t)?sr:$r;return i(t,yn(e,n,4),r,arguments.length<3,mr)}function Hi(t,e,r){var n=Ga(t)?er:jr;return e=yn(e,r,3),n(t,function(t,r,n){return!e(t,r,n)})}function qi(t,e,r){if(r?An(t,e,r):null==e){t=Fn(t);var n=t.length;return n>0?t[qr(0,n-1)]:O}var i=$i(t);return i.length=Aa(0>e?0:+e||0,i.length),i}function $i(t){t=Fn(t);for(var e=-1,r=t.length,n=Ds(r);++e3&&An(e[1],e[2],e[3])&&(e=[t,e[1]]);var r=-1,n=t?t.length:0,i=Ar(e,!1,!1,1),o=xn(n)?Ds(n):[];return _r(t,function(t){for(var e=i.length,n=Ds(e);e--;)n[e]=null==t?O:t[i[e]];o[++r]={criteria:n,index:r,value:t}}),a(o,p)}function Ji(t,e){return Si(t,Ur(e))}function Ki(t,e){if("function"!=typeof e){if("function"!=typeof t)throw new Js(V);var r=t;t=e,e=r}return t=wa(t=+t)?t:0,function(){return--t<1?e.apply(this,arguments):void 0}}function Gi(t,e,r){return r&&An(t,e,r)&&(e=null),e=t&&null==e?t.length:Ea(+e||0,0),fn(t,U,null,null,null,null,e)}function Qi(t,e){var r;if("function"!=typeof e){if("function"!=typeof t)throw new Js(V);var n=t;t=e,e=n}return function(){return--t>0?r=e.apply(this,arguments):e=null,r}}function Xi(t,e){var r=P;if(arguments.length>2){var n=Vr(arguments,2),i=b(n,Xi.placeholder);r|=F}return fn(t,r,e,n,i)}function Zi(t){return pr(t,arguments.length>1?Ar(arguments,!1,!1,1):Jo(t))}function to(t,e){var r=P|R;if(arguments.length>2){var n=Vr(arguments,2),i=b(n,to.placeholder);r|=F}return fn(e,r,t,n,i)}function eo(t,e,r){r&&An(t,e,r)&&(e=null);var n=fn(t,k,null,null,null,null,null,e);return n.placeholder=eo.placeholder,n}function ro(t,e,r){r&&An(t,e,r)&&(e=null);var n=fn(t,N,null,null,null,null,null,e);return n.placeholder=ro.placeholder,n}function no(t,e,r){function n(){h&&ua(h),u&&ua(u),u=h=p=O}function i(){var r=e-(Ka()-l);if(0>=r||r>e){u&&ua(u);var n=p;u=h=p=O,n&&(d=Ka(),c=t.apply(f,a),h||u||(a=f=null))}else h=da(i,r)}function o(){h&&ua(h),u=h=p=O,(y||g!==e)&&(d=Ka(),c=t.apply(f,a),h||u||(a=f=null))}function s(){if(a=arguments,l=Ka(),f=this,p=y&&(h||!v),g===!1)var r=v&&!h;else{u||v||(d=l);var n=g-(l-d),s=0>=n||n>g;s?(u&&(u=ua(u)),d=l,c=t.apply(f,a)):u||(u=da(o,n))}return s&&h?h=ua(h):h||e===g||(h=da(i,e)),r&&(s=!0,c=t.apply(f,a)),!s||h||u||(a=f=null),c}var a,u,c,l,f,h,p,d=0,g=!1,y=!0;if("function"!=typeof t)throw new Js(V);if(e=0>e?0:e,r===!0){var v=!0;y=!1}else Po(r)&&(v=r.leading,g="maxWait"in r&&Ea(+r.maxWait||0,e),y="trailing"in r?r.trailing:y);return s.cancel=n,s}function io(t){return yr(t,1,arguments,1)}function oo(t,e){return yr(t,e,arguments,2)}function so(){var t=arguments,e=t.length;if(!e)return function(){return arguments[0]};if(!tr(t,To))throw new Js(V);return function(){for(var r=0,n=t[r].apply(this,arguments);++re)return function(){return arguments[0]};if(!tr(t,To))throw new Js(V);return function(){for(var r=e,n=t[r].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function uo(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Js(V);var r=function(){var n=r.cache,i=e?e.apply(this,arguments):arguments[0];if(n.has(i))return n.get(i);var o=t.apply(this,arguments);return n.set(i,o),o};return r.cache=new uo.Cache,r}function co(t){if("function"!=typeof t)throw new Js(V);return function(){return!t.apply(this,arguments)}}function lo(t){return Qi(t,2)}function fo(t){var e=Vr(arguments,1),r=b(e,fo.placeholder);return fn(t,F,null,e,r)}function ho(t){var e=Vr(arguments,1),r=b(e,ho.placeholder);return fn(t,I,null,e,r)}function po(t){var e=Ar(arguments,!1,!1,1);return fn(t,C,null,null,null,e)}function go(t){if("function"!=typeof t)throw new Js(V);return function(e){return t.apply(this,e)}}function yo(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new Js(V);return r===!1?n=!1:Po(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),qe.leading=n,qe.maxWait=+e,qe.trailing=i,no(t,e,qe)}function vo(t,e){return e=null==e?Ps:e,fn(e,F,null,[t],[])}function _o(t,e,r,n){return"boolean"!=typeof e&&null!=e&&(n=r,r=An(t,e,n)?null:e,e=!1),r="function"==typeof r&&Qr(r,n,1),gr(t,e,r)}function mo(t,e,r){return e="function"==typeof e&&Qr(e,r,1),gr(t,!0,e)}function bo(t){var e=_(t)?t.length:O;return xn(e)&&ra.call(t)==W||!1}function wo(t){return t===!0||t===!1||_(t)&&ra.call(t)==J||!1}function jo(t){return _(t)&&ra.call(t)==K||!1}function Eo(t){return t&&1===t.nodeType&&_(t)&&ra.call(t).indexOf("Element")>-1||!1}function Ao(t){if(null==t)return!0;var e=t.length;return xn(e)&&(Ga(t)||Co(t)||bo(t)||_(t)&&To(t.splice))?!e:!tu(t).length}function xo(t,e,r,n){if(r="function"==typeof r&&Qr(r,n,3),!r&&On(t)&&On(e))return t===e;var i=r?r(t,e):O;return"undefined"==typeof i?Nr(t,e,r):!!i}function Oo(t){return _(t)&&"string"==typeof t.message&&ra.call(t)==G||!1}function To(t){return"function"==typeof t||!1}function Po(t){var e=typeof t;return"function"==e||t&&"object"==e||!1}function Ro(t,e,r,n){var i=tu(e),o=i.length;if(r="function"==typeof r&&Qr(r,n,3),!r&&1==o){var s=i[0],a=e[s];if(On(a))return null!=t&&a===t[s]&&ta.call(t,s)}for(var u=Ds(o),c=Ds(o);o--;)a=u[o]=e[i[o]],c[o]=On(a);return Ir(t,i,u,c,r)}function So(t){return Fo(t)&&t!=+t}function ko(t){return null==t?!1:ra.call(t)==Q?ia.test(Xs.call(t)):_(t)&&Re.test(t)||!1}function No(t){return null===t}function Fo(t){return"number"==typeof t||_(t)&&ra.call(t)==Z||!1}function Io(t){return _(t)&&ra.call(t)==ee||!1}function Co(t){return"string"==typeof t||_(t)&&ra.call(t)==ne||!1}function Uo(t){return _(t)&&xn(t.length)&&Me[ra.call(t)]||!1}function Lo(t){return"undefined"==typeof t}function Bo(t){var e=t?t.length:0;return xn(e)?e?Ge(t):[]:is(t)}function Do(t){return hr(t,Qo(t))}function Mo(t,e,r){var n=Ba(t);return r&&An(t,e,r)&&(e=null),e?hr(e,n,tu(e)):n}function Ho(t){if(null==t)return t;var e=Ge(arguments);return e.push(ur),Za.apply(O,e)}function qo(t,e,r){return e=yn(e,r,3),Er(t,e,Pr,!0)}function $o(t,e,r){return e=yn(e,r,3),Er(t,e,Rr,!0)}function Vo(t,e,r){return("function"!=typeof e||"undefined"!=typeof r)&&(e=Qr(e,r,3)),xr(t,e,Qo)}function Yo(t,e,r){return e=Qr(e,r,3),Or(t,e,Qo)}function Wo(t,e,r){return("function"!=typeof e||"undefined"!=typeof r)&&(e=Qr(e,r,3)),Pr(t,e)}function zo(t,e,r){return e=Qr(e,r,3),Or(t,e,tu)}function Jo(t){return Sr(t,Qo(t))}function Ko(t,e){return t?ta.call(t,e):!1}function Go(t,e,r){r&&An(t,e,r)&&(e=null);for(var n=-1,i=tu(t),o=i.length,s={};++n0;++nr?0:+r||0,n))-e.length,r>=0&&t.indexOf(e,r)==r}function ls(t){return t=u(t),t&&we.test(t)?t.replace(me,g):t}function fs(t){return t=u(t),t&&Fe.test(t)?t.replace(Ne,"\\$&"):t}function hs(t,e,r){t=u(t),e=+e;var n=t.length;if(n>=e||!wa(e))return t;var i=(e-n)/2,o=ca(i),s=aa(i);return r=cn("",s,r),r.slice(0,o)+t+r}function ps(t,e,r){return t=u(t),t&&cn(t,e,r)+t}function ds(t,e,r){return t=u(t),t&&t+cn(t,e,r)}function gs(t,e,r){return r&&An(t,e,r)&&(e=0),Ta(t,e)}function ys(t,e){var r="";if(t=u(t),e=+e,1>e||!t||!wa(e))return r;do e%2&&(r+=t),e=ca(e/2),t+=t;while(e);return r}function vs(t,e,r){return t=u(t),r=null==r?0:Aa(0>r?0:+r||0,t.length),t.lastIndexOf(e,r)==r}function _s(t,r,n){var i=e.templateSettings;n&&An(t,r,n)&&(r=n=null),t=u(t),r=lr(lr({},n||r),i,cr);var o,s,a=lr(lr({},r.imports),i.imports,cr),c=tu(a),l=zr(a,c),f=0,h=r.interpolate||ke,p="__p += '",d=Ws((r.escape||ke).source+"|"+h.source+"|"+(h===Ae?xe:ke).source+"|"+(r.evaluate||ke).source+"|$","g"),g="//# sourceURL="+("sourceURL"in r?r.sourceURL:"lodash.templateSources["+ ++De+"]")+"\n";t.replace(d,function(e,r,n,i,a,u){return n||(n=i),p+=t.slice(f,u).replace(Ce,y),r&&(o=!0,p+="' +\n__e("+r+") +\n'"),a&&(s=!0,p+="';\n"+a+";\n__p += '"),n&&(p+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),f=u+e.length,e}),p+="';\n";var v=r.variable;v||(p="with (obj) {\n"+p+"\n}\n"),p=(s?p.replace(ge,""):p).replace(ye,"$1").replace(ve,"$1;"),p="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var _=xs(function(){return qs(c,g+"return "+p).apply(O,l)});if(_.source=p,Oo(_))throw _;return _}function ms(t,e,r){var n=t;return(t=u(t))?(r?An(n,e,r):null==e)?t.slice(j(t),E(t)+1):(e+="",t.slice(l(t,e),f(t,e)+1)):t}function bs(t,e,r){var n=t;return t=u(t),t?t.slice((r?An(n,e,r):null==e)?j(t):l(t,e+"")):t}function ws(t,e,r){var n=t;return t=u(t),t?(r?An(n,e,r):null==e)?t.slice(0,E(t)+1):t.slice(0,f(t,e+"")+1):t}function js(t,e,r){r&&An(t,e,r)&&(e=null);var n=L,i=B;if(null!=e)if(Po(e)){var o="separator"in e?e.separator:o;n="length"in e?+e.length||0:n,i="omission"in e?u(e.omission):i}else n=+e||0;if(t=u(t),n>=t.length)return t;var s=n-i.length;if(1>s)return i;var a=t.slice(0,s);if(null==o)return a+i;if(Io(o)){if(t.slice(s).search(o)){var c,l,f=t.slice(0,s);for(o.global||(o=Ws(o.source,(Oe.exec(o)||"")+"g")),o.lastIndex=0;c=o.exec(f);)l=c.index;a=a.slice(0,null==l?s:l)}}else if(t.indexOf(o,s)!=s){var h=a.lastIndexOf(o);h>-1&&(a=a.slice(0,h))}return a+i}function Es(t){return t=u(t),t&&be.test(t)?t.replace(_e,A):t}function As(t,e,r){return r&&An(t,e,r)&&(e=null),t=u(t),t.match(e||Ue)||[]}function xs(t){try{return t.apply(O,Vr(arguments,1))}catch(e){return Oo(e)?e:new Hs(e)}}function Os(t,e,r){return r&&An(t,e,r)&&(e=null),_(t)?Rs(t):dr(t,e)}function Ts(t){return function(){return t}}function Ps(t){return t}function Rs(t){return Ur(gr(t,!0))}function Ss(t,e){return Lr(t+"",gr(e,!0))}function ks(t,e,r){if(null==r){var n=Po(e),i=n&&tu(e),o=i&&i.length&&Sr(e,i);(o?o.length:n)||(o=!1,r=e,e=t,t=this)}o||(o=Sr(e,tu(e)));var s=!0,a=-1,u=To(t),c=o.length;r===!1?s=!1:Po(r)&&"chain"in r&&(s=r.chain);for(;++at||!wa(t))return[];var n=-1,i=Ds(Aa(t,ka));for(e=Qr(e,r,1);++nn?i[n]=e(n):e(n);return i}function Bs(t){var e=++ea;return u(t)+e}t=t?Xe.defaults(Je.Object(),t,Xe.pick(Je,Be)):Je;var Ds=t.Array,Ms=t.Date,Hs=t.Error,qs=t.Function,$s=t.Math,Vs=t.Number,Ys=t.Object,Ws=t.RegExp,zs=t.String,Js=t.TypeError,Ks=Ds.prototype,Gs=Ys.prototype,Qs=(Qs=t.window)&&Qs.document,Xs=qs.prototype.toString,Zs=Mr("length"),ta=Gs.hasOwnProperty,ea=0,ra=Gs.toString,na=t._,ia=Ws("^"+fs(ra).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oa=ko(oa=t.ArrayBuffer)&&oa,sa=ko(sa=oa&&new oa(0).slice)&&sa,aa=$s.ceil,ua=t.clearTimeout,ca=$s.floor,la=ko(la=Ys.getPrototypeOf)&&la,fa=Ks.push,ha=Gs.propertyIsEnumerable,pa=ko(pa=t.Set)&&pa,da=t.setTimeout,ga=Ks.splice,ya=ko(ya=t.Uint8Array)&&ya,va=ko(va=t.WeakMap)&&va,_a=function(){try{var e=ko(e=t.Float64Array)&&e,r=new e(new oa(10),0,1)&&e}catch(n){}return r}(),ma=ko(ma=Ds.isArray)&&ma,ba=ko(ba=Ys.create)&&ba,wa=t.isFinite,ja=ko(ja=Ys.keys)&&ja,Ea=$s.max,Aa=$s.min,xa=ko(xa=Ms.now)&&xa,Oa=ko(Oa=Vs.isFinite)&&Oa,Ta=t.parseInt,Pa=$s.random,Ra=Vs.NEGATIVE_INFINITY,Sa=Vs.POSITIVE_INFINITY,ka=$s.pow(2,32)-1,Na=ka-1,Fa=ka>>>1,Ia=_a?_a.BYTES_PER_ELEMENT:0,Ca=$s.pow(2,53)-1,Ua=va&&new va,La=e.support={};!function(){La.funcDecomp=!ko(t.WinRTError)&&Ie.test(x),La.funcNames="string"==typeof qs.name;try{La.dom=11===Qs.createDocumentFragment().nodeType}catch(e){La.dom=!1}try{La.nonEnumArgs=!ha.call(arguments,1)}catch(e){La.nonEnumArgs=!0}}(0,0),e.templateSettings={escape:je,evaluate:Ee,interpolate:Ae,variable:"",imports:{_:e}};var Ba=function(){function e(){}return function(r){if(Po(r)){e.prototype=r;var n=new e;e.prototype=null}return n||t.Object()}}(),Da=Ua?function(t,e){return Ua.set(t,e),t}:Ps;sa||(Xr=oa&&ya?function(t){var e=t.byteLength,r=_a?ca(e/Ia):0,n=r*Ia,i=new oa(e);if(r){var o=new _a(i,0,r);o.set(new _a(t,0,r))}return e!=n&&(o=new ya(i,n),o.set(new ya(t,n))),i}:Ts(null));var Ma=ba&&pa?function(t){return new We(t)}:Ts(null),Ha=Ua?function(t){return Ua.get(t)}:Fs,qa=function(){var t=0,e=0;return function(r,n){var i=Ka(),o=M-(i-e);if(e=i,o>0){if(++t>=D)return r}else t=0;return Da(r,n)}}(),$a=en(function(t,e,r){ta.call(t,r)?++t[r]:t[r]=1}),Va=en(function(t,e,r){ta.call(t,r)?t[r].push(e):t[r]=[e]}),Ya=en(function(t,e,r){t[r]=e}),Wa=an(nr),za=an(ir,!0),Ja=en(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]}),Ka=xa||function(){return(new Ms).getTime()},Ga=ma||function(t){return _(t)&&xn(t.length)&&ra.call(t)==z||!1};La.dom||(Eo=function(t){return t&&1===t.nodeType&&_(t)&&!Xa(t)||!1});var Qa=Oa||function(t){return"number"==typeof t&&wa(t)};(To(/x/)||ya&&!To(ya))&&(To=function(t){return ra.call(t)==Q});var Xa=la?function(t){if(!t||ra.call(t)!=te)return!1;var e=t.valueOf,r=ko(e)&&(r=la(e))&&la(r);return r?t==r||la(t)==r:kn(t)}:kn,Za=rn(lr),tu=ja?function(t){if(t)var e=t.constructor,r=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&r&&xn(r)?Nn(t):Po(t)?ja(t):[]}:Nn,eu=rn(Br),ru=on(function(t,e,r){return e=e.toLowerCase(),t+(r?e.charAt(0).toUpperCase()+e.slice(1):e)}),nu=on(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()});8!=Ta(Le+"08")&&(gs=function(t,e,r){return(r?An(t,e,r):null==e)?e=0:e&&(e=+e),t=ms(t),Ta(t,e||(Pe.test(t)?16:10))});var iu=on(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}),ou=on(function(t,e,r){return t+(r?" ":"")+(e.charAt(0).toUpperCase()+e.slice(1))});return r.prototype=Ba(e.prototype),n.prototype=Ba(r.prototype),n.prototype.constructor=n,re.prototype["delete"]=ie,re.prototype.get=$e,re.prototype.has=Ve,re.prototype.set=Ye,We.prototype.push=Ke,uo.Cache=re,e.after=Ki,e.ary=Gi,e.assign=Za,e.at=Ti,e.before=Qi,e.bind=Xi,e.bindAll=Zi,e.bindKey=to,e.callback=Os,e.chain=_i,e.chunk=Un,e.compact=Ln,e.constant=Ts,e.countBy=$a,e.create=Mo,e.curry=eo,e.curryRight=ro,e.debounce=no,e.defaults=Ho,e.defer=io,e.delay=oo,e.difference=Bn,e.drop=Dn,e.dropRight=Mn,e.dropRightWhile=Hn,e.dropWhile=qn,e.fill=$n,e.filter=Si,e.flatten=zn,e.flattenDeep=Jn,e.flow=so,e.flowRight=ao,e.forEach=Ii,e.forEachRight=Ci,e.forIn=Vo,e.forInRight=Yo,e.forOwn=Wo,e.forOwnRight=zo,e.functions=Jo,e.groupBy=Va,e.indexBy=Ya,e.initial=Gn,e.intersection=Qn,e.invert=Go,e.invoke=Ui,e.keys=tu,e.keysIn=Qo,e.map=Li,e.mapValues=Xo,e.matches=Rs,e.matchesProperty=Ss,e.memoize=uo,e.merge=eu,e.mixin=ks,e.negate=co,e.omit=Zo,e.once=lo,e.pairs=ts,e.partial=fo,e.partialRight=ho,e.partition=Ja,e.pick=es,e.pluck=Bi,e.property=Is,e.propertyOf=Cs,e.pull=ti,e.pullAt=ei,e.range=Us,e.rearg=po,e.reject=Hi,e.remove=ri,e.rest=ni,e.shuffle=$i,e.slice=ii,e.sortBy=Wi,e.sortByAll=zi,e.spread=go,e.take=ai,e.takeRight=ui,e.takeRightWhile=ci,e.takeWhile=li,e.tap=mi,e.throttle=yo,e.thru=bi,e.times=Ls,e.toArray=Bo,e.toPlainObject=Do,e.transform=ns,e.union=fi,e.uniq=hi,e.unzip=pi,e.values=is,e.valuesIn=os,e.where=Ji,e.without=di,e.wrap=vo,e.xor=gi,e.zip=yi,e.zipObject=vi,e.backflow=ao,e.collect=Li,e.compose=ao,e.each=Ii,e.eachRight=Ci,e.extend=Za,e.iteratee=Os,e.methods=Jo,e.object=vi,e.select=Si,e.tail=ni,e.unique=hi,ks(e,e),e.attempt=xs,e.camelCase=ru,e.capitalize=as,e.clone=_o,e.cloneDeep=mo,e.deburr=us,e.endsWith=cs,e.escape=ls,e.escapeRegExp=fs,e.every=Ri,e.find=ki,e.findIndex=Vn,e.findKey=qo,e.findLast=Ni,e.findLastIndex=Yn,e.findLastKey=$o,e.findWhere=Fi,e.first=Wn,e.has=Ko,e.identity=Ps,e.includes=Pi,e.indexOf=Kn,e.isArguments=bo,e.isArray=Ga,e.isBoolean=wo,e.isDate=jo,e.isElement=Eo,e.isEmpty=Ao,e.isEqual=xo,e.isError=Oo,e.isFinite=Qa,e.isFunction=To,e.isMatch=Ro,e.isNaN=So,e.isNative=ko,e.isNull=No,e.isNumber=Fo,e.isObject=Po,e.isPlainObject=Xa,e.isRegExp=Io,e.isString=Co,e.isTypedArray=Uo,e.isUndefined=Lo,e.kebabCase=nu,e.last=Xn,e.lastIndexOf=Zn,e.max=Wa,e.min=za,e.noConflict=Ns,e.noop=Fs,e.now=Ka,e.pad=hs,e.padLeft=ps,e.padRight=ds,e.parseInt=gs,e.random=ss,e.reduce=Di,e.reduceRight=Mi,e.repeat=ys,e.result=rs,e.runInContext=x,e.size=Vi,e.snakeCase=iu,e.some=Yi,e.sortedIndex=oi,e.sortedLastIndex=si,e.startCase=ou,e.startsWith=vs,e.template=_s,e.trim=ms,e.trimLeft=bs,e.trimRight=ws,e.trunc=js,e.unescape=Es,e.uniqueId=Bs,e.words=As,e.all=Ri,e.any=Yi,e.contains=Pi,e.detect=ki,e.foldl=Di,e.foldr=Mi,e.head=Wn,e.include=Pi,e.inject=Di,ks(e,function(){var t={};return Pr(e,function(r,n){e.prototype[n]||(t[n]=r)}),t}(),!1),e.sample=qi,e.prototype.sample=function(t){return this.__chain__||null!=t?this.thru(function(e){return qi(e,t)}):qi(this.value())},e.VERSION=T,Qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){e[t].placeholder=e}),Qe(["filter","map","takeWhile"],function(t,e){var r=e==H,i=e==$;n.prototype[t]=function(t,n){var o=this.clone(),s=o.__filtered__,a=o.__iteratees__||(o.__iteratees__=[]);return o.__filtered__=s||r||i&&o.__dir__<0,a.push({iteratee:yn(t,n,3),type:e}),o}}),Qe(["drop","take"],function(t,e){var r="__"+t+"Count__",i=t+"While";n.prototype[t]=function(n){n=null==n?1:Ea(ca(n)||0,0);var i=this.clone();if(i.__filtered__){var o=i[r];i[r]=e?Aa(o,n):o+n}else{var s=i.__views__||(i.__views__=[]);s.push({size:n,type:t+(i.__dir__<0?"Right":"")})}return i},n.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()},n.prototype[t+"RightWhile"]=function(t,e){return this.reverse()[i](t,e).reverse()}}),Qe(["first","last"],function(t,e){var r="take"+(e?"Right":"");n.prototype[t]=function(){return this[r](1).value()[0]}}),Qe(["initial","rest"],function(t,e){var r="drop"+(e?"":"Right");n.prototype[t]=function(){return this[r](1)}}),Qe(["pluck","where"],function(t,e){var r=e?"filter":"map",i=e?Ur:Mr;n.prototype[t]=function(t){return this[r](i(t))}}),n.prototype.compact=function(){return this.filter(Ps)},n.prototype.dropWhile=function(t,e){var r;return t=yn(t,e,3),this.filter(function(e,n,i){return r||(r=!t(e,n,i))})},n.prototype.reject=function(t,e){return t=yn(t,e,3),this.filter(function(e,r,n){return!t(e,r,n)})},n.prototype.slice=function(t,e){t=null==t?0:+t||0;var r=0>t?this.takeRight(-t):this.drop(t);return"undefined"!=typeof e&&(e=+e||0,r=0>e?r.dropRight(-e):r.take(e-t)),r},n.prototype.toArray=function(){return this.drop(0)},Pr(n.prototype,function(t,i){var o=e[i],s=/^(?:first|last)$/.test(i);e.prototype[i]=function(){var i=this.__wrapped__,a=arguments,u=this.__chain__,c=!!this.__actions__.length,l=i instanceof n,f=l&&!c;if(s&&!u)return f?t.call(i):o.call(e,this.value());var h=function(t){var r=[t];return fa.apply(r,a),o.apply(e,r)};if(l||Ga(i)){var p=f?i:new n(this),d=t.apply(p,a);if(!s&&(c||d.__actions__)){var g=d.__actions__||(d.__actions__=[]);g.push({func:bi,args:[h],thisArg:e})}return new r(d,u)}return this.thru(h)}}),Qe(["concat","join","pop","push","shift","sort","splice","unshift"],function(t){var r=Ks[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?r.apply(this.value(),t):this[n](function(e){return r.apply(e,t)})}}),n.prototype.clone=i,n.prototype.reverse=m,n.prototype.value=X,e.prototype.chain=wi,e.prototype.commit=ji,e.prototype.plant=Ei,e.prototype.reverse=Ai,e.prototype.toString=xi,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Oi,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var O,T="3.2.0",P=1,R=2,S=4,k=8,N=16,F=32,I=64,C=128,U=256,L=30,B="...",D=150,M=16,H=0,q=1,$=2,V="Expected a function",Y="__lodash_placeholder__",W="[object Arguments]",z="[object Array]",J="[object Boolean]",K="[object Date]",G="[object Error]",Q="[object Function]",X="[object Map]",Z="[object Number]",te="[object Object]",ee="[object RegExp]",re="[object Set]",ne="[object String]",ie="[object WeakMap]",oe="[object ArrayBuffer]",se="[object Float32Array]",ae="[object Float64Array]",ue="[object Int8Array]",ce="[object Int16Array]",le="[object Int32Array]",fe="[object Uint8Array]",he="[object Uint8ClampedArray]",pe="[object Uint16Array]",de="[object Uint32Array]",ge=/\b__p \+= '';/g,ye=/\b(__p \+=) '' \+/g,ve=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_e=/&(?:amp|lt|gt|quot|#39|#96);/g,me=/[&<>"'`]/g,be=RegExp(_e.source),we=RegExp(me.source),je=/<%-([\s\S]+?)%>/g,Ee=/<%([\s\S]+?)%>/g,Ae=/<%=([\s\S]+?)%>/g,xe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oe=/\w*$/,Te=/^\s*function[ \n\r\t]+\w/,Pe=/^0[xX]/,Re=/^\[object .+?Constructor\]$/,Se=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,ke=/($^)/,Ne=/[.*+?^${}()|[\]\/\\]/g,Fe=RegExp(Ne.source),Ie=/\bthis\b/,Ce=/['\n\r\u2028\u2029\\]/g,Ue=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"{2,}(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),Le=" \f \n\r\u2028\u2029 ᠎              ",Be=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","document","isFinite","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","window","WinRTError"],De=-1,Me={};Me[se]=Me[ae]=Me[ue]=Me[ce]=Me[le]=Me[fe]=Me[he]=Me[pe]=Me[de]=!0,Me[W]=Me[z]=Me[oe]=Me[J]=Me[K]=Me[G]=Me[Q]=Me[X]=Me[Z]=Me[te]=Me[ee]=Me[re]=Me[ne]=Me[ie]=!1;var He={};He[W]=He[z]=He[oe]=He[J]=He[K]=He[se]=He[ae]=He[ue]=He[ce]=He[le]=He[Z]=He[te]=He[ee]=He[ne]=He[fe]=He[he]=He[pe]=He[de]=!0,He[G]=He[Q]=He[X]=He[re]=He[ie]=!1;var qe={leading:!1,maxWait:0,trailing:!1},$e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Ve={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ye={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},We={"function":!0,object:!0},ze={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Je=We[typeof window]&&window!==(this&&this.window)?window:this,Ke=We[typeof e]&&e&&!e.nodeType&&e,Ge=We[typeof t]&&t&&!t.nodeType&&t,Qe=Ke&&Ge&&"object"==typeof i&&i;!Qe||Qe.global!==Qe&&Qe.window!==Qe&&Qe.self!==Qe||(Je=Qe);var Xe=(Ge&&Ge.exports===Ke&&Ke,x());Je._=Xe,n=function(){return Xe}.call(e,r,e,t),!(n!==O&&(t.exports=n))}).call(this)}).call(e,r(60)(t),function(){return this}())},function(t,e,r){function n(t){return r(i(t))}function i(t){return o[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var o={"./browser":55,"./browser.js":55,"./collection":52,"./collection.js":52,"./index":27,"./index.js":27,"./utils":56,"./utils.js":56};n.keys=function(){return Object.keys(o)},n.resolve=i,t.exports=n,n.id=48},function(t,e,r){function n(t){return function(e){var r=t(e);return r.sort(),r}}function i(t,e){g.formats[t]=e}function o(t){return t.split("\n").map(function(t){return" "+t}).join("\n")}function s(t,e,r,n){n=n||e.keys(t);var i=0;return e.seen.push(t),n=n.map(function(r){var n=a(t,e,r);return i+=n.length,n}),e.seen.pop(),0===n.length?"{}":i<=e.maxLineLength?"{ "+(r?r+" ":"")+n.join(e.propSep+" ")+" }":"{\n"+(r?r+"\n":"")+n.map(o).join(e.propSep+"\n")+"\n}"}function a(t,e,r){var n;try{n=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(i){n={value:i}}var o=g.formatPropertyName(r,e),s=n.get&&n.set?"[Getter/Setter]":n.get?"[Getter]":n.set?"[Setter]":e.seen.indexOf(n.value)>=0?"[Circular]":g(n.value,e);return o+": "+s}function u(t){return 10>t?"0"+t:""+t}function c(t){return 100>t?"0"+u(t):""+t}function l(t){var e=t.getTimezoneOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r-60*n,o="GMT"+(0>e?"+":"-")+u(n)+u(i);return t.toLocaleDateString()+" "+t.toLocaleTimeString()+"."+c(t.getMilliseconds())+" "+o}function f(t){return function(e,r){var n=t(e),i=r.keys(e);return 0==i.length?n:s(e,r,n,i)}}function h(t){if(t.name)return t.name;var e=t.toString().match(y)[1];return e}function p(t,e){return function(r){var n="",i=50,o=r[t];if(o>0){for(var s=0;i>s&&o>s;s++){var a=r[s]||0;n+=" "+u(a.toString(16))}o>i&&(n+=" ... ")}return"["+(r.constructor.name||e)+(n?":"+n:"")+"]"}}var d=r(50),g=function(t,e){e=e||{},"seen"in e||(e.seen=[]),e.keys=n("keys"in e&&e.keys===!1?Object.getOwnPropertyNames:Object.keys),"maxLineLength"in e||(e.maxLineLength=60),"propSep"in e||(e.propSep=",");var r=d(t);return(g.formats[r]||g.formats.object)(t,e)};t.exports=g,g.formats={},["undefined","boolean","null"].forEach(function(t){i(t,String)}),["number","boolean"].forEach(function(t){var e=t.substring(0,1).toUpperCase()+t.substring(1);i("object-"+t,f(function(t){return"["+e+": "+g(t.valueOf())+"]"}))}),i("object-string",function(t,e){var r=t.valueOf(),n="[String: "+g(r)+"]",i=e.keys(t);return i=i.filter(function(t){return!(t.match(/\d+/)&&parseInt(t,10)1/t?"-0":String(t)}),i("string",function(t){return"'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'"}),i("object",s),i("array",function(t,e){var r=e.keys(t),n=0;e.seen.push(t);var i=r.map(function(r){var i;try{i=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(o){i={value:o}}var s;return s=r.match(/\d+/)?g(i.value,e):a(i.value,e,r),n+=s.length,s});return e.seen.pop(),0===i.length?"[]":n<=e.maxLineLength?"[ "+i.join(e.propSep+" ")+" ]":"[\n"+i.map(o).join(e.propSep+"\n")+"\n]"}),g.formatPropertyName=function(t,e){return t.match(/^[a-zA-Z_$][a-zA-Z_$0-9]*$/)?t:g(t,e)},i("date",f(l));var y=/^\s*function\s*(\S*)\s*\(/;i("function",f(function(t){var e=h(t);return"[Function"+(e?": "+e:"")+"]"})),i("error",f(function(t){var e=t.name,r=t.message;return"["+e+(r?": "+r:"")+"]"})),i("buffer",p("length","Buffer")),i("array-buffer",p("byteLength")),i("typed-array",p("byteLength")),i("promise",function(){return"[Promise]"}),i("xhr",function(){return"[XMLHttpRequest]"}),i("html-element",function(t){return t.outerHTML}),i("html-element-text",function(t){return t.nodeValue}),i("document",function(t){return t.documentElement.outerHTML}),i("window",function(){return"[Window]"})},function(t,e,r){(function(e){var r=Object.prototype.toString,n={NUMBER:"number",UNDEFINED:"undefined",STRING:"string",BOOLEAN:"boolean",OBJECT:"object",FUNCTION:"function",NULL:"null",ARRAY:"array",REGEXP:"regexp",DATE:"date",ERROR:"error",ARGUMENTS:"arguments",SYMBOL:"symbol",ARRAY_BUFFER:"array-buffer",TYPED_ARRAY:"typed-array",DATA_VIEW:"data-view",MAP:"map",SET:"set",WEAK_SET:"weak-set",WEAK_MAP:"weak-map",PROMISE:"promise",WRAPPER_NUMBER:"object-number",WRAPPER_BOOLEAN:"object-boolean",WRAPPER_STRING:"object-string",BUFFER:"buffer",HTML_ELEMENT:"html-element",HTML_ELEMENT_TEXT:"html-element-text",DOCUMENT:"document",WINDOW:"window",FILE:"file",FILE_LIST:"file-list",BLOB:"blob",XHR:"xhr"};t.exports=function i(t){var o=typeof t;switch(o){case n.NUMBER:return n.NUMBER;case n.UNDEFINED:return n.UNDEFINED;case n.STRING:return n.STRING;case n.BOOLEAN:return n.BOOLEAN;case n.FUNCTION:return n.FUNCTION;case n.SYMBOL:return n.SYMBOL;case n.OBJECT:if(null===t)return n.NULL;var s=r.call(t);switch(s){case"[object String]":return n.WRAPPER_STRING;case"[object Boolean]":return n.WRAPPER_BOOLEAN;case"[object Number]":return n.WRAPPER_NUMBER;case"[object Array]":return n.ARRAY;case"[object RegExp]":return n.REGEXP;case"[object Error]":return n.ERROR;case"[object Date]":return n.DATE;case"[object Arguments]":return n.ARGUMENTS;case"[object Math]":return n.OBJECT;case"[object JSON]":return n.OBJECT;case"[object ArrayBuffer]":return n.ARRAY_BUFFER;case"[object Int8Array]":return n.TYPED_ARRAY;case"[object Uint8Array]":return n.TYPED_ARRAY;case"[object Uint8ClampedArray]":return n.TYPED_ARRAY;case"[object Int16Array]":return n.TYPED_ARRAY;case"[object Uint16Array]":return n.TYPED_ARRAY;case"[object Int32Array]":return n.TYPED_ARRAY;case"[object Uint32Array]":return n.TYPED_ARRAY;case"[object Float32Array]":return n.TYPED_ARRAY;case"[object Float64Array]":return n.TYPED_ARRAY;case"[object DataView]":return n.DATA_VIEW;case"[object Map]":return n.MAP;case"[object WeakMap]":return n.WEAK_MAP;case"[object Set]":return n.SET;case"[object WeakSet]":return n.WEAK_SET;case"[object Promise]":return n.PROMISE;case"[object Window]":return n.WINDOW;case"[object HTMLDocument]":return n.DOCUMENT;case"[object Blob]":return n.BLOB;case"[object File]":return n.FILE;case"[object FileList]":return n.FILE_LIST;case"[object XMLHttpRequest]":return n.XHR;case"[object Text]":return n.HTML_ELEMENT_TEXT;default:if(typeof Promise===n.FUNCTION&&t instanceof Promise||i(t.then)===n.FUNCTION&&t.then.length>=2)return n.PROMISE;if("undefined"!=typeof e&&t instanceof e)return n.BUFFER;if(/^\[object HTML\w+Element\]$/.test(s))return n.HTML_ELEMENT;if("[object Object]"===s)return n.OBJECT}}},Object.keys(n).forEach(function(e){t.exports[e]=n[e]})}).call(e,r(61).Buffer)},function(t,e,r){function n(t){var e={};for(var r in t)e[r]=t[r];return e}var i=r(59);t.exports=function(t){var e=t;switch(i(t)){case"undefined":return"undefined";case"number":return t.toString();case"regexp":return t.toString();case"date":return t.toISOString();case"function":return t.toString();case"object":t=n(t);default:var r=[];return JSON.stringify(t,function(t,n){if(!r.length)return r.push(n),n;var i=r.indexOf(this);return~i?r.splice(i+1):r.push(this),n===e||~r.indexOf(n)?"[Circular]":void 0===n?"[Undefined]":n})}}},function(t,e,r){"use strict";function n(t){if(this._container=t||{},t&&"object"!=typeof t)throw new TypeError("Argument #1 passed to Collection must be an object")}var i=r(56);n.prototype.keys=function(){return Object.keys(this._container)},n.prototype.has=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.has() must be a string identifier, "+Object.prototype.toString(t)+" given");return t in this._container==!0},n.prototype.remove=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.remove() must be a string identifier");return delete this._container[t],this},n.prototype.set=function(t,e){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.set() must be a string identifier");return this._container[t]=e,this},n.prototype.setAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.setAll() must be an object");return this._container=t,this},n.prototype.addAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addAll() must be an object");for(var e in t)this.set(e,t[e]);return this},n.prototype.addOnce=function(t,e,r){if(this.has(t)){if(r)return this;throw new Error("Identifier "+t+" passed to Collection.addOnce() is already defined")}return this.set(t,e)},n.prototype.addOnceAll=function(t,e){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addOnceAll() must be an object");for(var r in t)this.addOnce(r,t[r],e);return this},n.prototype.merge=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.merge() must be an object");var e=Array.prototype.concat.apply([this._container],arguments);return this._container=i.mergeRecursive.apply(i,e),this},n.prototype.getAll=function(){return this._container},n.prototype.get=function(t,e,r){return"function"==typeof this._container[t]?this._container[t]():this.has(t)?this._container[t]:"function"==typeof e?this.raw(t,e,r)():this.raw(t,e,r)},n.prototype.raw=function(t,e,r){if(this.has(t))return this._container[t];if(r)throw new Error("Identifier "+t+" is not defined");return e},n.prototype.inject=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.raw(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.raw(t))},n.prototype.invoke=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.get(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.get(t))},n.prototype.apply=function(t){if(arguments.length>1){var e=Array.prototype.slice.call(arguments,1);return t.apply(this._container,e)}return t.call(this._container)},n.prototype.wrap=function(t){return function(){return t}},n.prototype.singleton=function(t,e){var r,n;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.singleton() must be a string identifier");if("function"!=typeof e)throw new TypeError("Argument #2 passed to Collection.singleton() must be a function");return this._container[t]=function(){return r||(r=!0,n=arguments.length?e.apply(null,arguments):e()),n},this},n.prototype.provider=function(t,e,r){var n,i,o=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.provider() must be a string identifier");return this._container[t]=function(){return n||(n=!0,i=o.inject(e,r)),i},this},n.prototype.factory=function(t,e,r){var n,i,o=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.factory() must be a string identifier");return this._container[t]=function(){return n||(n=!0,i=o.invoke(e,r)),i},this},t.exports=n},function(t,e,r){function n(t,e,r,i,o){var s=new a(t);s.params={operator:i,expected:e,message:r,stackStartFunction:o||n},s.fail()}function i(t,e){t||n(t,!0,e,"==",l.ok)}function o(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function s(t,e,r,i){var s;"string"==typeof r&&(i=r,r=null);try{e()}catch(a){s=a}if(i=(r&&r.name?" ("+r.name+")":".")+(i?" "+i:"."),t&&!s&&n(s,r,"Missing expected exception"+i),!t&&o(s,r)&&n(s,r,"Got unwanted exception"+i),t&&s&&r&&!o(s,r)||!t&&s)throw s}var a=(r(32),r(34)),u=r(58),c=Array.prototype.slice,l=t.exports=i;l.fail=n,l.ok=i,l.equal=function(t,e,r){t!=e&&n(t,e,r,"==",l.equal)},l.notEqual=function(t,e,r){t==e&&n(t,e,r,"!=",l.notEqual)},l.deepEqual=function(t,e,r){u(t,e).result||n(t,e,r,"deepEqual",l.deepEqual)},l.notDeepEqual=function(t,e,r){u(t,e).result&&n(t,e,r,"notDeepEqual",l.notDeepEqual)},l.strictEqual=function(t,e,r){t!==e&&n(t,e,r,"===",l.strictEqual)},l.notStrictEqual=function(t,e,r){t===e&&n(t,e,r,"!==",l.notStrictEqual)},l["throws"]=function(){s.apply(this,[!0].concat(c.call(arguments)))},l.doesNotThrow=function(){s.apply(this,[!1].concat(c.call(arguments)))},l.ifError=function(t){if(t)throw t}},function(t,e,r){(function(t,n){function i(t,r){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),u(n,t,n.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function s(t){return t}function a(t){var e={};return t.forEach(function(t){e[t]=!0}),e}function u(t,r,n){if(t.customInspect&&r&&O(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return m(i)||(i=u(t,i,n)),i}var o=c(t,r);if(o)return o;var s=Object.keys(r),g=a(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),x(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(O(r)){var y=r.name?": "+r.name:"";return t.stylize("[Function"+y+"]","special")}if(j(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(A(r))return t.stylize(Date.prototype.toString.call(r),"date");if(x(r))return l(r)}var v="",_=!1,b=["{","}"];if(d(r)&&(_=!0,b=["[","]"]),O(r)){var w=r.name?": "+r.name:"";v=" [Function"+w+"]"}if(j(r)&&(v=" "+RegExp.prototype.toString.call(r)),A(r)&&(v=" "+Date.prototype.toUTCString.call(r)),x(r)&&(v=" "+l(r)),0===s.length&&(!_||0==r.length))return b[0]+v+b[1];if(0>n)return j(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special");t.seen.push(r);var E;return E=_?f(t,r,n,g,s):s.map(function(e){return h(t,r,n,g,e,_)}),t.seen.pop(),p(E,v,b)}function c(t,e){if(w(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return _(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i){for(var o=[],s=0,a=e.length;a>s;++s)o.push(k(e,String(s))?h(t,e,r,n,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(t,e,r,n,i,!0))}),o}function h(t,e,r,n,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=y(r)?u(t,c.value,null):u(t,c.value,r-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t +}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return null==t}function _(t){return"number"==typeof t}function m(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function w(t){return void 0===t}function j(t){return E(t)&&"[object RegExp]"===P(t)}function E(t){return"object"==typeof t&&null!==t}function A(t){return E(t)&&"[object Date]"===P(t)}function x(t){return E(t)&&("[object Error]"===P(t)||t instanceof Error)}function O(t){return"function"==typeof t}function T(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function P(t){return Object.prototype.toString.call(t)}function R(t){return 10>t?"0"+t.toString(10):t.toString(10)}function S(){var t=new Date,e=[R(t.getHours()),R(t.getMinutes()),R(t.getSeconds())].join(":");return[t.getDate(),C[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var N=/%[sdj%]/g;e.format=function(t){if(!m(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),a=n[r];o>r;a=n[++r])s+=y(a)||!E(a)?" "+a:" "+i(a);return s},e.deprecate=function(r,i){function o(){if(!s){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),s=!0}return r.apply(this,arguments)}if(w(t.process))return function(){return e.deprecate(r,i).apply(this,arguments)};if(n.noDeprecation===!0)return r;var s=!1;return o};var F,I={};e.debuglog=function(t){if(w(F)&&(F={NODE_ENV:"production"}.NODE_DEBUG||""),t=t.toUpperCase(),!I[t])if(new RegExp("\\b"+t+"\\b","i").test(F)){var r=n.pid;I[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else I[t]=function(){};return I[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=g,e.isNull=y,e.isNullOrUndefined=v,e.isNumber=_,e.isString=m,e.isSymbol=b,e.isUndefined=w,e.isRegExp=j,e.isObject=E,e.isDate=A,e.isError=x,e.isFunction=O,e.isPrimitive=T,e.isBuffer=r(62);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){console.log("%s - %s",S(),e.format.apply(e,arguments))},e.inherits=r(63),e._extend=function(t,e){if(!e||!E(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(e,function(){return this}(),r(57))},function(t,e,r){"use strict";if(!Array.isArray){var n=Object.prototype.toString();Array.isArray=function(t){return"[object Array]"===n.call(t)?!0:"function"==typeof t.slice&&"number"==typeof t.length?!0:!1}}window.noder=r(27)},function(t){"use strict";function e(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t}function r(t){var e=arguments.length;if(2>e)throw new Error("There should be at least 2 arguments passed to utils.mergeRecursive()");for(var n=1;e>n;n++)for(var i in arguments[n])t[i]=t[i]&&"object"==typeof t[i]?r(t[i],arguments[n][i]):arguments[n][i];return t}t.exports.merge=e,t.exports.mergeRecursive=r},function(t){function e(){}var r=t.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,r="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var n=[];if(e){var i=document.createElement("div"),o=new MutationObserver(function(){var t=n.slice();n.length=0,t.forEach(function(t){t()})});return o.observe(i,{attributes:!0}),function(t){n.length||i.setAttribute("yes","no"),n.push(t)}}return r?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=e,r.addListener=e,r.once=e,r.off=e,r.removeListener=e,r.removeAllListeners=e,r.emit=e,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},function(t,e,r){function n(t,e,r,n,i){var o={result:t};return t||(o.path=e,o.reason=r,o.a=n,o.b=i),o}function i(t){for(var e=arguments,r=1,n=e.length;n>r;r++)t=t.replace(/%s/,e[r]);return t}function o(t,e,r,s,f,h,p){function d(i,o){var s=n(i,h,o,t,e);return!i&&r.collectAllFails&&p.push(s),s}function g(n){return o(t[n],e[n],r,s,f,h.concat([n]),p)}var y=c;if(t===e)return d(0!==t||1/t==1/e,l.PLUS_0_AND_MINUS_0);var v,_,m=a(t),b=a(e);if(m!==b)return d(!1,i(l.DIFFERENT_TYPES,m,b));switch(m){case"number":return t!==t?d(e!==e,l.NAN_NUMBER):0===t?d(1/t===1/e,l.PLUS_0_AND_MINUS_0):d(t===e,l.EQUALITY);case"regexp":for(_=["source","global","multiline","lastIndex","ignoreCase"];_.length;)if(y=g(_.shift()),!r.collectAllFails&&!y.result)return y;break;case"boolean":case"string":return d(t===e,l.EQUALITY);case"date":if(+t!==+e&&!r.collectAllFails)return d(!1,l.EQUALITY);break;case"object-number":case"object-boolean":case"object-string":if(y=o(t.valueOf(),e.valueOf(),r,s,f,h,p),!y.result&&!r.collectAllFails)return y.reason=l.WRAPPED_VALUE,y;break;case"buffer":if(y=g("length"),!r.collectAllFails&&!y.result)return y;for(v=t.length;v--;)if(y=g(v),!r.collectAllFails&&!y.result)return y;return c;case"error":for(_=["name","message"];_.length;)if(y=g(_.shift()),!r.collectAllFails&&!y.result)return y}for(s||(s=[]),f||(f=[]),v=s.length;v--;)if(s[v]==t)return d(f[v]==e,l.CIRCULAR_VALUES);s.push(t),f.push(e);var w;if(!("array"!==m&&"arguments"!==m&&"typed-array"!==m||(y=g("length"),r.collectAllFails||y.result)))return y;if(!("array-buffer"!==m&&"typed-array"!==m||(y=g("byteLength"),r.collectAllFails||y.result)))return y;if("function"===b){var j=t.toString(),E=e.toString();if(y=o(j,E,r,s,f,h,p),y.reason=l.FUNCTION_SOURCES,!r.collectAllFails&&!y.result)return y}for(w in e)if(u.call(e,w)){if(y=d(u.call(t,w),i(l.MISSING_KEY,"A",w)),!y.result&&!r.collectAllFails)return y;if(y.result&&(y=g(w),!y.result&&!r.collectAllFails))return y}for(w in t)if(u.call(t,w)&&(y=d(u.call(e,w),i(l.MISSING_KEY,"B",w)),!y.result&&!r.collectAllFails))return y;s.pop(),f.pop();var A=!1,x=!1;return(!r.checkProtoEql||(Object.getPrototypeOf?(A=Object.getPrototypeOf(t)===Object.getPrototypeOf(e),x=!0):t.__proto__&&e.__proto__&&(A=t.__proto__===e.__proto__,x=!0),!x||A||r.collectAllFails||(y=d(A,l.EQUALITY_PROTOTYPE),y.showReason=!0,y.result||r.collectAllFails)))&&("function"!==b||(y=g("prototype"),y.result||r.collectAllFails))?c:y}function s(t,e,r){r=r||f;var n=[],i=o(t,e,r||f,[],[],[],n);return r.collectAllFails?n:i}var a=r(50),u=Object.prototype.hasOwnProperty,c=n(!0),l={PLUS_0_AND_MINUS_0:"+0 is not equal to -0",DIFFERENT_TYPES:"A has type %s and B has type %s",NAN_NUMBER:"NaN is not equal to any number",EQUALITY:"A is not equal to B",EQUALITY_PROTOTYPE:"A and B have different prototypes",WRAPPED_VALUE:"A wrapped value is not equal to B wrapped value",FUNCTION_SOURCES:"function A is not equal to B by source code value (via .toString call)",MISSING_KEY:"%s has no key %s",CIRCULAR_VALUES:"A has circular reference that was visited not in the same time as B"},f={checkProtoEql:!0,collectAllFails:!1};t.exports=s,s.r=l},function(t){function e(t){if(void 0===t)return"undefined";if(null===t)return"null";switch(Object.prototype.toString.call(t)){case"[object Boolean]":return"boolean";case"[object Number]":return"number";case"[object String]":return"string";case"[object RegExp]":return"regexp";case"[object Date]":return"date";case"[object Array]":return"array";default:return typeof t}}t.exports=e},function(t){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,r){(function(t){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);var i,o=typeof e;if("number"===o)i=e>0?e>>>0:0;else if("string"===o)"base64"===r&&(e=j(e)),i=t.byteLength(e,r);else{if("object"!==o||null===e)throw new TypeError("must start with number, buffer, array or string");"Buffer"===e.type&&I(e.data)&&(e=e.data),i=+e.length>0?Math.floor(+e.length):0}if(this.length>C)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C.toString(16)+" bytes");var s;t.TYPED_ARRAY_SUPPORT?s=t._augment(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(t.TYPED_ARRAY_SUPPORT&&"number"==typeof e.byteLength)s._set(e);else if(A(e))if(t.isBuffer(e))for(a=0;i>a;a++)s[a]=e.readUInt8(a);else for(a=0;i>a;a++)s[a]=(e[a]%256+256)%256;else if("string"===o)s.write(e,0,r);else if("number"===o&&!t.TYPED_ARRAY_SUPPORT&&!n)for(a=0;i>a;a++)s[a]=0;return s}function n(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;n>s;s++){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[r+s]=a}return s}function i(t,e,r,n){var i=S(O(e),t,r,n);return i}function o(t,e,r,n){var i=S(T(e),t,r,n);return i}function s(t,e,r,n){return o(t,e,r,n)}function a(t,e,r,n){var i=S(R(e),t,r,n);return i}function u(t,e,r,n){var i=S(P(e),t,r,n,2);return i}function c(t,e,r){return N.fromByteArray(0===e&&r===t.length?t:t.slice(e,r))}function l(t,e,r){var n="",i="";r=Math.min(t.length,r);for(var o=e;r>o;o++)t[o]<=127?(n+=k(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return n+k(i)}function f(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function h(t,e,r){return f(t,e,r)}function p(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=e;r>o;o++)i+=x(t[o]);return i}function d(t,e,r){for(var n=t.slice(e,r),i="",o=0;ot)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function y(e,r,n,i,o,s){if(!t.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(r>o||s>r)throw new TypeError("value is out of bounds");if(n+i>e.length)throw new TypeError("index out of range")}function v(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);o>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function _(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);o>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function m(t,e,r,n,i,o){if(e>i||o>e)throw new TypeError("value is out of bounds");if(r+n>t.length)throw new TypeError("index out of range")}function b(t,e,r,n,i){return i||m(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),F.write(t,e,r,n,23,4),r+4}function w(t,e,r,n,i){return i||m(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),F.write(t,e,r,n,52,8),r+8}function j(t){for(t=E(t).replace(L,"");t.length%4!==0;)t+="=";return t}function E(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function A(e){return I(e)||t.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function x(t){return 16>t?"0"+t.toString(16):t.toString(16)}function O(t){for(var e=[],r=0;r=n)e.push(n);else{var i=r;n>=55296&&57343>=n&&r++;for(var o=encodeURIComponent(t.slice(i,r+1)).substr(1).split("%"),s=0;s>8,n=e%256,i.push(n),i.push(r);return i}function R(t){return N.toByteArray(t)}function S(t,e,r,n,i){i&&(n-=n%i);for(var o=0;n>o&&!(o+r>=e.length||o>=t.length);o++)e[o+r]=t[o];return o}function k(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -var F=r(100),R=r(97),C=r(98);e.Buffer=t,e.SlowBuffer=t,e.INSPECT_MAX_BYTES=50,t.poolSize=8192;var I=1073741823;t.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(r){return!1}}(),t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);s>o&&e[o]===r[o];o++);return o!==s&&(n=e[o],i=r[o]),i>n?-1:n>i?1:0},t.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,r){if(!C(e))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===e.length)return new t(0);if(1===e.length)return e[0];var n;if(void 0===r)for(r=0,n=0;n>>1;break;case"utf8":case"utf-8":r=O(t).length;break;case"base64":r=T(t).length;break;default:r=t.length}return r},t.prototype.length=void 0,t.prototype.parent=void 0,t.prototype.toString=function(t,e,r){var n=!1;if(e>>>=0,r=void 0===r||1/0===r?this.length:r>>>0,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return p(this,e,r);case"utf8":case"utf-8":return l(this,e,r);case"ascii":return f(this,e,r);case"binary":return h(this,e,r);case"base64":return c(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return 0===t.compare(this,e)},t.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return t.compare(this,e)},t.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},t.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},t.prototype.write=function(t,e,r,c){if(isFinite(e))isFinite(r)||(c=r,r=void 0);else{var l=c;c=e,e=r,r=l}e=Number(e)||0;var f=this.length-e;r?(r=Number(r),r>f&&(r=f)):r=f,c=String(c||"utf8").toLowerCase();var h;switch(c){case"hex":h=n(this,t,e,r);break;case"utf8":case"utf-8":h=i(this,t,e,r);break;case"ascii":h=o(this,t,e,r);break;case"binary":h=s(this,t,e,r);break;case"base64":h=a(this,t,e,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=u(this,t,e,r);break;default:throw new TypeError("Unknown encoding: "+c)}return h},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,r){var n=this.length;if(e=~~e,r=void 0===r?n:~~r,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>r?(r+=n,0>r&&(r=0)):r>n&&(r=n),e>r&&(r=e),t.TYPED_ARRAY_SUPPORT)return t._augment(this.subarray(e,r));for(var i=r-e,o=new t(i,void 0,!0),s=0;i>s;s++)o[s]=this[s+e];return o},t.prototype.readUInt8=function(t,e){return e||y(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||y(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||y(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||y(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||y(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readInt8=function(t,e){return e||y(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},t.prototype.readInt16LE=function(t,e){e||y(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||y(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||y(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||y(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||y(t,4,this.length),R.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||y(t,4,this.length),R.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||y(t,8,this.length),R.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||y(t,8,this.length),R.read(this,t,!1,52,8)},t.prototype.writeUInt8=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):v(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):v(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e):m(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):m(this,e,r,!1),r+4},t.prototype.writeInt8=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[r]=e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):v(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):v(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):m(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r>>>=0,n||g(this,e,r,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):m(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return b(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return b(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return w(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return w(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),r||(r=0),i!==n&&0!==e.length&&0!==o.length){if(n>i)throw new TypeError("sourceEnd < sourceStart");if(0>r||r>=e.length)throw new TypeError("targetStart out of bounds");if(0>n||n>=o.length)throw new TypeError("sourceStart out of bounds");if(0>i||i>o.length)throw new TypeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-rs||!t.TYPED_ARRAY_SUPPORT)for(var a=0;s>a;a++)e[a+r]=this[a+n];else e._set(this.subarray(n,n+s),r)}},t.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new TypeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new TypeError("start out of bounds");if(0>r||r>this.length)throw new TypeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=O(t.toString()),o=i.length;for(n=e;r>n;n++)this[n]=i[n%o]}return this}},t.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(t.TYPED_ARRAY_SUPPORT)return new t(this).buffer;for(var e=new Uint8Array(this.length),r=0,n=e.length;n>r;r+=1)e[r]=this[r];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var U=t.prototype;t._augment=function(e){return e.constructor=t,e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=U.get,e.set=U.set,e.write=U.write,e.toString=U.toString,e.toLocaleString=U.toString,e.toJSON=U.toJSON,e.equals=U.equals,e.compare=U.compare,e.copy=U.copy,e.slice=U.slice,e.readUInt8=U.readUInt8,e.readUInt16LE=U.readUInt16LE,e.readUInt16BE=U.readUInt16BE,e.readUInt32LE=U.readUInt32LE,e.readUInt32BE=U.readUInt32BE,e.readInt8=U.readInt8,e.readInt16LE=U.readInt16LE,e.readInt16BE=U.readInt16BE,e.readInt32LE=U.readInt32LE,e.readInt32BE=U.readInt32BE,e.readFloatLE=U.readFloatLE,e.readFloatBE=U.readFloatBE,e.readDoubleLE=U.readDoubleLE,e.readDoubleBE=U.readDoubleBE,e.writeUInt8=U.writeUInt8,e.writeUInt16LE=U.writeUInt16LE,e.writeUInt16BE=U.writeUInt16BE,e.writeUInt32LE=U.writeUInt32LE,e.writeUInt32BE=U.writeUInt32BE,e.writeInt8=U.writeInt8,e.writeInt16LE=U.writeInt16LE,e.writeInt16BE=U.writeInt16BE,e.writeInt32LE=U.writeInt32LE,e.writeInt32BE=U.writeInt32BE,e.writeFloatLE=U.writeFloatLE,e.writeFloatBE=U.writeFloatBE,e.writeDoubleLE=U.writeDoubleLE,e.writeDoubleBE=U.writeDoubleBE,e.fill=U.fill,e.inspect=U.inspect,e.toArrayBuffer=U.toArrayBuffer,e};var L=/[^+\/0-9A-z]/g}).call(e,r(57).Buffer)},function(t,e,r){"use strict";function n(t,e,r){try{return t.call(e,r)}catch(n){return E.e=n,E}}function i(t,e,r,n){try{return t.call(e,r,n)}catch(i){return E.e=i,E}}function o(t,e,r,n,i){try{return t.call(e,r,n,i)}catch(o){return E.e=o,E}}function s(t,e,r,n,i,o){try{return t.call(e,r,n,i,o)}catch(s){return E.e=s,E}}function a(t,e,r){try{return t.apply(r,e)}catch(n){return E.e=n,E}}function u(t){return"string"==typeof t?t:""+t}function c(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function l(t){return!c(t)}function f(t){return c(t)?new Error(u(t)):t}function h(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function p(t,e,r){if(!b.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function d(t,e,r){if(c(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return b.defineProperty(t,e,n),t}function y(t){throw t}function g(t){try{if("function"==typeof t){var e=b.keys(t.prototype);return e.length>0&&!(1===e.length&&"constructor"===e[0])}return!1}catch(r){return!1}}function v(t){function e(){}return e.prototype=t,e}function m(t){return P.test(t)}function _(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}var b=r(92),w=function(){try{var t={};return b.defineProperty(t,"f",{get:function(){return 3}}),3===t.f}catch(e){return!1}}(),j="undefined"==typeof navigator,E={e:{}},x=function(t,e){function r(){this.constructor=t,this.constructor$=e;for(var r in e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}var n={}.hasOwnProperty;return r.prototype=e.prototype,t.prototype=new r,t.prototype},A=function(){return"string"!==this}.call("string"),O=function(){return b.isES5?function(t,e){for(var r=[],n=Object.create(null),i=Object(e).includeHidden?Object.getOwnPropertyNames:Object.keys;null!=t;){var o;try{o=i(t)}catch(s){return r}for(var a=0;a0},n.prototype.invokeLater=function(t,e,r){void 0===u||null==u.domain||t.domain||(t=u.domain.bind(t)),this._lateBuffer.push(t,e,r),this._queueTick()},n.prototype.invoke=function(t,e,r){void 0===u||null==u.domain||t.domain||(t=u.domain.bind(t));var n=this._functionBuffer;n.push(t,e,r),this._length=n.length(),this._queueTick()},n.prototype._consumeFunctionBuffer=function(){for(var t=this._functionBuffer;t.length()>0;){var e=t.shift(),r=t.shift(),n=t.shift();e.call(r,n)}this._reset(),this._consumeLateBuffer()},n.prototype._consumeLateBuffer=function(){for(var t=this._lateBuffer;t.length()>0;){var e=t.shift(),r=t.shift(),n=t.shift(),i=a(e,r,n);if(i===s){if(this._queueTick(),null==e.domain)throw i.e;e.domain.emit("error",i.e)}}},n.prototype._queueTick=function(){this._isTickUsed||(this._schedule(this.consumeFunctionBuffer),this._isTickUsed=!0)},n.prototype._reset=function(){this._isTickUsed=!1,this._length=0},t.exports=new n}).call(e,r(51))},function(t,e,r){"use strict";function n(t){try{d(t,"isOperational",!0)}catch(e){}}function i(t){return null==t?!1:t instanceof u||t.isOperational===!0}function o(t){return t instanceof Error}function s(t){return o(t)}function a(t,e){function r(n){return this instanceof r?(this.message="string"==typeof n?n:e,this.name=t,void(Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new r(n)}return p(r,Error),r}function u(t){this.name="OperationalError",this.message=t,this.cause=t,this.isOperational=!0,t instanceof Error?(this.message=t.message,this.stack=t.stack):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}var c,l,f=r(92).freeze,h=r(58),p=h.inherits,d=h.notEnumerableProp,y=a("CancellationError","cancellation error"),g=a("TimeoutError","timeout error"),v=a("AggregateError","aggregate error");try{c=TypeError,l=RangeError}catch(m){c=a("TypeError","type error"),l=a("RangeError","range error")}for(var _="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),b=0;b<_.length;++b)"function"==typeof Array.prototype[_[b]]&&(v.prototype[_[b]]=Array.prototype[_[b]]);v.prototype.length=0,v.prototype.isOperational=!0;var w=0;v.prototype.toString=function(){var t=Array(4*w+1).join(" "),e="\n"+t+"AggregateError of:\n";w++,t=Array(4*w+1).join(" ");for(var r=0;rp;++p){var d=n(o[p],void 0);d instanceof t?d.isPending()?d._proxyPromiseArray(this,p):(d._unsetRejectionIsUnhandled(),h=!0):h=!0,f[p]=d}this._values=f,this._length=l,h&&this._scanDirectValues(a)},o.prototype._settlePromiseAt=function(e){var r=this._values[e];r instanceof t?r.isFulfilled()?this._promiseFulfilled(r._settledValue,e):r.isRejected()&&this._promiseRejected(r._settledValue,e):this._promiseFulfilled(r,e)},o.prototype._scanDirectValues=function(t){for(var e=0;t>e&&!this._isResolved();++e)this._settlePromiseAt(e)},o.prototype._isResolved=function(){return null===this._values},o.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},o.prototype.__hardReject__=o.prototype._reject=function(t){this._values=null;var e=s(t)?t:new Error(t+"");this._promise._attachExtraTrace(e),this._promise._reject(t,e)},o.prototype._promiseProgressed=function(t,e){this._isResolved()||this._promise._progress({index:e,value:t})},o.prototype._promiseFulfilled=function(t,e){if(!this._isResolved()){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)}},o.prototype._promiseRejected=function(t){this._isResolved()||(this._totalResolved++,this._reject(t))},o.prototype.shouldCopyValues=function(){return!0},o.prototype.getActualLength=function(t){return t},o}},function(t,e,r){"use strict";t.exports=function(){function t(t){var r;if("function"==typeof t)r="[function "+(t.name||"anonymous")+"]";else{r=t.toString();var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(r))try{var i=JSON.stringify(t);r=i}catch(o){}0===r.length&&(r="(empty array)")}return"(<"+e(r)+">, no stack trace)"}function e(t){var e=41;return t.length=0;--o)if(e[o]===n){i=o;break}for(var o=i;o>=0;--o){var u=e[o];if(t[r]!==u)break;t.pop(),r--}t.push("From previous event:");for(var c=t.concat(e),l=[],o=0,f=c.length;f>o;++o)s.test(c[o])&&a.test(c[o])||o>0&&!a.test(c[o])&&"From previous event:"!==c[o]||l.push(c[o]);return l},n.protectErrorMessageNewlines=function(t){for(var e=0;e=e)){for(var r=[],n=0;e>n;++n)r.push(t.shift());t.unshift(r.join("\x00"))}},n.isSupported=function(){return"function"==typeof c};var c=function l(){if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){a=/^\s*at\s*/,u=function(e,r){return"string"==typeof e?e:void 0!==r.name&&void 0!==r.message?r.name+". "+r.message:t(r)};var e=Error.captureStackTrace;return function(t,r){e(t,r)}}var r=new Error;if("string"==typeof r.stack&&"function"==typeof"".startsWith&&r.stack.startsWith("stackDetection@")&&"stackDetection"===l.name){o(Error,"stackTraceLimit",{writable:!0,enumerable:!1,configurable:!1,value:25}),a=/@/;var n=/[@\n]/;return u=function(e,r){return"string"==typeof e?r.name+". "+r.message+"\n"+e:void 0!==r.name&&void 0!==r.message?r.name+". "+r.message:t(r)},function(t){for(var e=(new Error).stack,r=e.split(n),i=r.length,o="",s=0;i>s;s+=2)o+=r[s],o+="@",o+=r[s+1],o+="\n";t.stack=o}}return u=function(e,r){return"string"==typeof e?e:"object"!=typeof r&&"function"!=typeof r||void 0===r.name||void 0===r.message?t(r):r.name+". "+r.message},null}();return n}},function(t,e,r){"use strict";t.exports=function(t){function e(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t,r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function"),a):n}var i=r(58),o=r(60),s=i.tryCatch1,a=i.errorObj,u=r(92).keys,c=o.TypeError;return e.prototype.doFilter=function(e){for(var r=this._callback,i=this._promise,u=i._boundTo,c=0,l=this._instances.length;l>c;++c){var f=this._instances[c],h=f===Error||null!=f&&f.prototype instanceof Error;if(h&&e instanceof f){var p=s(r,u,e);return p===a?(t.e=p.e,t):p}if("function"==typeof f&&!h){var d=n(f,e);if(d===a){var y=o.canAttach(a.e)?a.e:new Error(a.e+"");this._promise._attachExtraTrace(y),e=a.e;break}if(d){var p=s(r,u,e);return p===a?(t.e=p.e,t):p}}}return t.e=e,t},e}},function(t,e,r){"use strict";function n(t){return t instanceof Error&&d.getPrototypeOf(t)===Error.prototype}function i(t){var e;return e=n(t)?new f(t):t,c.markAsOriginatingFromRejection(e),e}function o(t){function e(e,r){if(null!==t){if(e){var n=i(u(e));t._attachExtraTrace(n),t._reject(n)}else if(arguments.length>2){for(var o=arguments.length,s=new Array(o-1),a=1;o>a;++a)s[a-1]=arguments[a];t._fulfill(s)}else t._fulfill(r);t=null}}return e}var s,a=r(58),u=a.maybeWrapAsError,c=r(60),l=c.TimeoutError,f=c.OperationalError,h=r(59),p=a.haveGetters,d=r(92);if(s=p?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=o(t),this.callback=this.asCallback},p){var y={get:function(){return o(this.promise)}};d.defineProperty(s.prototype,"asCallback",y),d.defineProperty(s.prototype,"callback",y)}s._nodebackForPromise=o,s.prototype.toString=function(){return"[object PromiseResolver]"},s.prototype.resolve=s.prototype.fulfill=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.");var e=this.promise;e._tryFollow(t)||h.invoke(e._fulfill,e,t)},s.prototype.reject=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.");var e=this.promise;c.markAsOriginatingFromRejection(t);var r=c.canAttach(t)?t:new Error(t+"");e._attachExtraTrace(r),h.invoke(e._reject,e,t),r!==t&&h.invoke(this._setCarriedStackTrace,this,r)},s.prototype.progress=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.");h.invoke(this.promise._progress,this.promise,t)},s.prototype.cancel=function(){h.invoke(this.promise.cancel,this.promise,void 0)},s.prototype.timeout=function(){this.reject(new l("timeout"))},s.prototype.isResolved=function(){return this.promise.isResolved()},s.prototype.toJSON=function(){return this.promise.toJSON()},s.prototype._setCarriedStackTrace=function(t){this.promise.isRejected()&&this.promise._setCarriedStackTrace(t)},t.exports=s},function(t,e,r){"use strict";t.exports=function(t){function e(e){var r=new n(e),i=t.rejected(r),o=i._peekContext();return null!=o&&o._attachExtraTrace(r),i}var n=r(60).TypeError;return e}},function(t,e,r){"use strict";t.exports=function(t,e,n){function i(){return this}function o(){throw this}function s(t){return function(){return t}}function a(t){return function(){throw t}}function u(t,e,r){var n;return n=h&&p(e)?r?s(e):a(e):r?i:o,t._then(n,d,void 0,e,void 0)}function c(r){var i=this.promise,o=this.handler,s=i._isBound()?o.call(i._boundTo):o();if(void 0!==s){var a=n(s,void 0);if(a instanceof t)return u(a,r,i.isFulfilled())}return i.isRejected()?(e.e=r,e):r}function l(e){var r=this.promise,i=this.handler,o=r._isBound()?i.call(r._boundTo,e):i(e);if(void 0!==o){var s=n(o,void 0);if(s instanceof t)return u(s,e,!0)}return e}var f=r(58),h=f.wrapsPrimitiveReceiver,p=f.isPrimitive,d=f.thrower;t.prototype._passThroughHandler=function(t,e){if("function"!=typeof t)return this.then();var r={promise:this,handler:t};return this._then(e?c:l,e?c:void 0,void 0,r,void 0)},t.prototype.lastly=t.prototype["finally"]=function(t){return this._passThroughHandler(t,!0)},t.prototype.tap=function(t){return this._passThroughHandler(t,!1)}}},function(t,e,r){"use strict";var n=r(58),i=n.isPrimitive,o=n.wrapsPrimitiveReceiver;t.exports=function(t){var e=function(){return this},r=function(){throw this},n=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(t){return o&&i(t)?this._then(n(t,2),void 0,void 0,void 0,void 0):this._then(e,void 0,void 0,t,void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return o&&i(t)?this._then(n(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},function(t){"use strict";t.exports=function(t){function e(t){void 0!==t?(this._bitField=t._bitField,this._settledValue=t.isResolved()?t._settledValue:void 0):(this._bitField=0,this._settledValue=void 0)}e.prototype.isFulfilled=t.prototype.isFulfilled=function(){return(268435456&this._bitField)>0},e.prototype.isRejected=t.prototype.isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype.isPending=function(){return 0===(402653184&this._bitField)},e.prototype.value=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise");return this._settledValue},e.prototype.error=e.prototype.reason=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise");return this._settledValue},e.prototype.isResolved=t.prototype.isResolved=function(){return(402653184&this._bitField)>0},t.PromiseInspection=e}},function(t,e,r){"use strict";t.exports=function(t,e,n,i){function o(t){this._reject(t)}var s=r(58),a=s.canEvaluate,u=s.tryCatch1,c=s.errorObj;if(a){for(var l=function(t){return new Function("value","holder"," \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g,t))},f=function(t){for(var e=[],r=1;t>=r;++r)e.push("holder.p"+r);return new Function("holder"," \n 'use strict'; \n var callback = holder.fn; \n return callback(values); \n ".replace(/values/g,e.join(", ")))},h=[],p=[void 0],d=1;5>=d;++d)h.push(l(d)),p.push(f(d));var y=function(t,e){this.p1=this.p2=this.p3=this.p4=this.p5=null,this.fn=e,this.total=t,this.now=0};y.prototype.callers=p,y.prototype.checkFulfillment=function(t){var e=this.now;e++;var r=this.total;if(e>=r){var n=this.callers[r],i=u(n,void 0,this);i===c?t._rejectUnchecked(i.e):t._tryFollow(i)||t._fulfillUnchecked(i)}else this.now=e}}t.join=function(){var r,s=arguments.length-1;if(s>0&&"function"==typeof arguments[s]&&(r=arguments[s],6>s&&a)){var u=new t(i);u._setTrace(void 0);for(var c=new y(s,r),l=h,f=0;s>f;++f){var p=n(arguments[f],void 0);p instanceof t?p.isPending()?p._then(l[f],o,void 0,u,c):p.isFulfilled()?l[f].call(u,p._settledValue,c):(u._reject(p._settledValue),p._unsetRejectionIsUnhandled()):l[f].call(u,p,c)}return u}for(var d=arguments.length,g=new Array(d),v=0;d>v;++v)g[v]=arguments[v];var u=new e(g).promise();return void 0!==r?u.spread(r):u}}},function(t,e,r){"use strict";var n=function(t,e){var r=arguments.length,n=arguments[2],i=arguments[3],o=r>=5?arguments[4]:void 0;return setTimeout(function(){t(n,i,o)},0|e)};t.exports=function(t,e,i){function o(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function s(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var a=(r(58),r(60)),u=(r(66)(t),t.TimeoutError),c=function(t,e,r){if(t.isPending()){"string"!=typeof e&&(e="operation timed out after "+r+" ms");var n=new u(e);a.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._cancel(n)}},l=function(t,e){e._fulfill(t)},f=t.delay=function(r,o){void 0===o&&(o=r,r=void 0),o=+o;var s=i(r,void 0),a=new t(e);return s instanceof t?(a._propagateFrom(s,7),a._follow(s),a.then(function(e){return t.delay(e,o)})):(a._setTrace(void 0),n(l,o,r,a),a)};t.prototype.delay=function(t){return f(this,t)},t.prototype.timeout=function(r,i){r=+r;var a=new t(e);a._propagateFrom(this,7),a._follow(this);var u=n(c,r,a,i,r);return a.cancellable()._then(o,s,void 0,u,void 0)}}},function(t,e,r){"use strict";t.exports=function(t,e,n){function i(r,i){var c=n(r,void 0);if(c instanceof t)return a(c);if(!s(r))return o("expecting an array, a promise or a thenable");var l=new t(e);void 0!==i?l._propagateFrom(i,7):l._setTrace(void 0);for(var f=l._fulfill,h=l._reject,p=0,d=r.length;d>p;++p){var y=r[p];(void 0!==y||u.call(r,p))&&t.cast(y)._then(f,h,void 0,l,null)}return l}var o=r(66)(t),s=r(58).isArray,a=function(t){return t.then(function(e){return i(e,t)})},u={}.hasOwnProperty;t.race=function(t){return i(t,void 0)},t.prototype.race=function(){return i(this,void 0)}}},function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}t.exports=function(t){function e(t){return new Function("obj"," \n 'use strict' \n var len = this.length; \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: return obj.methodName.apply(obj, this); \n } \n ".replace(/methodName/g,t)) -}function n(t){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",t))}function s(t,e,r){var n=r[t];if("function"!=typeof n){if(!d(t))return null;if(n=e(t),r[t]=n,r[" size"]++,r[" size"]>512){for(var i=Object.keys(r),o=0;256>o;++o)delete r[i[o]];r[" size"]=i.length-256}}return n}function a(t){return s(t,e,i)}function u(t){return s(t,n,o)}function c(t){return t[this.pop()].apply(t,this)}function l(t){return t[this]}function f(t){return t[this]}var h=r(58),p=h.canEvaluate,d=h.isIdentifier;t.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),n=1;e>n;++n)r[n-1]=arguments[n];if(p){var i=a(t);if(null!==i)return this._then(i,void 0,void 0,r,void 0)}return r.push(t),this._then(c,void 0,void 0,r,void 0)},t.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=f;else if(p){var n=u(t);e=null!==n?n:l}else e=l;return this._then(e,void 0,void 0,t,void 0)}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i){function o(e,r){for(var n=f,s=t,a=r.length,u=0;a>u;++u){var c=h(r[u],void 0,e);if(c===n)return s.reject(n.e);var l=i(c,o);if(l instanceof s)return l}return null}function s(e,r,i){var o=this._promise=new t(n);o._setTrace(void 0),this._generatorFunction=e,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(p):p}var a=r(60),u=a.TypeError,c=r(58).deprecated,l=r(58),f=l.errorObj,h=l.tryCatch1,p=[];s.prototype.promise=function(){return this._promise},s.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._next(void 0)},s.prototype._continue=function(e){if(e===f){this._generator=void 0;var r=a.canAttach(e.e)?e.e:new Error(e.e+"");return this._promise._attachExtraTrace(r),void this._promise._reject(e.e,r)}var n=e.value;if(e.done===!0)this._generator=void 0,this._promise._tryFollow(n)||this._promise._fulfill(n);else{var s=i(n,void 0);if(!(s instanceof t)&&(s=o(s,this._yieldHandlers),null===s))return void this._throw(new u("A value was yielded that could not be treated as a promise"));s._then(this._next,this._throw,void 0,this,null)}},s.prototype._throw=function(t){a.canAttach(t)&&this._promise._attachExtraTrace(t),this._continue(h(this._generator["throw"],this._generator,t))},s.prototype._next=function(t){this._continue(h(this._generator.next,this._generator,t))},t.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function");var r=Object(e).yieldHandler,n=s;return function(){var e=t.apply(this,arguments),i=new n(void 0,void 0,r);return i._generator=e,i._next(void 0),i.promise()}},t.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new u("fn must be a function");p.push(t)},t.spawn=function(r){if(c("Promise.spawn is deprecated. Use Promise.coroutine instead."),"function"!=typeof r)return e("generatorFunction must be a function");var n=new s(r,this),i=n.promise();return n._run(t.spawn),i}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i,o){function s(t,e,r,n){this.constructor$(t),this._callback=e,this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:h,this._init$(void 0,-2)}function a(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var u=r(58),c=u.tryCatch3,l=u.errorObj,f={},h=[];u.inherits(s,e),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(e,r){var n=this._values;if(null!==n){var o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===f){if(n[r]=e,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=e,void this._queue.push(r);null!==s&&(s[r]=e);var u=this._callback,h=this._promise._boundTo,p=c(u,h,e,r,o);if(p===l)return this._reject(p.e);var d=i(p,void 0);if(d instanceof t){if(d.isPending())return a>=1&&this._inFlight++,n[r]=f,d._proxyPromiseArray(this,r);if(!d.isFulfilled())return d._unsetRejectionIsUnhandled(),this._reject(d.reason());p=d.value()}n[r]=p}var y=++this._totalResolved;y>=o&&(null!==s?this._filter(n,s):this._resolve(n))}},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function"):a(this,t,e,null).promise()},t.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function"):a(t,e,r,i).promise()}}},function(t,e,r){"use strict";t.exports=function(t){function e(t){throw t}function n(t,r){if(!s.isArray(t))return i(t,r);var n=s.tryCatchApply(this,[null].concat(t),r);n===l&&a.invokeLater(e,void 0,n.e)}function i(t,r){var n=this,i=void 0===t?c(n,r,null):u(n,r,null,t);i===l&&a.invokeLater(e,void 0,i.e)}function o(t,r){var n=this,i=c(n,r,t);i===l&&a.invokeLater(e,void 0,i.e)}var s=r(58),a=r(59),u=s.tryCatch2,c=s.tryCatch1,l=s.errorObj;t.prototype.nodeify=function(t,e){if("function"==typeof t){var r=i;void 0!==e&&Object(e).spread&&(r=n),this._then(r,o,void 0,t,this._boundTo)}return this}}},function(t,e,r){"use strict";t.exports=function(t,e){function n(t){return t.replace(/([$])/,"\\$")}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=m.getDataPropertyOrDefault(t,e+r,O);return n?i(n):!1}function s(t,e,r){for(var n=0;n=r;--n)n!==t&&e.push(n);for(var n=t+1;5>=n;++n)e.push(n);return e}function c(t){return m.filledRange(t,"arguments[","]")}function l(t){return m.filledRange(t,"_arg","")}function f(t){return"number"==typeof t.length?Math.max(Math.min(t.length,1024),0):0}function h(t){return m.isIdentifier(t)?"."+t:"['"+t.replace(/(['\\])/g,"\\$1")+"']"}function p(r,n,i,o,s){function a(t){var e,i=c(t).join(", "),o=t>0?", ":"";return e="string"==typeof r?" \n this.method({{args}}, fn); \n break; \n ".replace(".method",h(r)):n===v?" \n callback.call(this, {{args}}, fn); \n break; \n ":void 0!==n?" \n callback.call(receiver, {{args}}, fn); \n break; \n ":" \n callback({{args}}, fn); \n break; \n ",e.replace("{{args}}",i).replace(", ",o)}function p(){for(var t="",e=0;eu;u+=2){var l=s[u],f=s[u+1],h=l+e;t[h]=i===P?P(l,v,l,f,e):i(f)}return m.toFastProperties(t),t}function g(t,e){return P(t,e,void 0,t)}var v={},m=r(58),_=r(65)._nodebackForPromise,b=m.withAppended,w=m.maybeWrapAsError,j=m.canEvaluate,E=r(60).TypeError,x="Async",A=function(t,e){return m.isIdentifier(t)&&"_"!==t.charAt(0)&&!m.isClass(e)},O={__isPromisified__:!0},P=j?p:d;t.promisify=function(t,e){if("function"!=typeof t)throw new E("fn must be a function");return i(t)?t:g(t,arguments.length<2?v:e)},t.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new E("the target of promisifyAll must be an object or a function");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=x);var n=e.filter;"function"!=typeof n&&(n=A);var i=e.promisifier;if("function"!=typeof i&&(i=P),!m.isIdentifier(r))throw new RangeError("suffix must be a valid identifier");for(var o=m.inheritedDataKeys(t,{includeHidden:!0}),s=0;si;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function o(e){var r,o=n(e,void 0);return u(o)?(r=o instanceof t?o._then(t.props,void 0,void 0,void 0,void 0):new i(o).promise(),o instanceof t&&r._propagateFrom(o,4),r):a("cannot await properties of a non-object")}var s=r(58),a=r(66)(t),u=s.isObject,c=r(92);s.inherits(i,e),i.prototype._init=function(){this._init$(void 0,-3)},i.prototype._promiseFulfilled=function(t,e){if(!this._isResolved()){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}}},i.prototype._promiseProgressed=function(t,e){this._isResolved()||this._promise._progress({key:this._values[e+this.length()],value:t})},i.prototype.shouldCopyValues=function(){return!1},i.prototype.getActualLength=function(t){return t>>1},t.prototype.props=function(){return o(this)},t.props=function(t){return o(t)}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i,o){function s(e,r,n,s){this.constructor$(e),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var a=i(n,void 0),u=!1,c=a instanceof t;c&&(a.isPending()?a._proxyPromiseArray(this,-1):a.isFulfilled()?(n=a.value(),this._gotAccum=!0):(a._unsetRejectionIsUnhandled(),this._reject(a.reason()),u=!0)),c||this._zerothIsAccum||(this._gotAccum=!0),this._callback=r,this._accum=n,u||this._init$(void 0,-5)}function a(t,e,r,i){if("function"!=typeof e)return n("fn must be a function");var o=new s(t,e,r,i);return o.promise()}var u=r(58),c=u.tryCatch4,l=u.tryCatch3,f=u.errorObj;u.inherits(s,e),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(e,r){var n=this._values;if(null!==n){var o,s=this.length(),a=this._preservedValues,u=null!==a,h=this._gotAccum,p=this._valuesPhase;if(!p)for(p=this._valuesPhase=Array(s),o=0;s>o;++o)p[o]=0;if(o=p[r],0===r&&this._zerothIsAccum?(h||(this._accum=e,this._gotAccum=h=!0),p[r]=0===o?1:2):-1===r?h||(this._accum=e,this._gotAccum=h=!0):0===o?p[r]=1:(p[r]=2,h&&(this._accum=e)),h){for(var d,y=this._callback,g=this._promise._boundTo,v=this._reducingIndex;s>v;++v)if(o=p[v],2!==o){if(1!==o)return;if(e=n[v],e instanceof t){if(!e.isFulfilled())return e.isPending()?void 0:(e._unsetRejectionIsUnhandled(),this._reject(e.reason()));e=e._settledValue}if(u?(a.push(e),d=l(y,g,e,v,s)):d=c(y,g,this._accum,e,v,s),d===f)return this._reject(d.e);var m=i(d,void 0);if(m instanceof t){if(m.isPending())return p[v]=4,m._proxyPromiseArray(this,v);if(!m.isFulfilled())return m._unsetRejectionIsUnhandled(),this._reject(m.reason());d=m.value()}this._reducingIndex=v+1,this._accum=d}else this._reducingIndex=v+1;this._reducingIndex=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){if(!this._isResolved()){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)}},n.prototype._promiseRejected=function(t,e){if(!this._isResolved()){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)}},t.settle=function(t){return new n(t).promise()},t.prototype.settle=function(){return new n(this).promise()}}},function(t,e,r){"use strict";t.exports=function(t,e,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer");var r=new i(t),o=r.promise();return o.isRejected()?o:(r.setHowMany(e),r.init(),o)}var s=r(58),a=r(60).RangeError,u=r(60).AggregateError,c=s.isArray;s.inherits(i,e),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._isResolved()||(this._howMany=t)},i.prototype._promiseFulfilled=function(t){this._isResolved()||(this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values)))},i.prototype._promiseRejected=function(t){if(!this._isResolved()&&(this._addRejected(t),this.howMany()>this._canPossiblyFulfill())){for(var e=new u,r=this.length();rs;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof t)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:r}):i.invoke(o,u,r);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,r,u):c instanceof t&&c._isProxied()?c._progressUnchecked(r):c instanceof e&&c._promiseProgressed(r,u)}}}}},function(t,e,r){"use strict";t.exports=function(t,e){var n=r(60),i=n.canAttach,o=r(59),s=n.CancellationError;t.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._attachExtraTrace(t),r._rejectUnchecked(t)},t.prototype.cancel=function(t){return this.isCancellable()?(t=void 0!==t?i(t)?t:new Error(t+""):new s,o.invokeLater(this._cancel,this,t),this):this},t.prototype.cancellable=function(){return this._cancellable()?this:(this._setCancellable(),this._cancellationParent=void 0,this)},t.prototype.uncancellable=function(){var r=new t(e);return r._propagateFrom(this,6),r._follow(this),r._unsetCancellable(),r},t.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},function(t){"use strict";t.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,i){return r(t,n,i,e)}}},function(t){"use strict";t.exports=function(t){function e(t){var e=new r(t),n=e.promise();return n.isRejected()?n:(e.setHowMany(1),e.setUnwrap(),e.init(),n)}var r=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},function(t){"use strict";t.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},function(t,e,r){"use strict";t.exports=function(t,e,n){function i(e){for(var r=e.length,n=0;r>n;++n){var i=e[n];if(i.isRejected())return t.reject(i.error());e[n]=i.value()}return e}function o(t){setTimeout(function(){throw t},0)}function s(t){var e=n(t,void 0);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function a(e,r){function i(){if(a>=u)return c.resolve();var l=s(e[a++]);if(l instanceof t&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),void 0)}catch(f){return o(f)}if(l instanceof t)return l._then(i,o,null,null,null)}i()}var a=0,u=e.length,c=t.defer();return i(),c.promise}function u(t){var e=new d;return e._settledValue=t,e._bitField=268435456,a(this,e).thenReturn(t)}function c(t){var e=new d;return e._settledValue=t,e._bitField=134217728,a(this,e).thenThrow(t)}function l(t,e){this._data=t,this._promise=e}function f(t,e){this.constructor$(t,e)}var h=r(60).TypeError,p=r(58).inherits,d=t.PromiseInspection;l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},l.prototype.tryDispose=function(t){var e=this.resource(),r=null!==e?this.doDispose(e,t):null;return this._promise._unsetDisposable(),this._data=this._promise=null,r},l.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},p(f,l),f.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},t.using=function(){var r=arguments.length;if(2>r)return e("you must pass at least 2 arguments to Promise.using");var n=arguments[r-1];if("function"!=typeof n)return e("fn must be a function");r--;for(var o=new Array(r),s=0;r>s;++s){var a=arguments[s];if(l.isDisposer(a)){var f=a;a=a.promise(),a._setDisposable(f)}o[s]=a}return t.settle(o).then(i).spread(n)._then(u,c,void 0,o,void 0)},t.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},t.prototype._isDisposable=function(){return(262144&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},t.prototype.disposer=function(t){if("function"==typeof t)return new f(t,this);throw new h}}},function(t,e,r){function n(t,e,r,n,i){var o={result:t};return t||(o.path=e,o.reason=r,o.a=n,o.b=i),o}function i(t){for(var e=arguments,r=1,n=e.length;n>r;r++)t=t.replace(/%s/,e[r]);return t}function o(t,e,r,y,g){if(g=g||[],t===e)return n(0!==t||1/t==1/e,g,c.PLUS_0_AND_MINUS_0,t,e);var v,m=s(t),_=s(e);if(m!==_)return n(!1,g,i(c.DIFFERENT_TYPES,m,_),t,e);switch(m){case"number":return t!==t?n(e!==e,g,c.NAN_NUMBER,t,e):0===t?n(1/t===1/e,g,c.PLUS_0_AND_MINUS_0,t,e):n(t===e,g,c.EQUALITY,t,e);case"regexp":return n(String(t)===String(e),g,c.EQUALITY,t,e);case"boolean":case"string":return n(t===e,g,c.EQUALITY,t,e);case"date":return n(+t===+e,g,c.EQUALITY,t,e);case"object-number":case"object-boolean":case"object-string":var b=t.valueOf()===e.valueOf();if(b)break;return n(!1,g,c.WRAPPED_VALUE,t.valueOf(),e.valueOf());case"buffer":if(t.length!==e.length)return n(!1,g.concat(l),c.EQUALITY,t.length,e.length);for(v=t.length;v--;)if(t[v]!==e[v])return n(!1,g.concat([v]),c.EQUALITY,t[v],e[v]);return u;case"error":if(t.name!==e.name)return n(!1,g.concat(f),c.EQUALITY,t.name,e.name);if(t.message!==e.message)return n(!1,g.concat(h),c.EQUALITY,t.message,e.message);break;case"array-buffer":if(t.byteLength!==e.byteLength)return n(!1,g.concat(p),c.EQUALITY,t.byteLength,e.byteLength);for(v=t.byteLength;v--;)if(t[v]!==e[v])return n(!1,g.concat([v]),c.EQUALITY,t[v],e[v]);return u}for(r||(r=[]),y||(y=[]),v=r.length;v--;)if(r[v]==t)return n(y[v]==e,g,c.CIRCULAR_VALUES,t,e);r.push(t),y.push(e);var w,j,E;if(("array"===m||"arguments"===m)&&t.length!==e.length)return n(!1,g.concat(l),c.EQUALITY,t.length,e.length);if("function"===_){var x=t.toString(),A=e.toString();if(x!==A)return n(!1,g,c.FUNCTION_SOURCES,x,A)}for(E in e)if(a.call(e,E)){if(w=a.call(t,E),!w)return n(!1,g,i(c.MISSING_KEY,"A",E),t,e);if(j=o(t[E],e[E],r,y,g.concat([E])),!j.result)return j}for(E in t)if(a.call(t,E)&&(w=a.call(e,E),!w))return n(!1,g,i(c.MISSING_KEY,"B",E),t,e);return r.pop(),y.pop(),"function"!==_||(j=o(t.prototype,e.prototype,r,y,g.concat(d)),j.result)?u:j}var s=r(99),a=Object.prototype.hasOwnProperty,u=n(!0),c={PLUS_0_AND_MINUS_0:"+0 is not equal to -0",DIFFERENT_TYPES:"A has type %s and B has type %s",NAN_NUMBER:"NaN is not equal to any number",EQUALITY:"A is not equal to B",WRAPPED_VALUE:"A wrapped value is not equal to B wrapped value",FUNCTION_SOURCES:"function A is not equal to B by source code value (via .toString call)",MISSING_KEY:"%s does not have key %s",CIRCULAR_VALUES:"A has circular reference that was visited not in the same time as B"},l=["length"],f=["name"],h=["message"],p=["byteLength"],d=["prototype"];t.exports=o},function(t){function e(t){if(void 0===t)return"undefined";if(null===t)return"null";switch(Object.prototype.toString.call(t)){case"[object Boolean]":return"boolean";case"[object Number]":return"number";case"[object String]":return"string";case"[object RegExp]":return"regexp";case"[object Date]":return"date";case"[object Array]":return"array";default:return typeof t}}t.exports=e},function(t){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t){var e=function(){"use strict";return void 0===this}();if(e)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,keys:Object.keys,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:e};else{var r={}.hasOwnProperty,n={}.toString,i={}.constructor.prototype,o=function(t){var e=[];for(var n in t)r.call(t,n)&&e.push(n);return e},s=function(t,e,r){return t[e]=r.value,t},a=function(t){return t},u=function(t){try{return Object(t).constructor.prototype}catch(e){return i}},c=function(t){try{return"[object Array]"===n.call(t)}catch(e){return!1}};t.exports={isArray:c,keys:o,defineProperty:s,freeze:a,getPrototypeOf:u,isES5:e}}},function(t,e,r){(function(e){"use strict";var r,n;if("object"==typeof e&&"string"==typeof e.version)r=function(t){e.nextTick(t)};else if("undefined"!=typeof MutationObserver&&(n=MutationObserver)||"undefined"!=typeof WebKitMutationObserver&&(n=WebKitMutationObserver))r=function(){var t=document.createElement("div"),e=void 0,r=new n(function(){var t=e;e=void 0,t()});return r.observe(t,{attributes:!0}),function(r){e=r,t.classList.toggle("foo")}}();else{if("undefined"==typeof setTimeout)throw new Error("no async scheduler available");r=function(t){setTimeout(t,0)}}t.exports=r}).call(e,r(51))},function(t){"use strict";function e(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e]}function r(t){this._capacity=t,this._length=0,this._front=0,this._makeCapacity()}r.prototype._willBeOverCapacity=function(t){return this._capacitye;++e)this[e]=void 0},r.prototype._checkCapacity=function(t){this._capacity=r+o)e(i,r,this,0,o);else{var s=o-(r+o&n-1);e(i,r,this,0,s),e(i,0,this,s,o-s)}},t.exports=r},function(t,e,r){(function(e){var r=Object.prototype.toString,n="undefined"!=typeof Promise,i="undefined"!=typeof e,o="number",s="undefined",a="string",u="boolean",c="object",l="function",f="null",h="array",p="regexp",d="date",y="error",g="arguments",v="symbol",m="array-buffer",_="typed-array",b="data-view",w="map",j="set",E="weak-set",x="weak-map",A="promise",O="object-number",P="object-boolean",k="object-string",T="buffer",S="html-element",N="html-element-text",F="document",R="window",C="file",I="file-list",U="blob",L="xhr";t.exports=function(t){var B=typeof t;switch(B){case o:return o;case s:return s;case a:return a;case u:return u;case l:return l;case v:return v;case c:if(null===t)return f;var D=r.call(t);switch(D){case"[object String]":return k;case"[object Boolean]":return P;case"[object Number]":return O;case"[object Array]":return h;case"[object RegExp]":return p;case"[object Error]":return y;case"[object Date]":return d;case"[object Arguments]":return g;case"[object Math]":return c;case"[object JSON]":return c;case"[object ArrayBuffer]":return m;case"[object Int8Array]":return _;case"[object Uint8Array]":return _;case"[object Uint8ClampedArray]":return _;case"[object Int16Array]":return _;case"[object Uint16Array]":return _;case"[object Int32Array]":return _;case"[object Uint32Array]":return _;case"[object Float32Array]":return _;case"[object Float64Array]":return _;case"[object DataView]":return b;case"[object Map]":return w;case"[object WeakMap]":return x;case"[object Set]":return j;case"[object WeakSet]":return E;case"[object Promise]":return A;case"[object Window]":return R;case"[object HTMLDocument]":return F;case"[object Blob]":return U;case"[object File]":return C;case"[object FileList]":return I;case"[object XMLHttpRequest]":return L;case"[object Text]":return N;default:if(n&&t instanceof Promise)return A;if(i&&t instanceof e)return T;if(/^\[object HTML\w+Element\]$/.test(D))return S;if("[object Object]"===D)return c}}}}).call(e,r(57).Buffer)},function(t){t.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?0/0:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=0>e||0===e&&0>1/e?1:0; -for(e=Math.abs(e),isNaN(e)||1/0===e?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+f>=1?h/u:h*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},function(t){var e=Array.isArray,r=Object.prototype.toString;t.exports=e||function(t){return!!t&&"[object Array]"==r.call(t)}},95,function(t,e){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===s?62:e===a?63:u>e?-1:u+10>e?e-u+26+26:l+26>e?e-l:c+26>e?e-c+26:void 0}function n(t){function r(t){c[f++]=t}var n,i,s,a,u,c;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new o(3*t.length/4-u),s=u>0?t.length-4:t.length;var f=0;for(n=0,i=0;s>n;n+=4,i+=3)a=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&a)>>16),r((65280&a)>>8),r(255&a);return 2===u?(a=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&a)):1===u&&(a=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(a>>8&255),r(255&a)),c}function i(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,s,a=t.length%3,u="";for(i=0,s=t.length-a;s>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=n(o);switch(a){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(o<<4&63),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(o>>4&63),u+=e(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i}(e)}])); \ No newline at end of file +var N=r(66),F=r(64),I=r(65);e.Buffer=t,e.SlowBuffer=t,e.INSPECT_MAX_BYTES=50,t.poolSize=8192;var C=1073741823;t.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(r){return!1}}(),t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);s>o&&e[o]===r[o];o++);return o!==s&&(n=e[o],i=r[o]),i>n?-1:n>i?1:0},t.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,r){if(!I(e))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===e.length)return new t(0);if(1===e.length)return e[0];var n;if(void 0===r)for(r=0,n=0;n>>1;break;case"utf8":case"utf-8":r=O(t).length;break;case"base64":r=R(t).length;break;default:r=t.length}return r},t.prototype.length=void 0,t.prototype.parent=void 0,t.prototype.toString=function(t,e,r){var n=!1;if(e>>>=0,r=void 0===r||1/0===r?this.length:r>>>0,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return p(this,e,r);case"utf8":case"utf-8":return l(this,e,r);case"ascii":return f(this,e,r);case"binary":return h(this,e,r);case"base64":return c(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return 0===t.compare(this,e)},t.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return t.compare(this,e)},t.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},t.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},t.prototype.write=function(t,e,r,c){if(isFinite(e))isFinite(r)||(c=r,r=void 0);else{var l=c;c=e,e=r,r=l}e=Number(e)||0;var f=this.length-e;r?(r=Number(r),r>f&&(r=f)):r=f,c=String(c||"utf8").toLowerCase();var h;switch(c){case"hex":h=n(this,t,e,r);break;case"utf8":case"utf-8":h=i(this,t,e,r);break;case"ascii":h=o(this,t,e,r);break;case"binary":h=s(this,t,e,r);break;case"base64":h=a(this,t,e,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=u(this,t,e,r);break;default:throw new TypeError("Unknown encoding: "+c)}return h},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,r){var n=this.length;if(e=~~e,r=void 0===r?n:~~r,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>r?(r+=n,0>r&&(r=0)):r>n&&(r=n),e>r&&(r=e),t.TYPED_ARRAY_SUPPORT)return t._augment(this.subarray(e,r));for(var i=r-e,o=new t(i,void 0,!0),s=0;i>s;s++)o[s]=this[s+e];return o},t.prototype.readUInt8=function(t,e){return e||g(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||g(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||g(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||g(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||g(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readInt8=function(t,e){return e||g(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},t.prototype.readInt16LE=function(t,e){e||g(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||g(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||g(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||g(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||g(t,4,this.length),F.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||g(t,4,this.length),F.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||g(t,8,this.length),F.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||g(t,8,this.length),F.read(this,t,!1,52,8)},t.prototype.writeUInt8=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):v(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):v(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e):_(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):_(this,e,r,!1),r+4},t.prototype.writeInt8=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[r]=e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):v(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):v(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):_(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r>>>=0,n||y(this,e,r,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):_(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return b(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return b(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return w(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return w(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),r||(r=0),i!==n&&0!==e.length&&0!==o.length){if(n>i)throw new TypeError("sourceEnd < sourceStart");if(0>r||r>=e.length)throw new TypeError("targetStart out of bounds");if(0>n||n>=o.length)throw new TypeError("sourceStart out of bounds");if(0>i||i>o.length)throw new TypeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-rs||!t.TYPED_ARRAY_SUPPORT)for(var a=0;s>a;a++)e[a+r]=this[a+n];else e._set(this.subarray(n,n+s),r)}},t.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new TypeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new TypeError("start out of bounds");if(0>r||r>this.length)throw new TypeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=O(t.toString()),o=i.length;for(n=e;r>n;n++)this[n]=i[n%o]}return this}},t.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(t.TYPED_ARRAY_SUPPORT)return new t(this).buffer;for(var e=new Uint8Array(this.length),r=0,n=e.length;n>r;r+=1)e[r]=this[r];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var U=t.prototype;t._augment=function(e){return e.constructor=t,e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=U.get,e.set=U.set,e.write=U.write,e.toString=U.toString,e.toLocaleString=U.toString,e.toJSON=U.toJSON,e.equals=U.equals,e.compare=U.compare,e.copy=U.copy,e.slice=U.slice,e.readUInt8=U.readUInt8,e.readUInt16LE=U.readUInt16LE,e.readUInt16BE=U.readUInt16BE,e.readUInt32LE=U.readUInt32LE,e.readUInt32BE=U.readUInt32BE,e.readInt8=U.readInt8,e.readInt16LE=U.readInt16LE,e.readInt16BE=U.readInt16BE,e.readInt32LE=U.readInt32LE,e.readInt32BE=U.readInt32BE,e.readFloatLE=U.readFloatLE,e.readFloatBE=U.readFloatBE,e.readDoubleLE=U.readDoubleLE,e.readDoubleBE=U.readDoubleBE,e.writeUInt8=U.writeUInt8,e.writeUInt16LE=U.writeUInt16LE,e.writeUInt16BE=U.writeUInt16BE,e.writeUInt32LE=U.writeUInt32LE,e.writeUInt32BE=U.writeUInt32BE,e.writeInt8=U.writeInt8,e.writeInt16LE=U.writeInt16LE,e.writeInt16BE=U.writeInt16BE,e.writeInt32LE=U.writeInt32LE,e.writeInt32BE=U.writeInt32BE,e.writeFloatLE=U.writeFloatLE,e.writeFloatBE=U.writeFloatBE,e.writeDoubleLE=U.writeDoubleLE,e.writeDoubleBE=U.writeDoubleBE,e.fill=U.fill,e.inspect=U.inspect,e.toArrayBuffer=U.toArrayBuffer,e};var L=/[^+\/0-9A-z]/g}).call(e,r(61).Buffer)},function(t){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t){t.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?0/0:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+f>=1?h/u:h*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*g}},function(t){var e=Array.isArray,r=Object.prototype.toString;t.exports=e||function(t){return!!t&&"[object Array]"==r.call(t)}},function(t,e){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===s?62:e===a?63:u>e?-1:u+10>e?e-u+26+26:l+26>e?e-l:c+26>e?e-c+26:void 0}function n(t){function r(t){c[f++]=t}var n,i,s,a,u,c;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new o(3*t.length/4-u),s=u>0?t.length-4:t.length;var f=0;for(n=0,i=0;s>n;n+=4,i+=3)a=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&a)>>16),r((65280&a)>>8),r(255&a);return 2===u?(a=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&a)):1===u&&(a=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(a>>8&255),r(255&a)),c}function i(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,s,a=t.length%3,u="";for(i=0,s=t.length-a;s>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=n(o);switch(a){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(o<<4&63),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(o>>4&63),u+=e(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i}(e)}]); \ No newline at end of file