-
Notifications
You must be signed in to change notification settings - Fork 0
/
jscex.jscexRequire.min.js
1 lines (1 loc) · 54.2 KB
/
jscex.jscexRequire.min.js
1
(function () { var b = I(["break", "case", "catch", "const", "continue", "default", "delete", "do", "else", "finally", "for", "function", "if", "in", "instanceof", "new", "return", "switch", "throw", "try", "typeof", "var", "void", "while", "with"]); var v = I(["abstract", "boolean", "byte", "char", "class", "debugger", "double", "enum", "export", "extends", "final", "float", "goto", "implements", "import", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "super", "synchronized", "throws", "transient", "volatile"]); var O = I(["return", "new", "delete", "throw", "else", "case"]); var g = I(["false", "null", "true", "undefined"]); var y = I(m("+-*&%=<>!?|~^")); var k = /^0x[0-9a-f]+$/i; var z = /^0[0-7]+$/; var H = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; var t = I(["in", "instanceof", "typeof", "new", "void", "delete", "++", "--", "+", "-", "!", "~", "&", "|", "^", "*", "/", "%", ">>", "<<", ">>>", "<", ">", "<=", ">=", "==", "===", "!=", "!==", "?", "=", "+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=", "&&", "||"]); var a = I(m(" \n\r\t\u200b")); var E = I(m("[{}(,.;:")); var l = I(m("[]{}(),;:")); var n = I(m("gmsiy")); var Q = { letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"), connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]") }; function d(T) { return Q.letter.test(T) } function N(T) { T = T.charCodeAt(0); return T >= 48 && T <= 57 } function R(T) { return N(T) || d(T) } function A(T) { return Q.non_spacing_mark.test(T) || Q.space_combining_mark.test(T) } function P(T) { return Q.connector_punctuation.test(T) } function F(T) { return T == "$" || T == "_" || d(T) } function i(T) { return F(T) || A(T) || N(T) || P(T) || T == "\u200c" || T == "\u200d" } function u(T) { if (k.test(T)) { return parseInt(T.substr(2), 16) } else { if (z.test(T)) { return parseInt(T.substr(1), 8) } else { if (H.test(T)) { return parseFloat(T) } } } } function C(W, T, U, X) { this.message = W; this.line = T; this.col = U; this.pos = X; try { ({})() } catch (V) { this.stack = V.stack } } C.prototype.toString = function () { return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")\n\n" + this.stack }; function h(V, T, U, W) { throw new C(V, T, U, W) } function M(T, U, V) { return T.type == U && (V == null || T.value == V) } var S = {}; function o(U) { var Y = { text: U.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ""), pos: 0, tokpos: 0, line: 0, tokline: 0, col: 0, tokcol: 0, newline_before: false, regex_allowed: false, comments_before: [] }; function am() { return Y.text.charAt(Y.pos) } function al(at) { var au = Y.text.charAt(Y.pos++); if (at && !au) { throw S } if (au == "\n") { Y.newline_before = true; ++Y.line; Y.col = 0 } else { ++Y.col } return au } function ah() { return !Y.peek() } function aj(au, at) { var av = Y.text.indexOf(au, Y.pos); if (at && av == -1) { throw S } return av } function ai() { Y.tokline = Y.line; Y.tokcol = Y.col; Y.tokpos = Y.pos } function ac(av, aw, au) { Y.regex_allowed = ((av == "operator" && !c(p, aw)) || (av == "keyword" && c(O, aw)) || (av == "punc" && c(E, aw))); var at = { type: av, value: aw, line: Y.tokline, col: Y.tokcol, pos: Y.tokpos, nlb: Y.newline_before }; if (!au) { at.comments_before = Y.comments_before; Y.comments_before = [] } Y.newline_before = false; return at } function ar() { while (c(a, am())) { al() } } function ae(at) { var au = "", aw = am(), av = 0; while (aw && at(aw, av++)) { au += al(); aw = am() } return au } function an(at) { h(at, Y.tokline, Y.tokcol, Y.tokpos) } function ag(ay) { var aw = false, au = false, az = false, at = ay == "."; var av = ae(function (aB, aA) { if (aB == "x" || aB == "X") { if (az) { return false } return az = true } if (!az && (aB == "E" || aB == "e")) { if (aw) { return false } return aw = au = true } if (aB == "-") { if (au || (aA == 0 && !ay)) { return true } return false } if (aB == "+") { return au } au = false; if (aB == ".") { if (!at && !az) { return at = true } return false } return R(aB) }); if (ay) { av = ay + av } var ax = u(av); if (!isNaN(ax)) { return ac("num", ax) } else { an("Invalid syntax: " + av) } } function ak() { var at = al(true); switch (at) { case "n": return "\n"; case "r": return "\r"; case "t": return "\t"; case "b": return "\b"; case "v": return "\v"; case "f": return "\f"; case "0": return "\0"; case "x": return String.fromCharCode(ad(2)); case "u": return String.fromCharCode(ad(4)); default: return at } } function ad(av) { var at = 0; for (; av > 0; --av) { var au = parseInt(al(true), 16); if (isNaN(au)) { an("Invalid hex-character pattern in string") } at = (at << 4) | au } return at } function X() { return Z("Unterminated string constant", function () { var at = al(), au = ""; for (; ; ) { var av = al(true); if (av == "\\") { av = ak() } else { if (av == at) { break } } au += av } return ac("string", au) }) } function ao() { al(); var au = aj("\n"), at; if (au == -1) { at = Y.text.substr(Y.pos); Y.pos = Y.text.length } else { at = Y.text.substring(Y.pos, au); Y.pos = au } return ac("comment1", at, true) } function aq() { al(); return Z("Unterminated multiline comment", function () { var au = aj("*/", true), av = Y.text.substring(Y.pos, au), at = ac("comment2", av, true); Y.pos = au + 2; Y.line += av.split("\n").length - 1; Y.newline_before = av.indexOf("\n") >= 0; if (/^@cc_on/i.test(av)) { q("WARNING: at line " + Y.line); q('*** Found "conditional comment": ' + av); q("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer.") } return at }) } function ab() { var av = false, at = "", au; while ((au = am()) != null) { if (!av) { if (au == "\\") { av = true, al() } else { if (i(au)) { at += al() } else { break } } } else { if (au != "u") { an("Expecting UnicodeEscapeSequence -- uXXXX") } au = ak(); if (!i(au)) { an("Unicode char: " + au.charCodeAt(0) + " is not valid in identifier") } at += au; av = false } } return at } function V() { return Z("Unterminated regular expression", function () { var at = false, aw = "", au, ax = false; while ((au = al(true))) { if (at) { aw += "\\" + au; at = false } else { if (au == "[") { ax = true; aw += au } else { if (au == "]" && ax) { ax = false; aw += au } else { if (au == "/" && !ax) { break } else { if (au == "\\") { at = true } else { aw += au } } } } } } var av = ab(); return ac("regexp", [aw, av]) }) } function ap(at) { function au(aw) { if (!am()) { return aw } var av = aw + am(); if (c(t, av)) { al(); return au(av) } else { return aw } } return ac("operator", au(at || al())) } function aa() { al(); var at = Y.regex_allowed; switch (am()) { case "/": Y.comments_before.push(ao()); Y.regex_allowed = at; return af(); case "*": Y.comments_before.push(aq()); Y.regex_allowed = at; return af() } return Y.regex_allowed ? V() : ap("/") } function T() { al(); return N(am()) ? ag(".") : ac("punc", ".") } function W() { var at = ab(); return !c(b, at) ? ac("name", at) : c(t, at) ? ac("operator", at) : c(g, at) ? ac("atom", at) : ac("keyword", at) } function Z(av, at) { try { return at() } catch (au) { if (au === S) { an(av) } else { throw au } } } function af(au) { if (au) { return V() } ar(); ai(); var at = am(); if (!at) { return ac("eof") } if (N(at)) { return ag() } if (at == '"' || at == "'") { return X() } if (c(l, at)) { return ac("punc", al()) } if (at == ".") { return T() } if (at == "/") { return aa() } if (c(y, at)) { return ap() } if (at == "\\" || F(at)) { return W() } an("Unexpected character '" + at + "'") } af.context = function (at) { if (at) { Y = at } return Y }; return af } var J = I(["typeof", "void", "delete", "--", "++", "!", "~", "-", "+"]); var p = I(["--", "++"]); var e = (function (T, U, V) { while (V < T.length) { U[T[V]] = T[V].substr(0, T[V].length - 1); V++ } return U })(["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="], { "=": true }, 0); var K = (function (U, W) { for (var X = 0, Y = 1; X < U.length; ++X, ++Y) { var T = U[X]; for (var V = 0; V < T.length; ++V) { W[T[V]] = Y } } return W })([["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"]], {}); var f = I(["for", "do", "while", "switch"]); var D = I(["atom", "num", "string", "regexp", "name"]); function x(U, V, T) { this.name = U; this.start = V; this.end = T } x.prototype.toString = function () { return this.name }; function w(X, aF, Z) { var ae = { input: typeof X == "string" ? o(X, true) : X, token: null, prev: null, peeked: null, in_function: 0, in_loop: 0, labels: [] }; ae.token = ac(); function ar(aT, aU) { return M(ae.token, aT, aU) } function ah() { return ae.peeked || (ae.peeked = ae.input()) } function ac() { ae.prev = ae.token; if (ae.peeked) { ae.token = ae.peeked; ae.peeked = null } else { ae.token = ae.input() } return ae.token } function av() { return ae.prev } function ab(aW, aU, aV, aX) { var aT = ae.input.context(); h(aW, aU != null ? aU : aT.tokline, aV != null ? aV : aT.tokcol, aX != null ? aX : aT.tokpos) } function V(aT, aU) { ab(aU, aT.line, aT.col) } function aE(aT) { if (aT == null) { aT = ae.token } V(aT, "Unexpected token: " + aT.type + " (" + aT.value + ")") } function aq(aT, aU) { if (ar(aT, aU)) { return ac() } V(ae.token, "Unexpected token " + ae.token.type + ", expected " + aT) } function W(aT) { return aq("punc", aT) } function ax() { return !aF && (ae.token.nlb || ar("eof") || ar("punc", "}")) } function aN() { if (ar("punc", ";")) { ac() } else { if (!ax()) { aE() } } } function af() { return s(arguments) } function ag() { W("("); var aT = ao(); W(")"); return aT } function al(aU, aV, aT) { return aU instanceof x ? aU : new x(aU, aV, aT) } var ap = Z ? function () { var aU = ae.token; var aT = aM.apply(this, arguments); aT[0] = al(aT[0], aU, av()); return aT } : aM; function aM() { if (ar("operator", "/")) { ae.peeked = null; ae.token = ae.input(true) } switch (ae.token.type) { case "num": case "string": case "regexp": case "operator": case "atom": return ak(); case "name": return M(ah(), "punc", ":") ? aK(j(ae.token.value, ac, ac)) : ak(); case "punc": switch (ae.token.value) { case "{": return af("block", aj()); case "[": case "(": return ak(); case ";": ac(); return af("block"); default: aE() } case "keyword": switch (j(ae.token.value, ac)) { case "break": return aO("break"); case "continue": return aO("continue"); case "debugger": aN(); return af("debugger"); case "do": return (function (aT) { aq("keyword", "while"); return af("do", j(ag, aN), aT) })(ad(ap)); case "for": return aG(); case "function": return aw(true); case "if": return at(); case "return": if (ae.in_function == 0) { ab("'return' outside of function") } return af("return", ar("punc", ";") ? (ac(), null) : ax() ? null : j(ao, aN)); case "switch": return af("switch", ag(), am()); case "throw": return af("throw", j(ao, aN)); case "try": return aJ(); case "var": return j(T, aN); case "const": return j(aD, aN); case "while": return af("while", ag(), ad(ap)); case "with": return af("with", ag(), ap()); default: aE() } } } function aK(aT) { ae.labels.push(aT); var aV = ae.token, aU = ap(); if (aF && !c(f, aU[0])) { aE(aV) } ae.labels.pop(); return af("label", aT, aU) } function ak() { return af("stat", j(ao, aN)) } function aO(aU) { var aT = ar("name") ? ae.token.value : null; if (aT != null) { ac(); if (!L(aT, ae.labels)) { ab("Label " + aT + " without matching loop or statement") } } else { if (ae.in_loop == 0) { ab(aU + " not inside a loop or switch") } } aN(); return af(aU, aT) } function aG() { W("("); var aT = null; if (!ar("punc", ";")) { aT = ar("keyword", "var") ? (ac(), T(true)) : ao(true, true); if (ar("operator", "in")) { return az(aT) } } return aC(aT) } function aC(aU) { W(";"); var aV = ar("punc", ";") ? null : ao(); W(";"); var aT = ar("punc", ")") ? null : ao(); W(")"); return af("for", aU, aV, aT, ad(ap)) } function az(aV) { var aT = aV[0] == "var" ? af("name", aV[1][0]) : aV; ac(); var aU = ao(); W(")"); return af("for-in", aV, aT, aU, ad(ap)) } var aw = Z ? function () { var aU = av(); var aT = aa.apply(this, arguments); aT[0] = al(aT[0], aU, av()); return aT } : aa; function aa(aT) { var aU = ar("name") ? j(ae.token.value, ac) : null; if (aT && !aU) { aE() } W("("); return af(aT ? "defun" : "function", aU, (function (aW, aV) { while (!ar("punc", ")")) { if (aW) { aW = false } else { W(",") } if (!ar("name")) { aE() } aV.push(ae.token.value); ac() } ac(); return aV })(true, []), (function () { ++ae.in_function; var aW = ae.in_loop; ae.in_loop = 0; var aV = aj(); --ae.in_function; ae.in_loop = aW; return aV })()) } function at() { var aV = ag(), aT = ap(), aU; if (ar("keyword", "else")) { ac(); aU = ap() } return af("if", aV, aT, aU) } function aj() { W("{"); var aT = []; while (!ar("punc", "}")) { if (ar("eof")) { aE() } aT.push(ap()) } ac(); return aT } var am = r(ad, function () { W("{"); var aT = [], aU = null; while (!ar("punc", "}")) { if (ar("eof")) { aE() } if (ar("keyword", "case")) { ac(); aU = []; aT.push([ao(), aU]); W(":") } else { if (ar("keyword", "default")) { ac(); W(":"); aU = []; aT.push([null, aU]) } else { if (!aU) { aE() } aU.push(ap()) } } } ac(); return aT }); function aJ() { var aT = aj(), aU, aW; if (ar("keyword", "catch")) { ac(); W("("); if (!ar("name")) { ab("Name expected") } var aV = ae.token.value; ac(); W(")"); aU = [aV, aj()] } if (ar("keyword", "finally")) { ac(); aW = aj() } if (!aU && !aW) { ab("Missing catch/finally blocks") } return af("try", aT, aU, aW) } function U(aU) { var aT = []; for (; ; ) { if (!ar("name")) { aE() } var aV = ae.token.value; ac(); if (ar("operator", "=")) { ac(); aT.push([aV, ao(false, aU)]) } else { aT.push([aV]) } if (!ar("punc", ",")) { break } ac() } return aT } function T(aT) { return af("var", U(aT)) } function aD() { return af("const", U()) } function ay() { var aU = au(false), aT; if (ar("punc", "(")) { ac(); aT = aQ(")") } else { aT = [] } return aA(af("new", aU, aT), true) } function au(aT) { if (ar("operator", "new")) { ac(); return ay() } if (ar("operator") && c(J, ae.token.value)) { return Y("unary-prefix", j(ae.token.value, ac), au(aT)) } if (ar("punc")) { switch (ae.token.value) { case "(": ac(); return aA(j(ao, r(W, ")")), aT); case "[": ac(); return aA(aL(), aT); case "{": ac(); return aA(aS(), aT) } aE() } if (ar("keyword", "function")) { ac(); return aA(aw(false), aT) } if (c(D, ae.token.type)) { var aU = ae.token.type == "regexp" ? af("regexp", ae.token.value[0], ae.token.value[1]) : af(ae.token.type, ae.token.value); return aA(j(aU, ac), aT) } aE() } function aQ(aV, aT, aW) { var aX = true, aU = []; while (!ar("punc", aV)) { if (aX) { aX = false } else { W(",") } if (aT && ar("punc", aV)) { break } if (ar("punc", ",") && aW) { aU.push(["atom", "undefined"]) } else { aU.push(ao(false)) } } ac(); return aU } function aL() { return af("array", aQ("]", !aF, true)) } function aS() { var aW = true, aT = []; while (!ar("punc", "}")) { if (aW) { aW = false } else { W(",") } if (!aF && ar("punc", "}")) { break } var aV = ae.token.type; var aU = an(); if (aV == "name" && (aU == "get" || aU == "set") && !ar("punc", ":")) { aT.push([aH(), aw(false), aU]) } else { W(":"); aT.push([aU, ao(false)]) } } ac(); return af("object", aT) } function an() { switch (ae.token.type) { case "num": case "string": return j(ae.token.value, ac) } return aH() } function aH() { switch (ae.token.type) { case "name": case "operator": case "keyword": case "atom": return j(ae.token.value, ac); default: aE() } } function aA(aU, aT) { if (ar("punc", ".")) { ac(); return aA(af("dot", aU, aH()), aT) } if (ar("punc", "[")) { ac(); return aA(af("sub", aU, j(ao, r(W, "]"))), aT) } if (aT && ar("punc", "(")) { ac(); return aA(af("call", aU, aQ(")")), true) } if (aT && ar("operator") && c(p, ae.token.value)) { return j(r(Y, "unary-postfix", ae.token.value, aU), ac) } return aU } function Y(aT, aV, aU) { if ((aV == "++" || aV == "--") && !aB(aU)) { ab("Invalid use of " + aV + " operator") } return af(aT, aV, aU) } function aI(aX, aW, aT) { var aY = ar("operator") ? ae.token.value : null; if (aY && aY == "in" && aT) { aY = null } var aU = aY != null ? K[aY] : null; if (aU != null && aU > aW) { ac(); var aV = aI(au(true), aU, aT); return aI(af("binary", aY, aX, aV), aW, aT) } return aX } function ai(aT) { return aI(au(true), 0, aT) } function aR(aT) { var aU = ai(aT); if (ar("operator", "?")) { ac(); var aV = ao(false); W(":"); return af("conditional", aU, aV, ao(false, aT)) } return aU } function aB(aT) { if (!aF) { return true } switch (aT[0]) { case "dot": case "sub": case "new": case "call": return true; case "name": return aT[1] != "this" } } function aP(aT) { var aU = aR(aT), aV = ae.token.value; if (ar("operator") && c(e, aV)) { if (aB(aU)) { ac(); return af("assign", e[aV], aU, aP(aT)) } ab("Invalid assignment") } return aU } function ao(aU, aT) { if (arguments.length == 0) { aU = true } var aV = aP(aT); if (aU && ar("punc", ",")) { ac(); return af("seq", aV, ao(true, aT)) } return aV } function ad(aT) { try { ++ae.in_loop; return aT() } finally { --ae.in_loop } } return af("toplevel", (function (aT) { while (!ar("eof")) { aT.push(ap()) } return aT })([])) } function r(U) { var T = s(arguments, 1); return function () { return U.apply(this, T.concat(s(arguments))) } } function j(T) { if (T instanceof Function) { T = T() } for (var U = 1, V = arguments.length; --V > 0; ++U) { arguments[U]() } return T } function I(T) { var U = {}; for (var V = 0; V < T.length; ++V) { U[T[V]] = true } return U } function s(T, U) { return Array.prototype.slice.call(T, U == null ? 0 : U) } function m(T) { return T.split("") } function L(T, V) { for (var U = V.length; --U >= 0; ) { if (V[U] === T) { return true } } return false } function c(T, U) { return Object.prototype.hasOwnProperty.call(T, U) } var q = function () { }; var B = (typeof require !== "undefined" && typeof module !== "undefined" && module.exports); if (!B) { UglifyJS = {} } var G = B ? module.exports : UglifyJS; G.tokenizer = o; G.parse = w; G.slice = s; G.curry = r; G.member = L; G.array_to_hash = I; G.PRECEDENCE = K; G.KEYWORDS_ATOM = g; G.RESERVED_WORDS = v; G.KEYWORDS = b; G.ATOMIC_START_TOKEN = D; G.OPERATORS = t; G.is_alphanumeric_char = R; G.set_logger = function (T) { q = T } })(); (function () { var b = (typeof require !== "undefined" && typeof module !== "undefined" && module.exports); if (!b) { Jscex = {} } var e = b ? module.exports : Jscex; if (typeof __jscex__tempVarSeed === "undefined") { __jscex__tempVarSeed = 0 } function d(i) { this._binder = e.binders[i]; this._root = null } d.prototype = { generate: function (i) { var k = i[2], j = i[3]; this._root = { type: "delay", stmts: [] }; this._visitStatements(j, this._root.stmts); return this._root }, _getBindInfo: function (o) { var m = o[0]; if (m == "stat") { var p = o[1]; if (p[0] == "call") { var l = p[1]; if (l[0] == "name" && l[1] == this._binder && p[2].length == 1) { return { expression: p[2][0], argName: "", assignee: null} } } else { if (p[0] == "assign") { var j = p[2]; p = p[3]; if (p[0] == "call") { var l = p[1]; if (l[0] == "name" && l[1] == this._binder && p[2].length == 1) { return { expression: p[2][0], argName: "$$_result_$$", assignee: j} } } } } } else { if (m == "var") { var i = o[1]; if (i.length == 1) { var n = i[0]; var k = n[0]; var p = n[1]; if (p && p[0] == "call") { var l = p[1]; if (l[0] == "name" && l[1] == this._binder && p[2].length == 1) { return { expression: p[2][0], argName: k, assignee: null} } } } } else { if (m == "return") { var p = o[1]; if (p && p[0] == "call") { var l = p[1]; if (l[0] == "name" && l[1] == this._binder && p[2].length == 1) { return { expression: p[2][0], argName: "$$_result_$$", assignee: "return"} } } } } } return null }, _visitStatements: function (n, j, m) { if (arguments.length <= 2) { m = 0 } if (m >= n.length) { j.push({ type: "normal" }); return this } var l = n[m]; var r = this._getBindInfo(l); if (r) { var i = { type: "bind", info: r }; j.push(i); if (r.assignee != "return") { i.stmts = []; this._visitStatements(n, i.stmts, m + 1) } } else { var o = l[0]; if (o == "return" || o == "break" || o == "continue" || o == "throw") { j.push({ type: o, stmt: l }) } else { if (o == "if" || o == "try" || o == "for" || o == "do" || o == "while" || o == "switch" || o == "for-in") { var q = this._visit(l); if (q.type == "raw") { j.push(q); this._visitStatements(n, j, m + 1) } else { var k = (m == n.length - 1); if (k) { j.push(q) } else { var p = { type: "combine", first: { type: "delay", stmts: [q] }, second: { type: "delay", stmts: []} }; j.push(p); this._visitStatements(n, p.second.stmts, m + 1) } } } else { j.push({ type: "raw", stmt: l }); this._visitStatements(n, j, m + 1) } } } return this }, _visit: function (i) { var j = i[0]; function l() { throw new Error('"' + j + '" is not currently supported.') } var k = this._visitors[j]; if (k) { return k.call(this, i) } else { l() } }, _visitBody: function (j, i) { if (j[0] == "block") { this._visitStatements(j[1], i) } else { this._visitStatements([j], i) } }, _noBinding: function (i) { switch (i[i.length - 1].type) { case "normal": case "return": case "break": case "throw": case "continue": return true } return false }, _collectCaseStatements: function (p, m) { var o = []; for (var n = m; n < p.length; n++) { var k = p[n][1]; for (var l = 0; l < k.length; l++) { if (k[l][0] == "break") { return o } o.push(k[l]) } } return o }, _visitors: { "for": function (k) { var m = []; var j = k[4]; this._visitBody(j, m); if (this._noBinding(m)) { return { type: "raw", stmt: k} } var n = { type: "delay", stmts: [] }; var i = k[1]; if (i) { n.stmts.push({ type: "raw", stmt: i }) } var l = { type: "loop", bodyFirst: false, bodyStmt: { type: "delay", stmts: m} }; n.stmts.push(l); var p = k[2]; if (p) { l.condition = p } var o = k[3]; if (o) { l.update = o } return n }, "for-in": function (i) { var j = (__jscex__tempVarSeed++); var k = "$$_members_$$_" + j; var s = "$$_index_$$_" + j; var l = "$$_mem_$$_" + j; var p = i[3]; var q = { type: "delay", stmts: [] }; q.stmts.push({ type: "raw", stmt: ["var", [[k, ["array", []]]]] }); q.stmts.push({ type: "raw", stmt: ["for-in", ["var", [[l]]], ["name", [l]], p, ["stat", ["call", ["dot", ["name", k], "push"], [["name", l]]]]] }); q.stmts.push({ type: "raw", stmt: ["var", [[s, ["num", 0]]]] }); var m = ["binary", "<", ["name", s], ["dot", ["name", k], "length"]]; var o = ["unary-postfix", "++", ["name", s]]; var t = { type: "loop", bodyFirst: false, update: o, condition: m, bodyStmt: { type: "delay", stmts: []} }; q.stmts.push(t); var n = i[2][1]; if (i[1][0] == "var") { t.bodyStmt.stmts.push({ type: "raw", stmt: ["var", [[n, ["sub", ["name", k], ["name", s]]]]] }) } else { t.bodyStmt.stmts.push({ type: "raw", stmt: ["stat", ["assign", true, ["name", n], ["sub", ["name", k], ["name", s]]]] }) } var r = i[4]; this._visitBody(r, t.bodyStmt.stmts); return q }, "while": function (j) { var l = []; var i = j[2]; this._visitBody(i, l); if (this._noBinding(l)) { return { type: "raw", stmt: j} } var k = { type: "loop", bodyFirst: false, bodyStmt: { type: "delay", stmts: l} }; var m = j[1]; k.condition = m; return k }, "do": function (j) { var l = []; var i = j[2]; this._visitBody(i, l); if (this._noBinding(l)) { return { type: "raw", stmt: j} } var k = { type: "loop", bodyFirst: true, bodyStmt: { type: "delay", stmts: l} }; var m = j[1]; k.condition = m; return k }, "switch": function (j) { var k = true; var o = { type: "switch", item: j[1], caseStmts: [] }; var n = j[2]; for (var m = 0; m < n.length; m++) { var p = { item: n[m][0], stmts: [] }; o.caseStmts.push(p); var l = this._collectCaseStatements(n, m); this._visitStatements(l, p.stmts); k = k && this._noBinding(p.stmts) } if (k) { return { type: "raw", stmt: j} } else { return o } }, "if": function (i) { var j = true; var m = { type: "if", conditionStmts: [] }; var o = i; while (true) { var p = o[1]; var l = { cond: p, stmts: [] }; m.conditionStmts.push(l); var n = o[2]; this._visitBody(n, l.stmts); j = j && this._noBinding(l.stmts); var k = o[3]; if (k && k[0] == "if") { o = k } else { break } } var k = o[3]; if (k) { m.elseStmts = []; this._visitBody(k, m.elseStmts); j = j && this._noBinding(m.elseStmts) } if (j) { return { type: "raw", stmt: i} } else { return m } }, "try": function (i, j) { var o = []; var m = i[1]; this._visitStatements(m, o); var l = this._noBinding(o); var q = { type: "try", bodyStmt: { type: "delay", stmts: o} }; var n = i[2]; if (n) { var p = n[0]; q.exVar = p; q.catchStmts = []; this._visitStatements(n[1], q.catchStmts); l = l && this._noBinding(q.catchStmts) } var k = i[3]; if (k) { q.finallyStmt = { type: "delay", stmts: [] }; this._visitStatements(k, q.finallyStmt.stmts); l = l && this._noBinding(q.finallyStmt.stmts) } if (l) { return { type: "raw", stmt: i} } else { return q } } } }; function h(j, i) { this._builderName = j; this._binder = e.builders[j].binder; this._normalMode = false; this._indent = i; this._indentLevel = 0; this._builderVar = "$$_builder_$$_" + (__jscex__tempVarSeed++) } h.prototype = { _write: function (i) { this._buffer.push(i); return this }, _writeLine: function (i) { this._write(i)._write("\n"); return this }, _writeIndents: function () { for (var j = 0; j < this._indent; j++) { this._write(" ") } for (var j = 0; j < this._indentLevel; j++) { this._write(" ") } return this }, generate: function (j, i) { this._buffer = []; this._writeLine("(function (" + j.join(", ") + ") {"); this._indentLevel++; this._writeIndents()._writeLine("var " + this._builderVar + " = Jscex.builders[" + JSON.stringify(this._builderName) + "];"); this._writeIndents()._writeLine("return " + this._builderVar + ".Start(this,"); this._indentLevel++; this._pos = {}; this._writeIndents()._visitJscex(i)._writeLine(); this._indentLevel--; this._writeIndents()._writeLine(");"); this._indentLevel--; this._writeIndents()._write("})"); return this._buffer.join("") }, _visitJscex: function (i) { this._jscexVisitors[i.type].call(this, i); return this }, _visitRaw: function (i) { var j = i[0]; function l() { throw new Error('"' + j + '" is not currently supported.') } var k = this._rawVisitors[j]; if (k) { k.call(this, i) } else { l() } return this }, _visitJscexStatements: function (j) { for (var k = 0; k < j.length; k++) { var l = j[k]; if (l.type == "raw" || l.type == "if" || l.type == "switch") { this._writeIndents()._visitJscex(l)._writeLine() } else { if (l.type == "delay") { this._visitJscexStatements(l.stmts) } else { this._writeIndents()._write("return ")._visitJscex(l)._writeLine(";") } } } }, _visitRawStatements: function (j) { for (var k = 0; k < j.length; k++) { var l = j[k]; this._writeIndents()._visitRaw(l)._writeLine(); switch (l[0]) { case "break": case "return": case "continue": case "throw": return } } }, _visitRawBody: function (i) { if (i[0] == "block") { this._visitRaw(i) } else { this._writeLine(); this._indentLevel++; this._writeIndents()._visitRaw(i); this._indentLevel-- } return this }, _visitRawFunction: function (i) { var m = i[1] || ""; var l = i[2]; var k = i[3]; this._writeLine("function " + m + "(" + l.join(", ") + ") {"); this._indentLevel++; var j = this._pos.inFunction; this._pos.inFunction = true; this._visitRawStatements(k); this._indentLevel--; this._pos.inFunction = j; this._writeIndents()._write("}") }, _jscexVisitors: { delay: function (j) { if (j.stmts.length == 1) { var i = j.stmts[0]; switch (i.type) { case "delay": case "combine": case "normal": case "break": case "continue": case "loop": case "try": this._visitJscex(i); return; case "return": if (!i.stmt[1]) { this._visitJscex(i); return } } } this._writeLine(this._builderVar + ".Delay(function () {"); this._indentLevel++; this._visitJscexStatements(j.stmts); this._indentLevel--; this._writeIndents()._write("})") }, combine: function (i) { this._writeLine(this._builderVar + ".Combine("); this._indentLevel++; this._writeIndents()._visitJscex(i.first)._writeLine(","); this._writeIndents()._visitJscex(i.second)._writeLine(); this._indentLevel--; this._writeIndents()._write(")") }, loop: function (i) { this._writeLine(this._builderVar + ".Loop("); this._indentLevel++; if (i.condition) { this._writeIndents()._writeLine("function () {"); this._indentLevel++; this._writeIndents()._write("return ")._visitRaw(i.condition)._writeLine(";"); this._indentLevel--; this._writeIndents()._writeLine("},") } else { this._writeIndents()._writeLine("null,") } if (i.update) { this._writeIndents()._writeLine("function () {"); this._indentLevel++; this._writeIndents()._visitRaw(i.update)._writeLine(";"); this._indentLevel--; this._writeIndents()._writeLine("},") } else { this._writeIndents()._writeLine("null,") } this._writeIndents()._visitJscex(i.bodyStmt)._writeLine(","); this._writeIndents()._writeLine(i.bodyFirst); this._indentLevel--; this._writeIndents()._write(")") }, raw: function (i) { this._visitRaw(i.stmt) }, bind: function (i) { var j = i.info; this._write(this._builderVar + ".Bind(")._visitRaw(j.expression)._writeLine(", function (" + j.argName + ") {"); this._indentLevel++; if (j.assignee == "return") { this._writeIndents()._writeLine("return " + this._builderVar + ".Return(" + j.argName + ");") } else { if (j.assignee) { this._writeIndents()._visitRaw(j.assignee)._writeLine(" = " + j.argName + ";") } this._visitJscexStatements(i.stmts) } this._indentLevel--; this._writeIndents()._write("})") }, "if": function (j) { for (var k = 0; k < j.conditionStmts.length; k++) { var l = j.conditionStmts[k]; this._write("if (")._visitRaw(l.cond)._writeLine(") {"); this._indentLevel++; this._visitJscexStatements(l.stmts); this._indentLevel--; this._writeIndents()._write("} else ") } this._writeLine("{"); this._indentLevel++; if (j.elseStmts) { this._visitJscexStatements(j.elseStmts) } else { this._writeIndents()._writeLine("return " + this._builderVar + ".Normal();") } this._indentLevel--; this._writeIndents()._write("}") }, "switch": function (j) { this._write("switch (")._visitRaw(j.item)._writeLine(") {"); this._indentLevel++; for (var k = 0; k < j.caseStmts.length; k++) { var l = j.caseStmts[k]; if (l.item) { this._writeIndents()._write("case ")._visitRaw(l.item)._writeLine(":") } else { this._writeIndents()._writeLine("default:") } this._indentLevel++; this._visitJscexStatements(l.stmts); this._indentLevel-- } this._writeIndents()._write("}") }, "try": function (i) { this._writeLine(this._builderVar + ".Try("); this._indentLevel++; this._writeIndents()._visitJscex(i.bodyStmt)._writeLine(","); if (i.catchStmts) { this._writeIndents()._writeLine("function (" + i.exVar + ") {"); this._indentLevel++; this._visitJscexStatements(i.catchStmts); this._indentLevel--; this._writeIndents()._writeLine("},") } else { this._writeIndents()._writeLine("null,") } if (i.finallyStmt) { this._writeIndents()._visitJscex(i.finallyStmt)._writeLine() } else { this._writeIndents()._writeLine("null") } this._indentLevel--; this._writeIndents()._write(")") }, normal: function (i) { this._write(this._builderVar + ".Normal()") }, "throw": function (i) { this._write(this._builderVar + ".Throw(")._visitRaw(i.stmt[1])._write(")") }, "break": function (i) { this._write(this._builderVar + ".Break()") }, "continue": function (i) { this._write(this._builderVar + ".Continue()") }, "return": function (i) { this._write(this._builderVar + ".Return("); if (i.stmt[1]) { this._visitRaw(i.stmt[1]) } this._write(")") } }, _rawVisitors: { "var": function (j) { this._write("var "); var k = j[1]; for (var l = 0; l < k.length; l++) { this._write(k[l][0]); if (k[l].length > 1) { this._write(" = ")._visitRaw(k[l][1]) } if (l < k.length - 1) { this._write(", ") } } this._write(";") }, seq: function (j) { for (var k = 1; k < j.length; k++) { this._visitRaw(j[k]); if (k < j.length - 1) { this._write(", ") } } }, binary: function (i) { var m = i[1], l = i[2], j = i[3]; function k(o) { var n = o[0]; return !(n == "num" || n == "name" || n == "dot") } if (k(l)) { this._write("(")._visitRaw(l)._write(") ") } else { this._visitRaw(l)._write(" ") } this._write(m); if (k(j)) { this._write(" (")._visitRaw(j)._write(")") } else { this._write(" ")._visitRaw(j) } }, sub: function (i) { var l = i[1], j = i[2]; function k() { return !(l[0] == "name") } if (k()) { this._write("(")._visitRaw(l)._write(")[")._visitRaw(j)._write("]") } else { this._visitRaw(l)._write("[")._visitRaw(j)._write("]") } }, "unary-postfix": function (i) { var k = i[1]; var j = i[2]; this._visitRaw(j)._write(k) }, "unary-prefix": function (i) { var k = i[1]; var j = i[2]; this._write(k)._visitRaw(j) }, assign: function (i) { var l = i[1]; var j = i[2]; var k = i[3]; this._visitRaw(j); if ((typeof l) == "string") { this._write(" " + l + "= ") } else { this._write(" = ") } this._visitRaw(k) }, stat: function (i) { this._visitRaw(i[1])._write(";") }, dot: function (i) { function j() { var k = i[1][0]; return !(k == "dot" || k == "name") } if (j()) { this._write("(")._visitRaw(i[1])._write(").")._write(i[2]) } else { this._visitRaw(i[1])._write(".")._write(i[2]) } }, "new": function (k) { var n = k[1]; this._write("new ")._visitRaw(n)._write("("); var l = k[2]; for (var m = 0, j = l.length; m < j; m++) { this._visitRaw(l[m]); if (m < j - 1) { this._write(", ") } } this._write(")") }, call: function (k) { if (g(k)) { var j = this._indent + this._indentLevel * 4; var n = c(k, j); this._write(n) } else { var o = (k[1][0] == "name") && (k[1][1] == this._binder); if (o) { this._pos = { inFunction: true }; this._buffer = [] } this._visitRaw(k[1])._write("("); var l = k[2]; for (var m = 0; m < l.length; m++) { this._visitRaw(l[m]); if (m < l.length - 1) { this._write(", ") } } this._write(")"); if (o) { throw ("Invalid bind operation: " + this._buffer.join("")) } } }, name: function (i) { this._write(i[1]) }, object: function (j) { this._write("{"); var k = j[1]; for (var l = 0; l < k.length; l++) { this._write(JSON.stringify(k[l][0]) + ": ")._visitRaw(k[l][1]); if (l < k.length - 1) { this._write(", ") } } this._write("}") }, array: function (j) { this._write("["); var k = j[1]; for (var l = 0; l < k.length; l++) { this._visitRaw(k[l]); if (l < k.length - 1) { this._write(", ") } } this._write("]") }, num: function (i) { this._write(i[1]) }, regexp: function (i) { this._write("/" + i[1] + "/" + i[2]) }, string: function (i) { this._write(JSON.stringify(i[1])) }, "function": function (i) { this._visitRawFunction(i) }, defun: function (i) { this._visitRawFunction(i) }, "return": function (i) { if (this._pos.inFunction) { this._write("return"); var j = i[1]; if (j) { this._write(" ")._visitRaw(j) } this._write(";") } else { this._write("return ")._visitJscex({ type: "return", stmt: i })._write(";") } }, "for": function (k) { this._write("for ("); var j = k[1]; if (j) { this._visitRaw(j); if (j[0] != "var") { this._write("; ") } else { this._write(" ") } } else { this._write("; ") } var n = k[2]; if (n) { this._visitRaw(n) } this._write("; "); var m = k[3]; if (m) { this._visitRaw(m) } this._write(") "); var l = this._pos.inLoop; this._pos.inLoop = true; var i = k[4]; this._visitRawBody(i); this._pos.inLoop = l }, "for-in": function (j) { this._write("for ("); var k = j[1]; if (k[0] == "var") { this._write("var " + k[1][0][0]) } else { this._visitRaw(k) } this._write(" in ")._visitRaw(j[3])._write(") "); var i = j[4]; this._visitRawBody(i) }, block: function (i) { this._writeLine("{"); this._indentLevel++; this._visitRawStatements(i[1]); this._indentLevel--; this._writeIndents()._write("}") }, "while": function (j) { var l = j[1]; var i = j[2]; var k = this._pos.inLoop; this._pos.inLoop = true; this._write("while (")._visitRaw(l)._write(") ")._visitRawBody(i); this._pos.inLoop = k }, "do": function (j) { var l = j[1]; var i = j[2]; var k = this._pos.inLoop; this._pos.inLoop = true; this._write("do ")._visitRawBody(i); this._pos.inLoop = k; if (i[0] == "block") { this._write(" ") } else { this._writeLine()._writeIndents() } this._write("while (")._visitRaw(l)._write(");") }, "if": function (i) { var l = i[1]; var k = i[2]; this._write("if (")._visitRaw(l)._write(") ")._visitRawBody(k); var j = i[3]; if (j) { if (k[0] == "block") { this._write(" ") } else { this._writeLine("")._writeIndents() } if (j[0] == "if") { this._write("else ")._visitRaw(j) } else { this._write("else ")._visitRawBody(j) } } }, "break": function (i) { if (this._pos.inLoop || this._pos.inSwitch) { this._write("break;") } else { this._write("return ")._visitJscex({ type: "break", stmt: i })._write(";") } }, "continue": function (i) { if (this._pos.inLoop) { this._write("continue;") } else { this._write("return ")._visitJscex({ type: "continue", stmt: i })._write(";") } }, "throw": function (i) { var j = this._pos; if (j.inTry || j.inFunction) { this._write("throw ")._visitRaw(i[1])._write(";") } else { this._write("return ")._visitJscex({ type: "throw", stmt: i })._write(";") } }, conditional: function (i) { this._write("(")._visitRaw(i[1])._write(") ? (")._visitRaw(i[2])._write(") : (")._visitRaw(i[3])._write(")") }, "try": function (i) { this._writeLine("try {"); this._indentLevel++; var l = this._pos.inTry; this._pos.inTry = true; this._visitRawStatements(i[1]); this._indentLevel--; this._pos.inTry = l; var k = i[2]; var j = i[3]; if (k) { this._writeIndents()._writeLine("} catch (" + k[0] + ") {"); this._indentLevel++; this._visitRawStatements(k[1]); this._indentLevel-- } if (j) { this._writeIndents()._writeLine("} finally {"); this._indentLevel++; this._visitRawStatements(j); this._indentLevel-- } this._writeIndents()._write("}") }, "switch": function (j) { this._write("switch (")._visitRaw(j[1])._writeLine(") {"); this._indentLevel++; var m = this._pos.inSwitch; this._pos.inSwitch = true; var l = j[2]; for (var k = 0; k < l.length; k++) { var n = l[k]; this._writeIndents(); if (n[0]) { this._write("case ")._visitRaw(n[0])._writeLine(":") } else { this._writeLine("default:") } this._indentLevel++; this._visitRawStatements(n[1]); this._indentLevel-- } this._indentLevel--; this._pos.inSwitch = m; this._writeIndents()._write("}") } } }; function g(i) { if (i[0] != "call") { return false } var k = i[1]; if (k[0] != "name" || k[1] != "eval") { return false } var l = i[2][0]; if (!l || l[0] != "call") { return false } var o = l[1]; if (!o || o[0] != "dot" || o[2] != "compile") { return false } var m = o[1]; if (!m || m[0] != "name" || m[1] != "Jscex") { return false } var j = l[2][0]; if (!j || j[0] != "string") { return false } var n = l[2][1]; if (!n || n[0] != "function") { return false } return true } function c(l, k) { var j = l[2][0][2][0][1]; var n = l[2][0][2][1]; var p = new d(j); var i = p.generate(n); var o = new h(j, k); var m = o.generate(n[2], i); return m } var a = b ? require("./uglifyjs-parser") : UglifyJS; function f(j, p) { var i = p.toString(); var m = "eval(Jscex.compile(" + JSON.stringify(j) + ", " + i + "))"; var l = a.parse(m); var o = l[1][0][1]; var k = c(o, 0); e.log(i + "\n\n>>>\n\n" + k); var n = e.config.codeGenerator; return n ? n(k) : k } e.config = {}; e.compile = f; e.binders = {}; e.log = function (j) { try { console.log(j) } catch (i) { } } })(); (function () { var j = function (p, o, m, n) { return { next: function (t, s) { var r = function (u) { m.next(t, function (v, w, x) { if (v == "normal" || v == "continue") { q(u) } else { if (v == "throw" || v == "return") { s(v, w) } else { if (v == "break") { s("normal") } else { throw new Error('Invalid type for "Loop": ' + v) } } } }) }; var q = function (v) { try { if (o && !v) { o.call(t) } if (!p || p.call(t)) { r(false) } else { s("normal") } } catch (u) { s("throw", u) } }; if (n) { r(true) } else { q(true) } } } }; var c = function (m) { return { next: function (q, p) { try { var o = m.call(q); o.next(q, p) } catch (n) { p("throw", n) } } } }; var h = function (n, m) { return { next: function (p, o) { n.next(p, function (r, s, t) { if (r == "normal") { try { m.next(p, o) } catch (q) { o("throw", q) } } else { o(r, s, t) } }) } } }; var b = function (m) { return { next: function (o, n) { n("return", m) } } }; var k = function () { return { next: function (n, m) { m("normal") } } }; var a = function () { return { next: function (n, m) { m("break") } } }; var d = function () { return { next: function (n, m) { m("continue") } } }; var g = function (m) { return { next: function (o, n) { n("throw", m) } } }; var e = function (n, o, m) { return { next: function (q, p) { n.next(q, function (t, u, v) { if (t != "throw" || !o) { if (!m) { p(t, u, v) } else { m.next(q, function (y, x, w) { if (y == "normal") { p(t, u, v) } else { p(y, x, w) } }) } } else { if (o) { var r; try { r = o.call(q, u) } catch (s) { if (m) { m.next(q, function (y, x, w) { if (y == "normal") { p("throw", s) } else { p(y, x, w) } }) } else { p("throw", s) } } if (r) { r.next(q, function (w, x, y) { if (w == "throw") { if (m) { m.next(q, function (B, A, z) { if (B == "normal") { p(w, x, y) } else { p(B, A, z) } }) } else { p(w, x, y) } } else { if (m) { m.next(q, function (B, A, z) { if (B == "normal") { p(w, x, y) } else { p(B, A, z) } }) } else { p(w, x, y) } } }) } } else { m.next(q, function (y, x, w) { if (y == "normal") { p(t, u, v) } else { p(y, x, w) } }) } } }) } } }; var f = function (m) { m.Loop = j; m.Delay = c; m.Combine = h; m.Return = b; m.Normal = k; m.Break = a; m.Continue = d; m.Throw = g; m.Try = e }; var l = function (m) { if (!m.modules) { m.modules = {} } if (m.modules.builderbase) { return } m.modules.builderbase = true; m.standardizeBuilder = f }; var i = (typeof require !== "undefined" && typeof module !== "undefined" && module.exports); if (i) { module.exports.init = l } else { if (typeof Jscex == "undefined") { Jscex = {} } l(Jscex) } })(); (function () { var c = function () { }; c.prototype.isCancellation = true; if (typeof __jscex__taskIdSeed === "undefined") { __jscex__taskIdSeed = 0 } var a = (typeof require !== "undefined" && typeof module !== "undefined" && module.exports); var b = function (e, g) { if (!g) { g = e } if (!e.modules || !e.modules.builderbase) { if (a) { require("./jscex-builderbase").init(e) } else { throw new Error('Missing essential component, please initialize "builderbase" module first.') } } if (g.binders) { g.binders.async = "$await" } if (e.modules.async) { return } var d = function () { }; d.prototype = { register: function (j) { if (this.isCancellationRequested) { j() } if (!this._handlers) { this._handlers = [] } this._handlers.push(j) }, unregister: function (k) { if (!this._handlers) { return } var j = this._handlers.indexOf(k); if (j >= 0) { this._handlers.splice(j, 1) } }, cancel: function () { if (this.isCancellationRequested) { return } this.isCancellationRequested = true; var j = this._handlers; delete this._handlers; for (var l = 0; l < j.length; l++) { try { j[l]() } catch (k) { e.log("WARNING: Cancellation handler threw an error: " + k) } } }, throwIfCancellationRequested: function () { if (this.isCancellationRequested) { throw new c() } } }; var i = function (j) { this.id = (++__jscex__taskIdSeed); this._delegate = j; this._listeners = {}; this.status = "ready" }; i.prototype = { start: function () { if (this.status != "ready") { throw new Error('Task can only be started in "ready" status.') } this.status = "running"; this._delegate(this) }, complete: function (j, k) { if (this.status != "running") { throw new Error('The "complete" method can only be called in "running" status.') } if (j == "success") { this.result = k; this.status = "succeeded"; this._notify("success") } else { if (j == "failure") { this.error = k; if (k.isCancellation) { this.status = "canceled" } else { this.status = "failed" } this._notify("failure") } else { throw new Error("Unsupported type: " + j) } } this._notify("complete"); delete this._listeners }, _notify: function (m) { var l = this._listeners[m]; if (!l) { return } for (var k = 0; k < l.length; k++) { try { l[k](this) } catch (j) { e.log("WARNING: the task's " + m + " listener threw an error: " + j) } } }, addEventListener: function (j, k) { if (!this._listeners) { throw new Error('Listeners can only be added in "ready" or "running" status.') } if (!this._listeners[j]) { this._listeners[j] = [] } this._listeners[j].push(k) }, removeEventListener: function (k, l) { if (!this._listeners) { throw new Error('Listeners can only be removed in "ready" or "running" status.') } var m = this._listeners[k]; if (!m) { return } var j = m.indexOf(l); if (j >= 0) { m.splice(j, 1) } } }; i.create = function (j) { return new i(j) }; var h = function () { }; h.prototype = { Start: function (k, j) { return i.create(function (l) { j.next(k, function (m, n, o) { if (m == "normal" || m == "return") { l.complete("success", n) } else { if (m == "throw") { l.complete("failure", n) } else { throw new Error("Unsupported type: " + m) } } }) }) }, Bind: function (j, k) { return { next: function (n, m) { var l = function (p) { if (p.error) { m("throw", p.error) } else { var q; try { q = k.call(n, p.result) } catch (o) { m("throw", o); return } q.next(n, m) } }; if (j.status == "ready") { j.addEventListener("complete", l); j.start() } else { if (j.status == "running") { j.addEventListener("complete", l) } else { l(j) } } } } } }; e.standardizeBuilder(h.prototype); if (!e.Async) { e.Async = {} } var f = e.Async; f.CancellationToken = d; f.CanceledError = c; f.Task = i; f.Builder = h; if (!e.builders) { e.builders = [] } e.builders.async = new h(); e.modules.async = true }; if (a) { module.exports.init = b } else { b(Jscex) } })(); (function () { var b = function (d) { if (d.modules && d.modules["async-powerpack"]) { return } if (!d.modules || !d.modules.async) { throw new Error('Missing essential component, please initialize "jscex-async" module first.') } var c = d.Async; var f = c.Task; var e = c.CanceledError; c.sleep = function (g, h) { return f.create(function (j) { if (h) { h.throwIfCancellationRequested() } var i; var k; if (h) { k = function () { clearTimeout(i); j.complete("failure", new e()) } } var i = setTimeout(function () { if (h) { h.unregister(k) } j.complete("success") }, g); if (h) { h.register(k) } }) }; c.onEvent = function (i, g, h) { return f.create(function (k) { if (h) { h.throwIfCancellationRequested() } var j; var l; if (h) { l = function () { if (i.removeEventListener) { i.removeEventListener(g, j) } else { i.detachEvent(g, j) } k.complete("failure", new e()) } } var j = function (m) { if (h) { h.unregister(l) } k.complete("success", m) }; if (i.addEventListener) { i.addEventListener(g, j) } else { i.attachEvent(g, j) } if (h) { h.register(l) } }) }; f.whenAll = function (g) { if (Object.prototype.toString.call(g) !== "[object Array]") { g = arguments } return f.create(function (n) { var o = {}; var l = []; for (var k = 0; k < g.length; k++) { o[g[k].id] = k; l.push(h) } var j = []; var m = function (r) { if (r.error) { for (var q = 0; q < tasksClone.length; q++) { l[q].removeListener(m) } n.complete("failure", r.error) } else { j[o[r.id]] = r.result; var p = l.indexOf(r); l.splice(p, 1); if (l.length == 0) { finished = true; n.complete("success", j) } } }; for (var k = 0; k < g.length; k++) { var h = g[k]; switch (h.status) { case "ready": h.addEventListener("complete", m); h.start(); break; case "running": h.addEventListener("complete", m); break; default: m(h); break } } }) }; d.modules["async-powerpack"] = true }; var a = (typeof require !== "undefined" && typeof module !== "undefined" && module.exports); if (a) { module.exports.init = b } else { b(Jscex) } })();