// generatedy by JSX compiler 0.9.24 (2013-04-08 17:03:43 +0900; e5eed33016a55daaee0a5e9758120d045e5093d4)
var JSX = {};
(function (JSX) {
/**
 * copies the implementations from source interface to target
 */
function $__jsx_merge_interface(target, source) {
	for (var k in source.prototype)
		if (source.prototype.hasOwnProperty(k))
			target.prototype[k] = source.prototype[k];
}

/**
 * defers the initialization of the property
 */
function $__jsx_lazy_init(obj, prop, func) {
	function reset(obj, prop, value) {
		delete obj[prop];
		obj[prop] = value;
		return value;
	}

	Object.defineProperty(obj, prop, {
		get: function () {
			return reset(obj, prop, func());
		},
		set: function (v) {
			reset(obj, prop, v);
		},
		enumerable: true,
		configurable: true
	});
}

/**
 * sideeffect().a /= b
 */
function $__jsx_div_assign(obj, prop, divisor) {
	return obj[prop] = (obj[prop] / divisor) | 0;
}

/*
 * global functions, renamed to avoid conflict with local variable names
 */
var $__jsx_parseInt = parseInt;
var $__jsx_parseFloat = parseFloat;
var $__jsx_isNaN = isNaN;
var $__jsx_isFinite = isFinite;

var $__jsx_encodeURIComponent = encodeURIComponent;
var $__jsx_decodeURIComponent = decodeURIComponent;
var $__jsx_encodeURI = encodeURI;
var $__jsx_decodeURI = decodeURI;

var $__jsx_ObjectToString = Object.prototype.toString;
var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;

/*
 * profiler object, initialized afterwards
 */
function $__jsx_profiler() {
}

/*
 * public interface to JSX code
 */
JSX.require = function (path) {
	var m = $__jsx_classMap[path];
	return m !== undefined ? m : null;
};

JSX.profilerIsRunning = function () {
	return $__jsx_profiler.getResults != null;
};

JSX.getProfileResults = function () {
	return ($__jsx_profiler.getResults || function () { return {}; })();
};

JSX.postProfileResults = function (url, cb) {
	if ($__jsx_profiler.postResults == null)
		throw new Error("profiler has not been turned on");
	return $__jsx_profiler.postResults(url, cb);
};

JSX.resetProfileResults = function () {
	if ($__jsx_profiler.resetResults == null)
		throw new Error("profiler has not been turned on");
	return $__jsx_profiler.resetResults();
};
JSX.DEBUG = false;
/**
 * class TestCase extends Object
 * @constructor
 */
function TestCase() {
}

/**
 * @constructor
 */
function TestCase$() {
	this.M = true;
	this.O = true;
	this.K = 0;
	this.L = 0;
	this.B = 0;
	this.F = 0;
	this.G = null;
	this.H = null;
	this.E = [  ];
};

TestCase$.prototype = new TestCase;

/**
 */
TestCase.prototype.setUp$ = function () {
};

/**
 */
TestCase.prototype.tearDown$ = function () {
};

/**
 * @param {Array.<undefined|!string>} tests
 */
TestCase.prototype.beforeClass$AS = function (tests) {
	/** @type {!string} */
	var message$0;
	/** @type {Array.<undefined|!string>} */
	var _tests$0;
	_tests$0 = this.G = tests;
	message$0 = "1.." + (_tests$0.length + "");
	console.info(message$0);
};

/**
 */
TestCase.prototype.afterClass$ = function () {
	/** @type {*} */
	var next;
	if (this.E.length === 0) {
		this.finish$();
	} else {
		next = this.E.shift();
		next();
	}
};

/**
 * @param {!string} name
 * @param {*} testFunction
 */
TestCase.prototype.run$SF$V$ = function (name, testFunction) {
	/** @type {!number} */
	var numAsyncTasks;
	/** @type {!string} */
	var msg;
	/** @type {!string} */
	var message$0;
	/** @type {!string} */
	var message$1;
	/** @type {!string} */
	var message$0$0;
	name = name.replace(/[$].*$/, "");
	numAsyncTasks = this.E.length;
	this.H = name;
	try {
		testFunction();
	} catch ($__jsx_catch_0) {
		if ($__jsx_catch_0 instanceof Error) {
			if ($__jsx_catch_0 instanceof TestCase$CFailure) {
				msg = ($__jsx_catch_0.message ? " - " + $__jsx_catch_0.message : "");
			} else {
				msg = " - failed with exception";
				if ($__jsx_catch_0.message) {
					msg += ": " + $__jsx_catch_0.message;
				}
			}
			message$0 = "\tnot ok " + (++ this.B + "") + msg;
			console.info(message$0);
			if ($__jsx_catch_0.stack && this.O) {
				message$1 = $__jsx_catch_0.stack;
				message$0$0 = message$1.replace(/^/mg, "# ");
				console.info(message$0$0);
			}
		} else {
			throw $__jsx_catch_0;
		}
	}
	if (numAsyncTasks === this.E.length) {
		this.S(name);
	}
};

/**
 * @param {!string} name
 */
TestCase.prototype.S = function (name) {
	/** @type {!string} */
	var message$0;
	/** @type {!string} */
	var message$1;
	/** @type {!string} */
	var message$2;
	++ this.K;
	message$0 = "\t1.." + (this.B + "");
	console.info(message$0);
	if (this.B === this.F) {
		++ this.L;
		message$1 = "ok " + (this.K + "") + " - " + name;
		console.info(message$1);
	} else {
		message$2 = "not ok " + (this.K + "") + " - " + name;
		console.info(message$2);
	}
	this.B = 0;
	this.F = 0;
};

/**
 */
TestCase.prototype.finish$ = function () {
	/** @type {!number} */
	var failed;
	/** @type {!string} */
	var message$0;
	/** @type {!string} */
	var message$0$0;
	/** @type {!number} */
	var _totalCount$0;
	if (this.K !== this.L) {
		failed = (_totalCount$0 = this.K) - this.L;
		message$0 = "tests failed " + (failed + "") + " of " + (_totalCount$0 + "");
		message$0$0 = message$0.replace(/^/mg, "# ");
		console.info(message$0$0);
	}
};

/**
 * @param {*} testBody
 * @param {*} timeoutHandler
 * @param {!number} timeoutMS
 */
TestCase.prototype.Q = function (testBody, timeoutHandler, timeoutMS) {
	var $this = this;
	/** @type {AsyncContext} */
	var async;
	async = new AsyncContext$LTestCase$SF$LAsyncContext$V$I(this, (function (v) {
		if (! (v != null)) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:185:47] null access\n        var async = new AsyncContext(this, this._currentName, timeoutHandler, timeoutMS);\n                                               ^\n");
		}
		return v;
	}(this.H)), timeoutHandler, timeoutMS);
	this.E.push((function () {
		testBody(async);
	}));
};

/**
 * @param {*} testBody
 * @param {!number} timeoutMS
 */
TestCase.prototype.async$F$LAsyncContext$V$I = function (testBody, timeoutMS) {
	var $this = this;
	this.Q(testBody, (function (async) {
		$this.N("TIMEOUT: " + async.D);
		async.U();
	}), timeoutMS);
};

/**
 * @param {*} value
 * @return {TestCase$CMatcher}
 */
TestCase.prototype.I = function (value) {
	++ this.B;
	return ({C: this, A: value, D: null});
};

/**
 * @param {*} value
 * @param {!string} message
 * @return {TestCase$CMatcher}
 */
TestCase.prototype.expect$XS = function (value, message) {
	++ this.B;
	return ({C: this, A: value, D: message});
};

/**
 * @param {undefined|!string} name
 */
TestCase.prototype._ok$US = function (name) {
	/** @type {!string} */
	var s;
	/** @type {!string} */
	var message$0;
	++ this.F;
	s = (name != null ? " - " + (function (v) {
		if (! (v != null)) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:222:39] null access\n        var s = name != null ? \" - \" + name :  \"\";\n                                       ^^^^\n");
		}
		return v;
	}(name)) : "");
	message$0 = "\tok " + (this.B + "") + s;
	console.info(message$0);
};

/**
 * @param {undefined|!string} name
 */
TestCase.prototype._nok$US = function (name) {
	this.R(name, null, null, null);
};

/**
 * @param {undefined|!string} name
 * @param {undefined|!string} op
 * @param {*} got
 * @param {*} expected
 */
TestCase.prototype.R = function (name, op, got, expected) {
	/** @type {!string} */
	var s;
	/** @type {!string} */
	var message$0;
	/** @type {!string} */
	var message$1;
	/** @type {!string} */
	var message$0$0;
	s = (name != null ? " - " + (function (v) {
		if (! (v != null)) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:237:39] null access\n        var s = name != null ? \" - \" + name :  \"\";\n                                       ^^^^\n");
		}
		return v;
	}(name)) : "");
	message$0 = "\tnot ok " + (this.B + "") + s;
	console.info(message$0);
	if (op != null) {
		message$1 = "comparing with " + (function (v) {
			if (! (v != null)) {
				debugger;
				throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:241:42] null access\n            this.diag(\"comparing with \" + op + s.replace(\" - \", \" for \"));\n                                          ^^\n");
			}
			return v;
		}(op)) + s.replace(" - ", " for ");
		message$0$0 = message$1.replace(/^/mg, "# ");
		console.info(message$0$0);
		this._dump$SX("got:      ", got);
		this._dump$SX("expected: ", expected);
	}
	throw new TestCase$CFailure$S((function (v) {
		if (! (v != null)) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:245:48] null access\n        throw new TestCase.Failure(name != null ? name : \"\");\n                                                ^\n");
		}
		return v;
	}(name != null ? name : "")));
};

/**
 * @param {!string} reason
 */
TestCase.prototype.pass$S = function (reason) {
	/** @type {!string} */
	var message$0;
	++ this.B;
	++ this.F;
	message$0 = "\tok " + (this.B + "") + " - " + reason;
	console.info(message$0);
};

/**
 * @param {!string} reason
 */
TestCase.prototype.N = function (reason) {
	++ this.B;
	throw new TestCase$CFailure$S(reason);
};

/**
 * @param {!string} tag
 * @param {*} value
 */
TestCase.prototype._dump$SX = function (tag, value) {
	/** @type {!string} */
	var message$0$0;
	/** @type {!string} */
	var message$0;
	/** @type {!string} */
	var message$0$1;
	if (typeof value === "object") {
		message$0$0 = tag.replace(/^/mg, "# ");
		console.info(message$0$0);
		console.dir(value);
	} else {
		message$0 = tag + (value + "");
		message$0$1 = message$0.replace(/^/mg, "# ");
		console.info(message$0$1);
	}
};

/**
 * @param {!string} message
 */
TestCase.prototype._say$S = function (message) {
	console.info(message);
};

/**
 * @param {*} a
 * @param {*} b
 * @return {!boolean}
 */
TestCase.prototype.P = function (a, b) {
	return this.T(a, b, 0);
};

/**
 * @param {*} a
 * @param {*} b
 * @param {!number} recursion
 * @return {!boolean}
 */
TestCase.prototype.T = function (a, b, recursion) {
	/** @type {Array.<undefined|*>} */
	var aryA;
	/** @type {Array.<undefined|*>} */
	var aryB;
	/** @type {!number} */
	var i;
	/** @type {Object.<string, undefined|*>} */
	var mapA;
	/** @type {Object.<string, undefined|*>} */
	var mapB;
	/** @type {Array.<undefined|!string>} */
	var mapAkeys;
	/** @type {Array.<undefined|!string>} */
	var mapBkeys;
	/** @type {undefined|!string} */
	var key;
	/** @type {Date} */
	var dateA;
	/** @type {Date} */
	var dateB;
	/** @type {!number} */
	var aryA$len$0;
	/** @type {!number} */
	var mapAkeys$len$0;
	if (++ recursion > 1000) {
		throw new RangeError("Deep recursion in equals()");
	}
	if (a == b || a == null && b == null) {
		return true;
	}
	if (a instanceof Array) {
		if (! (b instanceof Array)) {
			return false;
		}
		aryA = (function (v) {
			if (! (v == null || v instanceof Array)) {
				debugger;
				throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:297:25] detected invalid cast, value is not an Array or null\n            var aryA = a as Array.<variant>;\n                         ^^\n");
			}
			return v;
		}(a));
		aryB = (function (v) {
			if (! (v == null || v instanceof Array)) {
				debugger;
				throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:298:25] detected invalid cast, value is not an Array or null\n            var aryB = b as Array.<variant>;\n                         ^^\n");
			}
			return v;
		}(b));
		if (aryA.length !== aryB.length) {
			return false;
		}
		for ((i = 0, aryA$len$0 = aryA.length); i < aryA$len$0; ++ i) {
			if (! this.T(aryA[i], aryB[i], recursion)) {
				return false;
			}
		}
		return true;
	}
	if ((typeof(a) === "object")) {
		if (! ((typeof(b) === "object"))) {
			return false;
		}
		mapA = (function (v) {
			if (! (v == null || typeof v === "object" || typeof v === "function")) {
				debugger;
				throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:315:25] detected invalid cast, value is not a Map or null\n            var mapA = a as Map.<variant>;\n                         ^^\n");
			}
			return v;
		}(a));
		mapB = (function (v) {
			if (! (v == null || typeof v === "object" || typeof v === "function")) {
				debugger;
				throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:316:25] detected invalid cast, value is not a Map or null\n            var mapB = b as Map.<variant>;\n                         ^^\n");
			}
			return v;
		}(b));
		mapAkeys = Object.keys(mapA).sort();
		mapBkeys = Object.keys(mapB).sort();
		if (mapAkeys.length !== mapBkeys.length) {
			return false;
		}
		for ((i = 0, mapAkeys$len$0 = mapAkeys.length); i < mapAkeys$len$0; ++ i) {
			key = mapAkeys[i];
			if (key != mapBkeys[i]) {
				return false;
			}
			if (! this.T(mapA[key], mapB[key], recursion)) {
				return false;
			}
		}
		return true;
	}
	if (a instanceof Date) {
		if (! (b instanceof Date)) {
			return false;
		}
		dateA = (function (v) {
			if (! (v == null || v instanceof Date)) {
				debugger;
				throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:342:26] detected invalid cast, value is not an instance of the designated type or null\n            var dateA = a as Date;\n                          ^^\n");
			}
			return v;
		}(a));
		dateB = (function (v) {
			if (! (v == null || v instanceof Date)) {
				debugger;
				throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:343:26] detected invalid cast, value is not an instance of the designated type or null\n            var dateB = b as Date;\n                          ^^\n");
			}
			return v;
		}(b));
		if (dateA && dateB) {
			return dateA.getTime() === dateB.getTime();
		}
	}
	return false;
};

/**
 * @param {Array.<undefined|*>} a
 * @param {Array.<undefined|*>} b
 * @return {!string}
 */
TestCase.prototype.difflet$AXAX = function (a, b) {
	/** @type {!string} */
	var s;
	/** @type {!number} */
	var i;
	/** @type {!number} */
	var l;
	/** @type {*} */
	var ai;
	/** @type {*} */
	var bi;
	/** @type {!boolean} */
	var aIsOver;
	/** @type {!boolean} */
	var aIsLast;
	if (! (a != null)) {
		debugger;
		throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:354:17] assertion failure\n        assert a != null;\n                 ^^\n");
	}
	if (! (b != null)) {
		debugger;
		throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:355:17] assertion failure\n        assert b != null;\n                 ^^\n");
	}
	s = "[\n";
	for ((i = 0, l = Math.max(a.length, b.length)); i < l; ++ i) {
		ai = a[i];
		bi = b[i];
		aIsOver = i >= a.length;
		aIsLast = i + 1 >= a.length;
		if (! aIsOver) {
			s += "  " + JSON.stringify(ai);
			if (! aIsLast) {
				s += ",";
			}
			if (ai != bi) {
				s += " // != " + JSON.stringify(bi);
			}
		} else {
			s += "  // != " + JSON.stringify(bi);
		}
		s += "\n";
	}
	return s + "]";
};

/**
 * @param {!string} message
 */
TestCase.prototype.diag$S = function (message) {
	/** @type {!string} */
	var message$0;
	message$0 = message.replace(/^/mg, "# ");
	console.info(message$0);
};

/**
 * @param {!string} message
 */
TestCase.prototype.note$S = function (message) {
	/** @type {!string} */
	var message$0;
	if (this.M) {
		message$0 = message.replace(/^/mg, "# ");
		console.info(message$0);
	}
};

/**
 * @return {!string}
 */
TestCase.prototype.toString = function () {
	return (this.G != null ? "TestCase[" + this.G.join(", ") + "]" : "TestCase");
};

/**
 * class _Test extends TestCase
 * @constructor
 */
function _Test() {
}

_Test.prototype = new TestCase;
/**
 * @constructor
 */
function _Test$() {
	TestCase$.call(this);
};

_Test$.prototype = new _Test;

/**
 */
_Test.prototype.testInvoke$ = function () {
	/** @type {Array.<undefined|*>} */
	var a;
	TestCase$CMatcher$toBe$LTestCase$CMatcher$X(this.I(js.A.Math["abs"](-10)), 10);
	a = [ -10 ];
	TestCase$CMatcher$toBe$LTestCase$CMatcher$X(this.I((function (o, p, a) { return o[p].apply(o, a); }(js.A.Math, "abs", a))), 10);
};

/**
 */
_Test.prototype.testExecScript$ = function () {
	/** @type {!number} */
	var value;
	value = eval("2 + 3") | 0;
	TestCase$CMatcher$toBe$LTestCase$CMatcher$X(this.I(value), 5);
};

/**
 * class AsyncContext extends Object
 * @constructor
 */
function AsyncContext() {
}

/**
 * @constructor
 * @param {TestCase} test
 * @param {!string} name
 * @param {*} timeoutHandler
 * @param {!number} timeoutMS
 */
function AsyncContext$LTestCase$SF$LAsyncContext$V$I(test, name, timeoutHandler, timeoutMS) {
	var $this = this;
	/** @type {TimerHandle} */
	var id;
	this.J = null;
	this.C = test;
	this.D = name;
	id = Timer$setTimeout$F$V$N((function () {
		timeoutHandler($this);
	}), timeoutMS);
	this.J = id;
};

AsyncContext$LTestCase$SF$LAsyncContext$V$I.prototype = new AsyncContext;

/**
 * @return {!string}
 */
AsyncContext.prototype.name$ = function () {
	return this.D;
};

/**
 */
AsyncContext.prototype.U = function () {
	/** @type {*} */
	var next;
	/** @type {TimerHandle} */
	var timer$0;
	timer$0 = this.J;
	(function (v) {
		if (! (v == null || typeof v === "function")) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:38:35] detected invalid cast, value is not a function or null\n        (js.global[\"clearTimeout\"] as __noconvert__ function(:TimerHandle) : void)(timer);\n                                   ^^\n");
		}
		return v;
	}(js.A.clearTimeout))(timer$0);
	this.C.S(this.D);
	if (this.C.E.length !== 0) {
		next = this.C.E.shift();
		next();
	} else {
		this.C.finish$();
	}
};

/**
 * class js extends Object
 * @constructor
 */
function js() {
}

/**
 * @constructor
 */
function js$() {
};

js$.prototype = new js;

/**
 * class Timer extends Object
 * @constructor
 */
function Timer() {
}

/**
 * @constructor
 */
function Timer$() {
};

Timer$.prototype = new Timer;

/**
 * @param {*} callback
 * @param {!number} intervalMS
 * @return {TimerHandle}
 */
Timer.setTimeout$F$V$N = function (callback, intervalMS) {
	return (function (v) {
		if (! (v == null || typeof v === "function")) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:34:40] detected invalid cast, value is not a function or null\n        return (js.global[\"setTimeout\"] as __noconvert__ function(:function():void,:int) : TimerHandle)(callback, intervalMS);\n                                        ^^\n");
		}
		return v;
	}(js.A.setTimeout))(callback, intervalMS);
};

var Timer$setTimeout$F$V$N = Timer.setTimeout$F$V$N;

/**
 * @param {TimerHandle} timer
 */
Timer.clearTimeout$LTimerHandle$ = function (timer) {
	(function (v) {
		if (! (v == null || typeof v === "function")) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:38:35] detected invalid cast, value is not a function or null\n        (js.global[\"clearTimeout\"] as __noconvert__ function(:TimerHandle) : void)(timer);\n                                   ^^\n");
		}
		return v;
	}(js.A.clearTimeout))(timer);
};

var Timer$clearTimeout$LTimerHandle$ = Timer.clearTimeout$LTimerHandle$;

/**
 * @param {*} callback
 * @param {!number} intervalMS
 * @return {TimerHandle}
 */
Timer.setInterval$F$V$N = function (callback, intervalMS) {
	return (function (v) {
		if (! (v == null || typeof v === "function")) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:42:41] detected invalid cast, value is not a function or null\n        return (js.global[\"setInterval\"] as __noconvert__ function(:function():void,:int) : TimerHandle)(callback, intervalMS);\n                                         ^^\n");
		}
		return v;
	}(js.A.setInterval))(callback, intervalMS);
};

var Timer$setInterval$F$V$N = Timer.setInterval$F$V$N;

/**
 * @param {TimerHandle} timer
 */
Timer.clearInterval$LTimerHandle$ = function (timer) {
	(function (v) {
		if (! (v == null || typeof v === "function")) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:46:36] detected invalid cast, value is not a function or null\n        (js.global[\"clearInterval\"] as __noconvert__ function(:TimerHandle) : void)(timer);\n                                    ^^\n");
		}
		return v;
	}(js.A.clearInterval))(timer);
};

var Timer$clearInterval$LTimerHandle$ = Timer.clearInterval$LTimerHandle$;

/**
 * @param {*} callback
 * @return {TimerHandle}
 */
Timer.requestAnimationFrame$F$NV$ = function (callback) {
	return Timer.A(callback);
};

var Timer$requestAnimationFrame$F$NV$ = Timer.requestAnimationFrame$F$NV$;

/**
 * @param {TimerHandle} timer
 */
Timer.cancelAnimationFrame$LTimerHandle$ = function (timer) {
	Timer.B(timer);
};

var Timer$cancelAnimationFrame$LTimerHandle$ = Timer.cancelAnimationFrame$LTimerHandle$;

/**
 * @param {!boolean} enable
 */
Timer.useNativeRAF$B = function (enable) {
	Timer.A = Timer$_getRequestAnimationFrameImpl$B(enable);
	Timer.B = Timer$_getCancelAnimationFrameImpl$B(enable);
};

var Timer$useNativeRAF$B = Timer.useNativeRAF$B;

/**
 * @param {!boolean} useNativeImpl
 * @return {*}
 */
Timer._getRequestAnimationFrameImpl$B = function (useNativeImpl) {
	/** @type {!number} */
	var lastTime;
	if (useNativeImpl) {
		if (js.A.requestAnimationFrame) {
			return (function (callback) {
				return (function (v) {
					if (! (v == null || typeof v === "function")) {
						debugger;
						throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:72:63] detected invalid cast, value is not a function or null\n                    return (js.global[\"requestAnimationFrame\"] as __noconvert__\n                                                               ^^\n");
					}
					return v;
				}(js.A.requestAnimationFrame))(callback);
			});
		} else {
			if (js.A.webkitRequestAnimationFrame) {
				return (function (callback) {
					return (function (v) {
						if (! (v == null || typeof v === "function")) {
							debugger;
							throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:78:69] detected invalid cast, value is not a function or null\n                    return (js.global[\"webkitRequestAnimationFrame\"] as __noconvert__\n                                                                     ^^\n");
						}
						return v;
					}(js.A.webkitRequestAnimationFrame))(callback);
				});
			} else {
				if (js.A.mozRequestAnimationFrame) {
					return (function (callback) {
						return (function (v) {
							if (! (v == null || typeof v === "function")) {
								debugger;
								throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:84:66] detected invalid cast, value is not a function or null\n                    return (js.global[\"mozRequestAnimationFrame\"] as __noconvert__\n                                                                  ^^\n");
							}
							return v;
						}(js.A.mozRequestAnimationFrame))(callback);
					});
				} else {
					if (js.A.oRequestAnimationFrame) {
						return (function (callback) {
							return (function (v) {
								if (! (v == null || typeof v === "function")) {
									debugger;
									throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:90:64] detected invalid cast, value is not a function or null\n                    return (js.global[\"oRequestAnimationFrame\"] as __noconvert__\n                                                                ^^\n");
								}
								return v;
							}(js.A.oRequestAnimationFrame))(callback);
						});
					} else {
						if (js.A.msRequestAnimationFrame) {
							return (function (callback) {
								return (function (v) {
									if (! (v == null || typeof v === "function")) {
										debugger;
										throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:96:65] detected invalid cast, value is not a function or null\n                    return (js.global[\"msRequestAnimationFrame\"] as __noconvert__\n                                                                 ^^\n");
									}
									return v;
								}(js.A.msRequestAnimationFrame))(callback);
							});
						}
					}
				}
			}
		}
	}
	lastTime = 0;
	return (function (callback) {
		/** @type {!number} */
		var now;
		/** @type {!number} */
		var timeToCall;
		/** @type {!number} */
		var value2$0;
		now = Date.now();
		value2$0 = 16 - (now - lastTime);
		timeToCall = (0 >= value2$0 ? 0 : value2$0);
		lastTime = now + timeToCall;
		return (function (v) {
			if (! (v == null || typeof v === "function")) {
				debugger;
				throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:34:40] detected invalid cast, value is not a function or null\n        return (js.global[\"setTimeout\"] as __noconvert__ function(:function():void,:int) : TimerHandle)(callback, intervalMS);\n                                        ^^\n");
			}
			return v;
		}(js.A.setTimeout))((function () {
			callback(now + timeToCall);
		}), timeToCall);
	});
};

var Timer$_getRequestAnimationFrameImpl$B = Timer._getRequestAnimationFrameImpl$B;

/**
 * @param {!boolean} useNativeImpl
 * @return {*}
 */
Timer._getCancelAnimationFrameImpl$B = function (useNativeImpl) {
	if (useNativeImpl) {
		if (js.A.cancelAnimationFrame) {
			return (function (timer) {
				(function (v) {
					if (! (v == null || typeof v === "function")) {
						debugger;
						throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:119:55] detected invalid cast, value is not a function or null\n                    (js.global[\"cancelAnimationFrame\"] as __noconvert__\n                                                       ^^\n");
					}
					return v;
				}(js.A.cancelAnimationFrame))(timer);
			});
		} else {
			if (js.A.webkitCancelAnimationFrame) {
				return (function (timer) {
					(function (v) {
						if (! (v == null || typeof v === "function")) {
							debugger;
							throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:125:61] detected invalid cast, value is not a function or null\n                    (js.global[\"webkitCancelAnimationFrame\"] as __noconvert__\n                                                             ^^\n");
						}
						return v;
					}(js.A.webkitCancelAnimationFrame))(timer);
				});
			} else {
				if (js.A.mozCancelAnimationFrame) {
					return (function (timer) {
						(function (v) {
							if (! (v == null || typeof v === "function")) {
								debugger;
								throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:131:58] detected invalid cast, value is not a function or null\n                    (js.global[\"mozCancelAnimationFrame\"] as __noconvert__\n                                                          ^^\n");
							}
							return v;
						}(js.A.mozCancelAnimationFrame))(timer);
					});
				} else {
					if (js.A.oCancelAnimationFrame) {
						return (function (timer) {
							(function (v) {
								if (! (v == null || typeof v === "function")) {
									debugger;
									throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:137:56] detected invalid cast, value is not a function or null\n                    (js.global[\"oCancelAnimationFrame\"] as __noconvert__\n                                                        ^^\n");
								}
								return v;
							}(js.A.oCancelAnimationFrame))(timer);
						});
					} else {
						if (js.A.msCancelAnimationFrame) {
							return (function (timer) {
								(function (v) {
									if (! (v == null || typeof v === "function")) {
										debugger;
										throw new Error("[/Users/oku.kazuho/dev/JSX/lib/js/timer.jsx:143:57] detected invalid cast, value is not a function or null\n                    (js.global[\"msCancelAnimationFrame\"] as __noconvert__\n                                                         ^^\n");
									}
									return v;
								}(js.A.msCancelAnimationFrame))(timer);
							});
						}
					}
				}
			}
		}
	}
	return Timer$clearTimeout$LTimerHandle$;
};

var Timer$_getCancelAnimationFrameImpl$B = Timer._getCancelAnimationFrameImpl$B;

/**
 * class TimerHandle extends Object
 * @constructor
 */
function TimerHandle() {
}

/**
 * @constructor
 */
function TimerHandle$() {
};

TimerHandle$.prototype = new TimerHandle;

/**
 * class TestCase$CMatcher extends Object
 * @constructor
 */
function TestCase$CMatcher() {
}

/**
 * @constructor
 * @param {TestCase} test
 * @param {*} got
 */
function TestCase$CMatcher$LTestCase$X(test, got) {
	this.D = null;
	this.C = test;
	this.A = got;
};

TestCase$CMatcher$LTestCase$X.prototype = new TestCase$CMatcher;

/**
 * @constructor
 * @param {TestCase} test
 * @param {*} got
 * @param {!string} name
 */
function TestCase$CMatcher$LTestCase$XS(test, got, name) {
	this.C = test;
	this.A = got;
	this.D = name;
};

TestCase$CMatcher$LTestCase$XS.prototype = new TestCase$CMatcher;

/**
 * @param {TestCase$CMatcher} $this
 * @param {*} x
 */
TestCase$CMatcher.toBe$LTestCase$CMatcher$X = function ($this, x) {
	/** @type {*} */
	var _got$0;
	TestCase$CMatcher$_match$LTestCase$CMatcher$BXXS($this, (_got$0 = $this.A) == x, _got$0, x, "==");
};

var TestCase$CMatcher$toBe$LTestCase$CMatcher$X = TestCase$CMatcher.toBe$LTestCase$CMatcher$X;

/**
 * @param {TestCase$CMatcher} $this
 * @param {*} x
 */
TestCase$CMatcher.notToBe$LTestCase$CMatcher$X = function ($this, x) {
	/** @type {*} */
	var _got$0;
	TestCase$CMatcher$_match$LTestCase$CMatcher$BXXS($this, (_got$0 = $this.A) != x, _got$0, x, "!=");
};

var TestCase$CMatcher$notToBe$LTestCase$CMatcher$X = TestCase$CMatcher.notToBe$LTestCase$CMatcher$X;

/**
 * @param {TestCase$CMatcher} $this
 * @param {!number} x
 */
TestCase$CMatcher.toBeLT$LTestCase$CMatcher$N = function ($this, x) {
	/** @type {*} */
	var _got$0;
	TestCase$CMatcher$_match$LTestCase$CMatcher$BXXS($this, +(_got$0 = $this.A) < x, _got$0, x, "<");
};

var TestCase$CMatcher$toBeLT$LTestCase$CMatcher$N = TestCase$CMatcher.toBeLT$LTestCase$CMatcher$N;

/**
 * @param {TestCase$CMatcher} $this
 * @param {!number} x
 */
TestCase$CMatcher.toBeLE$LTestCase$CMatcher$N = function ($this, x) {
	/** @type {*} */
	var _got$0;
	TestCase$CMatcher$_match$LTestCase$CMatcher$BXXS($this, +(_got$0 = $this.A) <= x, _got$0, x, "<=");
};

var TestCase$CMatcher$toBeLE$LTestCase$CMatcher$N = TestCase$CMatcher.toBeLE$LTestCase$CMatcher$N;

/**
 * @param {TestCase$CMatcher} $this
 * @param {!number} x
 */
TestCase$CMatcher.toBeGT$LTestCase$CMatcher$N = function ($this, x) {
	/** @type {*} */
	var _got$0;
	TestCase$CMatcher$_match$LTestCase$CMatcher$BXXS($this, +(_got$0 = $this.A) > x, _got$0, x, ">");
};

var TestCase$CMatcher$toBeGT$LTestCase$CMatcher$N = TestCase$CMatcher.toBeGT$LTestCase$CMatcher$N;

/**
 * @param {TestCase$CMatcher} $this
 * @param {!number} x
 */
TestCase$CMatcher.toBeGE$LTestCase$CMatcher$N = function ($this, x) {
	/** @type {*} */
	var _got$0;
	TestCase$CMatcher$_match$LTestCase$CMatcher$BXXS($this, +(_got$0 = $this.A) >= x, _got$0, x, ">=");
};

var TestCase$CMatcher$toBeGE$LTestCase$CMatcher$N = TestCase$CMatcher.toBeGE$LTestCase$CMatcher$N;

/**
 * @param {TestCase$CMatcher} $this
 * @param {RegExp} x
 */
TestCase$CMatcher.toMatch$LTestCase$CMatcher$LRegExp$ = function ($this, x) {
	TestCase$CMatcher$_match$LTestCase$CMatcher$BXXS($this, x.test($this.A + ""), $this.A, x, "match");
};

var TestCase$CMatcher$toMatch$LTestCase$CMatcher$LRegExp$ = TestCase$CMatcher.toMatch$LTestCase$CMatcher$LRegExp$;

/**
 * @param {TestCase$CMatcher} $this
 * @param {RegExp} x
 */
TestCase$CMatcher.notToMatch$LTestCase$CMatcher$LRegExp$ = function ($this, x) {
	TestCase$CMatcher$_match$LTestCase$CMatcher$BXXS($this, ! x.test($this.A + ""), $this.A, x, "not match");
};

var TestCase$CMatcher$notToMatch$LTestCase$CMatcher$LRegExp$ = TestCase$CMatcher.notToMatch$LTestCase$CMatcher$LRegExp$;

/**
 * @param {TestCase$CMatcher} $this
 * @param {Array.<undefined|*>} x
 */
TestCase$CMatcher.toEqual$LTestCase$CMatcher$AX = function ($this, x) {
	/** @type {Array.<undefined|*>} */
	var got;
	/** @type {TestCase} */
	var this$0;
	/** @type {undefined|!string} */
	var name$0;
	/** @type {!string} */
	var s$0;
	/** @type {!string} */
	var message$0$0;
	/** @type {TestCase} */
	var _test$0;
	if (! (x != null)) {
		debugger;
		throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:470:21] assertion failure\n            assert x != null;\n                     ^^\n");
	}
	if (! ($this.A instanceof Array)) {
		$this.C.R($this.D, "equals", $this.A, x);
		return;
	}
	got = (function (v) {
		if (! (v == null || v instanceof Array)) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:477:32] detected invalid cast, value is not an Array or null\n            var got = this._got as Array.<variant>;\n                                ^^\n");
		}
		return v;
	}($this.A));
	if ($this.C.P(got, x)) {
		this$0 = $this.C;
		name$0 = $this.D;
		++ this$0.F;
		s$0 = (name$0 != null ? " - " + (function (v) {
			if (! (v != null)) {
				debugger;
				throw new Error("null access\n");
			}
			return v;
		}(name$0)) : "");
		message$0$0 = "\tok " + (this$0.B + "") + s$0;
		console.info(message$0$0);
	} else {
		$this.C.R($this.D, "equals", got, x);
		(_test$0 = $this.C).note$S(_test$0.difflet$AXAX(got, x));
	}
};

var TestCase$CMatcher$toEqual$LTestCase$CMatcher$AX = TestCase$CMatcher.toEqual$LTestCase$CMatcher$AX;

/**
 * @param {TestCase$CMatcher} $this
 * @param {Array.<undefined|!string>} x
 */
TestCase$CMatcher.toEqual$LTestCase$CMatcher$AS = function ($this, x) {
	TestCase$CMatcher$toEqual$LTestCase$CMatcher$AX($this, (function (v) {
		if (! (v == null || v instanceof Array)) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:488:27] detected invalid cast, value is not an Array or null\n            this.toEqual(x as __noconvert__ Array.<variant>);\n                           ^^\n");
		}
		return v;
	}(x)));
};

var TestCase$CMatcher$toEqual$LTestCase$CMatcher$AS = TestCase$CMatcher.toEqual$LTestCase$CMatcher$AS;

/**
 * @param {TestCase$CMatcher} $this
 * @param {Array.<undefined|!number>} x
 */
TestCase$CMatcher.toEqual$LTestCase$CMatcher$AN = function ($this, x) {
	TestCase$CMatcher$toEqual$LTestCase$CMatcher$AX($this, (function (v) {
		if (! (v == null || v instanceof Array)) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:491:27] detected invalid cast, value is not an Array or null\n            this.toEqual(x as __noconvert__ Array.<variant>);\n                           ^^\n");
		}
		return v;
	}(x)));
};

var TestCase$CMatcher$toEqual$LTestCase$CMatcher$AN = TestCase$CMatcher.toEqual$LTestCase$CMatcher$AN;

/**
 * @param {TestCase$CMatcher} $this
 * @param {Array.<undefined|!number>} x
 */
TestCase$CMatcher.toEqual$LTestCase$CMatcher$AI = function ($this, x) {
	TestCase$CMatcher$toEqual$LTestCase$CMatcher$AX($this, (function (v) {
		if (! (v == null || v instanceof Array)) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:494:27] detected invalid cast, value is not an Array or null\n            this.toEqual(x as __noconvert__ Array.<variant>);\n                           ^^\n");
		}
		return v;
	}(x)));
};

var TestCase$CMatcher$toEqual$LTestCase$CMatcher$AI = TestCase$CMatcher.toEqual$LTestCase$CMatcher$AI;

/**
 * @param {TestCase$CMatcher} $this
 * @param {Array.<undefined|!boolean>} x
 */
TestCase$CMatcher.toEqual$LTestCase$CMatcher$AB = function ($this, x) {
	TestCase$CMatcher$toEqual$LTestCase$CMatcher$AX($this, (function (v) {
		if (! (v == null || v instanceof Array)) {
			debugger;
			throw new Error("[/Users/oku.kazuho/dev/JSX/lib/common/test-case.jsx:497:27] detected invalid cast, value is not an Array or null\n            this.toEqual(x as __noconvert__ Array.<variant>);\n                           ^^\n");
		}
		return v;
	}(x)));
};

var TestCase$CMatcher$toEqual$LTestCase$CMatcher$AB = TestCase$CMatcher.toEqual$LTestCase$CMatcher$AB;

/**
 * @param {TestCase$CMatcher} $this
 * @param {!boolean} value
 * @param {*} got
 * @param {*} expected
 * @param {!string} op
 */
TestCase$CMatcher._match$LTestCase$CMatcher$BXXS = function ($this, value, got, expected, op) {
	/** @type {TestCase} */
	var this$0;
	/** @type {undefined|!string} */
	var name$0;
	/** @type {!string} */
	var s$0;
	/** @type {!string} */
	var message$0$0;
	if (value) {
		this$0 = $this.C;
		name$0 = $this.D;
		++ this$0.F;
		s$0 = (name$0 != null ? " - " + (function (v) {
			if (! (v != null)) {
				debugger;
				throw new Error("null access\n");
			}
			return v;
		}(name$0)) : "");
		message$0$0 = "\tok " + (this$0.B + "") + s$0;
		console.info(message$0$0);
	} else {
		$this.C.R($this.D, op, got, expected);
	}
};

var TestCase$CMatcher$_match$LTestCase$CMatcher$BXXS = TestCase$CMatcher._match$LTestCase$CMatcher$BXXS;

/**
 * class TestCase$CFailure extends Error
 * @constructor
 */
function TestCase$CFailure() {
}

TestCase$CFailure.prototype = new Error;
/**
 * @constructor
 * @param {!string} reason
 */
function TestCase$CFailure$S(reason) {
	Error.call(this);
	this.message = reason;
};

TestCase$CFailure$S.prototype = new TestCase$CFailure;

js.global = (function () { return this; })();
$__jsx_lazy_init(Timer, "A", function () {
	return Timer$_getRequestAnimationFrameImpl$B(true);
});
$__jsx_lazy_init(Timer, "B", function () {
	return Timer$_getCancelAnimationFrameImpl$B(true);
});
var $__jsx_classMap = {
	"system:lib/common/test-case.jsx": {
		TestCase: TestCase,
		TestCase$: TestCase$,
		AsyncContext: AsyncContext,
		AsyncContext$LTestCase$SF$LAsyncContext$V$I: AsyncContext$LTestCase$SF$LAsyncContext$V$I,
		Matcher: TestCase$CMatcher,
		Matcher$LTestCase$X: TestCase$CMatcher$LTestCase$X,
		Matcher$LTestCase$XS: TestCase$CMatcher$LTestCase$XS,
		Failure: TestCase$CFailure,
		Failure$S: TestCase$CFailure$S
	},
	"t/lib/003.js.jsx": {
		_Test: _Test,
		_Test$: _Test$
	},
	"system:lib/js/js.jsx": {
		js: js,
		js$: js$
	},
	"system:lib/js/timer.jsx": {
		Timer: Timer,
		Timer$: Timer$,
		TimerHandle: TimerHandle,
		TimerHandle$: TimerHandle$
	}
};


})(JSX);
