move
Version:
A programming language
577 lines • 29.8 kB
JavaScript
window.move || (window.move = function() {
typeof window.global == "undefined" && (window.global = window);
var Require = function(a) {
function g(a, b, c) {
typeof b == "function" && (c = b, b = null);
var d = {
block: c
};
e(d, "id", String(a)), b && e(d, "uri", String(b)), f.modules[d.id] = d;
return d;
}
function f(a, b, d) {
var g = a;
if (a.charAt(0) === ".") {
d && d.indexOf(b + "/index") !== -1 && (b += "/index");
var h = a;
a = c(a, b);
}
if (!f.modules.hasOwnProperty(a)) throw new Error("Module not found " + JSON.stringify(g));
var i = f.modules[a];
if (i.exports === undefined) {
var j = function(b) {
return f(b, a, i.uri);
};
e(j, "main", f.main);
var k = i.block;
delete i.block, i.exports = {}, f.initFilter && (k = f.initFilter(k)), k(j, i, i.exports);
}
return i.exports;
}
function d(a, c) {
if (!/^\w+:/.test(a)) {
var d = c.protocol + "//" + c.hostname;
c.port && c.port !== 80 && (d += ":" + c.port);
var e = c.pathname;
a.charAt(0) === "/" ? a = d + b(a.split("/")).join("/") : (e += (e.charAt(e.length - 1) === "/" ? "" : "/../") + a, a = d + b(e.split("/")).join("/"));
}
return a;
}
function c(a, c) {
a = a.replace(/\/+$/g, "");
var d = (c ? c + "/../" + a : a).split("/");
return b(d).join("/");
}
function b(a) {
var b = 0;
for (var c = a.length; c >= 0; c--) {
var d = a[c];
d == "." ? a.splice(c, 1) : d === ".." ? (a.splice(c, 1), b++) : b && (a.splice(c, 1), b--);
}
return a;
}
var e;
Object.defineProperty ? e = function(a, b, c) {
Object.defineProperty(a, b, {
value: c,
writable: !1,
enumerable: !0,
configurable: !1
});
} : e = function(a, b, c) {
a[b] = c;
}, f.modules = {};
var h = g("");
delete h.block, h.exports = a || {}, e(f, "main", h), f.define = g;
return f;
}, module, modules = {}, _require = Require();
_require.define("runtime/es5_array", "runtime/es5_array.js", function(a, b, c, d, e) {
Array.isArray || (Array.isArray = function(a) {
return a instanceof Array || Object.prototype.toString.call(a) === "[object Array]";
}), Array.prototype.indexOf || (Array.prototype.indexOf = function(a, b) {
var c, d = this.length;
for (c = +b || 0; c < d; ++c) if (this[c] === a) return c;
return -1;
}), Array.prototype.lastIndexOf || (Array.prototype.lastIndexOf = function(a, b) {
var c = Math.min(this.length, +b || 0);
for (; c !== -1; --c) if (this[c] === a) return c;
return -1;
}), Array.prototype.filter || (Array.prototype.filter = function(a, b) {
var c = [];
for (var d = 0; d < this.length; d++) a.call(b, this[d]) && c.push(this[d]);
return c;
}), Array.prototype.forEach || (Array.prototype.forEach = function(a, b) {
var c = this.length >>> 0;
for (var d = 0; d < c; ++d) d in this && a.call(b, this[d], d, this);
}), Array.prototype.every || (Array.prototype.every = function(a, b) {
var c = this.length >>> 0;
for (var d = 0; d < c; ++d) if (d in this && !a.call(b, this[d], d, this)) return !1;
return !0;
}), Array.prototype.some || (Array.prototype.some = function(a, b) {
var c = this.length >>> 0;
for (var d = 0; d < c; ++d) if (d in this && a.call(b, this[d], d, this)) return !0;
return !1;
}), Array.prototype.map || (Array.prototype.map = function(a, b) {
var c = this.length >>> 0, d = Array(c);
for (var e = 0; e < c; ++e) d[e] = a.call(b, this[e], e, this);
return d;
}), Array.prototype.reduce || (Array.prototype.reduce = function(a) {
var b = this.length >>> 0, c = 0, d;
if (b === 0 && arguments.length === 1) throw new TypeError;
if (arguments.length >= 2) d = arguments[1]; else do {
if (c in this) {
d = this[c++];
break;
}
if (++c >= b) throw new TypeError;
} while (!0);
for (; c < b; c++) c in this && (d = a.call(null, d, this[c], c, this));
return d;
}), Array.prototype.unshift || (Array.prototype.unshift = function() {
this.reverse();
var a = arguments.length;
while (a--) this.push(arguments[a]);
this.reverse();
return this.length;
});
}), _require.define("runtime/es5_date", "runtime/es5_date.js", function(a, b, c, d, e) {
Date.now || (Date.now = function() {
return (new Date).getTime();
}), Date.prototype.getTimezoneOffset || (Date.prototype.getTimezoneOffset = function() {
if (this._timezoneOffsetStd === undefined) {
var a = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0, 0), b = a.toGMTString(), c = new Date(b.substring(0, b.lastIndexOf(" ") - 1));
this._timezoneOffsetStd = (c - a) / 6e4;
}
return this._timezoneOffsetStd;
});
}), _require.define("runtime/es5_json", "runtime/es5_json.js", function(require, module, exports, __filename, __dirname) {
var JSON = global.JSON;
if (typeof JSON != "object" || typeof JSON.stringify != "function" || typeof JSON.parse != "function") JSON = global.JSON = {}, function() {
function str(a, b) {
var c, d, e, f, g = gap, h, i = b[a];
i && typeof i == "object" && typeof i.toJSON == "function" && (i = i.toJSON(a)), typeof rep == "function" && (i = rep.call(b, a, i));
switch (typeof i) {
case "string":
return quote(i);
case "number":
return isFinite(i) ? String(i) : "null";
case "boolean":
case "null":
return String(i);
case "object":
if (!i) return "null";
gap += indent, h = [];
if (Object.prototype.toString.apply(i) === "[object Array]") {
f = i.length;
for (c = 0; c < f; c += 1) h[c] = str(c, i) || "null";
e = h.length === 0 ? "[]" : gap ? "[\n" + gap + h.join(",\n" + gap) + "\n" + g + "]" : "[" + h.join(",") + "]", gap = g;
return e;
}
if (rep && typeof rep == "object") {
f = rep.length;
for (c = 0; c < f; c += 1) d = rep[c], typeof d == "string" && (e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e));
} else for (d in i) Object.hasOwnProperty.call(i, d) && (e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e));
e = h.length === 0 ? "{}" : gap ? "{\n" + gap + h.join(",\n" + gap) + "\n" + g + "}" : "{" + h.join(",") + "}", gap = g;
return e;
}
}
function quote(a) {
escapable.lastIndex = 0;
return escapable.test(a) ? '"' + a.replace(escapable, function(a) {
var b = meta[a];
return typeof b == "string" ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + a + '"';
}
function f(a) {
return a < 10 ? "0" + a : a;
}
"use strict", typeof Date.prototype.toJSON != "function" && (Date.prototype.toJSON = function(a) {
return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null;
}, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(a) {
return this.valueOf();
});
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
"\b": "\\b",
"\t": "\\t",
"\n": "\\n",
"\f": "\\f",
"\r": "\\r",
'"': '\\"',
"\\": "\\\\"
}, rep;
typeof JSON.stringify != "function" && (JSON.stringify = function(a, b, c) {
var d;
gap = "", indent = "";
if (typeof c == "number") for (d = 0; d < c; d += 1) indent += " "; else typeof c == "string" && (indent = c);
rep = b;
if (!b || typeof b == "function" || typeof b == "object" && typeof b.length == "number") return str("", {
"": a
});
throw new Error("JSON.stringify");
}), typeof JSON.parse != "function" && (JSON.parse = function(text, reviver) {
function walk(a, b) {
var c, d, e = a[b];
if (e && typeof e == "object") for (c in e) Object.hasOwnProperty.call(e, c) && (d = walk(e, c), d !== undefined ? e[c] = d : delete e[c]);
return reviver.call(a, b, e);
}
var j;
text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function(a) {
return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
}));
if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
j = eval("(" + text + ")");
return typeof reviver == "function" ? walk({
"": j
}, "") : j;
}
throw new SyntaxError("JSON.parse");
});
}();
}), _require.define("runtime/es5_object", "runtime/es5_object.js", function(a, b, c, d, e) {
var f = Array.prototype.slice.call;
Object.create || (Object.create = function(a, b) {
var c = function() {
b && Object.defineProperties && Object.defineProperties(this, b);
};
c.prototype = a;
return new c;
}), Object.keys || (Object.keys = function h(a) {
var h = [];
for (var b in a) h.push(b);
return h;
}), Object.getOwnPropertyNames || (Object.getOwnPropertyNames = function() {
return Object.keys.apply(this, f(arguments));
}), Object.getOwnPropertyDescriptor || (Object.getOwnPropertyDescriptor = function(a, b) {
if (a.hasOwnProperty(b)) return {
configurable: !0,
enumerable: !0,
value: a[b],
writable: !0
};
}), Object.prototype.hasOwnProperty || (Object.prototype.hasOwnProperty = function(a) {
return a in this;
}), Object.defineProperty || Object.prototype.__defineGetter__ && Object.prototype.__defineSetter__ && (Object.defineProperty = function(a, b, c) {
if (typeof c == "object") if (c.hasOwnProperty("value")) {
!a.__lookupGetter__(b) && !a.__lookupSetter__(b) && (a[b] = c.value);
if (c.hasOwnProperty("get") || c.hasOwnProperty("set")) throw new TypeError("Object doesn't support this action");
} else typeof c.get == "function" && a.__defineGetter__(b, c.get), typeof c.set == "function" && a.__defineSetter__(b, c.set);
return a;
}), !Object.defineProperties && Object.defineProperty && (Object.defineProperties = function(a, b) {
for (var c in b) Object.defineProperty(a, c, b[c]);
});
}), _require.define("runtime/es5_string", "runtime/es5_string.js", function(a, b, c, d, e) {
String.prototype.trim || (String.prototype.trim = function() {
return this.replace(/^(?:\s|\u00A0)+/, "").replace(/(?:\s|\u00A0)+$/, "");
}), String.prototype.trimLeft || (String.prototype.trimLeft = function() {
return this.replace(/^(?:\s|\u00A0)+/, "");
}), String.prototype.trimRight || (String.prototype.trimRight = function() {
return this.replace(/(?:\s|\u00A0)+$/, "");
});
}), _require.define("runtime", "runtime/index.js", function(a, b, c, d, e) {
a("./runtime_string"), global.__move || (global.__move = {}), global.__move.runtime = {
_MoveKWArgsT: a("./symbols")._MoveKWArgsT
}, global.__move.runtime = a("./runtime_move");
}), _require.define("runtime/runtime_array", "runtime/runtime_array.js", function(a, b, c, d, e) {
typeof Array.prototype.unique != "function" && (Array.prototype.unique = function() {
var a = [], b, c, d = this.length;
for (b = 0; b < d; ++b) {
for (c = b + 1; c < d; ++c) this[b] === this[c] && (c = ++b);
a.push(this[b]);
}
return a;
});
if (typeof Array.prototype._move_setSlice != "function") {
var f = Array.prototype.splice;
Array.prototype._move_setSlice = function(a, b, c) {
var d;
if (b !== undefined) {
if (typeof b != "number") throw new TypeError("Second argument must be a number");
d = b - a;
} else d = this.length;
return f.apply(this, [ a, d ].concat(c));
};
}
}), _require.define("runtime/runtime_class", "runtime/runtime_class.mv", function(a, b, c, d, e) {
(function() {
"use strict";
var a, b, d, e, f, g, h, i, j, k, l, m, k;
a = __move.runtime, b = a._MoveKWArgsT, d = a.Text, e = a.extend, f = a.create, g = a.print, h = a.repeat, i = a.after, j = a.JSON, k = a.__class, l = Object.prototype.constructor, m = typeof Object.prototype.__proto__ == "object" ? "__proto__" : "prototype", c.__class = k = function() {
var a, c, d, e, f;
a = arguments[0];
if (arguments.length === 3) {
c = arguments[1], d = arguments[2];
if ((e = typeof d) !== "object" && e !== "function") throw TypeError("unexpected type " + e + " of second argument (expected object)");
} else if (arguments.length === 2) {
d = arguments[1];
if ((e = typeof d) === "function") c = d, d = undefined; else if (e !== "object") throw TypeError("unexpected type " + e + " of first argument (expected object or function)");
}
d && d.__kw === b && delete d.__kw, c && (f = Object.create(c.prototype || null), d && Object.keys(d).forEach(function(a) {
a !== null && typeof a == "object" && a.__kw === b && (arguments.keywords = a, a = a.key);
var c;
if ((c = d[a]) !== undefined) return f[a] = c;
}), d = f), a.prototype = d || null, a.constructor = undefined;
return a;
};
return k.create = function() {
var a, b, c, d;
a = arguments[0], b = arguments[1], c = Object.create(a.prototype), (d = c.constructor) && d !== l && typeof d == "function" ? d.apply(c, b) : typeof b[0] == "object" && e(c, b[0]);
return c;
};
})();
}), _require.define("runtime/runtime_date", "runtime/runtime_date.mv", function(a, b, c, d, e) {
(function() {
"use strict";
var a, b, c, d, e, f, g, h, i, j;
a = __move.runtime, b = a._MoveKWArgsT, c = a.Text, d = a.extend, e = a.create, f = a.print, g = a.repeat, h = a.after, i = a.JSON, j = a.__class, Date.distantFuture === undefined && (Date.distantFuture = new Date(359753450957352)), Date.distantPast === undefined && (Date.distantPast = new Date(-621356868e5)), Date.nowUTC || (Date.nowUTC = function() {
return (new Date).getUTCTime();
}), Date.prototype.getUTCTime || (Date.prototype.getUTCTime = function() {
return this.getTime() - this.getTimezoneOffset();
});
if (!Date.prototype.getUTCComponents) return Date.prototype.getUTCComponents = function() {
return [ this.getUTCFullYear(), this.getUTCMonth() + 1, this.getUTCDate(), this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds(), this.getUTCMilliseconds() ];
};
})();
}), _require.define("runtime/runtime_inspect", "runtime/runtime_inspect.js", function(a, b, c, d, e) {
function h(a) {
if (a instanceof Date) return !0;
if (typeof a != "object") return !1;
var b = Date.prototype && Object.getOwnPropertyNames(Date.prototype), c = a.__proto__ && Object.getOwnPropertyNames(a.__proto__);
return JSON.stringify(c) === JSON.stringify(b);
}
function g(a) {
var b = "" + a;
return a instanceof RegExp || typeof a == "function" && a.constructor.name === "RegExp" && a.compile && a.test && a.exec && b.match(/^\/.*\/[gim]{0,3}$/);
}
function f(a) {
return a instanceof Array || Array.isArray(a) || a && a !== Object.prototype && f(a.prototype);
}
c.inspect = function(a, b, d, e) {
function k(a, d) {
if (a && typeof a.inspect == "function" && a !== c && a.inspect !== c.inspect && (!a.constructor || a.constructor.prototype !== a)) return a.inspect(d);
switch (typeof a) {
case "undefined":
return j("undefined", "undefined");
case "string":
var e = JSON.stringify(a).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
return j(e, "string");
case "number":
return j("" + a, "number");
case "boolean":
return j("" + a, "boolean");
}
if (a === null) return j("null", "null");
var l = Object.keys(a), m = b ? Object.getOwnPropertyNames(a) : l;
if (typeof a == "function" && m.length === 0) {
if (g(a)) return j("" + a, "regexp");
var n = a.name ? ": " + a.name : "";
return j("[Function" + n + "]", "special");
}
if (h(a) && m.length === 0) return j(a.toUTCString(), "date");
var o, p, q;
f(a) ? (p = "Array", q = [ "[", "]" ]) : (p = "Object", q = [ "{", "}" ]);
if (typeof a == "function") {
var r = a.name ? ": " + a.name : "";
o = g(a) ? " " + a : " [Function" + r + "]";
} else o = "";
h(a) && (o = " " + a.toUTCString());
if (m.length === 0) return q[0] + o + q[1];
if (d < 0) return g(a) ? j("" + a, "regexp") : j("[Object]", "special");
i.push(a);
var s = m.map(function(b) {
var c, e;
a.__lookupGetter__ && (a.__lookupGetter__(b) ? a.__lookupSetter__(b) ? e = j("[Getter/Setter]", "special") : e = j("[Getter]", "special") : a.__lookupSetter__(b) && (e = j("[Setter]", "special"))), l.indexOf(b) < 0 && (c = "[" + b + "]"), e || (i.indexOf(a[b]) < 0 ? (d === null ? e = k(a[b]) : e = k(a[b], d - 1), e.indexOf("\n") > -1 && (f(a) ? e = e.split("\n").map(function(a) {
return " " + a;
}).join("\n").substr(2) : e = "\n" + e.split("\n").map(function(a) {
return " " + a;
}).join("\n"))) : e = j("[Circular]", "special"));
if (typeof c == "undefined") {
if (p === "Array" && b.match(/^\d+$/)) return e;
c = JSON.stringify("" + b), c.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (c = c.substr(1, c.length - 2), c = j(c, "name")) : (c = c.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), c = j(c, "string"));
}
return c + ": " + e;
});
i.pop();
var t = 0, u = s.reduce(function(a, b) {
t++, b.indexOf("\n") >= 0 && t++;
return a + b.length + 1;
}, 0);
u > 50 ? s = q[0] + (o === "" ? "" : o + "\n ") + " " + s.join(",\n ") + " " + q[1] : s = q[0] + o + " " + s.join(", ") + " " + q[1];
return s;
}
var i = [], j = function(a, b) {
return a;
};
return k(a, typeof d == "undefined" ? 2 : d);
};
}), _require.define("runtime/runtime_move", "runtime/runtime_move.mv", function(a, b, c, d, e) {
(function() {
"use strict";
var b, d, e, f, g, h, i, j, k, l, m, n, f, g, i, j, o, p, q;
b = __move.runtime, d = b._MoveKWArgsT, e = b.Text, f = b.extend, g = b.create, h = b.print, i = b.repeat, j = b.after, k = b.JSON, l = b.__class, d = global.__move.runtime._MoveKWArgsT, global.__move.runtime = c, m = typeof process != "undefined" && !!(typeof process.versions == "object" && process.versions.node || process.pid), m || (a("./es5_object"), a("./es5_array"), a("./es5_date"), a("./es5_json")), a("./runtime_object"), a("./runtime_string"), a("./runtime_date"), a("./runtime_array"), Object.defineProperty ? n = function(a, b, c) {
a !== null && typeof a == "object" && a.__kw === d && (arguments.keywords = a, c = a.value, b = a.name, a = a.obj);
return Object.defineProperty(a, b, {
value: c,
writable: !1,
enumerable: !0,
configurable: !1
});
} : n = function(a, b, c) {
a !== null && typeof a == "object" && a.__kw === d && (arguments.keywords = a, c = a.value, b = a.name, a = a.obj);
return a[b] = c;
}, n(c, "_MoveKWArgsT", d), n(c, "Text", String), String.prototype.toText = String.prototype.toString, c.extend = f = function(a, b) {
a !== null && typeof a == "object" && a.__kw === d && (arguments.keywords = a, b = a.body, a = a.object);
var c;
c = b === null ? "undefined" : typeof b;
if (c === "object") Object.keys(b).forEach(function(c) {
c !== null && typeof c == "object" && c.__kw === d && (arguments.keywords = c, c = c.key);
var e;
if ((e = b[c]) !== undefined && e !== d) return a[c] = e;
}); else if (c === "function") b.call(a); else if (c !== "undefined") throw new TypeError('"body" argument must be either an object or a function, not a ' + c);
return a;
}, c.create = g = function(a, b) {
a !== null && typeof a == "object" && a.__kw === d && (arguments.keywords = a, b = a.body, a = a.prototype);
return f(Object.create(a), b);
};
if (typeof Object.inspect != "function") try {
Object.inspect = a("util").inspect;
if (typeof Object.inspect != "function") throw 1;
} catch (r) {
Object.inspect = a("./runtime_inspect").inspect;
}
typeof console != "undefined" && console.log ? typeof window != "undefined" ? (c.print = function w() {
return w.consoleFun.apply(console, Array.prototype.slice.call(arguments));
}, c.print.consoleFun = console.log) : c.print = console.log : c.print = function() {}, c.repeat = i = function(a, b, c) {
a !== null && typeof a == "object" && a.__kw === d && (arguments.keywords = a, c = a.block, b = a.every, a = a.times);
var e, f;
if (typeof a == "function") {
for (;;) if (!a()) break;
} else {
if (typeof c != "function") return function(c) {
c !== null && typeof c == "object" && c.__kw === d && (arguments.keywords = c, c = c.block);
if (a !== undefined) {
for (e = 0; e < a; ++e) if (c(e) === !0) break;
} else {
if (b !== undefined) {
f = Object.create({}, {
cancel: {
value: function() {
return clearInterval(this.id);
}
}
}), f.id = setInterval(function() {
return c(f);
}, b);
return f;
}
for (;;) if (!c()) break;
}
};
if (a !== undefined) {
for (e = 0; e < a; ++e) if (c(e) === !0) break;
} else {
if (b !== undefined) {
f = Object.create({}, {
cancel: {
value: function() {
return clearInterval(this.id);
}
}
}), f.id = setInterval(function() {
return c(f);
}, b);
return f;
}
for (;;) if (!c()) break;
}
}
}, c.after = j = function(a, b) {
a !== null && typeof a == "object" && a.__kw === d && (arguments.keywords = a, b = a.date, a = a.delay);
if (a) {
if (typeof a != "number") throw new TypeError('"delay" argument must be a number');
} else if (b) {
if (typeof b == "string" || typeof b == "number") {
b = new Date(b);
if (isNaN(b.getTime())) throw new Error('Invalid date/time passed for "date" argument');
} else if (typeof b != "object" || !(b instanceof Date)) throw new TypeError('"date" argument must be a Date object or a string');
a = Math.max(0, b.getTime() - (new Date).getTime());
}
return function(b) {
b !== null && typeof b == "object" && b.__kw === d && (arguments.keywords = b, b = b.block);
return setTimeout(b, a);
};
}, k = global.JSON, o = function(a, b) {
a !== null && typeof a == "object" && a.__kw === d && (arguments.keywords = a, b = a.parse, a = a.build);
return a !== undefined || b === undefined ? k.stringify(a) : k.parse(b);
}, o.parse = k.parse, o.stringify = k.stringify, c.JSON = o, p = function(a, b) {
a !== null && typeof a == "object" && a.__kw === d && (arguments.keywords = a, b = a.propertyName, a = a.target);
var c, e;
c = a[b], e = function(a, b) {
a !== null && typeof a == "object" && a.__kw === d && (arguments.keywords = a, b = a.call, a = a.event);
var e;
if (b) return c.call(this, a, b);
e = this;
return function(b) {
b !== null && typeof b == "object" && b.__kw === d && (arguments.keywords = b, b = b.block);
return c.call(e, a, b);
};
};
return a[b] = e;
};
try {
q = a("events");
} catch (r) {}
q && q.EventEmitter && (p(q.EventEmitter.prototype, "addListener"), q.EventEmitter.prototype.on = q.EventEmitter.prototype.addListener), typeof process != "undefined" && typeof process.on == "function" && p(process, "on");
return c.__class = a("./runtime_class").__class;
})();
}), _require.define("runtime/runtime_object", "runtime/runtime_object.js", function(a, b, c, d, e) {
if (!Object.prototype.forEach) {
var f = function(a, b) {
b !== null && typeof b != "object" && (b = this);
var c = this;
Object.keys(this).forEach(function(d) {
a.call(b, d, c[d], c);
});
return this;
};
Object.defineProperty && Object.defineProperty(Object.prototype, "forEach", {
value: f
});
}
}), _require.define("runtime/runtime_string", "runtime/runtime_string.js", function(a, b, c, d, e) {
String.prototype.repeat || (String.prototype.repeat = function(a) {
s = "";
while (a--) s += this;
return s;
}), String.prototype.padLeft || (String.prototype.padLeft = function(a, b) {
return this.length >= a ? this : String(b || " ").repeat(a - this.length) + this;
}), String.prototype.padRight || (String.prototype.padRight = function(a, b) {
return this.length >= a ? this : this + String(b || " ").repeat(a - this.length);
}), String.prototype.editDistance || (String.prototype.editDistance = function i(a) {
var b, c = (b = this.split("")).length, d = (a = a.split("")).length, e, f, g, h;
if (!c && !d) return Math.max(c, d);
for (var i = [], e = c + 1; e; i[--e] = [ e ]) ;
for (e = d + 1; i[0][--e] = e; ) ;
for (e = -1, g = b.length; ++e < g; ) for (f = -1, h = a.length; ++f < h; ) i[(e *= 1) + 1][(f *= 1) + 1] = Math.min(i[e][f + 1] + 1, i[e + 1][f] + 1, i[e][f] + (b[e] != a[f]));
return i[c][d];
}), String.prototype.matchAll || (String.prototype.matchAll = function(a) {
"use strict", a instanceof RegExp ? a.global || (a = new RegExp(a.source, "g")) : a = new RegExp(a, "g");
var b, c = [];
while (b = a.exec(this)) c.push(b);
return c;
}), String.prototype.forEachMatch || (String.prototype.forEachMatch = function(a, b, c) {
"use strict", c || (c = this), this.matchAll(a).forEach(b, c);
return c;
}), typeof String.prototype.toLocaleLowerCase == "function" && (String.prototype.toLowerCase = String.prototype.toLocaleLowerCase), typeof String.prototype.toLocaleUpperCase == "function" && (String.prototype.toUpperCase = String.prototype.toLocaleUpperCase);
}), _require.define("runtime/symbols", "runtime/symbols.js", function(a, b, c, d, e) {
c._MoveKWArgsT = function f(a) {
a.__kw = f;
return a;
};
}), _require("runtime");
var move = global.__move;
move.version = function() {
return "0.4.2";
}, move.require = Require();
return move;
}());
__move.require.define("foo","test/test-web-rt/foo.mv",function(require,module,exports){
var Move, _MoveKWArgsT, Text, extend, create, print, repeat, after, JSON, __class, EHTML, bar;
Move = __move.runtime, _MoveKWArgsT = Move._MoveKWArgsT, Text = Move.Text, extend = Move.extend, create = Move.create, print = Move.print, repeat = Move.repeat, after = Move.after, JSON = Move.JSON, __class = Move.__class;
EHTML = __move.EHTML;
exports.bar = bar = function bar(name) {
name !== null && typeof name === "object" && name.__kw === _MoveKWArgsT && (arguments.keywords = name, name = name.name);
if (name === undefined) name = "John";
return "This is bar, with my friend " + name;
};
});
__move.require.define("","test/test-web-rt/index.mv",function(require,module,exports){
var Move, _MoveKWArgsT, Text, extend, create, print, repeat, after, JSON, __class, EHTML, foo, html;
Move = __move.runtime, _MoveKWArgsT = Move._MoveKWArgsT, Text = Move.Text, extend = Move.extend, create = Move.create, print = Move.print, repeat = Move.repeat, after = Move.after, JSON = Move.JSON, __class = Move.__class;
EHTML = __move.EHTML;
foo = require("foo");
print("foo ->", foo);
print("foo.bar() ->", foo.bar());
print('foo.bar "Rob" ->', foo.bar("Rob"));
html = document.body.innerHTML;
return document.body.innerHTML = html + "<h1>Pass OK</h1>";
});(function(){var boot=function boot(){__move.require("");};if(window.addEventListener){window.addEventListener("DOMContentLoaded",boot,false);}else{window.attachEvent("onload",boot);}})();